#include <stdio.h>
#include <stdlib.h>

int pagerank(float *coovala,int *coorowinda,int *coocolinda,int nnz,int nodes,float q,int max_iters,float accept_key,float *pr,int *real_iters,float *real_key);

int main()
{
    FILE *fp=NULL;
    
    float *value=NULL,*pr=NULL;
    int *row=NULL,*col=NULL;
    
    float elapsedTime;
    cudaEvent_t start, stop;
    
    double sum=0.0;
    float q=0.8,accept_key=0.0000001,error_value;
    int i,nnz,nodes,max_iters=100,real_iters;
    
    fp=fopen("Graph.txt","r");
    if(fp==NULL)
    {
        printf("can't read matrix.txt!\n");
        return(1);
    }
    
    printf("start load data.\n");
    
    fscanf(fp,"%d",&nodes);
    fscanf(fp,"%d",&nnz);
    
    printf("nodes=%d,nnz=%d.\nif it is not right,then please check ID_To_ID.txt,ke neng you yi xie te shu zi fu zai wen jian kai tou.\n",nodes,nnz);
    
    value=(float *)malloc(sizeof(float)*nnz);
    row=(int *)malloc(sizeof(int)*nnz);
    col=(int *)malloc(sizeof(int)*nnz);
    pr=(float *)malloc(sizeof(float)*nodes);
    
    //待定_直接使用型
    for(i=0;i<nnz;i++)
    {
        fscanf(fp,"%d",row+i);
        fscanf(fp,"%d",col+i);
        fscanf(fp,"%f",value+i);
        row[i]--;
        col[i]--;
        //test ok
        //printf("%d,%d,%f.\n",row[i],col[i],value[i]);
        //getchar();
    }
    fclose(fp);
    fp=NULL;
    
    printf("data load is ok.\nstart solve pr value.\n");
    
    //test ok
    //printf("%d,%d,%d,%d,%d.\n",row[0],row[1],row[2],row[3],row[4]);
    
    cudaEventCreate(&start); 
    cudaEventCreate(&stop);
    cudaEventRecord(start, 0);
    
    pagerank(value,row,col,nnz,nodes,q,max_iters,accept_key,pr,&real_iters,&error_value);
    
    cudaEventRecord(stop, 0); 
    cudaEventSynchronize(stop); 
    cudaEventElapsedTime(&elapsedTime, start, stop);
    
    printf("pr value solve ok.\nstart write answ.\n");
    
    fp=fopen("pr_out.txt","w");
    if(fp==NULL)
    {
        printf("can't write pr_out.txt!\n");
        return(1);
    }
    fprintf(fp,"nodes:%d\n",nodes);
    fprintf(fp,"nnz:%d\n",nnz);
    fprintf(fp,"real_iters:%d\n",real_iters);
    fprintf(fp,"sigma:%f\n",error_value);
    for(i=0;i<nodes;i++)
        sum+=pr[i];
    fprintf(fp,"the sum pr value:%f\n",sum);
    fprintf(fp,"cuda_use_time_ms:%fms\n",elapsedTime);
    fclose(fp);
    fp=NULL;
    
    fp=fopen("pr_value.txt","w");
    if(fp==NULL)
    {
        printf("can't write pr_value.txt!\n");
        return(1);
    }
    for(i=0;i<nodes;i++)
        fprintf(fp,"%f\n",pr[i]*10000);
    fclose(fp);
    fp=NULL;
    
    return(0);
}

	.file	"tmpxft_0035dc4b_00000000-6_main.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2030:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2030:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"r"
.LC2:
	.string	"Graph.txt"
.LC3:
	.string	"can't read matrix.txt!\n"
.LC4:
	.string	"start load data.\n"
.LC5:
	.string	"%d"
.LC6:
	.string	"nodes=%d,nnz=%d.\nif it is not right,then please check ID_To_ID.txt,ke neng you yi xie te shu zi fu zai wen jian kai tou.\n"
.LC7:
	.string	"%f"
.LC8:
	.string	"data load is ok.\nstart solve pr value.\n"
.LC11:
	.string	"pr value solve ok.\nstart write answ.\n"
.LC12:
	.string	"w"
.LC13:
	.string	"pr_out.txt"
.LC14:
	.string	"can't write pr_out.txt!\n"
.LC15:
	.string	"nodes:%d\n"
.LC16:
	.string	"nnz:%d\n"
.LC17:
	.string	"real_iters:%d\n"
.LC18:
	.string	"sigma:%f\n"
.LC19:
	.string	"the sum pr value:%f\n"
.LC20:
	.string	"cuda_use_time_ms:%fms\n"
.LC21:
	.string	"pr_value.txt"
.LC22:
	.string	"can't write pr_value.txt!\n"
.LC24:
	.string	"%f\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	leaq	.LC3(%rip), %rsi
	testq	%rax, %rax
	je	.L17
	movq	%rax, %rbx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	48(%rsp), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	call	__isoc23_fscanf@PLT
	leaq	44(%rsp), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	call	__isoc23_fscanf@PLT
	movl	44(%rsp), %ecx
	movl	48(%rsp), %edx
	xorl	%eax, %eax
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movslq	44(%rsp), %rbp
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movslq	48(%rsp), %rdi
	movq	%rax, 24(%rsp)
	salq	$2, %rdi
	call	malloc@PLT
	movq	16(%rsp), %r13
	movq	24(%rsp), %r14
	movq	8(%rsp), %r15
	movq	%rax, %rbp
.L5:
	cmpl	%r12d, 44(%rsp)
	jle	.L19
	movq	%r13, %rdx
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movq	%r14, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	incl	%r12d
	call	__isoc23_fscanf@PLT
	movq	%r15, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC7(%rip), %rsi
	addq	$4, %r15
	call	__isoc23_fscanf@PLT
	decl	0(%r13)
	addq	$4, %r13
	decl	(%r14)
	addq	$4, %r14
	jmp	.L5
.L19:
	movq	%rbx, %rdi
	leaq	.LC12(%rip), %r12
	call	fclose@PLT
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	56(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	64(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movss	.LC9(%rip), %xmm1
	movss	.LC10(%rip), %xmm0
	movl	$100, %r9d
	pushq	%rax
	.cfi_def_cfa_offset 152
	leaq	48(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 160
	leaq	68(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 168
	pushq	%rbp
	.cfi_def_cfa_offset 176
	movl	80(%rsp), %r8d
	movl	76(%rsp), %ecx
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	40(%rsp), %rdi
	call	_Z8pagerankPfPiS0_iififS_S0_S_@PLT
	movq	96(%rsp), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 144
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	64(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	leaq	36(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rsi
	leaq	.LC13(%rip), %rdi
	call	fopen@PLT
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	.L7
	leaq	.LC14(%rip), %rsi
.L17:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %eax
	jmp	.L2
.L7:
	movl	48(%rsp), %ecx
	movq	%rax, %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	leaq	.LC15(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	44(%rsp), %ecx
	movl	$2, %esi
	xorl	%eax, %eax
	leaq	.LC16(%rip), %rdx
	movq	%rbx, %rdi
	call	__fprintf_chk@PLT
	movl	52(%rsp), %ecx
	movl	$2, %esi
	xorl	%eax, %eax
	leaq	.LC17(%rip), %rdx
	movq	%rbx, %rdi
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	movb	$1, %al
	leaq	.LC18(%rip), %rdx
	cvtss2sd	40(%rsp), %xmm0
	call	__fprintf_chk@PLT
	movl	48(%rsp), %edx
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L9:
	cmpl	%eax, %edx
	jle	.L20
	cvtss2sd	0(%rbp,%rax,4), %xmm1
	incq	%rax
	addsd	%xmm1, %xmm0
	jmp	.L9
.L20:
	movq	%rbx, %rdi
	leaq	.LC19(%rip), %rdx
	movl	$2, %esi
	movb	$1, %al
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	movb	$1, %al
	leaq	.LC20(%rip), %rdx
	cvtss2sd	36(%rsp), %xmm0
	call	__fprintf_chk@PLT
	movq	%rbx, %rdi
	call	fclose@PLT
	movq	%r12, %rsi
	leaq	.LC21(%rip), %rdi
	xorl	%r12d, %r12d
	call	fopen@PLT
	leaq	.LC22(%rip), %rsi
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.L17
.L11:
	cmpl	%r12d, 48(%rsp)
	jle	.L21
	movss	0(%rbp,%r12,4), %xmm0
	mulss	.LC23(%rip), %xmm0
	movq	%rbx, %rdi
	movb	$1, %al
	leaq	.LC24(%rip), %rdx
	movl	$2, %esi
	incq	%r12
	cvtss2sd	%xmm0, %xmm0
	call	__fprintf_chk@PLT
	jmp	.L11
.L21:
	movq	%rbx, %rdi
	call	fclose@PLT
	xorl	%eax, %eax
.L2:
	movq	72(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2053:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2053:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC9:
	.long	869711765
	.align 4
.LC10:
	.long	1061997773
	.align 4
.LC23:
	.long	1176256512
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>

int pagerank(float *coovala,int *coorowinda,int *coocolinda,int nnz,int nodes,float q,int max_iters,float accept_key,float *pr,int *real_iters,float *real_key);

int main()
{
    FILE *fp=NULL;
    
    float *value=NULL,*pr=NULL;
    int *row=NULL,*col=NULL;
    
    float elapsedTime;
    hipEvent_t start, stop;
    
    double sum=0.0;
    float q=0.8,accept_key=0.0000001,error_value;
    int i,nnz,nodes,max_iters=100,real_iters;
    
    fp=fopen("Graph.txt","r");
    if(fp==NULL)
    {
        printf("can't read matrix.txt!\n");
        return(1);
    }
    
    printf("start load data.\n");
    
    fscanf(fp,"%d",&nodes);
    fscanf(fp,"%d",&nnz);
    
    printf("nodes=%d,nnz=%d.\nif it is not right,then please check ID_To_ID.txt,ke neng you yi xie te shu zi fu zai wen jian kai tou.\n",nodes,nnz);
    
    value=(float *)malloc(sizeof(float)*nnz);
    row=(int *)malloc(sizeof(int)*nnz);
    col=(int *)malloc(sizeof(int)*nnz);
    pr=(float *)malloc(sizeof(float)*nodes);
    
    //待定_直接使用型
    for(i=0;i<nnz;i++)
    {
        fscanf(fp,"%d",row+i);
        fscanf(fp,"%d",col+i);
        fscanf(fp,"%f",value+i);
        row[i]--;
        col[i]--;
        //test ok
        //printf("%d,%d,%f.\n",row[i],col[i],value[i]);
        //getchar();
    }
    fclose(fp);
    fp=NULL;
    
    printf("data load is ok.\nstart solve pr value.\n");
    
    //test ok
    //printf("%d,%d,%d,%d,%d.\n",row[0],row[1],row[2],row[3],row[4]);
    
    hipEventCreate(&start); 
    hipEventCreate(&stop);
    hipEventRecord(start, 0);
    
    pagerank(value,row,col,nnz,nodes,q,max_iters,accept_key,pr,&real_iters,&error_value);
    
    hipEventRecord(stop, 0); 
    hipEventSynchronize(stop); 
    hipEventElapsedTime(&elapsedTime, start, stop);
    
    printf("pr value solve ok.\nstart write answ.\n");
    
    fp=fopen("pr_out.txt","w");
    if(fp==NULL)
    {
        printf("can't write pr_out.txt!\n");
        return(1);
    }
    fprintf(fp,"nodes:%d\n",nodes);
    fprintf(fp,"nnz:%d\n",nnz);
    fprintf(fp,"real_iters:%d\n",real_iters);
    fprintf(fp,"sigma:%f\n",error_value);
    for(i=0;i<nodes;i++)
        sum+=pr[i];
    fprintf(fp,"the sum pr value:%f\n",sum);
    fprintf(fp,"cuda_use_time_ms:%fms\n",elapsedTime);
    fclose(fp);
    fp=NULL;
    
    fp=fopen("pr_value.txt","w");
    if(fp==NULL)
    {
        printf("can't write pr_value.txt!\n");
        return(1);
    }
    for(i=0;i<nodes;i++)
        fprintf(fp,"%f\n",pr[i]*10000);
    fclose(fp);
    fp=NULL;
    
    return(0);
}

	.text
	.file	"main.hip"
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI0_0:
	.long	0x3f4ccccd                      # float 0.800000011
.LCPI0_1:
	.long	0x33d6bf95                      # float 1.00000001E-7
.LCPI0_2:
	.long	0x461c4000                      # float 1.0E+4
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_1
# %bb.3:
	movq	%rax, %r14
	movl	$.Lstr, %edi
	callq	puts@PLT
	leaq	12(%rsp), %rbx
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	leaq	16(%rsp), %r15
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	(%rbx), %esi
	movl	(%r15), %edx
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	movslq	(%r15), %r12
	leaq	(,%r12,4), %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movslq	(%rbx), %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %rbx
	testq	%r12, %r12
	jle	.LBB0_6
# %bb.4:                                # %.lr.ph.preheader
	movq	40(%rsp), %rbp                  # 8-byte Reload
	movq	32(%rsp), %r13                  # 8-byte Reload
	movq	48(%rsp), %r12                  # 8-byte Reload
	xorl	%r15d, %r15d
.LBB0_5:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	movq	%rbp, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	$.L.str.6, %esi
	movq	%r14, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	decl	(%rbp)
	decl	(%r13)
	incq	%r15
	movslq	16(%rsp), %rax
	addq	$4, %r12
	addq	$4, %r13
	addq	$4, %rbp
	cmpq	%rax, %r15
	jl	.LBB0_5
.LBB0_6:                                # %._crit_edge
	movq	%r14, %rdi
	callq	fclose
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	leaq	64(%rsp), %r14
	movq	%r14, %rdi
	callq	hipEventCreate
	leaq	56(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventCreate
	movq	(%r14), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movl	16(%rsp), %ecx
	movl	12(%rsp), %r8d
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	leaq	32(%rsp), %rax
	leaq	28(%rsp), %r10
	movss	.LCPI0_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI0_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movq	56(%rsp), %rdi                  # 8-byte Reload
	movq	48(%rsp), %rsi                  # 8-byte Reload
	movq	40(%rsp), %rdx                  # 8-byte Reload
	movl	$100, %r9d
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	callq	_Z8pagerankPfPiS0_iififS_S0_S_
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%r12), %rdi
	callq	hipEventSynchronize
	movq	(%r14), %rsi
	movq	(%r12), %rdx
	leaq	28(%rsp), %rdi
	callq	hipEventElapsedTime
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$.L.str.9, %edi
	movl	$.L.str.10, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_7
# %bb.8:
	movq	%rax, %r14
	movl	12(%rsp), %edx
	movl	$.L.str.12, %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	16(%rsp), %edx
	movl	$.L.str.13, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	20(%rsp), %edx
	movl	$.L.str.14, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	xorps	%xmm0, %xmm0
	cvtss2sd	24(%rsp), %xmm0
	movl	$.L.str.15, %esi
	movq	%r14, %rdi
	movb	$1, %al
	callq	fprintf
	movl	12(%rsp), %eax
	xorps	%xmm0, %xmm0
	testl	%eax, %eax
	jle	.LBB0_11
# %bb.9:                                # %.lr.ph61.preheader
	xorl	%ecx, %ecx
.LBB0_10:                               # %.lr.ph61
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm1, %xmm1
	cvtss2sd	(%rbx,%rcx,4), %xmm1
	addsd	%xmm1, %xmm0
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB0_10
.LBB0_11:                               # %._crit_edge62
	movl	$.L.str.16, %esi
	movq	%r14, %rdi
	movb	$1, %al
	callq	fprintf
	xorps	%xmm0, %xmm0
	cvtss2sd	28(%rsp), %xmm0
	movl	$.L.str.17, %esi
	movq	%r14, %rdi
	movb	$1, %al
	callq	fprintf
	movq	%r14, %rdi
	callq	fclose
	movl	$.L.str.18, %edi
	movl	$.L.str.10, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_17
# %bb.12:                               # %.preheader
	movq	%rax, %r14
	cmpl	$0, 12(%rsp)
	jle	.LBB0_15
# %bb.13:                               # %.lr.ph64.preheader
	xorl	%r15d, %r15d
.LBB0_14:                               # %.lr.ph64
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rbx,%r15,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	mulss	.LCPI0_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.20, %esi
	movq	%r14, %rdi
	movb	$1, %al
	callq	fprintf
	incq	%r15
	movslq	12(%rsp), %rax
	cmpq	%rax, %r15
	jl	.LBB0_14
.LBB0_15:                               # %._crit_edge65
	movq	%r14, %rdi
	callq	fclose
	xorl	%eax, %eax
	jmp	.LBB0_16
.LBB0_1:
	movl	$.Lstr.5, %edi
	jmp	.LBB0_2
.LBB0_7:
	movl	$.Lstr.4, %edi
	jmp	.LBB0_2
.LBB0_17:
	movl	$.Lstr.3, %edi
.LBB0_2:
	callq	puts@PLT
	movl	$1, %eax
.LBB0_16:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	main, .Lfunc_end0-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Graph.txt"
	.size	.L.str, 10

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"r"
	.size	.L.str.1, 2

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%d"
	.size	.L.str.4, 3

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"nodes=%d,nnz=%d.\nif it is not right,then please check ID_To_ID.txt,ke neng you yi xie te shu zi fu zai wen jian kai tou.\n"
	.size	.L.str.5, 122

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"%f"
	.size	.L.str.6, 3

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"pr_out.txt"
	.size	.L.str.9, 11

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"w"
	.size	.L.str.10, 2

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"nodes:%d\n"
	.size	.L.str.12, 10

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"nnz:%d\n"
	.size	.L.str.13, 8

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"real_iters:%d\n"
	.size	.L.str.14, 15

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"sigma:%f\n"
	.size	.L.str.15, 10

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"the sum pr value:%f\n"
	.size	.L.str.16, 21

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"cuda_use_time_ms:%fms\n"
	.size	.L.str.17, 23

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"pr_value.txt"
	.size	.L.str.18, 13

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"%f\n"
	.size	.L.str.20, 4

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"start load data."
	.size	.Lstr, 17

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"data load is ok.\nstart solve pr value."
	.size	.Lstr.1, 39

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"pr value solve ok.\nstart write answ."
	.size	.Lstr.2, 37

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"can't write pr_value.txt!"
	.size	.Lstr.3, 26

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"can't write pr_out.txt!"
	.size	.Lstr.4, 24

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"can't read matrix.txt!"
	.size	.Lstr.5, 23

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
