#include <stdio.h>
#include <time.h>

// For the CUDA runtime routines (prefixed with "cuda_")
#include <cuda_runtime.h>


typedef struct vertex vertex;

struct vertex {
    unsigned int vertex_id;
    float pagerank;
    float pagerank_next;
    unsigned int n_successors;
    vertex ** successors;
};


__global__ void initializePageranks(vertex * vertices, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (i < n_vertices) {
        vertices[i].pagerank = 1.0/(float)n_vertices;
        vertices[i].pagerank_next = 0.0;
    }
}


__global__ void addToNextPagerank(vertex * vertices, float * dangling_value, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    int j;

    if(i < n_vertices) {
        if(vertices[i].n_successors > 0) {
            for(j = 0; j < vertices[i].n_successors; j++) {
                atomicAdd(&(vertices[i].successors[j]->pagerank_next), 0.85*(vertices[i].pagerank)/vertices[i].n_successors);
            }
        }else {
            atomicAdd(dangling_value, 0.85*vertices[i].pagerank);
        }
    }
}

__global__ void finalPagerankForIteration(vertex * vertices, int n_vertices, float dangling_value){
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (i < n_vertices) {
        vertices[i].pagerank_next += (dangling_value + (1-0.85))/((float)n_vertices);
    }
}

__global__ void setPageranksFromNext(vertex * vertices, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (i < n_vertices) {
        vertices[i].pagerank = vertices[i].pagerank_next;
        vertices[i].pagerank_next = 0.0;
    }
}

__global__ void convergence(vertex * vertices, float * reduced_sums_d, int n_vertices) {
// Each thread computes the diff for two vertexes (thus, half # of blocks needed for this function)
// Because of this, we need to handle the case where only one block is needed
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    int i_thr = threadIdx.x;

    __shared__ float sums[1024];                       // blockDim.x == 1024

    float temp1, temp2;

    if(i < 1024) {
        reduced_sums_d[i] = 0;
    }

    if(i < n_vertices) {
        temp1 = vertices[i].pagerank_next - vertices[i].pagerank;
        if(i + (1024 * gridDim.x) < n_vertices) {
            temp2 = vertices[i+ (1024 * gridDim.x)].pagerank_next - vertices[i +(1024*gridDim.x)].pagerank;
        }else{
            temp2 = 0;
        }

        if(temp1 < 0) {
            temp1 = temp1 * (-1);
        }
        if(temp2 < 0) {
            temp2 = temp2 * (-1);
        }

        sums[i_thr] = temp1 + temp2;
    } else {
        sums[i_thr] = 0;
    }
    __syncthreads();

    int j, index, index2;
    index = i_thr;

    for(j = 0; j < 10; j++) {                    // 10 times as 2^10 = 1024 threads
        if((index+1) % (2 * (1 << j)) == 0) {    // Note: 1 << j == 2^j
            index2 = index - (1 << j);
            sums[index] += sums[index2];
        }
        __syncthreads();
    }

    reduced_sums_d[blockIdx.x] = sums[1023];
}

__global__ void getConvergence(float * reduced_sums_d, float * diff) {
    int j, index, index2;
    index = threadIdx.x;

    for(j = 0; j < 10; j++) {                    // 10 times as 2^10 = 1024 threads
        if((index+1) % (2 * (1 << j)) == 0) {    // Note: 1 << j == 2^j
            index2 = index - (1 << j);
            reduced_sums_d[index] += reduced_sums_d[index2];
        }
        __syncthreads();
    }

    *diff = reduced_sums_d[1023];
}


int main(int argc, char ** args) {
    if (argc != 2) {
	fprintf(stderr,"Wrong number of args. Provide input graph file.\n");
        exit(-1);
    }

    // size_t mem_total = 0;
    // size_t mem_free = 0;

    cudaFree(0); // Initialize the cuda context
    // Error code to check return values for CUDA calls
    cudaError_t err = cudaSuccess;

    //cudaMemGetInfo(&mem_free, &mem_total);
    // printf("1. mem_total: %zu, mem_free: %zu\n",mem_total, mem_free);

/*************************************************************************/
    // Start CPU timer
    clock_t cycles_to_build, cycles_to_calc;


/*************************************************************************/
    // build up the graph
    int i;
    unsigned int n_vertices = 0;
    unsigned int vertex_from = 0, vertex_to = 0;

    vertex * vertices;

    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
    // expected format: vertex_from vertex_to
    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_vertices++;
    clock_t start = clock();
    // allocate memory for vertices
    err = cudaMallocManaged((void **)&vertices, n_vertices*sizeof(vertex));

    if (!vertices) {
        fprintf(stderr,"Malloc failed for vertices.\n");
        exit(-1);
    }
    memset((void *)vertices, 0, (size_t)(n_vertices*sizeof(vertex)));

    // parse input file to count the number of successors of each vertex
    fseek(fp, 0L, SEEK_SET);
    while (fscanf(fp, "%u %u", &vertex_from, &vertex_to) != EOF) {
        vertices[vertex_from].n_successors++;
    }
    printf("sizeof(vertex*): %d\n", sizeof(vertex*));
    printf("sizeof(vertex): %d\n", sizeof(vertex));

    //cudaMemGetInfo(&mem_free, &mem_total);
    // printf("mem_total: %zu, mem_free: %zu\n",mem_total, mem_free);
    // allocate memory for successor pointers
    for (i=0; i<n_vertices; i++) {
        vertices[i].vertex_id = i;
        if (vertices[i].n_successors > 0) {
            err = cudaMallocManaged((void***)&vertices[i].successors,vertices[i].n_successors*sizeof(vertex*));
	    //cudaMemGetInfo(&mem_free, &mem_total);
	    cudaDeviceSynchronize();
    	    //printf("i:%d, mem_total: %zu, mem_free: %zu\n",i, mem_total, mem_free);
            if (!vertices[i].successors) {
                fprintf(stderr,"cudaMallocManaged failed for vertex %d successors (error: %s)\n",i,cudaGetErrorString(err));
		//cudaMemGetInfo(&mem_free, &mem_total);
	    	cudaDeviceSynchronize();
    	    	// printf("i:%d, mem_total: %zu, mem_free: %zu\n",i, mem_total, mem_free);
                exit(-1);
            }
            memset((void *)vertices[i].successors, 0, (size_t)(vertices[i].n_successors*sizeof(vertex *)));
        }
        else
            vertices[i].successors = NULL;
    }

    // parse input file to set up the successor pointers
    fseek(fp, 0L, SEEK_SET);
    while (fscanf(fp, "%d %d", &vertex_from, &vertex_to) != EOF) {
        for (i=0; i<vertices[vertex_from].n_successors; i++) {
            if (vertices[vertex_from].successors[i] == NULL) {
                vertices[vertex_from].successors[i] = &vertices[vertex_to];
                break;
            }
            else if (i==vertices[vertex_from].n_successors-1) {
                printf("Setting up the successor pointers of virtex %u failed",vertex_from);
                return -1;
            }
        }
    }

    fclose(fp);

    // Get time for building data structure
    cycles_to_build = clock() - start;
    int build_msec = cycles_to_build * 1000 / CLOCKS_PER_SEC;

    //Reset time
    start = clock();


  /*************************************************************************/
    // compute the pagerank on the GPU
    int n_iterations = 30;
    int numOfBlocks = 1;         // default value for 1000 vertex graph
    int threadsPerBlock = 1000;  // default value for 1000 vertex graph
    int converge_blocks = (n_vertices + 2048 - 1)/2048;
    if(converge_blocks == 0) {
        converge_blocks =1;
    }


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


    float dangling_value_h = 0;
    float * dangling_value_d;
    float * reduced_sums_d;
    float epsilon = 0.000001;
    float * d_diff;
    float h_diff = epsilon + 1;

    err = cudaMalloc((void **)&d_diff, sizeof(float));
    err = cudaMalloc((void **)&reduced_sums_d, 1024 * sizeof(float));

    err = cudaMalloc((void **)&dangling_value_d, sizeof(float));
    err = cudaMemcpy(dangling_value_d, &dangling_value_h, sizeof(float), cudaMemcpyHostToDevice);

    // Initialize pagerank and pagerank_next values
    initializePageranks<<<numOfBlocks,threadsPerBlock>>>(vertices, n_vertices);
    cudaDeviceSynchronize();

    int iteration = 0;
    while(epsilon < h_diff  && iteration < n_iterations) {
        // set the dangling value to 0
        dangling_value_h = 0;
        err = cudaMemcpy(dangling_value_d, &dangling_value_h, sizeof(float), cudaMemcpyHostToDevice);

        // initial parallel pagerank_next computation
        addToNextPagerank<<<numOfBlocks,threadsPerBlock>>>(vertices, dangling_value_d, n_vertices);

        // get the dangling value
        err = cudaMemcpy(&dangling_value_h, dangling_value_d, sizeof(float), cudaMemcpyDeviceToHost);

        // final parallel pagerank_next computation
        finalPagerankForIteration<<<numOfBlocks,threadsPerBlock>>>(vertices, n_vertices, dangling_value_h);

        convergence<<<converge_blocks, 1024>>>(vertices, reduced_sums_d, n_vertices);
        getConvergence<<<1,1024>>>(reduced_sums_d, d_diff);

        // Get difference to compare to epsilon
        cudaMemcpy(&h_diff, d_diff, sizeof(float), cudaMemcpyDeviceToHost);

        // Set pagerank = pagerank_next; And then pagerank_next = 0;
        setPageranksFromNext<<<numOfBlocks,threadsPerBlock>>>(vertices, n_vertices);

        iteration++;
    }
    cudaDeviceSynchronize();

    // End CPU Timer
    cycles_to_calc = clock() - start;

    // Print CPU time
    int calc_msec = cycles_to_calc * 1000 / CLOCKS_PER_SEC;

    // print the pagerank values computed on the GPU
    for (i=0;i<n_vertices;i++) {
        //printf("AFTER GPU | Vertex %u:\tpagerank = %.6f\n", i, vertices[i].pagerank);
    }

    printf("Time to build: %d seconds, %d milliseconds\n", build_msec/1000, build_msec%1000);
    printf("Time to calc: %d seconds, %d milliseconds\n", calc_msec/1000, calc_msec%1000);
    printf("Iteration: %d\n", iteration);

/*****************************************************************************************/

    // Free device global memory
    // err = cudaFree(d_A);

    // Free host memory
    // free(h_A);

    // Reset the device and exit
    // cudaDeviceReset causes the driver to clean up all state. While
    // not mandatory in normal operation, it is good practice.  It is also
    // needed to ensure correct operation when the application is being
    // profiled. Calling cudaDeviceReset causes all profile data to be
    // flushed before the application exits
    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_002655d3_00000000-6_pagerank_GPU_benchmark.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__Z19initializePageranksP6vertexiP6vertexi
	.type	_Z46__device_stub__Z19initializePageranksP6vertexiP6vertexi, @function
_Z46__device_stub__Z19initializePageranksP6vertexiP6vertexi:
.LFB2052:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z19initializePageranksP6vertexi(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L2:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z46__device_stub__Z19initializePageranksP6vertexiP6vertexi, .-_Z46__device_stub__Z19initializePageranksP6vertexiP6vertexi
	.globl	_Z19initializePageranksP6vertexi
	.type	_Z19initializePageranksP6vertexi, @function
_Z19initializePageranksP6vertexi:
.LFB2053:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z19initializePageranksP6vertexiP6vertexi
	.cfi_endproc
.LFE2053:
	.size	_Z19initializePageranksP6vertexi, .-_Z19initializePageranksP6vertexi
	.globl	_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi
	.type	_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi, @function
_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi:
.LFB2054:
	.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	.L8
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z17addToNextPagerankP6vertexPfi(%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
.L8:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi, .-_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi
	.globl	_Z17addToNextPagerankP6vertexPfi
	.type	_Z17addToNextPagerankP6vertexPfi, @function
_Z17addToNextPagerankP6vertexPfi:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi
	.cfi_endproc
.LFE2055:
	.size	_Z17addToNextPagerankP6vertexPfi, .-_Z17addToNextPagerankP6vertexPfi
	.globl	_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif
	.type	_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif, @function
_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif:
.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	_Z25finalPagerankForIterationP6vertexif(%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	_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif, .-_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif
	.globl	_Z25finalPagerankForIterationP6vertexif
	.type	_Z25finalPagerankForIterationP6vertexif, @function
_Z25finalPagerankForIterationP6vertexif:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif
	.cfi_endproc
.LFE2057:
	.size	_Z25finalPagerankForIterationP6vertexif, .-_Z25finalPagerankForIterationP6vertexif
	.globl	_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi
	.type	_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi, @function
_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z20setPageranksFromNextP6vertexi(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L18:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi, .-_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi
	.globl	_Z20setPageranksFromNextP6vertexi
	.type	_Z20setPageranksFromNextP6vertexi, @function
_Z20setPageranksFromNextP6vertexi:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi
	.cfi_endproc
.LFE2059:
	.size	_Z20setPageranksFromNextP6vertexi, .-_Z20setPageranksFromNextP6vertexi
	.globl	_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi
	.type	_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi, @function
_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi:
.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	_Z11convergenceP6vertexPfi(%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	_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi, .-_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi
	.globl	_Z11convergenceP6vertexPfi
	.type	_Z11convergenceP6vertexPfi, @function
_Z11convergenceP6vertexPfi:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi
	.cfi_endproc
.LFE2061:
	.size	_Z11convergenceP6vertexPfi, .-_Z11convergenceP6vertexPfi
	.globl	_Z36__device_stub__Z14getConvergencePfS_PfS_
	.type	_Z36__device_stub__Z14getConvergencePfS_PfS_, @function
_Z36__device_stub__Z14getConvergencePfS_PfS_:
.LFB2062:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L28
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z14getConvergencePfS_(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L28:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z36__device_stub__Z14getConvergencePfS_PfS_, .-_Z36__device_stub__Z14getConvergencePfS_PfS_
	.globl	_Z14getConvergencePfS_
	.type	_Z14getConvergencePfS_, @function
_Z14getConvergencePfS_:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z36__device_stub__Z14getConvergencePfS_PfS_
	.cfi_endproc
.LFE2063:
	.size	_Z14getConvergencePfS_, .-_Z14getConvergencePfS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Wrong number of args. Provide input graph file.\n"
.LC1:
	.string	"r"
.LC2:
	.string	"ERROR: Could not open input file.\n"
.LC3:
	.string	"%u %u"
.LC4:
	.string	"Malloc failed for vertices.\n"
.LC5:
	.string	"sizeof(vertex*): %d\n"
.LC6:
	.string	"sizeof(vertex): %d\n"
.LC7:
	.string	"cudaMallocManaged failed for vertex %d successors (error: %s)\n"
.LC8:
	.string	"Setting up the successor pointers of virtex %u failed"
.LC9:
	.string	"%d %d"
.LC13:
	.string	"Time to build: %d seconds, %d milliseconds\n"
.LC14:
	.string	"Time to calc: %d seconds, %d milliseconds\n"
.LC15:
	.string	"Iteration: %d\n"
.LC16:
	.string	"Failed to deinitialize the device! error=%s\n"
.LC17:
	.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	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	cmpl	$2, %edi
	je	.L34
	movq	stderr(%rip), %rdi
	leaq	.LC0(%rip), %rdx
	movl	$2, %esi
	jmp	.L76
.L34:
	movq	%rsi, %rbx
	xorl	%edi, %edi
	leaq	.LC3(%rip), %r13
	call	cudaFree@PLT
	movq	8(%rbx), %rdi
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rsi
	movl	%edx, 48(%rsp)
	movl	%edx, 52(%rsp)
	call	fopen@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	jne	.L35
	leaq	.LC2(%rip), %rdx
.L77:
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
.L76:
	call	__fprintf_chk@PLT
.L79:
	orl	$-1, %edi
.L78:
	call	exit@PLT
.L37:
	movl	48(%rsp), %eax
	cmpl	%eax, %ebx
	jb	.L36
	movl	52(%rsp), %eax
	cmpl	%eax, %ebx
	cmovnb	%ebx, %eax
.L36:
	movl	%eax, %ebx
.L35:
	leaq	52(%rsp), %rax
	movq	%r13, %rsi
	movq	%rbp, %rdi
	movq	%rax, 16(%rsp)
	leaq	48(%rsp), %rax
	movq	16(%rsp), %rcx
	movq	%rax, 24(%rsp)
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	incl	%eax
	jne	.L37
	leal	1(%rbx), %eax
	movl	%eax, 12(%rsp)
	call	clock@PLT
	movl	12(%rsp), %r12d
	movl	$1, %edx
	leaq	64(%rsp), %rdi
	movq	%rax, %r15
	imulq	$24, %r12, %r12
	movq	%r12, %rsi
	call	cudaMallocManaged@PLT
	movq	64(%rsp), %rdx
	testq	%rdx, %rdx
	jne	.L38
	leaq	.LC4(%rip), %rdx
	jmp	.L77
.L38:
	movq	%rdx, %rdi
	xorl	%eax, %eax
	movq	%r12, %rcx
	xorl	%edx, %edx
	rep stosb
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	fseek@PLT
.L39:
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	%eax, %r12d
	cmpl	$-1, %eax
	je	.L80
	movl	48(%rsp), %eax
	imulq	$24, %rax, %rax
	addq	64(%rsp), %rax
	incl	12(%rax)
	jmp	.L39
.L80:
	movl	$8, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	leaq	.LC5(%rip), %rsi
	xorl	%r14d, %r14d
	call	__printf_chk@PLT
	movl	$24, %edx
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
.L41:
	movl	12(%rsp), %eax
	movl	%r13d, 32(%rsp)
	cmpl	%eax, %r13d
	jnb	.L81
	imulq	$24, %r13, %rcx
	movq	64(%rsp), %rdi
	addq	%rcx, %rdi
	movl	12(%rdi), %esi
	movl	%r13d, (%rdi)
	testl	%esi, %esi
	je	.L42
	addq	$16, %rdi
	salq	$3, %rsi
	movl	$1, %edx
	movq	%rcx, 40(%rsp)
	call	cudaMallocManaged@PLT
	movl	%eax, 36(%rsp)
	call	cudaDeviceSynchronize@PLT
	movq	40(%rsp), %rcx
	addq	64(%rsp), %rcx
	movq	16(%rcx), %rdx
	movl	36(%rsp), %edi
	testq	%rdx, %rdx
	jne	.L43
	call	cudaGetErrorString@PLT
	movl	32(%rsp), %ecx
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	movq	%rax, %r8
	leaq	.LC7(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	cudaDeviceSynchronize@PLT
	jmp	.L79
.L43:
	movl	12(%rcx), %ecx
	movq	%rdx, %rdi
	movl	%r14d, %eax
	salq	$3, %rcx
	rep stosb
	jmp	.L44
.L42:
	xorl	%eax, %eax
	movq	%rax, 16(%rdi)
.L44:
	incq	%r13
	jmp	.L41
.L81:
	xorl	%edx, %edx
	xorl	%esi, %esi
	leaq	.LC9(%rip), %r13
	movq	%rbp, %rdi
	call	fseek@PLT
.L51:
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%rbp, %rdi
	call	__isoc23_fscanf@PLT
	incl	%eax
	je	.L52
	movl	48(%rsp), %eax
	movq	64(%rsp), %rsi
	xorl	%edx, %edx
	movq	%rax, %rdi
	imulq	$24, %rax, %rax
	addq	%rsi, %rax
	movl	12(%rax), %ecx
	leal	-1(%rcx), %r9d
.L53:
	movl	%edx, %r10d
	cmpl	%ecx, %edx
	jnb	.L51
	movq	16(%rax), %r8
	leaq	(%r8,%rdx,8), %r8
	cmpq	$0, (%r8)
	jne	.L47
	movl	52(%rsp), %eax
	imulq	$24, %rax, %rax
	addq	%rsi, %rax
	movq	%rax, (%r8)
	jmp	.L51
.L47:
	cmpl	%r10d, %r9d
	jne	.L48
	movl	%edi, %edx
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L33
.L48:
	incq	%rdx
	jmp	.L53
.L52:
	movq	%rbp, %rdi
	leal	2048(%rbx), %r12d
	call	fclose@PLT
	call	clock@PLT
	movl	$1000, %ecx
	subq	%r15, %rax
	cqto
	idivq	%rcx
	movq	%rax, 24(%rsp)
	call	clock@PLT
	shrl	$11, %r12d
	movq	%rax, %r15
	je	.L54
	cmpl	$1024, 12(%rsp)
	ja	.L55
.L54:
	movl	12(%rsp), %r13d
	movl	$1, %r12d
	movl	$1, %ebx
	jmp	.L56
.L55:
	addl	$1024, %ebx
	movl	$1024, %r13d
	shrl	$10, %ebx
.L56:
	leaq	88(%rsp), %rdi
	movl	$4, %esi
	movl	$0x00000000, 56(%rsp)
	movl	$0x3f800008, 60(%rsp)
	call	cudaMalloc@PLT
	leaq	80(%rsp), %rdi
	movl	$4096, %esi
	call	cudaMalloc@PLT
	leaq	72(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rax
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	movq	%rax, %rsi
	movq	%rax, 16(%rsp)
	call	cudaMemcpy@PLT
	movl	%r13d, 108(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rax
	movl	%ebx, 96(%rsp)
	movq	%rax, 112(%rsp)
	movl	116(%rsp), %ecx
	movq	%rax, 100(%rsp)
	movq	108(%rsp), %rdx
	movq	96(%rsp), %rdi
	movl	104(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L57
	movl	12(%rsp), %esi
	movq	64(%rsp), %rdi
	call	_Z46__device_stub__Z19initializePageranksP6vertexiP6vertexi
.L57:
	call	cudaDeviceSynchronize@PLT
	xorl	%r14d, %r14d
	movabsq	$4294967297, %rbp
.L58:
	movss	60(%rsp), %xmm0
	comiss	.LC12(%rip), %xmm0
	jbe	.L64
	cmpl	$30, %r14d
	je	.L64
	movq	16(%rsp), %rsi
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	movl	$0x00000000, 56(%rsp)
	call	cudaMemcpy@PLT
	movq	%rbp, 112(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbp, 100(%rsp)
	movl	116(%rsp), %ecx
	movl	%r13d, 108(%rsp)
	movl	104(%rsp), %esi
	movl	%ebx, 96(%rsp)
	movq	108(%rsp), %rdx
	movq	96(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L59
	movl	12(%rsp), %edx
	movq	72(%rsp), %rsi
	movq	64(%rsp), %rdi
	call	_Z46__device_stub__Z17addToNextPagerankP6vertexPfiP6vertexPfi
.L59:
	movq	72(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	%rbp, 112(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbp, 100(%rsp)
	movl	116(%rsp), %ecx
	movl	%r13d, 108(%rsp)
	movl	104(%rsp), %esi
	movl	%ebx, 96(%rsp)
	movq	108(%rsp), %rdx
	movq	96(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movss	56(%rsp), %xmm0
	movl	12(%rsp), %esi
	movq	64(%rsp), %rdi
	call	_Z53__device_stub__Z25finalPagerankForIterationP6vertexifP6vertexif
.L60:
	movq	%rbp, 100(%rsp)
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%r12d, 96(%rsp)
	movl	104(%rsp), %esi
	salq	$10, %rdx
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	movq	%rdx, 108(%rsp)
	movl	$1, 116(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L61
	movl	12(%rsp), %edx
	movq	80(%rsp), %rsi
	movq	64(%rsp), %rdi
	call	_Z40__device_stub__Z11convergenceP6vertexPfiP6vertexPfi
.L61:
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movq	%rbp, %rdi
	movl	$1, %esi
	movl	$1, 116(%rsp)
	movq	%rdx, 108(%rsp)
	movq	%rbp, 96(%rsp)
	movl	$1, 104(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L62
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z36__device_stub__Z14getConvergencePfS_PfS_
.L62:
	movq	88(%rsp), %rsi
	leaq	60(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	%rbp, 112(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbp, 100(%rsp)
	movl	116(%rsp), %ecx
	movl	%r13d, 108(%rsp)
	movl	104(%rsp), %esi
	movl	%ebx, 96(%rsp)
	movq	108(%rsp), %rdx
	movq	96(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L63
	movl	12(%rsp), %esi
	movq	64(%rsp), %rdi
	call	_Z47__device_stub__Z20setPageranksFromNextP6vertexiP6vertexi
.L63:
	incl	%r14d
	jmp	.L58
.L64:
	call	cudaDeviceSynchronize@PLT
	movl	$1000, %ebp
	call	clock@PLT
	movl	$1000, %ecx
	movl	$2, %edi
	leaq	.LC13(%rip), %rsi
	subq	%r15, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rbx
	movl	24(%rsp), %eax
	cltd
	idivl	%ebp
	movl	%edx, %ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebx, %eax
	movl	$2, %edi
	leaq	.LC14(%rip), %rsi
	cltd
	idivl	%ebp
	movl	%edx, %ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$2, %edi
	movl	%r14d, %edx
	xorl	%eax, %eax
	leaq	.LC15(%rip), %rsi
	call	__printf_chk@PLT
	call	cudaDeviceReset@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L67
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC16(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	jmp	.L78
.L67:
	leaq	.LC17(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	call	__printf_chk@PLT
.L33:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.LC18:
	.string	"_Z14getConvergencePfS_"
.LC19:
	.string	"_Z11convergenceP6vertexPfi"
.LC20:
	.string	"_Z20setPageranksFromNextP6vertexi"
.LC21:
	.string	"_Z25finalPagerankForIterationP6vertexif"
.LC22:
	.string	"_Z17addToNextPagerankP6vertexPfi"
.LC23:
	.string	"_Z19initializePageranksP6vertexi"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2065:
	.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	.LC18(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z14getConvergencePfS_(%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	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11convergenceP6vertexPfi(%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	.LC20(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z20setPageranksFromNextP6vertexi(%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	.LC21(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z25finalPagerankForIterationP6vertexif(%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	.LC22(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17addToNextPagerankP6vertexPfi(%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	.LC23(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z19initializePageranksP6vertexi(%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
.LFE2065:
	.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
.LC12:
	.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>

// For the CUDA runtime routines (prefixed with "cuda_")
#include <hip/hip_runtime.h>


typedef struct vertex vertex;

struct vertex {
    unsigned int vertex_id;
    float pagerank;
    float pagerank_next;
    unsigned int n_successors;
    vertex ** successors;
};


__global__ void initializePageranks(vertex * vertices, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (i < n_vertices) {
        vertices[i].pagerank = 1.0/(float)n_vertices;
        vertices[i].pagerank_next = 0.0;
    }
}


__global__ void addToNextPagerank(vertex * vertices, float * dangling_value, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    int j;

    if(i < n_vertices) {
        if(vertices[i].n_successors > 0) {
            for(j = 0; j < vertices[i].n_successors; j++) {
                atomicAdd(&(vertices[i].successors[j]->pagerank_next), 0.85*(vertices[i].pagerank)/vertices[i].n_successors);
            }
        }else {
            atomicAdd(dangling_value, 0.85*vertices[i].pagerank);
        }
    }
}

__global__ void finalPagerankForIteration(vertex * vertices, int n_vertices, float dangling_value){
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (i < n_vertices) {
        vertices[i].pagerank_next += (dangling_value + (1-0.85))/((float)n_vertices);
    }
}

__global__ void setPageranksFromNext(vertex * vertices, int n_vertices) {
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (i < n_vertices) {
        vertices[i].pagerank = vertices[i].pagerank_next;
        vertices[i].pagerank_next = 0.0;
    }
}

__global__ void convergence(vertex * vertices, float * reduced_sums_d, int n_vertices) {
// Each thread computes the diff for two vertexes (thus, half # of blocks needed for this function)
// Because of this, we need to handle the case where only one block is needed
    int i = (blockIdx.x * blockDim.x) + threadIdx.x;
    int i_thr = threadIdx.x;

    __shared__ float sums[1024];                       // blockDim.x == 1024

    float temp1, temp2;

    if(i < 1024) {
        reduced_sums_d[i] = 0;
    }

    if(i < n_vertices) {
        temp1 = vertices[i].pagerank_next - vertices[i].pagerank;
        if(i + (1024 * gridDim.x) < n_vertices) {
            temp2 = vertices[i+ (1024 * gridDim.x)].pagerank_next - vertices[i +(1024*gridDim.x)].pagerank;
        }else{
            temp2 = 0;
        }

        if(temp1 < 0) {
            temp1 = temp1 * (-1);
        }
        if(temp2 < 0) {
            temp2 = temp2 * (-1);
        }

        sums[i_thr] = temp1 + temp2;
    } else {
        sums[i_thr] = 0;
    }
    __syncthreads();

    int j, index, index2;
    index = i_thr;

    for(j = 0; j < 10; j++) {                    // 10 times as 2^10 = 1024 threads
        if((index+1) % (2 * (1 << j)) == 0) {    // Note: 1 << j == 2^j
            index2 = index - (1 << j);
            sums[index] += sums[index2];
        }
        __syncthreads();
    }

    reduced_sums_d[blockIdx.x] = sums[1023];
}

__global__ void getConvergence(float * reduced_sums_d, float * diff) {
    int j, index, index2;
    index = threadIdx.x;

    for(j = 0; j < 10; j++) {                    // 10 times as 2^10 = 1024 threads
        if((index+1) % (2 * (1 << j)) == 0) {    // Note: 1 << j == 2^j
            index2 = index - (1 << j);
            reduced_sums_d[index] += reduced_sums_d[index2];
        }
        __syncthreads();
    }

    *diff = reduced_sums_d[1023];
}


int main(int argc, char ** args) {
    if (argc != 2) {
	fprintf(stderr,"Wrong number of args. Provide input graph file.\n");
        exit(-1);
    }

    // size_t mem_total = 0;
    // size_t mem_free = 0;

    hipFree(0); // Initialize the cuda context
    // Error code to check return values for CUDA calls
    hipError_t err = hipSuccess;

    //cudaMemGetInfo(&mem_free, &mem_total);
    // printf("1. mem_total: %zu, mem_free: %zu\n",mem_total, mem_free);

/*************************************************************************/
    // Start CPU timer
    clock_t cycles_to_build, cycles_to_calc;


/*************************************************************************/
    // build up the graph
    int i;
    unsigned int n_vertices = 0;
    unsigned int vertex_from = 0, vertex_to = 0;

    vertex * vertices;

    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
    // expected format: vertex_from vertex_to
    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_vertices++;
    clock_t start = clock();
    // allocate memory for vertices
    err = hipMallocManaged((void **)&vertices, n_vertices*sizeof(vertex));

    if (!vertices) {
        fprintf(stderr,"Malloc failed for vertices.\n");
        exit(-1);
    }
    memset((void *)vertices, 0, (size_t)(n_vertices*sizeof(vertex)));

    // parse input file to count the number of successors of each vertex
    fseek(fp, 0L, SEEK_SET);
    while (fscanf(fp, "%u %u", &vertex_from, &vertex_to) != EOF) {
        vertices[vertex_from].n_successors++;
    }
    printf("sizeof(vertex*): %d\n", sizeof(vertex*));
    printf("sizeof(vertex): %d\n", sizeof(vertex));

    //cudaMemGetInfo(&mem_free, &mem_total);
    // printf("mem_total: %zu, mem_free: %zu\n",mem_total, mem_free);
    // allocate memory for successor pointers
    for (i=0; i<n_vertices; i++) {
        vertices[i].vertex_id = i;
        if (vertices[i].n_successors > 0) {
            err = hipMallocManaged((void***)&vertices[i].successors,vertices[i].n_successors*sizeof(vertex*));
	    //cudaMemGetInfo(&mem_free, &mem_total);
	    hipDeviceSynchronize();
    	    //printf("i:%d, mem_total: %zu, mem_free: %zu\n",i, mem_total, mem_free);
            if (!vertices[i].successors) {
                fprintf(stderr,"hipMallocManaged failed for vertex %d successors (error: %s)\n",i,hipGetErrorString(err));
		//cudaMemGetInfo(&mem_free, &mem_total);
	    	hipDeviceSynchronize();
    	    	// printf("i:%d, mem_total: %zu, mem_free: %zu\n",i, mem_total, mem_free);
                exit(-1);
            }
            memset((void *)vertices[i].successors, 0, (size_t)(vertices[i].n_successors*sizeof(vertex *)));
        }
        else
            vertices[i].successors = NULL;
    }

    // parse input file to set up the successor pointers
    fseek(fp, 0L, SEEK_SET);
    while (fscanf(fp, "%d %d", &vertex_from, &vertex_to) != EOF) {
        for (i=0; i<vertices[vertex_from].n_successors; i++) {
            if (vertices[vertex_from].successors[i] == NULL) {
                vertices[vertex_from].successors[i] = &vertices[vertex_to];
                break;
            }
            else if (i==vertices[vertex_from].n_successors-1) {
                printf("Setting up the successor pointers of virtex %u failed",vertex_from);
                return -1;
            }
        }
    }

    fclose(fp);

    // Get time for building data structure
    cycles_to_build = clock() - start;
    int build_msec = cycles_to_build * 1000 / CLOCKS_PER_SEC;

    //Reset time
    start = clock();


  /*************************************************************************/
    // compute the pagerank on the GPU
    int n_iterations = 30;
    int numOfBlocks = 1;         // default value for 1000 vertex graph
    int threadsPerBlock = 1000;  // default value for 1000 vertex graph
    int converge_blocks = (n_vertices + 2048 - 1)/2048;
    if(converge_blocks == 0) {
        converge_blocks =1;
    }


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


    float dangling_value_h = 0;
    float * dangling_value_d;
    float * reduced_sums_d;
    float epsilon = 0.000001;
    float * d_diff;
    float h_diff = epsilon + 1;

    err = hipMalloc((void **)&d_diff, sizeof(float));
    err = hipMalloc((void **)&reduced_sums_d, 1024 * sizeof(float));

    err = hipMalloc((void **)&dangling_value_d, sizeof(float));
    err = hipMemcpy(dangling_value_d, &dangling_value_h, sizeof(float), hipMemcpyHostToDevice);

    // Initialize pagerank and pagerank_next values
    initializePageranks<<<numOfBlocks,threadsPerBlock>>>(vertices, n_vertices);
    hipDeviceSynchronize();

    int iteration = 0;
    while(epsilon < h_diff  && iteration < n_iterations) {
        // set the dangling value to 0
        dangling_value_h = 0;
        err = hipMemcpy(dangling_value_d, &dangling_value_h, sizeof(float), hipMemcpyHostToDevice);

        // initial parallel pagerank_next computation
        addToNextPagerank<<<numOfBlocks,threadsPerBlock>>>(vertices, dangling_value_d, n_vertices);

        // get the dangling value
        err = hipMemcpy(&dangling_value_h, dangling_value_d, sizeof(float), hipMemcpyDeviceToHost);

        // final parallel pagerank_next computation
        finalPagerankForIteration<<<numOfBlocks,threadsPerBlock>>>(vertices, n_vertices, dangling_value_h);

        convergence<<<converge_blocks, 1024>>>(vertices, reduced_sums_d, n_vertices);
        getConvergence<<<1,1024>>>(reduced_sums_d, d_diff);

        // Get difference to compare to epsilon
        hipMemcpy(&h_diff, d_diff, sizeof(float), hipMemcpyDeviceToHost);

        // Set pagerank = pagerank_next; And then pagerank_next = 0;
        setPageranksFromNext<<<numOfBlocks,threadsPerBlock>>>(vertices, n_vertices);

        iteration++;
    }
    hipDeviceSynchronize();

    // End CPU Timer
    cycles_to_calc = clock() - start;

    // Print CPU time
    int calc_msec = cycles_to_calc * 1000 / CLOCKS_PER_SEC;

    // print the pagerank values computed on the GPU
    for (i=0;i<n_vertices;i++) {
        //printf("AFTER GPU | Vertex %u:\tpagerank = %.6f\n", i, vertices[i].pagerank);
    }

    printf("Time to build: %d seconds, %d milliseconds\n", build_msec/1000, build_msec%1000);
    printf("Time to calc: %d seconds, %d milliseconds\n", calc_msec/1000, calc_msec%1000);
    printf("Iteration: %d\n", iteration);

/*****************************************************************************************/

    // Free device global memory
    // err = cudaFree(d_A);

    // Free host memory
    // free(h_A);

    // Reset the device and exit
    // cudaDeviceReset causes the driver to clean up all state. While
    // not mandatory in normal operation, it is good practice.  It is also
    // needed to ensure correct operation when the application is being
    // profiled. Calling cudaDeviceReset causes all profile data to be
    // flushed before the application exits
    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_GPU_benchmark.hip"
	.globl	_Z34__device_stub__initializePageranksP6vertexi # -- Begin function _Z34__device_stub__initializePageranksP6vertexi
	.type	_Z34__device_stub__initializePageranksP6vertexi,@function
_Z34__device_stub__initializePageranksP6vertexi: # @_Z34__device_stub__initializePageranksP6vertexi
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.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)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%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	$_Z19initializePageranksP6vertexi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z34__device_stub__initializePageranksP6vertexi, .Lfunc_end0-_Z34__device_stub__initializePageranksP6vertexi
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__addToNextPagerankP6vertexPfi # -- Begin function _Z32__device_stub__addToNextPagerankP6vertexPfi
	.type	_Z32__device_stub__addToNextPagerankP6vertexPfi,@function
_Z32__device_stub__addToNextPagerankP6vertexPfi: # @_Z32__device_stub__addToNextPagerankP6vertexPfi
	.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	$_Z17addToNextPagerankP6vertexPfi, %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_end1:
	.size	_Z32__device_stub__addToNextPagerankP6vertexPfi, .Lfunc_end1-_Z32__device_stub__addToNextPagerankP6vertexPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z40__device_stub__finalPagerankForIterationP6vertexif # -- Begin function _Z40__device_stub__finalPagerankForIterationP6vertexif
	.type	_Z40__device_stub__finalPagerankForIterationP6vertexif,@function
_Z40__device_stub__finalPagerankForIterationP6vertexif: # @_Z40__device_stub__finalPagerankForIterationP6vertexif
	.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	$_Z25finalPagerankForIterationP6vertexif, %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	_Z40__device_stub__finalPagerankForIterationP6vertexif, .Lfunc_end2-_Z40__device_stub__finalPagerankForIterationP6vertexif
	.cfi_endproc
                                        # -- End function
	.globl	_Z35__device_stub__setPageranksFromNextP6vertexi # -- Begin function _Z35__device_stub__setPageranksFromNextP6vertexi
	.type	_Z35__device_stub__setPageranksFromNextP6vertexi,@function
_Z35__device_stub__setPageranksFromNextP6vertexi: # @_Z35__device_stub__setPageranksFromNextP6vertexi
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.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)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%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	$_Z20setPageranksFromNextP6vertexi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z35__device_stub__setPageranksFromNextP6vertexi, .Lfunc_end3-_Z35__device_stub__setPageranksFromNextP6vertexi
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__convergenceP6vertexPfi # -- Begin function _Z26__device_stub__convergenceP6vertexPfi
	.type	_Z26__device_stub__convergenceP6vertexPfi,@function
_Z26__device_stub__convergenceP6vertexPfi: # @_Z26__device_stub__convergenceP6vertexPfi
	.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	$_Z11convergenceP6vertexPfi, %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__convergenceP6vertexPfi, .Lfunc_end4-_Z26__device_stub__convergenceP6vertexPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__getConvergencePfS_ # -- Begin function _Z29__device_stub__getConvergencePfS_
	.type	_Z29__device_stub__getConvergencePfS_,@function
_Z29__device_stub__getConvergencePfS_:  # @_Z29__device_stub__getConvergencePfS_
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.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	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z14getConvergencePfS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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_end5:
	.size	_Z29__device_stub__getConvergencePfS_, .Lfunc_end5-_Z29__device_stub__getConvergencePfS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI6_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	$88, %rsp
	.cfi_def_cfa_offset 144
	.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	.LBB6_46
# %bb.1:
	movq	%rsi, %r14
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	hipFree
	movl	%ebx, (%rsp)
	movl	%ebx, 4(%rsp)
	movq	8(%r14), %rdi
	movl	$.L.str.1, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB6_47
# %bb.2:                                # %.preheader152
	movq	%rax, %r15
	movq	%rsp, %rdx
	leaq	4(%rsp), %rcx
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	je	.LBB6_5
# %bb.3:                                # %.lr.ph.preheader
	movq	%rsp, %r14
	leaq	4(%rsp), %r12
	xorl	%ecx, %ecx
.LBB6_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rsp), %eax
	movl	4(%rsp), %ebx
	cmpl	%ecx, %ebx
	cmovbel	%ecx, %ebx
	cmpl	%ecx, %eax
	cmoval	%eax, %ebx
	movl	$.L.str.3, %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	%ebx, %ecx
	cmpl	$-1, %eax
	jne	.LBB6_4
.LBB6_5:                                # %._crit_edge
	leal	1(%rbx), %r14d
	callq	clock
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	leaq	(,%r14,8), %rax
	leaq	(%rax,%rax,2), %r12
	leaq	8(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	movq	(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB6_48
# %bb.6:
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	memset@PLT
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	fseek
	movq	%rsp, %rdx
	leaq	4(%rsp), %rcx
	movl	$.L.str.3, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	je	.LBB6_9
# %bb.7:                                # %.lr.ph165.preheader
	movq	%rsp, %r12
	leaq	4(%rsp), %rbp
.LBB6_8:                                # %.lr.ph165
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rax
	movl	(%rsp), %ecx
	leaq	(%rcx,%rcx,2), %rcx
	incl	12(%rax,%rcx,8)
	movl	$.L.str.3, %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	%rbp, %rcx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	jne	.LBB6_8
.LBB6_9:                                # %._crit_edge166
	movl	$.L.str.5, %edi
	movl	$8, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.6, %edi
	movl	$24, %esi
	xorl	%eax, %eax
	callq	printf
	testq	%r14, %r14
	je	.LBB6_16
# %bb.10:                               # %.lr.ph169.preheader
	movl	$16, %r13d
	xorl	%r12d, %r12d
.LBB6_11:                               # %.lr.ph169
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rax
	leaq	(%rax,%r13), %rdi
	movl	%r12d, -16(%rax,%r13)
	movl	-4(%rax,%r13), %esi
	testq	%rsi, %rsi
	je	.LBB6_14
# %bb.12:                               #   in Loop: Header=BB6_11 Depth=1
	shlq	$3, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	movl	%eax, %ebp
	callq	hipDeviceSynchronize
	movq	8(%rsp), %rax
	movq	(%rax,%r13), %rdi
	testq	%rdi, %rdi
	je	.LBB6_45
# %bb.13:                               #   in Loop: Header=BB6_11 Depth=1
	movl	-4(%rax,%r13), %edx
	shlq	$3, %rdx
	xorl	%esi, %esi
	callq	memset@PLT
	jmp	.LBB6_15
.LBB6_14:                               #   in Loop: Header=BB6_11 Depth=1
	movq	$0, (%rdi)
.LBB6_15:                               #   in Loop: Header=BB6_11 Depth=1
	incq	%r12
	addq	$24, %r13
	cmpq	%r12, %r14
	jne	.LBB6_11
.LBB6_16:                               # %._crit_edge170
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	fseek
	movq	%rsp, %rdx
	leaq	4(%rsp), %rcx
	movl	$.L.str.8, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	je	.LBB6_26
# %bb.17:                               # %.preheader.preheader
	movq	%rsp, %r12
	leaq	4(%rsp), %rbp
.LBB6_18:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_21 Depth 2
	movq	8(%rsp), %rax
	movl	(%rsp), %esi
	leaq	(%rsi,%rsi,2), %rcx
	movl	12(%rax,%rcx,8), %edx
	testl	%edx, %edx
	je	.LBB6_25
# %bb.19:                               # %.lr.ph174
                                        #   in Loop: Header=BB6_18 Depth=1
	movq	16(%rax,%rcx,8), %rcx
	cmpq	$0, (%rcx)
	je	.LBB6_23
# %bb.20:                               # %.lr.ph209.preheader
                                        #   in Loop: Header=BB6_18 Depth=1
	decl	%edx
	xorl	%r8d, %r8d
.LBB6_21:                               # %.lr.ph209
                                        #   Parent Loop BB6_18 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpq	%r8, %rdx
	je	.LBB6_43
# %bb.22:                               #   in Loop: Header=BB6_21 Depth=2
	leaq	1(%r8), %rdi
	cmpq	$0, 8(%rcx,%r8,8)
	movq	%rdi, %r8
	jne	.LBB6_21
	jmp	.LBB6_24
.LBB6_23:                               #   in Loop: Header=BB6_18 Depth=1
	xorl	%edi, %edi
.LBB6_24:                               # %._crit_edge210
                                        #   in Loop: Header=BB6_18 Depth=1
	movl	4(%rsp), %edx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx,%rdi,8)
.LBB6_25:                               # %.loopexit
                                        #   in Loop: Header=BB6_18 Depth=1
	movl	$.L.str.8, %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	%rbp, %rcx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	cmpl	$-1, %eax
	jne	.LBB6_18
.LBB6_26:                               # %._crit_edge176
	movq	%r15, %rdi
	callq	fclose
	callq	clock
	subq	24(%rsp), %rax                  # 8-byte Folded Reload
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %r12
	movq	%rdx, %rax
	shrq	$63, %rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	shrq	$7, %r12
	callq	clock
	leal	2048(%rbx), %r15d
	shrl	$11, %r15d
	cmpl	$-2048, %ebx                    # imm = 0xF800
	movl	$1, %ecx
	cmovael	%ecx, %r15d
	movl	$1024, %r13d                    # imm = 0x400
	addl	%r13d, %ebx
	shrl	$10, %ebx
	cmpl	$1025, %r14d                    # imm = 0x401
	cmovbl	%r14d, %r13d
	cmovbl	%ecx, %ebx
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	leaq	20(%rsp), %rax
	movl	$0, (%rax)
	movl	$1065353224, 36(%rsp)           # imm = 0x3F800008
	leaq	48(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	56(%rsp), %rdi
	movl	$4096, %esi                     # imm = 0x1000
	callq	hipMalloc
	leaq	40(%rsp), %rbp
	movl	$4, %esi
	movq	%rbp, %rdi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movl	$4, %edx
	leaq	20(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	btsq	$32, %rbx
	btsq	$32, %r13
	xorl	%ebp, %ebp
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_28
# %bb.27:
	movq	8(%rsp), %rdi
	movl	%r14d, %esi
	callq	_Z34__device_stub__initializePageranksP6vertexi
.LBB6_28:                               # %.lr.ph179
	addl	24(%rsp), %r12d                 # 4-byte Folded Reload
	movq	%r12, 72(%rsp)                  # 8-byte Spill
	callq	hipDeviceSynchronize
	movl	%r15d, %eax
	movabsq	$4294967296, %rcx               # imm = 0x100000000
	orq	%rcx, %rax
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	leaq	1024(%rcx), %r12
	incq	%rcx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
.LBB6_29:                               # =>This Inner Loop Header: Depth=1
	movl	$0, 20(%rsp)
	movq	40(%rsp), %rdi
	movl	$4, %edx
	leaq	20(%rsp), %r15
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_31
# %bb.30:                               #   in Loop: Header=BB6_29 Depth=1
	movq	8(%rsp), %rdi
	movq	40(%rsp), %rsi
	movl	%r14d, %edx
	callq	_Z32__device_stub__addToNextPagerankP6vertexPfi
.LBB6_31:                               #   in Loop: Header=BB6_29 Depth=1
	movq	40(%rsp), %rsi
	movl	$4, %edx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_33
# %bb.32:                               #   in Loop: Header=BB6_29 Depth=1
	movq	8(%rsp), %rdi
	movss	20(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movl	%r14d, %esi
	callq	_Z40__device_stub__finalPagerankForIterationP6vertexif
.LBB6_33:                               #   in Loop: Header=BB6_29 Depth=1
	movq	80(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	movq	24(%rsp), %r15                  # 8-byte Reload
	jne	.LBB6_35
# %bb.34:                               #   in Loop: Header=BB6_29 Depth=1
	movq	8(%rsp), %rdi
	movq	56(%rsp), %rsi
	movl	%r14d, %edx
	callq	_Z26__device_stub__convergenceP6vertexPfi
.LBB6_35:                               #   in Loop: Header=BB6_29 Depth=1
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_37
# %bb.36:                               #   in Loop: Header=BB6_29 Depth=1
	movq	56(%rsp), %rdi
	movq	48(%rsp), %rsi
	callq	_Z29__device_stub__getConvergencePfS_
.LBB6_37:                               #   in Loop: Header=BB6_29 Depth=1
	movq	48(%rsp), %rsi
	movl	$4, %edx
	leaq	36(%rsp), %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_39
# %bb.38:                               #   in Loop: Header=BB6_29 Depth=1
	movq	8(%rsp), %rdi
	movl	%r14d, %esi
	callq	_Z35__device_stub__setPageranksFromNextP6vertexi
.LBB6_39:                               #   in Loop: Header=BB6_29 Depth=1
	leal	1(%rbp), %r15d
	movss	36(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	ucomiss	.LCPI6_0(%rip), %xmm0
	jbe	.LBB6_41
# %bb.40:                               #   in Loop: Header=BB6_29 Depth=1
	cmpl	$29, %ebp
	movl	%r15d, %ebp
	jb	.LBB6_29
.LBB6_41:                               # %._crit_edge180
	callq	hipDeviceSynchronize
	callq	clock
	subq	64(%rsp), %rax                  # 8-byte Folded Reload
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %r14
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %r14
	addq	%rax, %r14
	movslq	72(%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
	xorl	%ebx, %ebx
	movl	$.L.str.10, %edi
                                        # kill: def $esi killed $esi killed $rsi
                                        # kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	printf
	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.11, %edi
                                        # kill: def $esi killed $esi killed $rsi
                                        # kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.12, %edi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	printf
	callq	hipDeviceReset
	testl	%eax, %eax
	jne	.LBB6_51
# %bb.42:
	movl	$.Lstr, %edi
	callq	puts@PLT
	jmp	.LBB6_44
.LBB6_43:
	movl	$.L.str.9, %edi
                                        # kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	printf
	movl	$-1, %ebx
.LBB6_44:
	movl	%ebx, %eax
	addq	$88, %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
.LBB6_45:
	.cfi_def_cfa_offset 144
	movq	stderr(%rip), %rbx
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$.L.str.7, %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	fprintf
	callq	hipDeviceSynchronize
.LBB6_50:
	movl	$-1, %edi
	callq	exit
.LBB6_46:
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$48, %esi
	jmp	.LBB6_49
.LBB6_47:
	movq	stderr(%rip), %rcx
	movl	$.L.str.2, %edi
	movl	$34, %esi
	jmp	.LBB6_49
.LBB6_48:
	movq	stderr(%rip), %rcx
	movl	$.L.str.4, %edi
	movl	$28, %esi
.LBB6_49:
	movl	$1, %edx
	callq	fwrite@PLT
	jmp	.LBB6_50
.LBB6_51:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.13, %esi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end6:
	.size	main, .Lfunc_end6-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	.LBB7_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB7_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19initializePageranksP6vertexi, %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	$_Z17addToNextPagerankP6vertexPfi, %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	$_Z25finalPagerankForIterationP6vertexif, %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	$_Z20setPageranksFromNextP6vertexi, %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	$_Z11convergenceP6vertexPfi, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14getConvergencePfS_, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %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_end7:
	.size	__hip_module_ctor, .Lfunc_end7-__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	.LBB8_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
.LBB8_2:
	retq
.Lfunc_end8:
	.size	__hip_module_dtor, .Lfunc_end8-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z19initializePageranksP6vertexi,@object # @_Z19initializePageranksP6vertexi
	.section	.rodata,"a",@progbits
	.globl	_Z19initializePageranksP6vertexi
	.p2align	3, 0x0
_Z19initializePageranksP6vertexi:
	.quad	_Z34__device_stub__initializePageranksP6vertexi
	.size	_Z19initializePageranksP6vertexi, 8

	.type	_Z17addToNextPagerankP6vertexPfi,@object # @_Z17addToNextPagerankP6vertexPfi
	.globl	_Z17addToNextPagerankP6vertexPfi
	.p2align	3, 0x0
_Z17addToNextPagerankP6vertexPfi:
	.quad	_Z32__device_stub__addToNextPagerankP6vertexPfi
	.size	_Z17addToNextPagerankP6vertexPfi, 8

	.type	_Z25finalPagerankForIterationP6vertexif,@object # @_Z25finalPagerankForIterationP6vertexif
	.globl	_Z25finalPagerankForIterationP6vertexif
	.p2align	3, 0x0
_Z25finalPagerankForIterationP6vertexif:
	.quad	_Z40__device_stub__finalPagerankForIterationP6vertexif
	.size	_Z25finalPagerankForIterationP6vertexif, 8

	.type	_Z20setPageranksFromNextP6vertexi,@object # @_Z20setPageranksFromNextP6vertexi
	.globl	_Z20setPageranksFromNextP6vertexi
	.p2align	3, 0x0
_Z20setPageranksFromNextP6vertexi:
	.quad	_Z35__device_stub__setPageranksFromNextP6vertexi
	.size	_Z20setPageranksFromNextP6vertexi, 8

	.type	_Z11convergenceP6vertexPfi,@object # @_Z11convergenceP6vertexPfi
	.globl	_Z11convergenceP6vertexPfi
	.p2align	3, 0x0
_Z11convergenceP6vertexPfi:
	.quad	_Z26__device_stub__convergenceP6vertexPfi
	.size	_Z11convergenceP6vertexPfi, 8

	.type	_Z14getConvergencePfS_,@object  # @_Z14getConvergencePfS_
	.globl	_Z14getConvergencePfS_
	.p2align	3, 0x0
_Z14getConvergencePfS_:
	.quad	_Z29__device_stub__getConvergencePfS_
	.size	_Z14getConvergencePfS_, 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	"Malloc failed for vertices.\n"
	.size	.L.str.4, 29

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"sizeof(vertex*): %d\n"
	.size	.L.str.5, 21

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"sizeof(vertex): %d\n"
	.size	.L.str.6, 20

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"hipMallocManaged failed for vertex %d successors (error: %s)\n"
	.size	.L.str.7, 62

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"%d %d"
	.size	.L.str.8, 6

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Setting up the successor pointers of virtex %u failed"
	.size	.L.str.9, 54

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

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

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

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

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z17addToNextPagerankP6vertexPfi"
	.size	.L__unnamed_2, 33

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z25finalPagerankForIterationP6vertexif"
	.size	.L__unnamed_3, 40

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z20setPageranksFromNextP6vertexi"
	.size	.L__unnamed_4, 34

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z11convergenceP6vertexPfi"
	.size	.L__unnamed_5, 27

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"_Z14getConvergencePfS_"
	.size	.L__unnamed_6, 23

	.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 _Z34__device_stub__initializePageranksP6vertexi
	.addrsig_sym _Z32__device_stub__addToNextPagerankP6vertexPfi
	.addrsig_sym _Z40__device_stub__finalPagerankForIterationP6vertexif
	.addrsig_sym _Z35__device_stub__setPageranksFromNextP6vertexi
	.addrsig_sym _Z26__device_stub__convergenceP6vertexPfi
	.addrsig_sym _Z29__device_stub__getConvergencePfS_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z19initializePageranksP6vertexi
	.addrsig_sym _Z17addToNextPagerankP6vertexPfi
	.addrsig_sym _Z25finalPagerankForIterationP6vertexif
	.addrsig_sym _Z20setPageranksFromNextP6vertexi
	.addrsig_sym _Z11convergenceP6vertexPfi
	.addrsig_sym _Z14getConvergencePfS_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19initializePageranksP6vertexi ; -- Begin function _Z19initializePageranksP6vertexi
	.globl	_Z19initializePageranksP6vertexi
	.p2align	8
	.type	_Z19initializePageranksP6vertexi,@function
_Z19initializePageranksP6vertexi:       ; @_Z19initializePageranksP6vertexi
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x1c
	s_load_b32 s2, s[0:1], 0x8
	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 v0, s2
	s_load_b64 s[0:1], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v2, null, v0, v0, 1.0
	v_div_scale_f32 v5, vcc_lo, 1.0, v0, 1.0
	v_rcp_f32_e32 v3, v2
	s_waitcnt_depctr 0xfff
	v_fma_f32 v4, -v2, v3, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v4, v3
	v_mul_f32_e32 v4, v5, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v6, -v2, v4, v5
	v_fmac_f32_e32 v4, v6, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v2, -v2, v4, v5
	v_div_fmas_f32 v4, v2, v3, v4
	s_waitcnt lgkmcnt(0)
	v_mad_i64_i32 v[2:3], null, v1, 24, s[0:1]
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_div_fixup_f32 v0, v4, v0, 1.0
	global_store_b64 v[2:3], v[0:1], off offset:4
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19initializePageranksP6vertexi
		.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 7
		.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	_Z19initializePageranksP6vertexi, .Lfunc_end0-_Z19initializePageranksP6vertexi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 204
; NumSgprs: 18
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 7
; 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	_Z17addToNextPagerankP6vertexPfi ; -- Begin function _Z17addToNextPagerankP6vertexPfi
	.globl	_Z17addToNextPagerankP6vertexPfi
	.p2align	8
	.type	_Z17addToNextPagerankP6vertexPfi,@function
_Z17addToNextPagerankP6vertexPfi:       ; @_Z17addToNextPagerankP6vertexPfi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	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 .LBB1_13
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	s_mov_b32 s5, 0
	s_mov_b32 s4, exec_lo
	s_waitcnt lgkmcnt(0)
	v_mad_i64_i32 v[2:3], null, v1, 24, s[0:1]
	global_load_b32 v8, v[2:3], off offset:12
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e32 0, v8
	s_xor_b32 s8, exec_lo, s4
	s_cbranch_execz .LBB1_7
; %bb.2:                                ; %.lr.ph
	v_mad_i64_i32 v[4:5], null, v1, 24, s[0:1]
	v_add_co_u32 v0, vcc_lo, v2, 12
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v3, vcc_lo
	s_mov_b32 s6, 0x33333333
	s_mov_b32 s7, 0x3feb3333
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v2, vcc_lo, v4, 16
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_mov_b32 s9, 0
	s_mov_b32 s4, s5
.LBB1_3:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_4 Depth 2
	s_clause 0x1
	global_load_b64 v[6:7], v[2:3], off
	global_load_b32 v9, v[4:5], off
	s_lshl_b64 s[10:11], s[4:5], 3
	v_cvt_f64_u32_e32 v[12:13], v8
	s_waitcnt vmcnt(1)
	v_add_co_u32 v6, vcc_lo, v6, s10
	v_add_co_ci_u32_e32 v7, vcc_lo, s11, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[9:10], v9
	s_mov_b32 s10, 0
	flat_load_b64 v[6:7], v[6:7]
	v_mul_f64 v[10:11], v[9:10], s[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f64 v[14:15], null, v[12:13], v[12:13], v[10:11]
	v_rcp_f64_e32 v[16:17], v[14:15]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[18:19], -v[14:15], v[16:17], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], v[16:17], v[18:19], v[16:17]
	v_fma_f64 v[18:19], -v[14:15], v[16:17], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], v[16:17], v[18:19], v[16:17]
	v_div_scale_f64 v[18:19], vcc_lo, v[10:11], v[12:13], v[10:11]
	v_mul_f64 v[20:21], v[18:19], v[16:17]
	s_waitcnt vmcnt(0) lgkmcnt(0)
	flat_load_b32 v9, v[6:7] offset:8
	v_fma_f64 v[14:15], -v[14:15], v[20:21], v[18:19]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[14:15], v[14:15], v[16:17], v[20:21]
	v_div_fixup_f64 v[10:11], v[14:15], v[12:13], v[10:11]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f32_f64_e32 v10, v[10:11]
.LBB1_4:                                ; %atomicrmw.start
                                        ;   Parent Loop BB1_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_waitcnt vmcnt(0) lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v8, v9, v10
	flat_atomic_cmpswap_b32 v8, v[6:7], v[8:9] offset:8 glc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v8, v9
	v_mov_b32_e32 v9, v8
	s_or_b32 s10, vcc_lo, s10
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB1_4
; %bb.5:                                ; %atomicrmw.end
                                        ;   in Loop: Header=BB1_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	global_load_b32 v8, v[0:1], off
	s_add_i32 s4, s4, 1
	s_waitcnt vmcnt(0)
	v_cmp_ge_u32_e32 vcc_lo, s4, v8
	s_or_b32 s9, vcc_lo, s9
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s9
	s_cbranch_execnz .LBB1_3
; %bb.6:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s9
                                        ; implicit-def: $vgpr1_vgpr2
.LBB1_7:                                ; %Flow38
	s_and_not1_saveexec_b32 s4, s8
	s_cbranch_execz .LBB1_13
; %bb.8:
	v_mad_i64_i32 v[2:3], null, v1, 24, s[0:1]
	s_mov_b32 s0, 0x33333333
	s_mov_b32 s1, 0x3feb3333
	s_mov_b32 s4, exec_lo
	global_load_b32 v0, v[2:3], off offset:4
	v_bfrev_b32_e32 v2, 1
	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[0:1]
	v_cvt_f32_f64_e32 v0, v[0:1]
.LBB1_9:                                ; %ComputeLoop
                                        ; =>This Inner Loop Header: Depth=1
	s_ctz_i32_b32 s0, s4
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_readlane_b32 s1, v0, s0
	s_lshl_b32 s0, 1, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s4, s4, s0
	s_cmp_lg_u32 s4, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v2, s1, v2
	s_cbranch_scc1 .LBB1_9
; %bb.10:                               ; %ComputeEnd
	v_mbcnt_lo_u32_b32 v0, exec_lo, 0
	s_mov_b32 s0, 0
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB1_13
; %bb.11:
	v_mov_b32_e32 v3, 0
	global_load_b32 v1, v3, s[2:3]
.LBB1_12:                               ; %atomicrmw.start24
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	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 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB1_12
.LBB1_13:                               ; %.loopexit
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17addToNextPagerankP6vertexPfi
		.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 22
		.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	_Z17addToNextPagerankP6vertexPfi, .Lfunc_end1-_Z17addToNextPagerankP6vertexPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 680
; NumSgprs: 18
; NumVgprs: 22
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 22
; 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	_Z25finalPagerankForIterationP6vertexif ; -- Begin function _Z25finalPagerankForIterationP6vertexif
	.globl	_Z25finalPagerankForIterationP6vertexif
	.p2align	8
	.type	_Z25finalPagerankForIterationP6vertexif,@function
_Z25finalPagerankForIterationP6vertexif: ; @_Z25finalPagerankForIterationP6vertexif
; %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_2
; %bb.1:
	v_cvt_f64_f32_e32 v[2:3], s3
	v_cvt_f32_i32_e32 v0, s2
	s_mov_b32 s2, 0x33333334
	s_mov_b32 s3, 0x3fc33333
	s_load_b64 s[0:1], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_cvt_f64_f32_e32 v[4:5], v0
	s_waitcnt lgkmcnt(0)
	v_mad_i64_i32 v[8:9], null, v1, 24, s[0:1]
	global_load_b32 v14, v[8:9], off offset:8
	v_add_f64 v[2:3], v[2:3], s[2:3]
	v_div_scale_f64 v[6:7], null, v[4:5], v[4:5], v[2:3]
	v_div_scale_f64 v[12:13], vcc_lo, v[2:3], v[4:5], v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[0:1], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[0:1], 1.0
	v_fma_f64 v[0:1], v[0:1], v[10:11], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], -v[6:7], v[0:1], 1.0
	v_fma_f64 v[0:1], v[0:1], v[10:11], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[10:11], v[12:13], v[0:1]
	v_fma_f64 v[6:7], -v[6:7], v[10:11], v[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[0:1], v[6:7], v[0:1], v[10:11]
	v_div_fixup_f64 v[0:1], v[0:1], v[4:5], v[2:3]
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[2:3], v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[0:1], v[0:1], v[2:3]
	v_cvt_f32_f64_e32 v0, v[0:1]
	global_store_b32 v[8:9], v0, off offset:8
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25finalPagerankForIterationP6vertexif
		.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 15
		.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	_Z25finalPagerankForIterationP6vertexif, .Lfunc_end2-_Z25finalPagerankForIterationP6vertexif
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 276
; NumSgprs: 18
; NumVgprs: 15
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 15
; 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	_Z20setPageranksFromNextP6vertexi ; -- Begin function _Z20setPageranksFromNextP6vertexi
	.globl	_Z20setPageranksFromNextP6vertexi
	.p2align	8
	.type	_Z20setPageranksFromNextP6vertexi,@function
_Z20setPageranksFromNextP6vertexi:      ; @_Z20setPageranksFromNextP6vertexi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x1c
	s_load_b32 s3, s[0:1], 0x8
	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_b64 s[0:1], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	v_mad_i64_i32 v[2:3], null, v1, 24, s[0:1]
	v_mov_b32_e32 v1, 0
	global_load_b32 v0, v[2:3], off offset:8
	s_waitcnt vmcnt(0)
	global_store_b64 v[2:3], v[0:1], off offset:4
.LBB3_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z20setPageranksFromNextP6vertexi
		.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 4
		.amdhsa_next_free_sgpr 16
		.amdhsa_reserve_vcc 0
		.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	_Z20setPageranksFromNextP6vertexi, .Lfunc_end3-_Z20setPageranksFromNextP6vertexi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 116
; NumSgprs: 16
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 16
; 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
	.protected	_Z11convergenceP6vertexPfi ; -- Begin function _Z11convergenceP6vertexPfi
	.globl	_Z11convergenceP6vertexPfi
	.p2align	8
	.type	_Z11convergenceP6vertexPfi,@function
_Z11convergenceP6vertexPfi:             ; @_Z11convergenceP6vertexPfi
; %bb.0:
	s_clause 0x2
	s_load_b32 s8, s[0:1], 0x24
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b32 s3, s[0:1], 0x18
	s_mov_b32 s2, s15
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s8, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s2, s8, v[0:1]
	s_mov_b32 s8, exec_lo
	v_cmpx_gt_i32_e32 0x400, v1
	s_cbranch_execz .LBB4_2
; %bb.1:
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v4, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_co_u32 v2, vcc_lo, s6, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v3, vcc_lo
	global_store_b32 v[2:3], v4, off
.LBB4_2:
	s_or_b32 exec_lo, exec_lo, s8
	s_load_b32 s1, s[0:1], 0x10
	v_mov_b32_e32 v2, 0
	s_mov_b32 s0, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_i32_e64 s1, v1
	s_cbranch_execz .LBB4_6
; %bb.3:
	v_mad_i64_i32 v[2:3], null, v1, 24, s[4:5]
	v_lshl_add_u32 v4, s3, 10, v1
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_cmp_gt_u32_e32 vcc_lo, s1, v4
	global_load_b64 v[2:3], v[2:3], off offset:4
	s_and_saveexec_b32 s1, vcc_lo
	s_cbranch_execz .LBB4_5
; %bb.4:
	v_mad_u64_u32 v[5:6], null, v4, 24, s[4:5]
	global_load_b64 v[4:5], v[5:6], off offset:4
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v1, v5, v4
.LBB4_5:
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v2, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_gt_f32_e32 vcc_lo, 0, v2
	v_cndmask_b32_e64 v2, v2, -v2, vcc_lo
	v_cmp_gt_f32_e32 vcc_lo, 0, v1
	v_cndmask_b32_e64 v1, v1, -v1, vcc_lo
	v_add_f32_e32 v2, v2, v1
.LBB4_6:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s0
	v_lshlrev_b32_e32 v1, 2, v0
	v_add_nc_u32_e32 v0, 1, v0
	s_mov_b32 s0, 0
	ds_store_b32 v1, v2
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
.LBB4_7:                                ; =>This Inner Loop Header: Depth=1
	s_lshl_b32 s1, 2, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s1, s1, -1
	v_and_b32_e32 v2, s1, v0
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v2
	s_cbranch_execz .LBB4_9
; %bb.8:                                ;   in Loop: Header=BB4_7 Depth=1
	s_lshl_b32 s3, -1, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	v_lshl_add_u32 v2, s3, 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_9:                                ;   in Loop: Header=BB4_7 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_add_i32 s0, s0, 1
	s_waitcnt lgkmcnt(0)
	s_cmp_lg_u32 s0, 10
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB4_7
; %bb.10:
	v_mov_b32_e32 v0, 0
	s_mov_b32 s3, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[2:3], 2
	s_add_u32 s0, s6, s0
	ds_load_b32 v1, v0 offset:4092
	s_addc_u32 s1, s7, s1
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v1, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11convergenceP6vertexPfi
		.amdhsa_group_segment_fixed_size 4096
		.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 7
		.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	_Z11convergenceP6vertexPfi, .Lfunc_end4-_Z11convergenceP6vertexPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 476
; NumSgprs: 18
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 7
; 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	_Z14getConvergencePfS_  ; -- Begin function _Z14getConvergencePfS_
	.globl	_Z14getConvergencePfS_
	.p2align	8
	.type	_Z14getConvergencePfS_,@function
_Z14getConvergencePfS_:                 ; @_Z14getConvergencePfS_
; %bb.0:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_lshlrev_b32_e32 v1, 2, v0
	v_add_nc_u32_e32 v2, 1, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v0, s4, s0, v1
	v_add_co_ci_u32_e64 v1, null, s1, 0, s4
	s_mov_b32 s4, 0
.LBB5_1:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b32 s5, 2, s4
	s_add_i32 s5, s5, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_and_b32_e32 v3, s5, v2
	s_mov_b32 s5, exec_lo
	v_cmpx_eq_u32_e32 0, v3
	s_cbranch_execz .LBB5_3
; %bb.2:                                ;   in Loop: Header=BB5_1 Depth=1
	s_lshl_b32 s6, -1, s4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_ashr_i32 s7, s6, 31
	s_lshl_b64 s[6:7], s[6:7], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_co_u32 v3, vcc_lo, v0, s6
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v1, vcc_lo
	s_clause 0x1
	global_load_b32 v3, v[3:4], off
	global_load_b32 v4, v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v3, v3, v4
	global_store_b32 v[0:1], v3, off
.LBB5_3:                                ;   in Loop: Header=BB5_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_add_i32 s4, s4, 1
	s_waitcnt_vscnt null, 0x0
	s_cmp_lg_u32 s4, 10
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB5_1
; %bb.4:
	v_mov_b32_e32 v0, 0
	global_load_b32 v1, v0, s[0:1] offset:4092
	s_waitcnt vmcnt(0)
	global_store_b32 v0, v1, s[2:3]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14getConvergencePfS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 16
		.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 5
		.amdhsa_next_free_sgpr 8
		.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_end5:
	.size	_Z14getConvergencePfS_, .Lfunc_end5-_Z14getConvergencePfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 212
; NumSgprs: 10
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 10
; NumVGPRsForWavesPerEU: 5
; 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
      - .offset:         8
        .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:           _Z19initializePageranksP6vertexi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z19initializePageranksP6vertexi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .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: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17addToNextPagerankP6vertexPfi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17addToNextPagerankP6vertexPfi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     22
    .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:           _Z25finalPagerankForIterationP6vertexif
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z25finalPagerankForIterationP6vertexif.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     15
    .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:         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:           _Z20setPageranksFromNextP6vertexi
    .private_segment_fixed_size: 0
    .sgpr_count:     16
    .sgpr_spill_count: 0
    .symbol:         _Z20setPageranksFromNextP6vertexi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .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: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11convergenceP6vertexPfi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11convergenceP6vertexPfi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .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
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 16
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14getConvergencePfS_
    .private_segment_fixed_size: 0
    .sgpr_count:     10
    .sgpr_spill_count: 0
    .symbol:         _Z14getConvergencePfS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
