#include "graphs.cuh"
#include <ctime>
#include <algorithm>

using namespace graphs;

__global__
void stage1(bool * status, int * d_q_curlen, int * d_q_nexlen, int * d_S_len, int * d_ends_len, int * d_q_cur, int * d_q_next, int * d_sigma, int * d_delta, int * d_S, int * d_ends, int * d_dist,int* d_depth, int * d_no_nodes, Edge * d_edges){        
    
    int id = threadIdx.x + blockIdx.x*blockDim.x;

    if(id<*d_q_curlen)
    {   
        int current = d_q_cur[id];
        for(int i=0;i<d_edges[current].no_neigh;i++)
        {
            if(atomicCAS(&d_dist[d_edges[current].neighbours[i]],INT_MAX,d_dist[current]+1)==INT_MAX)
            {
                int temp = atomicAdd(d_q_nexlen,1);
                d_q_next[temp]=d_edges[current].neighbours[i];
            }
            if(d_dist[d_edges[current].neighbours[i]]==(d_dist[current]+1))
                atomicAdd(&d_sigma[d_edges[current].neighbours[i]],d_sigma[current]);
        }
        __syncthreads();
    }
}

__global__
void stage1_1(bool * status, int * d_q_curlen, int * d_q_nexlen, int * d_S_len, int * d_ends_len, int * d_q_cur, int * d_q_next, int * d_sigma, int * d_delta, int * d_S, int * d_ends, int * d_dist,int* d_depth, int * d_no_nodes, Edge * d_edges)
{
    int id = threadIdx.x + blockIdx.x*blockDim.x;

    if(id<*d_q_nexlen)
    {
        d_q_cur[id]=d_q_next[id];
        d_S[id+*d_S_len]=d_q_next[id];
        __syncthreads();
    }
}

__global__ 
void single(int * d_depth, int * d_dist, int * d_S, int * d_S_len){
    *d_depth=d_dist[d_S[*d_S_len-1]]-1;
}

__global__ 
void singleThread(int * d_ends, int * d_ends_len, int * d_q_nexlen, int * d_q_curlen, int * d_S_len){
    d_ends[*d_ends_len]=d_ends[*d_ends_len-1]+*d_q_nexlen;
    *d_ends_len = *d_ends_len + 1;
    *d_q_curlen=*d_q_nexlen;
    *d_S_len+=*d_q_nexlen;
    *d_q_nexlen=0;
}

__global__
void stage2_2(int * d_delta, int *  d_dist, int *  d_sigma, int * d_S, Edge * d_edges, const int offset, const int itr){
    int idx = threadIdx.x + blockIdx.x * blockDim.x;

    if(idx <= itr){
        int tid = idx + offset;
        int w = d_S[tid];
        float dsw = 0;
        int sw = d_sigma[w];
    
        for(int i = 0; i < d_edges[w].no_neigh; i++){
            int v = d_edges[w].neighbours[i];
            if(d_dist[v] == d_dist[w] + 1){
                dsw += ((float) sw * (1 + d_delta[v])) / d_sigma[v];
            }
        }
        d_delta[w] = (int)dsw;

        __syncthreads();
    }
}


namespace graphs{

    Results calculateBC(Edge * h_edges, int no_nodes, int threads){

        clock_t begin = clock();

        int t = min(no_nodes, threads);

        #define size t

        int * d_q_curlen, * d_q_nexlen, * d_depth, * d_S_len, * d_ends_len, * d_no_nodes, h_q_nexlen;

        int * d_q_cur, * d_q_next, * d_sigma, * d_delta, *h_delta, * d_S, * d_ends, * d_dist, * h_ends, h_depth;

        int * h_dis = new int[no_nodes];
        h_ends = new int[no_nodes];

        for(int cc=0;cc<no_nodes;cc++)
        {
            h_ends[cc] = 0;
            h_dis[cc] = INT_MAX;
        }

        h_dis[0] = 0;
        
        Edge * d_edges;

        bool * d_status;

        cudaMalloc((void **)&d_q_curlen, sizeof(int));
        cudaMalloc((void **)&d_q_nexlen, sizeof(int));
        cudaMalloc((void **)&d_depth, sizeof(int));
        cudaMalloc((void **)&d_S_len, sizeof(int));
        cudaMalloc((void **)&d_ends_len, sizeof(int));
        cudaMalloc((void **)&d_no_nodes, sizeof(int));
        cudaMalloc((void **)&d_status, sizeof(bool));

        cudaMalloc((void **)&d_q_cur, no_nodes*sizeof(int));
        cudaMalloc((void **)&d_q_next, no_nodes*sizeof(int));
        cudaMalloc((void **)&d_sigma, no_nodes*sizeof(int));
        cudaMalloc((void **)&d_delta, no_nodes*sizeof(int));
        cudaMalloc((void **)&d_S, no_nodes*sizeof(int));
        cudaMalloc((void **)&d_ends, no_nodes*sizeof(int));
        cudaMalloc((void **)&d_dist, no_nodes*sizeof(int));

        cudaMalloc((void **)&d_edges, no_nodes*sizeof(Edge));

        cudaMemset(d_delta, 0, no_nodes*sizeof(int));

        int One = 1;
        int Zero = 0;
        int Two = 2;
        int initEnd[2] = {0, 1};

        // Initialize
        cudaMemcpy(d_q_curlen, &One, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_q_nexlen, &Zero, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_S_len, &One, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_ends_len, &Two, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_ends, initEnd, 2*sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_no_nodes, &no_nodes, sizeof(int), cudaMemcpyHostToDevice);

        cudaMemcpy(d_q_cur, &Zero, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_sigma, &One, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_S, &Zero, sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(d_dist, h_dis, no_nodes*sizeof(int), cudaMemcpyHostToDevice);
           
        cudaMemcpy(d_edges, h_edges, no_nodes*sizeof(Edge), cudaMemcpyHostToDevice);

        while(1){
            int blocks = ceil((float)no_nodes/size);

            stage1<<<blocks,size>>>(d_status,d_q_curlen,d_q_nexlen,d_S_len,d_ends_len,d_q_cur,d_q_next,d_sigma,d_delta,d_S,d_ends,d_dist,d_depth,d_no_nodes,d_edges);
            cudaMemcpy(&h_q_nexlen, d_q_nexlen, sizeof(int), cudaMemcpyDeviceToHost);
 
            if(h_q_nexlen==0){
                single<<<1, 1>>>(d_depth, d_dist, d_S, d_S_len);
                break;
            }
            stage1_1<<<blocks,size>>>(d_status,d_q_curlen,d_q_nexlen,d_S_len,d_ends_len,d_q_cur,d_q_next,d_sigma,d_delta,d_S,d_ends,d_dist,d_depth,d_no_nodes,d_edges);
            singleThread<<<1, 1>>>(d_ends, d_ends_len, d_q_nexlen, d_q_curlen, d_S_len);
        }
        
        cudaMemcpy(&h_depth,d_depth,sizeof(int),cudaMemcpyDeviceToHost);
        cudaMemcpy(h_ends,d_ends,no_nodes * sizeof(int),cudaMemcpyDeviceToHost);
        
        int counter = h_depth;

        int offset;

        while(counter >= 0){

            offset = h_ends[counter];
            int itr = h_ends[counter + 1] - 1 - offset;

            int blocks = ceil((float)(itr+1)/size);

            stage2_2<<<blocks, size>>>(d_delta, d_dist, d_sigma, d_S, d_edges, (const int)offset, (const int)itr);

            counter --;
        }

        h_delta = new int[no_nodes];
        
        cudaMemcpy(h_delta, d_delta, no_nodes * sizeof(int),cudaMemcpyDeviceToHost);
        
        cudaFree(d_q_curlen);
        cudaFree(d_q_nexlen);
        cudaFree(d_depth);
        cudaFree(d_S_len);
        cudaFree(d_ends_len);

        cudaFree(d_q_cur);
        cudaFree(d_q_next);
        cudaFree(d_sigma);
        cudaFree(d_delta);
        cudaFree(d_S);
        cudaFree(d_ends);
        cudaFree(d_dist);

        clock_t end = clock();

        double elapsed_secs = double(end - begin) / (CLOCKS_PER_SEC);
        
        Results res;

        res.time = elapsed_secs;

        res.delta = *max_element(h_delta, h_delta + no_nodes);

        return res;
    }
}
	.file	"tmpxft_002cc3b9_00000000-6_graphs.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3892:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3892:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.type	_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, @function
_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE:
.LFB3914:
	.cfi_startproc
	endbr64
	subq	$328, %rsp
	.cfi_def_cfa_offset 336
	movq	336(%rsp), %rax
	movq	%rdi, 120(%rsp)
	leaq	144(%rsp), %rdi
	movq	%rsi, 112(%rsp)
	leaq	156(%rsp), %rsi
	movq	%rax, 72(%rsp)
	movq	344(%rsp), %rax
	movq	%rdx, 104(%rsp)
	leaq	128(%rsp), %rdx
	movq	%rax, 64(%rsp)
	movq	352(%rsp), %rax
	movq	%rcx, 96(%rsp)
	leaq	136(%rsp), %rcx
	movq	%rax, 56(%rsp)
	movq	360(%rsp), %rax
	movq	%r8, 88(%rsp)
	movq	%rax, 48(%rsp)
	movq	368(%rsp), %rax
	movq	%r9, 80(%rsp)
	movq	%rax, 40(%rsp)
	movq	376(%rsp), %rax
	movq	%rax, 32(%rsp)
	movq	384(%rsp), %rax
	movq	%rax, 24(%rsp)
	movq	392(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	400(%rsp), %rax
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 312(%rsp)
	xorl	%eax, %eax
	leaq	120(%rsp), %rax
	movq	%rax, 192(%rsp)
	leaq	112(%rsp), %rax
	movq	%rax, 200(%rsp)
	leaq	104(%rsp), %rax
	movq	%rax, 208(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 216(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 224(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 232(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 240(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 248(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 256(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 264(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 272(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 280(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 288(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 296(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 304(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 144(%rsp)
	movl	$1, 152(%rsp)
	movq	%rax, 156(%rsp)
	movl	$1, 164(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	136(%rsp)
	.cfi_def_cfa_offset 344
	leaq	_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE(%rip), %rdi
	pushq	136(%rsp)
	.cfi_def_cfa_offset 352
	movq	172(%rsp), %rcx
	movl	180(%rsp), %r8d
	movq	160(%rsp), %rsi
	movl	168(%rsp), %edx
	leaq	208(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 344
	popq	%rdx
	.cfi_def_cfa_offset 336
.L2:
	movq	312(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$328, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3914:
	.size	_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, .-_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.globl	_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.type	_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, @function
_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE:
.LFB3915:
	.cfi_startproc
	endbr64
	jmp	_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.cfi_endproc
.LFE3915:
	.size	_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, .-_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.globl	_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.type	_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, @function
_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE:
.LFB3916:
	.cfi_startproc
	endbr64
	subq	$328, %rsp
	.cfi_def_cfa_offset 336
	movq	336(%rsp), %rax
	movq	%rdi, 120(%rsp)
	leaq	144(%rsp), %rdi
	movq	%rsi, 112(%rsp)
	leaq	156(%rsp), %rsi
	movq	%rax, 72(%rsp)
	movq	344(%rsp), %rax
	movq	%rdx, 104(%rsp)
	leaq	128(%rsp), %rdx
	movq	%rax, 64(%rsp)
	movq	352(%rsp), %rax
	movq	%rcx, 96(%rsp)
	leaq	136(%rsp), %rcx
	movq	%rax, 56(%rsp)
	movq	360(%rsp), %rax
	movq	%r8, 88(%rsp)
	movq	%rax, 48(%rsp)
	movq	368(%rsp), %rax
	movq	%r9, 80(%rsp)
	movq	%rax, 40(%rsp)
	movq	376(%rsp), %rax
	movq	%rax, 32(%rsp)
	movq	384(%rsp), %rax
	movq	%rax, 24(%rsp)
	movq	392(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	400(%rsp), %rax
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 312(%rsp)
	xorl	%eax, %eax
	leaq	120(%rsp), %rax
	movq	%rax, 192(%rsp)
	leaq	112(%rsp), %rax
	movq	%rax, 200(%rsp)
	leaq	104(%rsp), %rax
	movq	%rax, 208(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 216(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 224(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 232(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 240(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 248(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 256(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 264(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 272(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 280(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 288(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 296(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 304(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 144(%rsp)
	movl	$1, 152(%rsp)
	movq	%rax, 156(%rsp)
	movl	$1, 164(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	136(%rsp)
	.cfi_def_cfa_offset 344
	leaq	_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE(%rip), %rdi
	pushq	136(%rsp)
	.cfi_def_cfa_offset 352
	movq	172(%rsp), %rcx
	movl	180(%rsp), %r8d
	movq	160(%rsp), %rsi
	movl	168(%rsp), %edx
	leaq	208(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 344
	popq	%rdx
	.cfi_def_cfa_offset 336
.L8:
	movq	312(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$328, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3916:
	.size	_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, .-_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.globl	_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.type	_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, @function
_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE:
.LFB3917:
	.cfi_startproc
	endbr64
	jmp	_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.cfi_endproc
.LFE3917:
	.size	_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE, .-_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	.globl	_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_
	.type	_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_, @function
_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_:
.LFB3918:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L13
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z6singlePiS_S_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L13:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3918:
	.size	_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_, .-_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_
	.globl	_Z6singlePiS_S_S_
	.type	_Z6singlePiS_S_S_, @function
_Z6singlePiS_S_S_:
.LFB3919:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_
	.cfi_endproc
.LFE3919:
	.size	_Z6singlePiS_S_S_, .-_Z6singlePiS_S_S_
	.globl	_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_
	.type	_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_, @function
_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_:
.LFB3920:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z12singleThreadPiS_S_S_S_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L18:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3920:
	.size	_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_, .-_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_
	.globl	_Z12singleThreadPiS_S_S_S_
	.type	_Z12singleThreadPiS_S_S_S_, @function
_Z12singleThreadPiS_S_S_S_:
.LFB3921:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_
	.cfi_endproc
.LFE3921:
	.size	_Z12singleThreadPiS_S_S_S_, .-_Z12singleThreadPiS_S_S_S_
	.globl	_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii
	.type	_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii, @function
_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii:
.LFB3922:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L23
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z8stage2_2PiS_S_S_PN6graphs4edgeEii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 208
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L23:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3922:
	.size	_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii, .-_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii
	.globl	_Z8stage2_2PiS_S_S_PN6graphs4edgeEii
	.type	_Z8stage2_2PiS_S_S_PN6graphs4edgeEii, @function
_Z8stage2_2PiS_S_S_PN6graphs4edgeEii:
.LFB3923:
	.cfi_startproc
	endbr64
	jmp	_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii
	.cfi_endproc
.LFE3923:
	.size	_Z8stage2_2PiS_S_S_PN6graphs4edgeEii, .-_Z8stage2_2PiS_S_S_PN6graphs4edgeEii
	.globl	_ZN6graphs11calculateBCEPNS_4edgeEii
	.type	_ZN6graphs11calculateBCEPNS_4edgeEii, @function
_ZN6graphs11calculateBCEPNS_4edgeEii:
.LFB3889:
	.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
	movabsq	$2305843009213693950, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%rdi, (%rsp)
	movl	%esi, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	call	clock@PLT
	movslq	12(%rsp), %rdi
	cmpl	%ebx, %edi
	cmovle	%edi, %ebx
	cmpq	%rdi, %rbp
	jb	.L29
	salq	$2, %rdi
	movq	%rax, %r13
	call	_Znam@PLT
	movslq	12(%rsp), %rdi
	movq	%rax, %r12
	cmpq	%rdi, %rbp
	jnb	.L30
.L29:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	call	__cxa_throw_bad_array_new_length@PLT
.L30:
	salq	$2, %rdi
	call	_Znam@PLT
	movl	12(%rsp), %edx
	movq	%rax, %rbp
	xorl	%eax, %eax
.L32:
	cmpl	%eax, %edx
	jle	.L51
	xorl	%r10d, %r10d
	movl	$2147483647, (%r12,%rax,4)
	movl	%r10d, 0(%rbp,%rax,4)
	incq	%rax
	jmp	.L32
.L51:
	xorl	%r8d, %r8d
	leaq	48(%rsp), %rdi
	movl	$4, %esi
	movl	%r8d, (%r12)
	leaq	36(%rsp), %r15
	leaq	40(%rsp), %r14
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	72(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	80(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	88(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	160(%rsp), %rdi
	movl	$1, %esi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	96(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	104(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	112(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	120(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	128(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	136(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	144(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rsi
	leaq	152(%rsp), %rdi
	imulq	$44, %rsi, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rdx
	movq	120(%rsp), %rdi
	xorl	%esi, %esi
	salq	$2, %rdx
	call	cudaMemset@PLT
	movq	48(%rsp), %rdi
	xorl	%r9d, %r9d
	movq	%r15, %rsi
	movl	$1, %eax
	movl	$1, %ecx
	movl	$4, %edx
	movl	%r9d, 40(%rsp)
	salq	$32, %rax
	movl	$1, 36(%rsp)
	movl	$2, 44(%rsp)
	movq	%rax, 192(%rsp)
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movq	%r15, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	80(%rsp), %rdi
	leaq	44(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$8, %edx
	movq	136(%rsp), %rdi
	leaq	192(%rsp), %rsi
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	leaq	12(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	96(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r15, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movslq	12(%rsp), %rdx
	movq	%r12, %rsi
	movq	144(%rsp), %rdi
	movabsq	$4294967297, %r12
	movl	$1, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	12(%rsp), %rdx
	movq	(%rsp), %rsi
	movl	$1, %ecx
	movq	152(%rsp), %rdi
	imulq	$44, %rdx, %rdx
	call	cudaMemcpy@PLT
.L40:
	cvtsi2ssl	%ebx, %xmm1
	cvtsi2ssl	12(%rsp), %xmm0
	movss	%xmm1, (%rsp)
	divss	%xmm1, %xmm0
	call	ceilf@PLT
	movq	%r12, 184(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2sil	%xmm0, %r14d
	movq	%r12, 172(%rsp)
	movl	188(%rsp), %ecx
	movl	%ebx, 180(%rsp)
	movl	176(%rsp), %esi
	movq	180(%rsp), %rdx
	movl	%r14d, 168(%rsp)
	movq	168(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L34
	pushq	%rdi
	.cfi_def_cfa_offset 280
	pushq	160(%rsp)
	.cfi_def_cfa_offset 288
	pushq	104(%rsp)
	.cfi_def_cfa_offset 296
	pushq	88(%rsp)
	.cfi_def_cfa_offset 304
	pushq	176(%rsp)
	.cfi_def_cfa_offset 312
	pushq	176(%rsp)
	.cfi_def_cfa_offset 320
	pushq	176(%rsp)
	.cfi_def_cfa_offset 328
	pushq	176(%rsp)
	.cfi_def_cfa_offset 336
	pushq	176(%rsp)
	.cfi_def_cfa_offset 344
	pushq	176(%rsp)
	.cfi_def_cfa_offset 352
	movq	176(%rsp), %r9
	movq	160(%rsp), %r8
	movq	152(%rsp), %rcx
	movq	136(%rsp), %rdx
	movq	128(%rsp), %rsi
	movq	240(%rsp), %rdi
	call	_Z78__device_stub__Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	addq	$80, %rsp
	.cfi_def_cfa_offset 272
.L34:
	movq	56(%rsp), %rsi
	leaq	28(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	cmpl	$0, 28(%rsp)
	jne	.L35
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 188(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 180(%rsp)
	movq	%rdi, 168(%rsp)
	movl	$1, 176(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L36
	movq	72(%rsp), %rcx
	movq	128(%rsp), %rdx
	movq	144(%rsp), %rsi
	movq	64(%rsp), %rdi
	call	_Z31__device_stub__Z6singlePiS_S_S_PiS_S_S_
.L36:
	movq	64(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	movabsq	$4294967297, %r14
	call	cudaMemcpy@PLT
	movslq	12(%rsp), %rdx
	movl	$2, %ecx
	movq	%rbp, %rdi
	movq	136(%rsp), %rsi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	32(%rsp), %r12
	jmp	.L37
.L35:
	movq	%r12, 184(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	188(%rsp), %ecx
	movq	%r12, 172(%rsp)
	movl	176(%rsp), %esi
	movl	%ebx, 180(%rsp)
	movq	180(%rsp), %rdx
	movl	%r14d, 168(%rsp)
	movq	168(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L38
	pushq	%rsi
	.cfi_def_cfa_offset 280
	pushq	160(%rsp)
	.cfi_def_cfa_offset 288
	pushq	104(%rsp)
	.cfi_def_cfa_offset 296
	pushq	88(%rsp)
	.cfi_def_cfa_offset 304
	pushq	176(%rsp)
	.cfi_def_cfa_offset 312
	pushq	176(%rsp)
	.cfi_def_cfa_offset 320
	pushq	176(%rsp)
	.cfi_def_cfa_offset 328
	pushq	176(%rsp)
	.cfi_def_cfa_offset 336
	pushq	176(%rsp)
	.cfi_def_cfa_offset 344
	pushq	176(%rsp)
	.cfi_def_cfa_offset 352
	movq	176(%rsp), %r9
	movq	160(%rsp), %r8
	movq	152(%rsp), %rcx
	movq	136(%rsp), %rdx
	movq	128(%rsp), %rsi
	movq	240(%rsp), %rdi
	call	_Z80__device_stub__Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeEPbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE
	addq	$80, %rsp
	.cfi_def_cfa_offset 272
.L38:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r12, 180(%rsp)
	movl	$1, 188(%rsp)
	movq	%r12, 168(%rsp)
	movl	$1, 176(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L40
	movq	72(%rsp), %r8
	movq	48(%rsp), %rcx
	movq	56(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	136(%rsp), %rdi
	call	_Z40__device_stub__Z12singleThreadPiS_S_S_S_PiS_S_S_S_
	jmp	.L40
.L42:
	movl	0(%rbp,%r12,4), %r15d
	movl	%r15d, %r10d
	notl	%r10d
	addl	4(%rbp,%r12,4), %r10d
	leal	1(%r10), %eax
	movl	%r10d, 8(%rsp)
	cvtsi2ssl	%eax, %xmm0
	divss	(%rsp), %xmm0
	call	ceilf@PLT
	movq	%r14, 184(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2sil	%xmm0, %eax
	movq	%r14, 172(%rsp)
	movl	188(%rsp), %ecx
	movl	%ebx, 180(%rsp)
	movl	176(%rsp), %esi
	movq	180(%rsp), %rdx
	movl	%eax, 168(%rsp)
	movq	168(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	movl	8(%rsp), %r10d
	testl	%eax, %eax
	jne	.L41
	pushq	%rax
	.cfi_def_cfa_offset 280
	movl	%r15d, %r9d
	pushq	%r10
	.cfi_def_cfa_offset 288
	movq	168(%rsp), %r8
	movq	144(%rsp), %rcx
	movq	128(%rsp), %rdx
	movq	160(%rsp), %rsi
	movq	136(%rsp), %rdi
	call	_Z50__device_stub__Z8stage2_2PiS_S_S_PN6graphs4edgeEiiPiS_S_S_PN6graphs4edgeEii
	popq	%rdx
	.cfi_def_cfa_offset 280
	popq	%rcx
	.cfi_def_cfa_offset 272
.L41:
	decq	%r12
.L37:
	testl	%r12d, %r12d
	jns	.L42
	movabsq	$2305843009213693950, %rax
	movslq	12(%rsp), %rdi
	cmpq	%rdi, %rax
	jb	.L29
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	12(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rax, %rdi
	movq	%rax, %rbx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaFree@PLT
	movq	136(%rsp), %rdi
	call	cudaFree@PLT
	movq	144(%rsp), %rdi
	call	cudaFree@PLT
	call	clock@PLT
	subq	%r13, %rax
	cvtsi2sdq	%rax, %xmm0
	movslq	12(%rsp), %rax
	divsd	.LC0(%rip), %xmm0
	leaq	(%rbx,%rax,4), %rdx
	movq	%rbx, %rax
	cmpq	%rbx, %rdx
	je	.L43
.L44:
	addq	$4, %rbx
	movl	(%rax), %ecx
	cmpq	%rbx, %rdx
	je	.L52
	cmpl	%ecx, (%rbx)
	cmovg	%rbx, %rax
	jmp	.L44
.L52:
	movq	%rax, %rbx
.L43:
	movl	(%rbx), %eax
	movq	200(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L47
.L50:
	call	__stack_chk_fail@PLT
.L47:
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3889:
	.size	_ZN6graphs11calculateBCEPNS_4edgeEii, .-_ZN6graphs11calculateBCEPNS_4edgeEii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z8stage2_2PiS_S_S_PN6graphs4edgeEii"
.LC2:
	.string	"_Z12singleThreadPiS_S_S_S_"
.LC3:
	.string	"_Z6singlePiS_S_S_"
.LC4:
	.string	"_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE"
.LC5:
	.string	"_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3925:
	.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	.LC1(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z8stage2_2PiS_S_S_PN6graphs4edgeEii(%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	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z12singleThreadPiS_S_S_S_(%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	.LC3(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z6singlePiS_S_S_(%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	.LC4(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8stage1_1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE(%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	.LC5(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z6stage1PbPiS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_PN6graphs4edgeE(%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
.LFE3925:
	.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.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1093567616
	.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:

#ifndef GRAPHS
#define GRAPHS

#include <iostream>

using namespace std;

namespace graphs{

    typedef struct edge{
        int neighbours[10];
        int no_neigh;
    } Edge;

    typedef struct result{
        double time;
        int delta;
    } Results;
    
    Results calculateBC(Edge * edges, int no_nodes, int threads);
}

#endif
	.text
	.file	"graphs.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.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_

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

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

	.end_amdgpu_metadata
