#include <stdio.h>
#include <time.h>
#include <cuda_runtime.h>
#include <cuda_profiler_api.h>
#define  damping_factor 0.9
#define  thread_num 128
#define  block_num ((n_vertices + thread_num-1)/thread_num)
#define  ctm 1024
#define  cbm 32768

__global__ void initializePagerankArray(float * pagerank_d,float * pagerank_next_d, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    if (i < n_vertices) {
        pagerank_d[i] = 1.0/(float)n_vertices;
		pagerank_next_d[i] = 0.0;
    }
}

__global__ void addToNextPagerankArray(float * pagerank_d, float * pagerank_next_d, int * n_successors_d, int * successors_d, int * successor_offset_d, float * dangling_value2, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    int j;
    int n_suc;
    if (i < n_vertices) {
        n_suc = n_successors_d[i];
        if(n_suc > 0) {
            for(j = 0; j < n_suc; j++) {
                atomicAdd(&(pagerank_next_d[successors_d[successor_offset_d[i]+j]]), damping_factor*(pagerank_d[i])/n_suc);
            }
        } else {
            atomicAdd(dangling_value2, damping_factor*pagerank_d[i]);
        }
    }
}       

__global__ void finalPagerankArrayForIteration(float * pagerank_next_d, int n_vertices, float dangling_value2) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    if(i < n_vertices) {
		atomicAdd(&(pagerank_next_d[i]),(dangling_value2 + (1-damping_factor))/((float)n_vertices));
        //pagerank_next_d[i] += (dangling_value2 + (1-0.85))/((float)n_vertices);
    }
}

__global__ void setPagerankArrayFromNext(float * pagerank_d, float * pagerank_next_d, int n_vertices, float *diffs) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
	float temp;
    if(i < n_vertices) {
		temp=pagerank_d[i];
        pagerank_d[i] = pagerank_next_d[i];
        pagerank_next_d[i] = 0.0;
		diffs[i]=((temp - pagerank_d[i])>=0)?(temp- pagerank_d[i]):(pagerank_d[i]-temp);
    }
}  

__global__ void convergence(float *g_idata, float *g_odata, int n) {
	__shared__ float sdata[2*ctm];
	// each thread loads one element from global to shared mem
	unsigned int tid = threadIdx.x;
	unsigned int i = blockIdx.x*blockDim.x + threadIdx.x;
	sdata[tid] = (i < n) ? g_idata[i] : 0;
	__syncthreads();
	// do reduction in shared mem
	for (unsigned int s = blockDim.x/2; s > 0; s /= 2) {
	if (tid < s) {
	sdata[tid] += sdata[tid + s];
	}
	__syncthreads();
	}
	// write result for this block to global mem
	if (tid == 0) g_odata[blockIdx.x] = sdata[0];
}
 

int main(int argc, char ** args) {
    if (argc != 2) {
	fprintf(stderr,"Wrong number of args. Provide input graph file.\n");
        exit(-1);
    } 
    cudaFree(0);   
    cudaError_t err = cudaSuccess;
    cudaProfilerStart();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    // Start CPU timer
    clock_t cycles_to_build, cycles_to_calc;


    // build up the graph
    int i;
    unsigned int n_vertices = 0;
    unsigned int n_edges = 0;
    unsigned int vertex_from = 0, vertex_to = 0, vertex_prev = 0;
    
    // Vertex
	float *diffs_new_h;
    float * pagerank_h, *pagerank_d, *diffs, *diffs_new;
    float *pagerank_next_d;
    int * n_successors_h;
    int * successors_h;             
    int * successor_offset_h;
    int * successor_offset_d;
	
    FILE * fp;
    if ((fp = fopen(args[1], "r")) == NULL) {
        fprintf(stderr,"ERROR: Could not open input file.\n");
        exit(-1);
    }

    // parse input file to count the number of vertices
    while (fscanf(fp, "%u %u", &vertex_from, &vertex_to) != EOF) {
        if (vertex_from > n_vertices) {
            n_vertices = vertex_from;
	}
        else if (vertex_to > n_vertices) {
            n_vertices = vertex_to;
	}
	n_edges++;
    }
    n_vertices++;
        clock_t start = clock();
    // Allocate flattened data structure host and device memory
    pagerank_h = (float *) malloc(n_vertices * sizeof(*pagerank_h));
	diffs_new_h = (float * ) malloc(cbm*sizeof(*diffs_new_h));
    err = cudaMalloc((void **)&pagerank_d, n_vertices*sizeof(float));
	err = cudaMalloc((void **)&diffs, n_vertices*sizeof(float));
	err = cudaMalloc((void **)&diffs_new, cbm*sizeof(float));
    err = cudaMalloc((void **)&pagerank_next_d, n_vertices*sizeof(float));
	err = cudaHostAlloc((void **)&n_successors_h, n_vertices*sizeof(int),cudaHostAllocDefault);
	
	successor_offset_h = (int *) malloc(n_vertices * sizeof(*successor_offset_h));
    err = cudaMalloc((void **)&successor_offset_d, n_vertices*sizeof(int));
	
	err = cudaHostAlloc((void**)&successors_h, n_edges*sizeof(int),cudaHostAllocDefault);

    // allocate memory for successor pointers
    int offset = 0, edges = 0;      

    // parse input file to count the number of successors of each vertex
    fseek(fp, 0L, SEEK_SET);
    i = 0;
 
    while (fscanf(fp, "%u %u", &vertex_from, &vertex_to) != EOF) {
        n_successors_h[vertex_from] += 1;
	
	// Fill successor_offset_h array
        successor_offset_h[i] = offset;
	if(edges != 0 && vertex_prev != vertex_from) {
	    i = vertex_from;
	    offset = edges;
	    successor_offset_h[i] = offset;	   
	    vertex_prev = vertex_from;
	}

	// Fill successor array
	successors_h[edges] = vertex_to;
	
	edges++;
    }
    successor_offset_h[i] = edges - 1;    

    fclose(fp);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Get build time and reset start
    cycles_to_build = clock() - start;
    start = clock();	
    err = cudaMemcpy(successor_offset_d, successor_offset_h, n_vertices*sizeof(int), cudaMemcpyHostToDevice);
	
    // Compute the pagerank
    int n_iterations = 60;
    int iteration = 0;
    int numOfBlocks = 1;                 
    int threadsPerBlock = 1000;                 

    if(n_vertices <= thread_num) {
        threadsPerBlock = n_vertices;
        numOfBlocks = 1;
    } else {
        threadsPerBlock = thread_num;
        numOfBlocks = (n_vertices + thread_num-1)/thread_num;   // The "+ 1023" ensures we round up
    }

    float dangling_value_h = 0;
    float dangling_value_h2 = 0;
    float *dangling_value2;
    int n_blocks = (n_vertices + 2048 - 1)/2048;
    if (n_blocks == 0){
        n_blocks = 1;
    }
    float epsilon = 0.000001;
    //float * d_diff;
	//float diff;
    float diff = epsilon + 1;

    //err = cudaMalloc((void **)&d_diff, sizeof(float));    
    err = cudaMalloc((void **)&dangling_value2, sizeof(float));
    err = cudaMemcpy(dangling_value2, &dangling_value_h, sizeof(float), cudaMemcpyHostToDevice);

    initializePagerankArray<<<numOfBlocks,threadsPerBlock>>>(pagerank_d, pagerank_next_d, n_vertices);

    while(epsilon < diff && iteration < n_iterations) {  //was 23

       // set the dangling value to 0 
        dangling_value_h = 0;
        err = cudaMemcpy(dangling_value2, &dangling_value_h, sizeof(float), cudaMemcpyHostToDevice);     
        // initial parallel pagerank_next computation
        addToNextPagerankArray<<<numOfBlocks,threadsPerBlock>>>(pagerank_d, pagerank_next_d, n_successors_h, successors_h, successor_offset_d, dangling_value2, n_vertices);
        // get the dangling value
        err = cudaMemcpy(&dangling_value_h2, dangling_value2, sizeof(float), cudaMemcpyDeviceToHost); 
        // final parallel pagerank_next computation
        finalPagerankArrayForIteration<<<numOfBlocks,threadsPerBlock>>>(pagerank_next_d, n_vertices, dangling_value_h2);      
        // Get difference to compare to epsilon
		//cudaMemset(d_diff, 0, sizeof(float) );
		cudaMemset(diffs_new, 0, cbm*sizeof(float) );
        setPagerankArrayFromNext<<<numOfBlocks,threadsPerBlock>>>(pagerank_d, pagerank_next_d, n_vertices, diffs);

		convergence<<<cbm,ctm>>>(diffs, diffs_new, n_vertices);

		cudaMemcpy(diffs_new_h, diffs_new, sizeof(float) * cbm, cudaMemcpyDeviceToHost);
		/*
		for (i = 0; i < cbm; i++) {
			printf("%f\n",diffs_new_h[i]);
		}*/
		diff=0;
		for (i = 0; i < cbm; i++) {
			diff += diffs_new_h[i];
		}
			//h_diff=diff;
			printf("Probe : %f\n",diff);
			cudaDeviceSynchronize();
			iteration++;
    }
	
    err = cudaMemcpy(pagerank_h, pagerank_d, n_vertices*sizeof(float), cudaMemcpyDeviceToHost);

    // CPU time
    cycles_to_calc = clock() - start;
    int build_milli = cycles_to_build * 1000 / CLOCKS_PER_SEC;
    int calc_milli = cycles_to_calc * 1000 / CLOCKS_PER_SEC;
 
	FILE *f_result;
	f_result=fopen("rg","w");
	for (i=0;i<n_vertices;i++) {
        fprintf(f_result,"Vertex %u:\tpagerank = %.18f\n", i, pagerank_h[i]);
	}  

    printf("Time to build: %d seconds, %d milliseconds\n",build_milli/1000, build_milli%1000);
    printf("Time to calc: %d seconds, %d milliseconds\n",calc_milli/1000, calc_milli%1000);
    printf("iter: %d\n", iteration);

    // Free device global memory
    err = cudaFree(pagerank_d);
    err = cudaFree(pagerank_next_d);
    // Free host memory
    free(pagerank_h);
    err = cudaDeviceReset();

    if (err != cudaSuccess)
    {
        fprintf(stderr, "Failed to deinitialize the device! error=%s\n", cudaGetErrorString(err));
        exit(EXIT_FAILURE);
    }

    printf("Done\n");
    return 0;
}


	.file	"tmpxft_003a189d_00000000-6_pagerank_hostalloc_tree.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
	.globl	_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i
	.type	_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i, @function
_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i:
.LFB2052:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z23initializePagerankArrayPfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L2:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i, .-_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i
	.globl	_Z23initializePagerankArrayPfS_i
	.type	_Z23initializePagerankArrayPfS_i, @function
_Z23initializePagerankArrayPfS_i:
.LFB2053:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i
	.cfi_endproc
.LFE2053:
	.size	_Z23initializePagerankArrayPfS_i, .-_Z23initializePagerankArrayPfS_i
	.globl	_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i
	.type	_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i, @function
_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movq	%rsp, %rax
	movq	%rax, 152(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 208
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L8:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i, .-_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i
	.globl	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.type	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i, @function
_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i
	.cfi_endproc
.LFE2055:
	.size	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i, .-_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.globl	_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif
	.type	_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif, @function
_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	32(%rsp), %rdi
	leaq	44(%rsp), %rsi
	movss	%xmm0, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L13
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z30finalPagerankArrayForIterationPfif(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L13:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif, .-_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif
	.globl	_Z30finalPagerankArrayForIterationPfif
	.type	_Z30finalPagerankArrayForIterationPfif, @function
_Z30finalPagerankArrayForIterationPfif:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif
	.cfi_endproc
.LFE2057:
	.size	_Z30finalPagerankArrayForIterationPfif, .-_Z30finalPagerankArrayForIterationPfif
	.globl	_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_
	.type	_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_, @function
_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z24setPagerankArrayFromNextPfS_iS_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L18:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_, .-_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_
	.globl	_Z24setPagerankArrayFromNextPfS_iS_
	.type	_Z24setPagerankArrayFromNextPfS_iS_, @function
_Z24setPagerankArrayFromNextPfS_iS_:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_
	.cfi_endproc
.LFE2059:
	.size	_Z24setPagerankArrayFromNextPfS_iS_, .-_Z24setPagerankArrayFromNextPfS_iS_
	.globl	_Z34__device_stub__Z11convergencePfS_iPfS_i
	.type	_Z34__device_stub__Z11convergencePfS_iPfS_i, @function
_Z34__device_stub__Z11convergencePfS_iPfS_i:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L23
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11convergencePfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L23:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z34__device_stub__Z11convergencePfS_iPfS_i, .-_Z34__device_stub__Z11convergencePfS_iPfS_i
	.globl	_Z11convergencePfS_i
	.type	_Z11convergencePfS_i, @function
_Z11convergencePfS_i:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z11convergencePfS_iPfS_i
	.cfi_endproc
.LFE2061:
	.size	_Z11convergencePfS_i, .-_Z11convergencePfS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Wrong number of args. Provide input graph file.\n"
.LC2:
	.string	"r"
.LC3:
	.string	"ERROR: Could not open input file.\n"
.LC4:
	.string	"%u %u"
.LC5:
	.string	"Probe : %f\n"
.LC7:
	.string	"w"
.LC8:
	.string	"rg"
.LC9:
	.string	"Vertex %u:\tpagerank = %.18f\n"
.LC10:
	.string	"Time to build: %d seconds, %d milliseconds\n"
.LC11:
	.string	"Time to calc: %d seconds, %d milliseconds\n"
.LC12:
	.string	"iter: %d\n"
.LC13:
	.string	"Failed to deinitialize the device! error=%s\n"
.LC14:
	.string	"Done\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
	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	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	cmpl	$2, %edi
	je	.L29
	movq	stderr(%rip), %rdi
	leaq	.LC1(%rip), %rdx
	movl	$2, %esi
	jmp	.L59
.L29:
	movq	%rsi, %rbx
	xorl	%edi, %edi
	leaq	.LC4(%rip), %rbp
	xorl	%r13d, %r13d
	call	cudaFree@PLT
	call	cudaProfilerStart@PLT
	xorl	%esi, %esi
	movq	8(%rbx), %rdi
	xorl	%ebx, %ebx
	movl	%esi, 48(%rsp)
	movl	%esi, 52(%rsp)
	leaq	.LC2(%rip), %rsi
	call	fopen@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	jne	.L30
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
.L59:
	call	__fprintf_chk@PLT
	orl	$-1, %edi
.L60:
	call	exit@PLT
.L32:
	movl	48(%rsp), %eax
	cmpl	%eax, %ebx
	jb	.L31
	movl	52(%rsp), %eax
	cmpl	%eax, %ebx
	cmovnb	%ebx, %eax
.L31:
	incl	%r13d
	movl	%eax, %ebx
.L30:
	xorl	%eax, %eax
	leaq	52(%rsp), %rcx
	leaq	48(%rsp), %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc23_fscanf@PLT
	incl	%eax
	jne	.L32
	call	clock@PLT
	leal	1(%rbx), %ebp
	movq	%rax, %r14
	movl	%ebp, %eax
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movl	$131072, %edi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rsi
	leaq	64(%rsp), %rdi
	movq	%rax, 24(%rsp)
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	cudaMalloc@PLT
	leaq	80(%rsp), %rdi
	movl	$131072, %esi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	88(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	xorl	%edx, %edx
	leaq	96(%rsp), %rdi
	call	cudaHostAlloc@PLT
	movq	8(%rsp), %rdi
	call	malloc@PLT
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	movq	%rax, %r15
	call	cudaMalloc@PLT
	movl	%r13d, %esi
	leaq	104(%rsp), %rdi
	xorl	%edx, %edx
	salq	$2, %rsi
	xorl	%r13d, %r13d
	call	cudaHostAlloc@PLT
	xorl	%edx, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	fseek@PLT
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
.L33:
	leaq	48(%rsp), %rdx
	xorl	%eax, %eax
	leaq	52(%rsp), %rcx
	movq	%r12, %rdi
	leaq	.LC4(%rip), %rsi
	movl	%r11d, 44(%rsp)
	movl	%r10d, 40(%rsp)
	movl	%r9d, 32(%rsp)
	call	__isoc23_fscanf@PLT
	movl	40(%rsp), %r10d
	movl	44(%rsp), %r11d
	movl	%eax, %edx
	movslq	32(%rsp), %rax
	incl	%edx
	movq	%rax, %r9
	leaq	(%r15,%rax,4), %rax
	je	.L61
	movl	48(%rsp), %ecx
	movq	96(%rsp), %rdx
	incl	(%rdx,%rcx,4)
	movl	%r11d, (%rax)
	movl	%r10d, %eax
	testq	%r13, %r13
	je	.L34
	movl	48(%rsp), %eax
	cmpl	%r10d, %eax
	je	.L34
	movslq	%eax, %rdx
	movl	%r13d, %r11d
	movl	%r13d, (%r15,%rdx,4)
	movq	%rdx, %r9
.L34:
	movq	104(%rsp), %rdx
	movl	52(%rsp), %ecx
	movl	%eax, %r10d
	movl	%ecx, (%rdx,%r13,4)
	incq	%r13
	jmp	.L33
.L61:
	leal	-1(%r13), %r8d
	movq	%r12, %rdi
	movl	%r8d, (%rax)
	call	fclose@PLT
	call	clock@PLT
	subq	%r14, %rax
	movq	%rax, 32(%rsp)
	call	clock@PLT
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	movq	%rax, %r14
	call	cudaMemcpy@PLT
	cmpl	$128, %ebp
	ja	.L36
	movl	%ebp, %r13d
	movl	$1, %ebx
	jmp	.L37
.L36:
	subl	$-128, %ebx
	movl	$128, %r13d
	shrl	$7, %ebx
.L37:
	leaq	120(%rsp), %rdi
	movl	$4, %esi
	movl	$0x00000000, 56(%rsp)
	movl	$0x00000000, 60(%rsp)
	call	cudaMalloc@PLT
	movq	120(%rsp), %rdi
	leaq	56(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movl	%r13d, 140(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rax
	movl	%ebx, 128(%rsp)
	movq	%rax, 144(%rsp)
	movl	148(%rsp), %ecx
	movq	%rax, 132(%rsp)
	movq	140(%rsp), %rdx
	movq	128(%rsp), %rdi
	movl	136(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L38
	movq	88(%rsp), %rsi
	movq	64(%rsp), %rdi
	movl	%ebp, %edx
	call	_Z46__device_stub__Z23initializePagerankArrayPfS_iPfS_i
.L38:
	movabsq	$4294967297, %r12
	xorl	%r15d, %r15d
.L46:
	movq	120(%rsp), %rdi
	leaq	56(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	movl	$0x00000000, 56(%rsp)
	call	cudaMemcpy@PLT
	movq	%r12, 144(%rsp)
	xorl	%r9d, %r9d
	movl	148(%rsp), %ecx
	movq	%r12, 132(%rsp)
	movl	136(%rsp), %esi
	xorl	%r8d, %r8d
	movl	%r13d, 140(%rsp)
	movq	140(%rsp), %rdx
	movl	%ebx, 128(%rsp)
	movq	128(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L39
	pushq	%rax
	.cfi_def_cfa_offset 232
	pushq	%rbp
	.cfi_def_cfa_offset 240
	movq	136(%rsp), %r9
	movq	128(%rsp), %r8
	movq	120(%rsp), %rcx
	movq	112(%rsp), %rdx
	movq	104(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z55__device_stub__Z22addToNextPagerankArrayPfS_PiS0_S0_S_iPfS_PiS0_S0_S_i
	popq	%rdx
	.cfi_def_cfa_offset 232
	popq	%rcx
	.cfi_def_cfa_offset 224
.L39:
	movq	120(%rsp), %rsi
	leaq	60(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	%r12, 144(%rsp)
	xorl	%r9d, %r9d
	movl	148(%rsp), %ecx
	movq	%r12, 132(%rsp)
	movl	136(%rsp), %esi
	xorl	%r8d, %r8d
	movl	%r13d, 140(%rsp)
	movq	140(%rsp), %rdx
	movl	%ebx, 128(%rsp)
	movq	128(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L40
	movss	60(%rsp), %xmm0
	movq	88(%rsp), %rdi
	movl	%ebp, %esi
	call	_Z52__device_stub__Z30finalPagerankArrayForIterationPfifPfif
.L40:
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	movl	$131072, %edx
	call	cudaMemset@PLT
	movq	%r12, 144(%rsp)
	xorl	%r9d, %r9d
	movl	148(%rsp), %ecx
	movq	%r12, 132(%rsp)
	movl	136(%rsp), %esi
	xorl	%r8d, %r8d
	movl	%r13d, 140(%rsp)
	movq	140(%rsp), %rdx
	movl	%ebx, 128(%rsp)
	movq	128(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	movq	72(%rsp), %rcx
	movq	88(%rsp), %rsi
	movl	%ebp, %edx
	movq	64(%rsp), %rdi
	call	_Z49__device_stub__Z24setPagerankArrayFromNextPfS_iS_PfS_iS_
.L41:
	movl	$4194305, %edx
	movl	$131073, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	salq	$15, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 140(%rsp)
	movl	$1, 148(%rsp)
	movq	%rdi, 128(%rsp)
	movl	$1, 136(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L42
	movq	80(%rsp), %rsi
	movq	72(%rsp), %rdi
	movl	%ebp, %edx
	call	_Z34__device_stub__Z11convergencePfS_iPfS_i
.L42:
	movq	80(%rsp), %rsi
	movq	24(%rsp), %rdi
	movl	$2, %ecx
	movl	$131072, %edx
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
.L43:
	movq	24(%rsp), %rcx
	addss	(%rcx,%rax,4), %xmm1
	incq	%rax
	cmpq	$32768, %rax
	jne	.L43
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	incl	%r15d
	movss	%xmm1, 40(%rsp)
	cvtss2sd	%xmm1, %xmm0
	call	__printf_chk@PLT
	call	cudaDeviceSynchronize@PLT
	movss	40(%rsp), %xmm1
	comiss	.LC6(%rip), %xmm1
	jbe	.L44
	cmpl	$60, %r15d
	jne	.L46
.L44:
	movq	8(%rsp), %rdx
	movq	64(%rsp), %rsi
	movl	$2, %ecx
	xorl	%ebx, %ebx
	movq	16(%rsp), %rdi
	leaq	.LC9(%rip), %r13
	call	cudaMemcpy@PLT
	call	clock@PLT
	movl	$1000, %ecx
	leaq	.LC8(%rip), %rdi
	movq	%rax, %rsi
	movq	32(%rsp), %rax
	cqto
	idivq	%rcx
	movq	%rax, 8(%rsp)
	movq	%rsi, %rax
	leaq	.LC7(%rip), %rsi
	subq	%r14, %rax
	cqto
	idivq	%rcx
	movq	%rax, %r14
	call	fopen@PLT
	movq	%rax, %r12
.L47:
	movl	%ebx, %ecx
	cmpl	%ebp, %ebx
	jnb	.L62
	movq	16(%rsp), %rax
	movq	%r13, %rdx
	movl	$2, %esi
	movq	%r12, %rdi
	cvtss2sd	(%rax,%rbx,4), %xmm0
	movb	$1, %al
	incq	%rbx
	call	__fprintf_chk@PLT
	jmp	.L47
.L62:
	movl	8(%rsp), %eax
	movl	$1000, %ebp
	movl	$2, %edi
	leaq	.LC10(%rip), %rsi
	cltd
	idivl	%ebp
	movl	%edx, %ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r14d, %eax
	movl	$2, %edi
	leaq	.LC11(%rip), %rsi
	cltd
	idivl	%ebp
	movl	%edx, %ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r15d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC12(%rip), %rsi
	call	__printf_chk@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	call	cudaDeviceReset@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L49
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC13(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	jmp	.L60
.L49:
	xorl	%eax, %eax
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$168, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
	.section	.rodata.str1.1
.LC15:
	.string	"_Z11convergencePfS_i"
.LC16:
	.string	"_Z24setPagerankArrayFromNextPfS_iS_"
.LC17:
	.string	"_Z30finalPagerankArrayForIterationPfif"
.LC18:
	.string	"_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i"
.LC19:
	.string	"_Z23initializePagerankArrayPfS_i"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2063:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC15(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z11convergencePfS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC16(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z24setPagerankArrayFromNextPfS_iS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC17(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z30finalPagerankArrayForIterationPfif(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z23initializePagerankArrayPfS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2063:
	.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
.LC6:
	.long	897988541
	.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 <stdio.h>
#include <time.h>
#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>
#define  damping_factor 0.9
#define  thread_num 128
#define  block_num ((n_vertices + thread_num-1)/thread_num)
#define  ctm 1024
#define  cbm 32768

__global__ void initializePagerankArray(float * pagerank_d,float * pagerank_next_d, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    if (i < n_vertices) {
        pagerank_d[i] = 1.0/(float)n_vertices;
		pagerank_next_d[i] = 0.0;
    }
}

__global__ void addToNextPagerankArray(float * pagerank_d, float * pagerank_next_d, int * n_successors_d, int * successors_d, int * successor_offset_d, float * dangling_value2, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    int j;
    int n_suc;
    if (i < n_vertices) {
        n_suc = n_successors_d[i];
        if(n_suc > 0) {
            for(j = 0; j < n_suc; j++) {
                atomicAdd(&(pagerank_next_d[successors_d[successor_offset_d[i]+j]]), damping_factor*(pagerank_d[i])/n_suc);
            }
        } else {
            atomicAdd(dangling_value2, damping_factor*pagerank_d[i]);
        }
    }
}       

__global__ void finalPagerankArrayForIteration(float * pagerank_next_d, int n_vertices, float dangling_value2) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    if(i < n_vertices) {
		atomicAdd(&(pagerank_next_d[i]),(dangling_value2 + (1-damping_factor))/((float)n_vertices));
        //pagerank_next_d[i] += (dangling_value2 + (1-0.85))/((float)n_vertices);
    }
}

__global__ void setPagerankArrayFromNext(float * pagerank_d, float * pagerank_next_d, int n_vertices, float *diffs) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
	float temp;
    if(i < n_vertices) {
		temp=pagerank_d[i];
        pagerank_d[i] = pagerank_next_d[i];
        pagerank_next_d[i] = 0.0;
		diffs[i]=((temp - pagerank_d[i])>=0)?(temp- pagerank_d[i]):(pagerank_d[i]-temp);
    }
}  

__global__ void convergence(float *g_idata, float *g_odata, int n) {
	__shared__ float sdata[2*ctm];
	// each thread loads one element from global to shared mem
	unsigned int tid = threadIdx.x;
	unsigned int i = blockIdx.x*blockDim.x + threadIdx.x;
	sdata[tid] = (i < n) ? g_idata[i] : 0;
	__syncthreads();
	// do reduction in shared mem
	for (unsigned int s = blockDim.x/2; s > 0; s /= 2) {
	if (tid < s) {
	sdata[tid] += sdata[tid + s];
	}
	__syncthreads();
	}
	// write result for this block to global mem
	if (tid == 0) g_odata[blockIdx.x] = sdata[0];
}
 

int main(int argc, char ** args) {
    if (argc != 2) {
	fprintf(stderr,"Wrong number of args. Provide input graph file.\n");
        exit(-1);
    } 
    hipFree(0);   
    hipError_t err = hipSuccess;
    hipProfilerStart();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    // Start CPU timer
    clock_t cycles_to_build, cycles_to_calc;


    // build up the graph
    int i;
    unsigned int n_vertices = 0;
    unsigned int n_edges = 0;
    unsigned int vertex_from = 0, vertex_to = 0, vertex_prev = 0;
    
    // Vertex
	float *diffs_new_h;
    float * pagerank_h, *pagerank_d, *diffs, *diffs_new;
    float *pagerank_next_d;
    int * n_successors_h;
    int * successors_h;             
    int * successor_offset_h;
    int * successor_offset_d;
	
    FILE * fp;
    if ((fp = fopen(args[1], "r")) == NULL) {
        fprintf(stderr,"ERROR: Could not open input file.\n");
        exit(-1);
    }

    // parse input file to count the number of vertices
    while (fscanf(fp, "%u %u", &vertex_from, &vertex_to) != EOF) {
        if (vertex_from > n_vertices) {
            n_vertices = vertex_from;
	}
        else if (vertex_to > n_vertices) {
            n_vertices = vertex_to;
	}
	n_edges++;
    }
    n_vertices++;
        clock_t start = clock();
    // Allocate flattened data structure host and device memory
    pagerank_h = (float *) malloc(n_vertices * sizeof(*pagerank_h));
	diffs_new_h = (float * ) malloc(cbm*sizeof(*diffs_new_h));
    err = hipMalloc((void **)&pagerank_d, n_vertices*sizeof(float));
	err = hipMalloc((void **)&diffs, n_vertices*sizeof(float));
	err = hipMalloc((void **)&diffs_new, cbm*sizeof(float));
    err = hipMalloc((void **)&pagerank_next_d, n_vertices*sizeof(float));
	err = hipHostAlloc((void **)&n_successors_h, n_vertices*sizeof(int),hipHostMallocDefault);
	
	successor_offset_h = (int *) malloc(n_vertices * sizeof(*successor_offset_h));
    err = hipMalloc((void **)&successor_offset_d, n_vertices*sizeof(int));
	
	err = hipHostAlloc((void**)&successors_h, n_edges*sizeof(int),hipHostMallocDefault);

    // allocate memory for successor pointers
    int offset = 0, edges = 0;      

    // parse input file to count the number of successors of each vertex
    fseek(fp, 0L, SEEK_SET);
    i = 0;
 
    while (fscanf(fp, "%u %u", &vertex_from, &vertex_to) != EOF) {
        n_successors_h[vertex_from] += 1;
	
	// Fill successor_offset_h array
        successor_offset_h[i] = offset;
	if(edges != 0 && vertex_prev != vertex_from) {
	    i = vertex_from;
	    offset = edges;
	    successor_offset_h[i] = offset;	   
	    vertex_prev = vertex_from;
	}

	// Fill successor array
	successors_h[edges] = vertex_to;
	
	edges++;
    }
    successor_offset_h[i] = edges - 1;    

    fclose(fp);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Get build time and reset start
    cycles_to_build = clock() - start;
    start = clock();	
    err = hipMemcpy(successor_offset_d, successor_offset_h, n_vertices*sizeof(int), hipMemcpyHostToDevice);
	
    // Compute the pagerank
    int n_iterations = 60;
    int iteration = 0;
    int numOfBlocks = 1;                 
    int threadsPerBlock = 1000;                 

    if(n_vertices <= thread_num) {
        threadsPerBlock = n_vertices;
        numOfBlocks = 1;
    } else {
        threadsPerBlock = thread_num;
        numOfBlocks = (n_vertices + thread_num-1)/thread_num;   // The "+ 1023" ensures we round up
    }

    float dangling_value_h = 0;
    float dangling_value_h2 = 0;
    float *dangling_value2;
    int n_blocks = (n_vertices + 2048 - 1)/2048;
    if (n_blocks == 0){
        n_blocks = 1;
    }
    float epsilon = 0.000001;
    //float * d_diff;
	//float diff;
    float diff = epsilon + 1;

    //err = cudaMalloc((void **)&d_diff, sizeof(float));    
    err = hipMalloc((void **)&dangling_value2, sizeof(float));
    err = hipMemcpy(dangling_value2, &dangling_value_h, sizeof(float), hipMemcpyHostToDevice);

    initializePagerankArray<<<numOfBlocks,threadsPerBlock>>>(pagerank_d, pagerank_next_d, n_vertices);

    while(epsilon < diff && iteration < n_iterations) {  //was 23

       // set the dangling value to 0 
        dangling_value_h = 0;
        err = hipMemcpy(dangling_value2, &dangling_value_h, sizeof(float), hipMemcpyHostToDevice);     
        // initial parallel pagerank_next computation
        addToNextPagerankArray<<<numOfBlocks,threadsPerBlock>>>(pagerank_d, pagerank_next_d, n_successors_h, successors_h, successor_offset_d, dangling_value2, n_vertices);
        // get the dangling value
        err = hipMemcpy(&dangling_value_h2, dangling_value2, sizeof(float), hipMemcpyDeviceToHost); 
        // final parallel pagerank_next computation
        finalPagerankArrayForIteration<<<numOfBlocks,threadsPerBlock>>>(pagerank_next_d, n_vertices, dangling_value_h2);      
        // Get difference to compare to epsilon
		//cudaMemset(d_diff, 0, sizeof(float) );
		hipMemset(diffs_new, 0, cbm*sizeof(float) );
        setPagerankArrayFromNext<<<numOfBlocks,threadsPerBlock>>>(pagerank_d, pagerank_next_d, n_vertices, diffs);

		convergence<<<cbm,ctm>>>(diffs, diffs_new, n_vertices);

		hipMemcpy(diffs_new_h, diffs_new, sizeof(float) * cbm, hipMemcpyDeviceToHost);
		/*
		for (i = 0; i < cbm; i++) {
			printf("%f\n",diffs_new_h[i]);
		}*/
		diff=0;
		for (i = 0; i < cbm; i++) {
			diff += diffs_new_h[i];
		}
			//h_diff=diff;
			printf("Probe : %f\n",diff);
			hipDeviceSynchronize();
			iteration++;
    }
	
    err = hipMemcpy(pagerank_h, pagerank_d, n_vertices*sizeof(float), hipMemcpyDeviceToHost);

    // CPU time
    cycles_to_calc = clock() - start;
    int build_milli = cycles_to_build * 1000 / CLOCKS_PER_SEC;
    int calc_milli = cycles_to_calc * 1000 / CLOCKS_PER_SEC;
 
	FILE *f_result;
	f_result=fopen("rg","w");
	for (i=0;i<n_vertices;i++) {
        fprintf(f_result,"Vertex %u:\tpagerank = %.18f\n", i, pagerank_h[i]);
	}  

    printf("Time to build: %d seconds, %d milliseconds\n",build_milli/1000, build_milli%1000);
    printf("Time to calc: %d seconds, %d milliseconds\n",calc_milli/1000, calc_milli%1000);
    printf("iter: %d\n", iteration);

    // Free device global memory
    err = hipFree(pagerank_d);
    err = hipFree(pagerank_next_d);
    // Free host memory
    free(pagerank_h);
    err = hipDeviceReset();

    if (err != hipSuccess)
    {
        fprintf(stderr, "Failed to deinitialize the device! error=%s\n", hipGetErrorString(err));
        exit(EXIT_FAILURE);
    }

    printf("Done\n");
    return 0;
}


	.text
	.file	"pagerank_hostalloc_tree.hip"
	.globl	_Z38__device_stub__initializePagerankArrayPfS_i # -- Begin function _Z38__device_stub__initializePagerankArrayPfS_i
	.type	_Z38__device_stub__initializePagerankArrayPfS_i,@function
_Z38__device_stub__initializePagerankArrayPfS_i: # @_Z38__device_stub__initializePagerankArrayPfS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z23initializePagerankArrayPfS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end0:
	.size	_Z38__device_stub__initializePagerankArrayPfS_i, .Lfunc_end0-_Z38__device_stub__initializePagerankArrayPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i # -- Begin function _Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i
	.type	_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i,@function
_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i: # @_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.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
	retq
.Lfunc_end1:
	.size	_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i, .Lfunc_end1-_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z45__device_stub__finalPagerankArrayForIterationPfif # -- Begin function _Z45__device_stub__finalPagerankArrayForIterationPfif
	.type	_Z45__device_stub__finalPagerankArrayForIterationPfif,@function
_Z45__device_stub__finalPagerankArrayForIterationPfif: # @_Z45__device_stub__finalPagerankArrayForIterationPfif
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$96, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	movq	%rsp, %rdx
	movss	%xmm0, (%rdx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z30finalPagerankArrayForIterationPfif, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	popq	%rbx
	.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
	retq
.Lfunc_end2:
	.size	_Z45__device_stub__finalPagerankArrayForIterationPfif, .Lfunc_end2-_Z45__device_stub__finalPagerankArrayForIterationPfif
	.cfi_endproc
                                        # -- End function
	.globl	_Z39__device_stub__setPagerankArrayFromNextPfS_iS_ # -- Begin function _Z39__device_stub__setPagerankArrayFromNextPfS_iS_
	.type	_Z39__device_stub__setPagerankArrayFromNextPfS_iS_,@function
_Z39__device_stub__setPagerankArrayFromNextPfS_iS_: # @_Z39__device_stub__setPagerankArrayFromNextPfS_iS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	4(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	24(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z24setPagerankArrayFromNextPfS_iS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end3:
	.size	_Z39__device_stub__setPagerankArrayFromNextPfS_iS_, .Lfunc_end3-_Z39__device_stub__setPagerankArrayFromNextPfS_iS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__convergencePfS_i # -- Begin function _Z26__device_stub__convergencePfS_i
	.type	_Z26__device_stub__convergencePfS_i,@function
_Z26__device_stub__convergencePfS_i:    # @_Z26__device_stub__convergencePfS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11convergencePfS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end4:
	.size	_Z26__device_stub__convergencePfS_i, .Lfunc_end4-_Z26__device_stub__convergencePfS_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI5_0:
	.long	0x358637bd                      # float 9.99999997E-7
	.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	$168, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$2, %edi
	jne	.LBB5_1
# %bb.3:
	movq	%rsi, %rbx
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	hipFree
	callq	hipProfilerStart
	movl	%r14d, 16(%rsp)
	movl	%r14d, 20(%rsp)
	movq	8(%rbx), %rdi
	movl	$.L.str.1, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB5_6
# %bb.4:                                # %.preheader
	movq	%rax, %r12
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	je	.LBB5_5
# %bb.7:                                # %.lr.ph.preheader
	leaq	16(%rsp), %rbx
	leaq	20(%rsp), %r15
	xorl	%r14d, %r14d
	xorl	%ebp, %ebp
.LBB5_8:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	20(%rsp), %eax
	cmpl	%r14d, %eax
	cmovbel	%r14d, %eax
	movl	16(%rsp), %ecx
	cmpl	%r14d, %ecx
	movl	%eax, %r14d
	cmoval	%ecx, %r14d
	incl	%ebp
	movl	$.L.str.3, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	jne	.LBB5_8
# %bb.9:                                # %._crit_edge.loopexit
	movl	%ebp, %ebp
	shlq	$2, %rbp
	jmp	.LBB5_10
.LBB5_5:
	xorl	%ebp, %ebp
.LBB5_10:                               # %._crit_edge
	leal	1(%r14), %ebx
	callq	clock
	movq	%rax, 144(%rsp)                 # 8-byte Spill
	movq	%rbx, 72(%rsp)                  # 8-byte Spill
	leaq	(,%rbx,4), %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 160(%rsp)                 # 8-byte Spill
	movl	$131072, %edi                   # imm = 0x20000
	callq	malloc
	movq	%rax, %r13
	leaq	48(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	136(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	96(%rsp), %rdi
	movl	$131072, %esi                   # imm = 0x20000
	callq	hipMalloc
	leaq	40(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	128(%rsp), %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	hipHostAlloc
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	leaq	112(%rsp), %rdi
	movq	%rbx, 104(%rsp)                 # 8-byte Spill
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	120(%rsp), %rdi
	movq	%rbp, %rsi
	xorl	%edx, %edx
	callq	hipHostAlloc
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	fseek
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	movl	$.L.str.3, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	je	.LBB5_11
# %bb.12:                               # %.lr.ph169.preheader
	movq	%r12, 64(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
.LBB5_13:                               # %.lr.ph169
                                        # =>This Inner Loop Header: Depth=1
	movq	128(%rsp), %rax
	movl	16(%rsp), %ecx
	incl	(%rax,%rcx,4)
	movslq	%ebp, %rax
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movl	%r12d, (%rcx,%rax,4)
	testq	%r15, %r15
	je	.LBB5_16
# %bb.14:                               #   in Loop: Header=BB5_13 Depth=1
	movl	16(%rsp), %eax
	cmpl	%eax, %ebx
	je	.LBB5_16
# %bb.15:                               #   in Loop: Header=BB5_13 Depth=1
	movslq	%eax, %rcx
	movq	24(%rsp), %rdx                  # 8-byte Reload
	movl	%r15d, (%rdx,%rcx,4)
	movl	%r15d, %r12d
	movl	%eax, %ebx
	movl	%eax, %ebp
.LBB5_16:                               #   in Loop: Header=BB5_13 Depth=1
	movl	20(%rsp), %eax
	movq	120(%rsp), %rcx
	movl	%eax, (%rcx,%r15,4)
	incq	%r15
	movl	$.L.str.3, %esi
	movq	64(%rsp), %rdi                  # 8-byte Reload
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	jne	.LBB5_13
# %bb.17:                               # %._crit_edge170.loopexit
	decl	%r15d
	movslq	%ebp, %rax
	movq	64(%rsp), %r12                  # 8-byte Reload
	jmp	.LBB5_18
.LBB5_11:
	movl	$-1, %r15d
	xorl	%eax, %eax
.LBB5_18:                               # %._crit_edge170
	movabsq	$4294967296, %rbx               # imm = 0x100000000
	movq	24(%rsp), %rbp                  # 8-byte Reload
	movl	%r15d, (%rbp,%rax,4)
	movq	%r12, %rdi
	callq	fclose
	callq	clock
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	callq	clock
	movq	%rax, 152(%rsp)                 # 8-byte Spill
	movq	112(%rsp), %rdi
	movl	$1, %r15d
	movq	%rbp, %rsi
	movq	104(%rsp), %rdx                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$128, %r12d
	addl	%r12d, %r14d
	shrl	$7, %r14d
	movq	72(%rsp), %rax                  # 8-byte Reload
	cmpl	$129, %eax
	cmovbl	%eax, %r12d
	cmovbl	%r15d, %r14d
	xorl	%r15d, %r15d
	leaq	36(%rsp), %rax
	movl	%r15d, (%rax)
	movl	%r15d, 60(%rsp)
	leaq	88(%rsp), %rbp
	movl	$4, %esi
	movq	%rbp, %rdi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movl	$4, %edx
	leaq	36(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	btsq	$32, %r14
	btsq	$32, %r12
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_20
# %bb.19:
	movq	48(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	72(%rsp), %rdx                  # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	callq	_Z38__device_stub__initializePagerankArrayPfS_i
.LBB5_20:                               # %.preheader195
	movq	80(%rsp), %rax                  # 8-byte Reload
	subq	144(%rsp), %rax                 # 8-byte Folded Reload
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	leaq	1024(%rbx), %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	addq	$32768, %rbx                    # imm = 0x8000
.LBB5_21:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_30 Depth 2
	movl	$0, 36(%rsp)
	movq	88(%rsp), %rdi
	movl	$4, %edx
	leaq	36(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	movq	72(%rsp), %rbp                  # 8-byte Reload
	jne	.LBB5_23
# %bb.22:                               #   in Loop: Header=BB5_21 Depth=1
	movq	48(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	128(%rsp), %rdx
	movq	120(%rsp), %rcx
	movq	112(%rsp), %r8
	movq	88(%rsp), %r9
	movl	%ebp, (%rsp)
	callq	_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i
.LBB5_23:                               #   in Loop: Header=BB5_21 Depth=1
	movq	88(%rsp), %rsi
	movl	$4, %edx
	leaq	60(%rsp), %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_25
# %bb.24:                               #   in Loop: Header=BB5_21 Depth=1
	movq	40(%rsp), %rdi
	movss	60(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movl	%ebp, %esi
	callq	_Z45__device_stub__finalPagerankArrayForIterationPfif
.LBB5_25:                               #   in Loop: Header=BB5_21 Depth=1
	movq	96(%rsp), %rdi
	movl	$131072, %edx                   # imm = 0x20000
	xorl	%esi, %esi
	callq	hipMemset
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_27
# %bb.26:                               #   in Loop: Header=BB5_21 Depth=1
	movq	48(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	136(%rsp), %rcx
	movl	%ebp, %edx
	callq	_Z39__device_stub__setPagerankArrayFromNextPfS_iS_
.LBB5_27:                               #   in Loop: Header=BB5_21 Depth=1
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	64(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_29
# %bb.28:                               #   in Loop: Header=BB5_21 Depth=1
	movq	136(%rsp), %rdi
	movq	96(%rsp), %rsi
	movl	%ebp, %edx
	callq	_Z26__device_stub__convergencePfS_i
.LBB5_29:                               #   in Loop: Header=BB5_21 Depth=1
	movq	96(%rsp), %rsi
	movl	$131072, %edx                   # imm = 0x20000
	movq	%r13, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	xorps	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB5_30:                               #   Parent Loop BB5_21 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	addss	(%r13,%rax,4), %xmm0
	incq	%rax
	cmpq	$32768, %rax                    # imm = 0x8000
	jne	.LBB5_30
# %bb.31:                               #   in Loop: Header=BB5_21 Depth=1
	movss	%xmm0, 24(%rsp)                 # 4-byte Spill
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.4, %edi
	movb	$1, %al
	callq	printf
	callq	hipDeviceSynchronize
	leal	1(%r15), %ebp
	movss	24(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	ucomiss	.LCPI5_0(%rip), %xmm0
	jbe	.LBB5_33
# %bb.32:                               #   in Loop: Header=BB5_21 Depth=1
	cmpl	$59, %r15d
	movl	%ebp, %r15d
	jb	.LBB5_21
.LBB5_33:
	movq	48(%rsp), %rsi
	movq	160(%rsp), %r15                 # 8-byte Reload
	movq	%r15, %rdi
	movq	104(%rsp), %rdx                 # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	callq	clock
	movq	%rax, %rcx
	subq	152(%rsp), %rcx                 # 8-byte Folded Reload
	movabsq	$2361183241434822607, %rsi      # imm = 0x20C49BA5E353F7CF
	movq	80(%rsp), %rax                  # 8-byte Reload
	imulq	%rsi
	movq	%rdx, %r14
	movq	%rdx, %rax
	shrq	$63, %rax
	shrq	$7, %r14
	addl	%eax, %r14d
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rdx, %rax
	shrq	$63, %rax
	shrq	$7, %rdx
	addl	%eax, %edx
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
	movl	$.L.str.5, %edi
	movl	$.L.str.6, %esi
	callq	fopen
	movq	72(%rsp), %rbx                  # 8-byte Reload
	testq	%rbx, %rbx
	je	.LBB5_36
# %bb.34:                               # %.lr.ph178.preheader
	movq	%rax, %r12
	xorl	%r13d, %r13d
.LBB5_35:                               # %.lr.ph178
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15,%r13,4), %xmm0
	movl	$.L.str.7, %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	movb	$1, %al
	callq	fprintf
	incq	%r13
	cmpq	%r13, %rbx
	jne	.LBB5_35
.LBB5_36:                               # %._crit_edge179
	movslq	%r14d, %rdx
	imulq	$274877907, %rdx, %rsi          # imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	imull	$1000, %esi, %eax               # imm = 0x3E8
	subl	%eax, %edx
	movl	$.L.str.8, %edi
                                        # kill: def $esi killed $esi killed $rsi
                                        # kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	printf
	movslq	24(%rsp), %rdx                  # 4-byte Folded Reload
	imulq	$274877907, %rdx, %rsi          # imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	imull	$1000, %esi, %eax               # imm = 0x3E8
	subl	%eax, %edx
	movl	$.L.str.9, %edi
                                        # kill: def $esi killed $esi killed $rsi
                                        # kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.10, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	%r15, %rdi
	callq	free
	callq	hipDeviceReset
	testl	%eax, %eax
	jne	.LBB5_38
# %bb.37:
	movl	$.Lstr, %edi
	callq	puts@PLT
	xorl	%eax, %eax
	addq	$168, %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
.LBB5_1:
	.cfi_def_cfa_offset 224
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$48, %esi
	jmp	.LBB5_2
.LBB5_6:
	movq	stderr(%rip), %rcx
	movl	$.L.str.2, %edi
	movl	$34, %esi
.LBB5_2:
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$-1, %edi
	callq	exit
.LBB5_38:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %esi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end5:
	.size	main, .Lfunc_end5-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z23initializePagerankArrayPfS_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z30finalPagerankArrayForIterationPfif, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z24setPagerankArrayFromNextPfS_iS_, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11convergencePfS_i, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB7_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z23initializePagerankArrayPfS_i,@object # @_Z23initializePagerankArrayPfS_i
	.section	.rodata,"a",@progbits
	.globl	_Z23initializePagerankArrayPfS_i
	.p2align	3, 0x0
_Z23initializePagerankArrayPfS_i:
	.quad	_Z38__device_stub__initializePagerankArrayPfS_i
	.size	_Z23initializePagerankArrayPfS_i, 8

	.type	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i,@object # @_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.globl	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.p2align	3, 0x0
_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i:
	.quad	_Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i
	.size	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i, 8

	.type	_Z30finalPagerankArrayForIterationPfif,@object # @_Z30finalPagerankArrayForIterationPfif
	.globl	_Z30finalPagerankArrayForIterationPfif
	.p2align	3, 0x0
_Z30finalPagerankArrayForIterationPfif:
	.quad	_Z45__device_stub__finalPagerankArrayForIterationPfif
	.size	_Z30finalPagerankArrayForIterationPfif, 8

	.type	_Z24setPagerankArrayFromNextPfS_iS_,@object # @_Z24setPagerankArrayFromNextPfS_iS_
	.globl	_Z24setPagerankArrayFromNextPfS_iS_
	.p2align	3, 0x0
_Z24setPagerankArrayFromNextPfS_iS_:
	.quad	_Z39__device_stub__setPagerankArrayFromNextPfS_iS_
	.size	_Z24setPagerankArrayFromNextPfS_iS_, 8

	.type	_Z11convergencePfS_i,@object    # @_Z11convergencePfS_i
	.globl	_Z11convergencePfS_i
	.p2align	3, 0x0
_Z11convergencePfS_i:
	.quad	_Z26__device_stub__convergencePfS_i
	.size	_Z11convergencePfS_i, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Wrong number of args. Provide input graph file.\n"
	.size	.L.str, 49

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"ERROR: Could not open input file.\n"
	.size	.L.str.2, 35

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

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"rg"
	.size	.L.str.5, 3

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

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Vertex %u:\tpagerank = %.18f\n"
	.size	.L.str.7, 29

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Time to build: %d seconds, %d milliseconds\n"
	.size	.L.str.8, 44

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Time to calc: %d seconds, %d milliseconds\n"
	.size	.L.str.9, 43

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

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Failed to deinitialize the device! error=%s\n"
	.size	.L.str.11, 45

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z23initializePagerankArrayPfS_i"
	.size	.L__unnamed_1, 33

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i"
	.size	.L__unnamed_2, 42

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z30finalPagerankArrayForIterationPfif"
	.size	.L__unnamed_3, 39

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z24setPagerankArrayFromNextPfS_iS_"
	.size	.L__unnamed_4, 36

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z11convergencePfS_i"
	.size	.L__unnamed_5, 21

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.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	"Done"
	.size	.Lstr, 5

	.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 _Z38__device_stub__initializePagerankArrayPfS_i
	.addrsig_sym _Z37__device_stub__addToNextPagerankArrayPfS_PiS0_S0_S_i
	.addrsig_sym _Z45__device_stub__finalPagerankArrayForIterationPfif
	.addrsig_sym _Z39__device_stub__setPagerankArrayFromNextPfS_iS_
	.addrsig_sym _Z26__device_stub__convergencePfS_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z23initializePagerankArrayPfS_i
	.addrsig_sym _Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.addrsig_sym _Z30finalPagerankArrayForIterationPfif
	.addrsig_sym _Z24setPagerankArrayFromNextPfS_iS_
	.addrsig_sym _Z11convergencePfS_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z23initializePagerankArrayPfS_i ; -- Begin function _Z23initializePagerankArrayPfS_i
	.globl	_Z23initializePagerankArrayPfS_i
	.p2align	8
	.type	_Z23initializePagerankArrayPfS_i,@function
_Z23initializePagerankArrayPfS_i:       ; @_Z23initializePagerankArrayPfS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x24
	s_load_b32 s2, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s3, v[0:1]
	s_mov_b32 s3, exec_lo
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_cvt_f32_i32_e32 v4, s2
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mov_b32_e32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v0, null, v4, v4, 1.0
	v_div_scale_f32 v5, vcc_lo, 1.0, v4, 1.0
	v_rcp_f32_e32 v3, v0
	s_waitcnt_depctr 0xfff
	v_fma_f32 v2, -v0, v3, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v2, v3
	v_mul_f32_e32 v6, v5, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v2, -v0, v6, v5
	v_fmac_f32_e32 v6, v2, v3
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v5, -v0, v6, v5
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v5, v5, v3, v6
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_div_fixup_f32 v4, v5, v4, 1.0
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	global_store_b32 v[2:3], v4, off
	global_store_b32 v[0:1], v7, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z23initializePagerankArrayPfS_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z23initializePagerankArrayPfS_i, .Lfunc_end0-_Z23initializePagerankArrayPfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 244
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i ; -- Begin function _Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.globl	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
	.p2align	8
	.type	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i,@function
_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i: ; @_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x44
	s_load_b32 s3, s[0:1], 0x30
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB1_14
; %bb.1:
	s_load_b256 s[4:11], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b128 s[0:3], s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[4:5], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s8, v4
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v5, vcc_lo
	s_mov_b32 s8, exec_lo
	global_load_b32 v10, v[0:1], off
	s_waitcnt vmcnt(0)
	v_cmpx_gt_i32_e32 1, v10
	s_xor_b32 s8, exec_lo, s8
	s_cbranch_execz .LBB1_9
; %bb.2:
	v_add_co_u32 v0, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v5, vcc_lo
	s_mov_b32 s12, 0xcccccccd
	s_mov_b32 s13, 0x3feccccc
	v_bfrev_b32_e32 v2, 1
	global_load_b32 v0, v[0:1], off
	s_mov_b32 s9, exec_lo
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[0:1], v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[0:1], v[0:1], s[12:13]
	v_cvt_f32_f64_e32 v0, v[0:1]
.LBB1_3:                                ; %ComputeLoop
                                        ; =>This Inner Loop Header: Depth=1
	s_ctz_i32_b32 s12, s9
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_readlane_b32 s13, v0, s12
	s_lshl_b32 s12, 1, s12
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s9, s9, s12
	s_cmp_lg_u32 s9, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v2, s13, v2
	s_cbranch_scc1 .LBB1_3
; %bb.4:                                ; %ComputeEnd
	v_mbcnt_lo_u32_b32 v0, exec_lo, 0
	s_mov_b32 s12, 0
	s_mov_b32 s9, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_xor_b32 s9, exec_lo, s9
	s_cbranch_execz .LBB1_8
; %bb.5:
	s_load_b32 s13, s[2:3], 0x0
	v_mov_b32_e32 v3, 0
	s_waitcnt lgkmcnt(0)
	v_mov_b32_e32 v1, s13
.LBB1_6:                                ; %atomicrmw.start28
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v0, v1, v2
	global_atomic_cmpswap_b32 v0, v3, v[0:1], s[2:3] glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v0, v1
	v_mov_b32_e32 v1, v0
	s_or_b32 s12, vcc_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB1_6
; %bb.7:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s12
.LBB1_8:                                ; %Flow52
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s9
                                        ; implicit-def: $vgpr10
                                        ; implicit-def: $vgpr4_vgpr5
.LBB1_9:                                ; %Flow54
	s_and_not1_saveexec_b32 s2, s8
	s_cbranch_execz .LBB1_14
; %bb.10:                               ; %.preheader
	v_cvt_f64_i32_e32 v[0:1], v10
	v_add_co_u32 v2, vcc_lo, s0, v4
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v5, vcc_lo
	v_add_co_u32 v4, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	s_mov_b32 s0, 0xcccccccd
	s_mov_b32 s1, 0x3feccccc
	s_mov_b32 s2, 0
	s_mov_b32 s3, 0
.LBB1_11:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_12 Depth 2
	global_load_b32 v6, v[2:3], off
	global_load_b32 v8, v[4:5], off
	s_mov_b32 s4, 0
	s_waitcnt vmcnt(1)
	v_add_nc_u32_e32 v6, s3, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v6
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, s10, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s11, v7, vcc_lo
	global_load_b32 v6, v[6:7], off
	s_waitcnt vmcnt(1)
	v_cvt_f64_f32_e32 v[7:8], v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[11:12], v[7:8], s[0:1]
	v_div_scale_f64 v[13:14], null, v[0:1], v[0:1], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[15:16], v[13:14]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[17:18], -v[13:14], v[15:16], 1.0
	v_fma_f64 v[15:16], v[15:16], v[17:18], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], -v[13:14], v[15:16], 1.0
	v_fma_f64 v[15:16], v[15:16], v[17:18], v[15:16]
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v7, 31, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	v_add_co_u32 v6, vcc_lo, s6, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v7, vcc_lo
	v_div_scale_f64 v[17:18], vcc_lo, v[11:12], v[0:1], v[11:12]
	global_load_b32 v9, v[6:7], off
	v_mul_f64 v[19:20], v[17:18], v[15:16]
	v_fma_f64 v[13:14], -v[13:14], v[19:20], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[13:14], v[13:14], v[15:16], v[19:20]
	v_div_fixup_f64 v[11:12], v[13:14], v[0:1], v[11:12]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f32_f64_e32 v11, v[11:12]
.LBB1_12:                               ; %atomicrmw.start
                                        ;   Parent Loop BB1_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v8, v9, v11
	global_atomic_cmpswap_b32 v8, v[6:7], v[8:9], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v8, v9
	v_mov_b32_e32 v9, v8
	s_or_b32 s4, vcc_lo, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB1_12
; %bb.13:                               ; %atomicrmw.end
                                        ;   in Loop: Header=BB1_11 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	s_add_i32 s3, s3, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_eq_u32_e32 vcc_lo, s3, v10
	s_or_b32 s2, vcc_lo, s2
	s_and_not1_b32 exec_lo, exec_lo, s2
	s_cbranch_execnz .LBB1_11
.LBB1_14:                               ; %.loopexit
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 312
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 21
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i, .Lfunc_end1-_Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 740
; NumSgprs: 18
; NumVgprs: 21
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 21
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z30finalPagerankArrayForIterationPfif ; -- Begin function _Z30finalPagerankArrayForIterationPfif
	.globl	_Z30finalPagerankArrayForIterationPfif
	.p2align	8
	.type	_Z30finalPagerankArrayForIterationPfif,@function
_Z30finalPagerankArrayForIterationPfif: ; @_Z30finalPagerankArrayForIterationPfif
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x1c
	s_load_b64 s[2:3], s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_mov_b32 s4, exec_lo
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB2_3
; %bb.1:
	v_cvt_f64_f32_e32 v[2:3], s3
	v_cvt_f32_i32_e32 v0, s2
	s_mov_b32 s2, 0x99999998
	s_mov_b32 s3, 0x3fb99999
	s_load_b64 s[0:1], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_f64_f32_e32 v[4:5], v0
	v_add_f64 v[6:7], v[2:3], s[2:3]
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_mov_b32 s0, 0
	global_load_b32 v3, v[0:1], off
	v_div_scale_f64 v[8:9], null, v[4:5], v[4:5], v[6:7]
	v_rcp_f64_e32 v[10:11], v[8:9]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[12:13], -v[8:9], v[10:11], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], v[10:11], v[12:13], v[10:11]
	v_fma_f64 v[12:13], -v[8:9], v[10:11], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], v[10:11], v[12:13], v[10:11]
	v_div_scale_f64 v[12:13], vcc_lo, v[6:7], v[4:5], v[6:7]
	v_mul_f64 v[14:15], v[12:13], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], -v[8:9], v[14:15], v[12:13]
	v_div_fmas_f64 v[8:9], v[8:9], v[10:11], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[4:5], v[8:9], v[4:5], v[6:7]
	v_cvt_f32_f64_e32 v4, v[4:5]
.LBB2_2:                                ; %atomicrmw.start
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v2, v3, v4
	global_atomic_cmpswap_b32 v2, v[0:1], v[2:3], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v2, v3
	v_mov_b32_e32 v3, v2
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB2_2
.LBB2_3:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z30finalPagerankArrayForIterationPfif
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 16
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z30finalPagerankArrayForIterationPfif, .Lfunc_end2-_Z30finalPagerankArrayForIterationPfif
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 316
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z24setPagerankArrayFromNextPfS_iS_ ; -- Begin function _Z24setPagerankArrayFromNextPfS_iS_
	.globl	_Z24setPagerankArrayFromNextPfS_iS_
	.p2align	8
	.type	_Z24setPagerankArrayFromNextPfS_iS_,@function
_Z24setPagerankArrayFromNextPfS_iS_:    ; @_Z24setPagerankArrayFromNextPfS_iS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB3_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v1, vcc_lo
	global_load_b32 v6, v[2:3], off
	global_load_b32 v8, v[4:5], off
	v_mov_b32_e32 v7, 0
	s_waitcnt vmcnt(1)
	global_store_b32 v[4:5], v6, off
	global_store_b32 v[2:3], v7, off
	global_load_b32 v2, v[4:5], off
	s_waitcnt vmcnt(0)
	v_dual_sub_f32 v3, v8, v2 :: v_dual_sub_f32 v2, v2, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_nle_f32_e32 vcc_lo, 0, v3
	v_cndmask_b32_e32 v2, v3, v2, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB3_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z24setPagerankArrayFromNextPfS_iS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z24setPagerankArrayFromNextPfS_iS_, .Lfunc_end3-_Z24setPagerankArrayFromNextPfS_iS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 228
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z11convergencePfS_i    ; -- Begin function _Z11convergencePfS_i
	.globl	_Z11convergencePfS_i
	.p2align	8
	.type	_Z11convergencePfS_i,@function
_Z11convergencePfS_i:                   ; @_Z11convergencePfS_i
; %bb.0:
	s_clause 0x2
	s_load_b32 s5, s[0:1], 0x24
	s_load_b32 s6, s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	s_mov_b32 s4, s15
	s_waitcnt lgkmcnt(0)
	s_and_b32 s5, s5, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[1:2], null, s4, s5, v[0:1]
	v_mov_b32_e32 v2, 0
	v_cmp_gt_u32_e32 vcc_lo, s6, v1
	s_and_saveexec_b32 s6, vcc_lo
	s_cbranch_execz .LBB4_2
; %bb.1:
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	v_add_co_u32 v1, vcc_lo, s0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	global_load_b32 v2, v[1:2], off
.LBB4_2:
	s_or_b32 exec_lo, exec_lo, s6
	v_lshlrev_b32_e32 v1, 2, v0
	s_cmp_lt_u32 s5, 2
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v2
	s_waitcnt lgkmcnt(0)
	s_barrier
.LBB4_3:                                ; =>This Inner Loop Header: Depth=1
	buffer_gl0_inv
	s_cbranch_scc1 .LBB4_7
; %bb.4:                                ; %.lr.ph
                                        ;   in Loop: Header=BB4_3 Depth=1
	s_lshr_b32 s0, s5, 1
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u32_e64 s0, v0
	s_cbranch_execz .LBB4_6
; %bb.5:                                ;   in Loop: Header=BB4_3 Depth=1
	v_lshl_add_u32 v2, s0, 2, v1
	ds_load_b32 v2, v2
	ds_load_b32 v3, v1
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	ds_store_b32 v1, v2
.LBB4_6:                                ;   in Loop: Header=BB4_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_cmp_lt_u32 s5, 4
	s_mov_b32 s5, s0
	s_branch .LBB4_3
.LBB4_7:                                ; %._crit_edge
	s_mov_b32 s5, 0
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB4_9
; %bb.8:
	v_mov_b32_e32 v0, 0
	s_lshl_b64 s[0:1], s[4:5], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s2, s0
	s_addc_u32 s1, s3, s1
	ds_load_b32 v1, v0
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v1, s[0:1]
.LBB4_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11convergencePfS_i
		.amdhsa_group_segment_fixed_size 8192
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 4
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end4:
	.size	_Z11convergencePfS_i, .Lfunc_end4-_Z11convergencePfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 308
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 8192 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.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_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z23initializePagerankArrayPfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z23initializePagerankArrayPfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     by_value
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         60
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         68
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         70
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         72
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         74
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         76
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         78
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         120
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 312
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22addToNextPagerankArrayPfS_PiS0_S0_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22addToNextPagerankArrayPfS_PiS0_S0_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     21
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z30finalPagerankArrayForIterationPfif
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z30finalPagerankArrayForIterationPfif.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     16
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z24setPagerankArrayFromNextPfS_iS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z24setPagerankArrayFromNextPfS_iS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 8192
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11convergencePfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11convergencePfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
