#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<iterator>
#include<ctime>
#include<limits>
#include<list>
#include<algorithm>

using namespace std;

struct info_edge     
{
int vertex1,vertex2;
int edge;
};

//This function to extract data from file
void extract_data(info_edge &info,char* str)
{
int i,m=0;
int vertex[2];
int weight;
vertex[0]=0;
vertex[1]=0;
for(i=2;i<strlen(&str[0])-1;i++)
{
if(str[i]!=' ')
{
vertex[m]*=10;
vertex[m]+=(int)str[i]-48;
}
else if(m<1)
{
m++;
}
else
break;
}
weight=0;
i++;
while(i<strlen(&str[0]))
{
weight*=10;
weight+=(int)str[i]-48;
i++;
}
info.vertex1=--vertex[0];
info.vertex2=--vertex[1];
info.edge=weight;
}



//This is the kernel
__global__ void sssp(pair<int,int>* adjacency,int* dist,int* change,int* count)
{
int n=blockDim.x*blockIdx.x + threadIdx.x;
int n1=n*10;
//if(n%10000==0)
//printf("%d\t",count[n]);
if(dist[n]!=2147483647)
for(int i=0;i<count[n];i++)
{
if(dist[adjacency[n1+i].first] > adjacency[n1+i].second + dist[n])
{
change[0]=1;
dist[adjacency[n1+i].first] = adjacency[n1+i].second + dist[n];
}
}
}

int main(int argc,char** argv)
{
struct timespec start,finish;
ifstream in(argv[2]);
string str;
for(int i=0;i<4;i++)
getline(in,str);

getline(in,str);
int vertex=0;
int edge=0;
int i=5;

//these 2 while loop for finding number of veritices and edges
while(str[i]!=' ')
{
vertex*=10;
vertex+=(int)str[i]-48;
i++;
}
i++;
while(i<strlen(&str[0])-1)
{
edge*=10;
edge+=(int)str[i]-48;
i++;
}
vertex++;



pair<int,int>* adjacency1=new pair<int,int>[vertex*10];//datasructure of graph
int* count1=new int[vertex];

for(i=0;i<2;i++)
getline(in,str);
int* dist1=new int[vertex];

int source=atoi(argv[1]);
dist1[source]=0;

for(int i=0;i<vertex;i++)
{
count1[i]=0;
if(i!=source)
dist1[i]=std::numeric_limits<int>::max();
}
info_edge info;
pair<int,int> sub_info;


while(!in.eof())    		//loop on each line of file
{
getline(in,str);
extract_data(info,&str[0]);
sub_info.first=info.vertex2;
sub_info.second=info.edge;
adjacency1[info.vertex1*10+count1[info.vertex1]]=sub_info;
count1[info.vertex1]++;
}


pair<int,int>* adjacency;
int *dist,*count;
int* change1=new int[1];
int* change;

cudaMalloc((void**)&adjacency,sizeof(int)*2*vertex*10);
cudaMalloc((void**)&dist,sizeof(int)*vertex);
cudaMalloc((void**)&count,sizeof(int)*vertex);
cudaMemcpy(adjacency,adjacency1,sizeof(int)*2*vertex*10,cudaMemcpyHostToDevice);
cudaMemcpy(dist,dist1,sizeof(int)*vertex,cudaMemcpyHostToDevice);
cudaMemcpy(count,count1,sizeof(int)*vertex,cudaMemcpyHostToDevice);
dim3 dimBlock(512);
dim3 dimGrid(3693);

int iteration=0;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&start);


do
{
change1[0]=0;
cudaMalloc((void**)&change,sizeof(int));
cudaMemcpy(change,change1,sizeof(int),cudaMemcpyHostToDevice);

sssp<<<dimGrid,dimBlock>>>(adjacency,dist,change,count);

cudaMemcpy(change1,change,sizeof(int),cudaMemcpyDeviceToHost);
iteration++;
}while(change1[0]==1);

clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&finish);
cudaMemcpy(dist1,dist,sizeof(int)*vertex,cudaMemcpyDeviceToHost);



cout<<"no.of iterations: "<<iteration<<"\n";
cout<<"Time taken\t"<<(finish.tv_sec-start.tv_sec)+(finish.tv_nsec-start.tv_nsec)/1e09<<"\n";
ofstream out("output.txt");
for(int i=0;i<vertex-1;i++)
out<<i+1<<"\t"<<dist1[i]<<"\n";
return 0;
}

	.file	"tmpxft_003232f0_00000000-6_top_driven.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4597:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4597:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0, @function
_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0:
.LFB5321:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	(%rdi), %rax
	movq	-24(%rax), %rax
	movq	240(%rdi,%rax), %rbx
	testq	%rbx, %rbx
	jne	.L3
	call	_ZSt16__throw_bad_castv@PLT
.L3:
	cmpb	$0, 56(%rbx)
	movq	%rdi, %rbp
	movq	%rsi, %r12
	je	.L4
	movb	67(%rbx), %al
	jmp	.L5
.L4:
	movq	%rbx, %rdi
	call	_ZNKSt5ctypeIcE13_M_widen_initEv@PLT
	movq	(%rbx), %rax
	movl	$10, %esi
	movq	%rbx, %rdi
	call	*48(%rax)
.L5:
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%r12, %rsi
	movq	%rbp, %rdi
	movsbl	%al, %edx
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_@PLT
	.cfi_endproc
.LFE5321:
	.size	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0, .-_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0
	.globl	_Z12extract_dataR9info_edgePc
	.type	_Z12extract_dataR9info_edgePc, @function
_Z12extract_dataR9info_edgePc:
.LFB4587:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	$2, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	movq	%rax, (%rsp)
.L9:
	movq	%r12, %rdi
	call	strlen@PLT
	leaq	-1(%rax), %rdx
	cmpq	%rdx, %rbx
	jnb	.L15
	movsbl	(%r12,%rbx), %edx
	cmpb	$32, %dl
	je	.L10
	movslq	%r13d, %rax
	imull	$10, (%rsp,%rax,4), %ecx
	leal	-48(%rcx,%rdx), %edx
	movl	%edx, (%rsp,%rax,4)
	jmp	.L11
.L10:
	testl	%r13d, %r13d
	jle	.L12
.L15:
	incl	%ebx
	xorl	%edx, %edx
	movslq	%ebx, %rbx
	jmp	.L13
.L12:
	incl	%r13d
.L11:
	incq	%rbx
	jmp	.L9
.L13:
	cmpq	%rax, %rbx
	jnb	.L19
	imull	$10, %edx, %edx
	movsbl	(%r12,%rbx), %ecx
	incq	%rbx
	leal	-48(%rdx,%rcx), %edx
	jmp	.L13
.L19:
	movl	(%rsp), %eax
	movl	%edx, 8(%rbp)
	decl	%eax
	movl	%eax, 0(%rbp)
	movl	4(%rsp), %eax
	decl	%eax
	movl	%eax, 4(%rbp)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4587:
	.size	_Z12extract_dataR9info_edgePc, .-_Z12extract_dataR9info_edgePc
	.globl	_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_
	.type	_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_, @function
_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_:
.LFB4619:
	.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	.L20
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z4ssspPSt4pairIiiEPiS2_S2_(%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
.L20:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4619:
	.size	_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_, .-_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_
	.globl	_Z4ssspPSt4pairIiiEPiS2_S2_
	.type	_Z4ssspPSt4pairIiiEPiS2_S2_, @function
_Z4ssspPSt4pairIiiEPiS2_S2_:
.LFB4620:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_
	.cfi_endproc
.LFE4620:
	.size	_Z4ssspPSt4pairIiiEPiS2_S2_, .-_Z4ssspPSt4pairIiiEPiS2_S2_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z4ssspPSt4pairIiiEPiS2_S2_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4622:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z4ssspPSt4pairIiiEPiS2_S2_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4622:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC1:
	.string	"no.of iterations: "
.LC2:
	.string	"\n"
.LC3:
	.string	"Time taken\t"
.LC5:
	.string	"output.txt"
.LC6:
	.string	"\t"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4588:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4588
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$8, %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	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
	movl	$4, %ebx
	subq	$1224, %rsp
	.cfi_def_cfa_offset 1280
	movq	16(%rsi), %rsi
	movq	%fs:40, %rax
	movq	%rax, 1208(%rsp)
	xorl	%eax, %eax
	leaq	688(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	160(%rsp), %rax
	xorl	%r8d, %r8d
	movb	$0, 160(%rsp)
	movq	%rax, 144(%rsp)
	leaq	144(%rsp), %rax
	movq	%r8, 152(%rsp)
	movq	%rax, 16(%rsp)
.L28:
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
.LEHB1:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0
	decl	%ebx
	jne	.L28
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0
	movq	144(%rsp), %rax
	xorl	%ebp, %ebp
	addq	$5, %rax
.L29:
	movsbl	(%rax), %edx
	incq	%rax
	cmpb	$32, %dl
	je	.L58
	imull	$10, %ebp, %ebp
	leal	-48(%rbp,%rdx), %ebp
	jmp	.L29
.L58:
	movabsq	$1152921504606846975, %rdx
	leal	1(%rbp), %r15d
	imull	$10, %r15d, %eax
	cltq
	cmpq	%rax, %rdx
	jb	.L31
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	_Znam@PLT
	movq	%rax, %r12
	movq	24(%rsp), %rax
	leaq	(%r12,%rax), %rdx
	movq	%r12, %rax
	jmp	.L34
.L31:
	movq	1208(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	call	__cxa_throw_bad_array_new_length@PLT
.L34:
	cmpq	%rdx, %rax
	je	.L59
	xorl	%edi, %edi
	addq	$8, %rax
	movl	%edi, -8(%rax)
	movl	%edi, -4(%rax)
	jmp	.L34
.L59:
	movslq	%r15d, %rax
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	call	_Znam@PLT
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	movq	%rax, %r13
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0
	movq	(%rsp), %rdi
	call	_Znam@PLT
	movq	8(%r14), %rdi
	movq	%rax, %rbx
	call	atoi@PLT
	xorl	%esi, %esi
	movslq	%eax, %rdx
	movl	%esi, (%rbx,%rdx,4)
	xorl	%edx, %edx
.L36:
	cmpl	%edx, %r15d
	jle	.L60
	xorl	%ecx, %ecx
	movl	%ecx, 0(%r13,%rdx,4)
	cmpl	%edx, %eax
	je	.L37
	movl	$2147483647, (%rbx,%rdx,4)
.L37:
	incq	%rdx
	jmp	.L36
.L60:
	leaq	76(%rsp), %r14
.L39:
	testb	$2, 976(%rsp)
	jne	.L61
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.isra.0
	movq	144(%rsp), %rsi
	movq	%r14, %rdi
	call	_Z12extract_dataR9info_edgePc
	movslq	76(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	%rdx, %rax
	leaq	0(%r13,%rdx,4), %rcx
	imull	$10, %eax, %eax
	movl	(%rcx), %edx
	addl	%edx, %eax
	incl	%edx
	cltq
	movl	%edx, (%rcx)
	movq	%rsi, (%r12,%rax,8)
	jmp	.L39
.L61:
	movl	$4, %edi
	call	_Znam@PLT
	movq	24(%rsp), %rsi
	leaq	40(%rsp), %rdi
	movq	%rax, %r14
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	48(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	56(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdx
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	56(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movl	$8388609, %eax
	leaq	112(%rsp), %rsi
	movl	$2, %edi
	movl	$1, 96(%rsp)
	salq	$9, %rax
	movl	$1, 108(%rsp)
	xorl	%r12d, %r12d
	leaq	64(%rsp), %r13
	movq	%rax, 88(%rsp)
	addq	$3181, %rax
	movq	%rax, 100(%rsp)
	call	clock_gettime@PLT
.L42:
	xorl	%eax, %eax
	movl	$4, %esi
	movq	%r13, %rdi
	movl	%eax, (%r14)
	call	cudaMalloc@PLT
	movq	64(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	movq	%r14, %rsi
	call	cudaMemcpy@PLT
	movl	96(%rsp), %ecx
	movq	88(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	100(%rsp), %rdi
	movl	108(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	movq	64(%rsp), %rdx
	testl	%eax, %eax
	jne	.L41
	movq	56(%rsp), %rcx
	movq	48(%rsp), %rsi
	movq	40(%rsp), %rdi
	call	_Z41__device_stub__Z4ssspPSt4pairIiiEPiS2_S2_PSt4pairIiiEPiS2_S2_
.L41:
	movq	64(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	movq	%r14, %rdi
	call	cudaMemcpy@PLT
	incl	%r12d
	cmpl	$1, (%r14)
	je	.L42
	leaq	128(%rsp), %rsi
	movl	$2, %edi
	call	clock_gettime@PLT
	movq	(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	%rbx, %rdi
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	leaq	_ZSt4cout(%rip), %r13
	leaq	.LC1(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %r14
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC3(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	136(%rsp), %rax
	subq	120(%rsp), %rax
	cvtsi2sdq	%rax, %xmm0
	movq	128(%rsp), %rax
	subq	112(%rsp), %rax
	divsd	.LC4(%rip), %xmm0
	cvtsi2sdq	%rax, %xmm1
	addsd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	176(%rsp), %r13
	movl	$16, %edx
	leaq	.LC5(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE1:
	xorl	%r12d, %r12d
	leaq	.LC6(%rip), %r15
.L43:
	cmpl	%r12d, %ebp
	jle	.L62
	leal	1(%r12), %esi
	movq	%r13, %rdi
.LEHB2:
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%r15, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%rbx,%r12,4), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE2:
	incq	%r12
	jmp	.L43
.L62:
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	144(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	688(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1208(%rsp), %rax
	subq	%fs:40, %rax
	je	.L48
	jmp	.L55
.L51:
	endbr64
	movq	%rax, %rbx
.L45:
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L46
.L50:
	endbr64
	movq	%rax, %rbx
.L46:
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1208(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L55:
	call	__stack_chk_fail@PLT
.L48:
	addq	$1224, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4588:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4588:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4588-.LLSDACSB4588
.LLSDACSB4588:
	.uleb128 .LEHB0-.LFB4588
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4588
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L50-.LFB4588
	.uleb128 0
	.uleb128 .LEHB2-.LFB4588
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L51-.LFB4588
	.uleb128 0
	.uleb128 .LEHB3-.LFB4588
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE4588:
	.section	.text.startup
	.size	main, .-main
	.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
.LC4:
	.long	0
	.long	1104006501
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<iterator>
#include<ctime>
#include<limits>
#include<list>
#include<algorithm>

using namespace std;

struct info_edge     
{
int vertex1,vertex2;
int edge;
};

//This function to extract data from file
void extract_data(info_edge &info,char* str)
{
int i,m=0;
int vertex[2];
int weight;
vertex[0]=0;
vertex[1]=0;
for(i=2;i<strlen(&str[0])-1;i++)
{
if(str[i]!=' ')
{
vertex[m]*=10;
vertex[m]+=(int)str[i]-48;
}
else if(m<1)
{
m++;
}
else
break;
}
weight=0;
i++;
while(i<strlen(&str[0]))
{
weight*=10;
weight+=(int)str[i]-48;
i++;
}
info.vertex1=--vertex[0];
info.vertex2=--vertex[1];
info.edge=weight;
}



//This is the kernel
__global__ void sssp(pair<int,int>* adjacency,int* dist,int* change,int* count)
{
int n=blockDim.x*blockIdx.x + threadIdx.x;
int n1=n*10;
//if(n%10000==0)
//printf("%d\t",count[n]);
if(dist[n]!=2147483647)
for(int i=0;i<count[n];i++)
{
if(dist[adjacency[n1+i].first] > adjacency[n1+i].second + dist[n])
{
change[0]=1;
dist[adjacency[n1+i].first] = adjacency[n1+i].second + dist[n];
}
}
}

int main(int argc,char** argv)
{
struct timespec start,finish;
ifstream in(argv[2]);
string str;
for(int i=0;i<4;i++)
getline(in,str);

getline(in,str);
int vertex=0;
int edge=0;
int i=5;

//these 2 while loop for finding number of veritices and edges
while(str[i]!=' ')
{
vertex*=10;
vertex+=(int)str[i]-48;
i++;
}
i++;
while(i<strlen(&str[0])-1)
{
edge*=10;
edge+=(int)str[i]-48;
i++;
}
vertex++;



pair<int,int>* adjacency1=new pair<int,int>[vertex*10];//datasructure of graph
int* count1=new int[vertex];

for(i=0;i<2;i++)
getline(in,str);
int* dist1=new int[vertex];

int source=atoi(argv[1]);
dist1[source]=0;

for(int i=0;i<vertex;i++)
{
count1[i]=0;
if(i!=source)
dist1[i]=std::numeric_limits<int>::max();
}
info_edge info;
pair<int,int> sub_info;


while(!in.eof())    		//loop on each line of file
{
getline(in,str);
extract_data(info,&str[0]);
sub_info.first=info.vertex2;
sub_info.second=info.edge;
adjacency1[info.vertex1*10+count1[info.vertex1]]=sub_info;
count1[info.vertex1]++;
}


pair<int,int>* adjacency;
int *dist,*count;
int* change1=new int[1];
int* change;

hipMalloc((void**)&adjacency,sizeof(int)*2*vertex*10);
hipMalloc((void**)&dist,sizeof(int)*vertex);
hipMalloc((void**)&count,sizeof(int)*vertex);
hipMemcpy(adjacency,adjacency1,sizeof(int)*2*vertex*10,hipMemcpyHostToDevice);
hipMemcpy(dist,dist1,sizeof(int)*vertex,hipMemcpyHostToDevice);
hipMemcpy(count,count1,sizeof(int)*vertex,hipMemcpyHostToDevice);
dim3 dimBlock(512);
dim3 dimGrid(3693);

int iteration=0;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&start);


do
{
change1[0]=0;
hipMalloc((void**)&change,sizeof(int));
hipMemcpy(change,change1,sizeof(int),hipMemcpyHostToDevice);

sssp<<<dimGrid,dimBlock>>>(adjacency,dist,change,count);

hipMemcpy(change1,change,sizeof(int),hipMemcpyDeviceToHost);
iteration++;
}while(change1[0]==1);

clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&finish);
hipMemcpy(dist1,dist,sizeof(int)*vertex,hipMemcpyDeviceToHost);



cout<<"no.of iterations: "<<iteration<<"\n";
cout<<"Time taken\t"<<(finish.tv_sec-start.tv_sec)+(finish.tv_nsec-start.tv_nsec)/1e09<<"\n";
ofstream out("output.txt");
for(int i=0;i<vertex-1;i++)
out<<i+1<<"\t"<<dist1[i]<<"\n";
return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z12extract_dataR9info_edgePc   # -- Begin function _Z12extract_dataR9info_edgePc
	.type	_Z12extract_dataR9info_edgePc,@function
_Z12extract_dataR9info_edgePc:          # @_Z12extract_dataR9info_edgePc
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	$0, (%rsp)
	movq	%rsi, %rdi
	callq	strlen
	leaq	-1(%rax), %rcx
	xorl	%edx, %edx
	cmpq	$3, %rcx
	jb	.LBB0_10
# %bb.1:                                # %.lr.ph.preheader
	movl	$4294967295, %edx               # imm = 0xFFFFFFFF
	addq	%rax, %rdx
	movl	$3, %esi
	subq	%rax, %rsi
	xorl	%edi, %edi
	movl	$2, %ecx
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsbl	(%r14,%rcx), %r8d
	cmpl	$32, %r8d
	jne	.LBB0_3
# %bb.4:                                #   in Loop: Header=BB0_2 Depth=1
	testl	%edi, %edi
	movl	$1, %edi
	jle	.LBB0_5
	jmp	.LBB0_7
.LBB0_3:                                #   in Loop: Header=BB0_2 Depth=1
	movl	%edi, %r9d
	movl	(%rsp,%r9,4), %r10d
	leal	(%r10,%r10,4), %r10d
	leal	(%r8,%r10,2), %r8d
	addl	$-48, %r8d
	movl	%r8d, (%rsp,%r9,4)
.LBB0_5:                                #   in Loop: Header=BB0_2 Depth=1
	leaq	(%rsi,%rcx), %r8
	incq	%r8
	incq	%rcx
	cmpq	$2, %r8
	jne	.LBB0_2
# %bb.6:
	movq	%rdx, %rcx
.LBB0_7:                                # %._crit_edge
	incl	%ecx
	xorl	%edx, %edx
	cmpq	%rcx, %rax
	jbe	.LBB0_10
# %bb.8:                                # %.lr.ph37.preheader
	xorl	%edx, %edx
.LBB0_9:                                # %.lr.ph37
                                        # =>This Inner Loop Header: Depth=1
	leal	(%rdx,%rdx,4), %edx
	movsbl	(%r14,%rcx), %esi
	leal	(%rsi,%rdx,2), %edx
	addl	$-48, %edx
	incq	%rcx
	cmpq	%rcx, %rax
	ja	.LBB0_9
.LBB0_10:                               # %._crit_edge38
	movl	(%rsp), %eax
	decl	%eax
	movl	%eax, (%rbx)
	movl	4(%rsp), %eax
	decl	%eax
	movl	%eax, 4(%rbx)
	movl	%edx, 8(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z12extract_dataR9info_edgePc, .Lfunc_end0-_Z12extract_dataR9info_edgePc
	.cfi_endproc
                                        # -- End function
	.globl	_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_ # -- Begin function _Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_
	.type	_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_,@function
_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_: # @_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z4ssspPSt4pairIiiEPiS2_S2_, %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	_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_, .Lfunc_end1-_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI2_0:
	.quad	0x41cdcd6500000000              # double 1.0E+9
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %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	$1192, %rsp                     # imm = 0x4A8
	.cfi_def_cfa_offset 1248
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r13
	movq	16(%rsi), %rsi
	leaq	160(%rsp), %rbx
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	leaq	80(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
	movl	$4, %ebp
	leaq	64(%rsp), %r14
.LBB2_1:                                # =>This Inner Loop Header: Depth=1
	movq	160(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp0:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp1:
# %bb.2:                                # %.noexc102
                                        #   in Loop: Header=BB2_1 Depth=1
.Ltmp2:
	movsbl	%al, %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp3:
# %bb.3:                                # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit104
                                        #   in Loop: Header=BB2_1 Depth=1
	decl	%ebp
	jne	.LBB2_1
# %bb.4:
	movq	160(%rsp), %rax
	addq	-24(%rax), %rbx
.Ltmp5:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp6:
# %bb.5:                                # %.noexc
.Ltmp7:
	movsbl	%al, %edx
	leaq	160(%rsp), %rbx
	leaq	64(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp8:
# %bb.6:                                # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit.preheader
	movq	64(%rsp), %rax
	movb	5(%rax), %cl
	xorl	%r12d, %r12d
	cmpb	$32, %cl
	je	.LBB2_9
# %bb.7:                                # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit.preheader180
	addq	$6, %rax
	xorl	%r12d, %r12d
.LBB2_8:                                # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
                                        # =>This Inner Loop Header: Depth=1
	leal	(%r12,%r12,4), %edx
	movsbl	%cl, %ecx
	leal	(%rcx,%rdx,2), %r12d
	addl	$-48, %r12d
	movb	(%rax), %cl
	incq	%rax
	cmpb	$32, %cl
	jne	.LBB2_8
.LBB2_9:                                # %._crit_edge
	leal	2(,%r12,2), %eax
	leal	(%rax,%rax,4), %eax
	movslq	%eax, %r14
	shlq	$3, %r14
	cmpl	$-1, %r12d
	movq	$-1, %rdi
	cmovgeq	%r14, %rdi
.Ltmp10:
	callq	_Znam
.Ltmp11:
# %bb.10:
	movq	%rax, %r15
	movl	%r12d, %ebp
	incl	%ebp
	je	.LBB2_12
# %bb.11:                               # %.loopexit136.loopexit
	movq	%r15, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	memset@PLT
.LBB2_12:                               # %.loopexit136
	movq	%r13, 104(%rsp)                 # 8-byte Spill
	movl	%ebp, 36(%rsp)                  # 4-byte Spill
	movslq	%ebp, %rax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	leaq	(,%rax,4), %rax
	movq	%r12, 40(%rsp)                  # 8-byte Spill
	cmpl	$-1, %r12d
	movq	$-1, %r14
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	cmovgeq	%rax, %r14
.Ltmp13:
	movq	%r14, %rdi
	callq	_Znam
.Ltmp14:
# %bb.13:                               # %.preheader.preheader
	movq	%rax, %r12
	movb	$1, %r13b
	leaq	64(%rsp), %rbp
.LBB2_14:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	160(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp16:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp17:
# %bb.15:                               # %.noexc105
                                        #   in Loop: Header=BB2_14 Depth=1
.Ltmp18:
	movsbl	%al, %edx
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp19:
# %bb.16:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit107
                                        #   in Loop: Header=BB2_14 Depth=1
	testb	$1, %r13b
	movl	$0, %r13d
	jne	.LBB2_14
# %bb.17:
.Ltmp21:
	movq	%r14, %rdi
	callq	_Znam
.Ltmp22:
# %bb.18:
	movq	%rax, %rbx
	movq	104(%rsp), %rax                 # 8-byte Reload
	movq	8(%rax), %rdi
	callq	atoi
	movslq	%eax, %rcx
	movl	$0, (%rbx,%rcx,4)
	cmpl	$0, 40(%rsp)                    # 4-byte Folded Reload
	movl	36(%rsp), %ecx                  # 4-byte Reload
	js	.LBB2_23
# %bb.19:                               # %.lr.ph153.preheader
	movl	%eax, %eax
	movl	%ecx, %ecx
	xorl	%edx, %edx
.LBB2_20:                               # %.lr.ph153
                                        # =>This Inner Loop Header: Depth=1
	movl	$0, (%r12,%rdx,4)
	cmpq	%rdx, %rax
	je	.LBB2_22
# %bb.21:                               #   in Loop: Header=BB2_20 Depth=1
	movl	$2147483647, (%rbx,%rdx,4)      # imm = 0x7FFFFFFF
.LBB2_22:                               #   in Loop: Header=BB2_20 Depth=1
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB2_20
.LBB2_23:                               # %._crit_edge154
	movq	160(%rsp), %rax
	movq	-24(%rax), %rax
	testb	$2, 192(%rsp,%rax)
	jne	.LBB2_28
# %bb.24:
	leaq	(%rsp,%rax), %rdi
	addq	$160, %rdi
	leaq	160(%rsp), %r14
	leaq	64(%rsp), %r13
	leaq	116(%rsp), %rbp
.LBB2_25:                               # =>This Inner Loop Header: Depth=1
.Ltmp24:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp25:
# %bb.26:                               # %.noexc108
                                        #   in Loop: Header=BB2_25 Depth=1
.Ltmp26:
	movsbl	%al, %edx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp27:
# %bb.27:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit110
                                        #   in Loop: Header=BB2_25 Depth=1
	movq	64(%rsp), %rsi
	movq	%rbp, %rdi
	callq	_Z12extract_dataR9info_edgePc
	movq	120(%rsp), %rax
	movslq	116(%rsp), %rcx
	leaq	(%rcx,%rcx,4), %rdx
	movslq	(%r12,%rcx,4), %rsi
	leaq	(%rsi,%rdx,2), %rdx
	movq	%rax, (%r15,%rdx,8)
	leal	1(%rsi), %eax
	movl	%eax, (%r12,%rcx,4)
	movq	160(%rsp), %rax
	movq	-24(%rax), %rax
	leaq	(%rsp,%rax), %rdi
	addq	$160, %rdi
	testb	$2, 32(%rdi)
	je	.LBB2_25
.LBB2_28:                               # %._crit_edge158
.Ltmp29:
	movl	$4, %edi
	callq	_Znam
.Ltmp30:
# %bb.29:
	movq	%rax, %r13
	movq	96(%rsp), %rax                  # 8-byte Reload
	shlq	$4, %rax
	leaq	(%rax,%rax,4), %r14
.Ltmp32:
	leaq	56(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
.Ltmp33:
# %bb.30:
.Ltmp34:
	leaq	24(%rsp), %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	callq	hipMalloc
.Ltmp35:
# %bb.31:
.Ltmp36:
	leaq	48(%rsp), %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	callq	hipMalloc
.Ltmp37:
# %bb.32:
	movq	56(%rsp), %rdi
.Ltmp38:
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp39:
# %bb.33:
	movq	24(%rsp), %rdi
.Ltmp40:
	movq	%rbx, %rsi
	movq	8(%rsp), %rdx                   # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp41:
# %bb.34:
	movq	48(%rsp), %rdi
.Ltmp42:
	movq	%r12, %rsi
	movq	8(%rsp), %rdx                   # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp43:
# %bb.35:
	leaq	144(%rsp), %rsi
	movl	$2, %edi
	callq	clock_gettime
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r12
	movabsq	$4294970989, %rbp               # imm = 0x100000E6D
	movabsq	$4294967808, %r14               # imm = 0x100000200
.LBB2_36:                               # =>This Inner Loop Header: Depth=1
	movl	$0, (%r13)
.Ltmp45:
	movl	$4, %esi
	movq	%r12, %rdi
	callq	hipMalloc
.Ltmp46:
# %bb.37:                               #   in Loop: Header=BB2_36 Depth=1
	movq	16(%rsp), %rdi
.Ltmp47:
	movl	$4, %edx
	movq	%r13, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp48:
# %bb.38:                               #   in Loop: Header=BB2_36 Depth=1
.Ltmp49:
	movq	%rbp, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp50:
# %bb.39:                               #   in Loop: Header=BB2_36 Depth=1
	testl	%eax, %eax
	jne	.LBB2_41
# %bb.40:                               #   in Loop: Header=BB2_36 Depth=1
	movq	56(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	movq	48(%rsp), %rcx
.Ltmp51:
	callq	_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_
.Ltmp52:
.LBB2_41:                               #   in Loop: Header=BB2_36 Depth=1
	movq	16(%rsp), %rsi
.Ltmp53:
	movl	$4, %edx
	movq	%r13, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp54:
# %bb.42:                               #   in Loop: Header=BB2_36 Depth=1
	incl	%r15d
	cmpl	$1, (%r13)
	je	.LBB2_36
# %bb.43:
	leaq	128(%rsp), %rsi
	movl	$2, %edi
	callq	clock_gettime
	movq	24(%rsp), %rsi
.Ltmp56:
	movq	%rbx, %rdi
	movq	8(%rsp), %rdx                   # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp57:
# %bb.44:
.Ltmp58:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp59:
# %bb.45:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp60:
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
.Ltmp61:
# %bb.46:
.Ltmp62:
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp63:
# %bb.47:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit113
.Ltmp64:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp65:
# %bb.48:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit115
	movq	128(%rsp), %rax
	movq	136(%rsp), %rcx
	subq	144(%rsp), %rax
	cvtsi2sd	%rax, %xmm1
	subq	152(%rsp), %rcx
	cvtsi2sd	%rcx, %xmm0
	divsd	.LCPI2_0(%rip), %xmm0
	addsd	%xmm1, %xmm0
.Ltmp66:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp67:
# %bb.49:                               # %_ZNSolsEd.exit
.Ltmp68:
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp69:
# %bb.50:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit118
.Ltmp71:
	leaq	680(%rsp), %rdi
	movl	$.L.str.3, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp72:
# %bb.51:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit122.preheader
	xorl	%r12d, %r12d
	movq	40(%rsp), %r13                  # 8-byte Reload
	testl	%r13d, %r13d
	cmovlel	%r12d, %r13d
	leaq	680(%rsp), %r14
.LBB2_52:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit122
                                        # =>This Inner Loop Header: Depth=1
	cmpq	%r12, %r13
	je	.LBB2_57
# %bb.53:                               #   in Loop: Header=BB2_52 Depth=1
	leal	1(%r12), %esi
.Ltmp74:
	movq	%r14, %rdi
	callq	_ZNSolsEi
.Ltmp75:
# %bb.54:                               #   in Loop: Header=BB2_52 Depth=1
.Ltmp76:
	movq	%rax, %r15
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp77:
# %bb.55:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit120
                                        #   in Loop: Header=BB2_52 Depth=1
	movl	(%rbx,%r12,4), %esi
.Ltmp78:
	movq	%r15, %rdi
	callq	_ZNSolsEi
.Ltmp79:
# %bb.56:                               #   in Loop: Header=BB2_52 Depth=1
	incq	%r12
.Ltmp80:
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp81:
	jmp	.LBB2_52
.LBB2_57:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	688(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 680(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	928(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_59
# %bb.58:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB2_59:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	160(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	xorl	%eax, %eax
	addq	$1192, %rsp                     # imm = 0x4A8
	.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
.LBB2_60:
	.cfi_def_cfa_offset 1248
.Ltmp73:
	jmp	.LBB2_73
.LBB2_61:
.Ltmp31:
	jmp	.LBB2_73
.LBB2_62:
.Ltmp23:
	jmp	.LBB2_73
.LBB2_63:                               # %.loopexit.split-lp132
.Ltmp15:
	jmp	.LBB2_73
.LBB2_64:
.Ltmp12:
	jmp	.LBB2_73
.LBB2_65:
.Ltmp9:
	jmp	.LBB2_73
.LBB2_66:
.Ltmp44:
	jmp	.LBB2_73
.LBB2_67:                               # %.loopexit.split-lp
.Ltmp70:
	jmp	.LBB2_73
.LBB2_68:
.Ltmp28:
	jmp	.LBB2_73
.LBB2_69:                               # %.loopexit131
.Ltmp20:
	jmp	.LBB2_73
.LBB2_70:
.Ltmp4:
	jmp	.LBB2_73
.LBB2_71:
.Ltmp82:
	movq	%rax, %rbx
	leaq	680(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	jmp	.LBB2_74
.LBB2_72:                               # %.loopexit
.Ltmp55:
.LBB2_73:
	movq	%rax, %rbx
.LBB2_74:
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_76
# %bb.75:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i123
	callq	_ZdlPv
.LBB2_76:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit125
	leaq	160(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp8-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp8
	.uleb128 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp11-.Ltmp10                #   Call between .Ltmp10 and .Ltmp11
	.uleb128 .Ltmp12-.Lfunc_begin0          #     jumps to .Ltmp12
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp11-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp13-.Ltmp11                #   Call between .Ltmp11 and .Ltmp13
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp14-.Ltmp13                #   Call between .Ltmp13 and .Ltmp14
	.uleb128 .Ltmp15-.Lfunc_begin0          #     jumps to .Ltmp15
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp16-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp19-.Ltmp16                #   Call between .Ltmp16 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin0          #     jumps to .Ltmp20
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp22-.Ltmp21                #   Call between .Ltmp21 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin0          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp27-.Ltmp24                #   Call between .Ltmp24 and .Ltmp27
	.uleb128 .Ltmp28-.Lfunc_begin0          #     jumps to .Ltmp28
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp30-.Ltmp29                #   Call between .Ltmp29 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp43-.Ltmp32                #   Call between .Ltmp32 and .Ltmp43
	.uleb128 .Ltmp44-.Lfunc_begin0          #     jumps to .Ltmp44
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp54-.Ltmp45                #   Call between .Ltmp45 and .Ltmp54
	.uleb128 .Ltmp55-.Lfunc_begin0          #     jumps to .Ltmp55
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp56-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp69-.Ltmp56                #   Call between .Ltmp56 and .Ltmp69
	.uleb128 .Ltmp70-.Lfunc_begin0          #     jumps to .Ltmp70
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp72-.Ltmp71                #   Call between .Ltmp71 and .Ltmp72
	.uleb128 .Ltmp73-.Lfunc_begin0          #     jumps to .Ltmp73
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp74-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp81-.Ltmp74                #   Call between .Ltmp74 and .Ltmp81
	.uleb128 .Ltmp82-.Lfunc_begin0          #     jumps to .Ltmp82
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp81-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Lfunc_end2-.Ltmp81            #   Call between .Ltmp81 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4ssspPSt4pairIiiEPiS2_S2_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z4ssspPSt4pairIiiEPiS2_S2_,@object # @_Z4ssspPSt4pairIiiEPiS2_S2_
	.section	.rodata,"a",@progbits
	.globl	_Z4ssspPSt4pairIiiEPiS2_S2_
	.p2align	3, 0x0
_Z4ssspPSt4pairIiiEPiS2_S2_:
	.quad	_Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_
	.size	_Z4ssspPSt4pairIiiEPiS2_S2_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"no.of iterations: "
	.size	.L.str, 19

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Time taken\t"
	.size	.L.str.2, 12

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"output.txt"
	.size	.L.str.3, 11

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"\t"
	.size	.L.str.4, 2

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z4ssspPSt4pairIiiEPiS2_S2_"
	.size	.L__unnamed_1, 28

	.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

	.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 _Z19__device_stub__ssspPSt4pairIiiEPiS2_S2_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z4ssspPSt4pairIiiEPiS2_S2_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4ssspPSt4pairIiiEPiS2_S2_ ; -- Begin function _Z4ssspPSt4pairIiiEPiS2_S2_
	.globl	_Z4ssspPSt4pairIiiEPiS2_S2_
	.p2align	8
	.type	_Z4ssspPSt4pairIiiEPiS2_S2_,@function
_Z4ssspPSt4pairIiiEPiS2_S2_:            ; @_Z4ssspPSt4pairIiiEPiS2_S2_
; %bb.0:
	s_clause 0x1
	s_load_b32 s8, s[0:1], 0x2c
	s_load_b256 s[0:7], s[0:1], 0x0
	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[4:5], null, s15, s8, v[0:1]
	s_mov_b32 s8, exec_lo
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[4:5]
	v_add_co_u32 v0, vcc_lo, s2, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v3, vcc_lo
	global_load_b32 v5, v[0:1], off
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e32 0x7fffffff, v5
	s_cbranch_execz .LBB0_6
; %bb.1:                                ; %.preheader
	v_add_co_u32 v2, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v3, vcc_lo
	s_mov_b32 s6, 0
	global_load_b32 v6, v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, 0, v6
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_6
; %bb.2:                                ; %.lr.ph.preheader
	v_mul_lo_u32 v4, v4, 10
	v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v8, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v5, 31, v4
	v_lshlrev_b64 v[4:5], 3, v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v4, s0
	v_add_co_ci_u32_e32 v5, vcc_lo, s1, v5, vcc_lo
	s_mov_b32 s1, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
.LBB0_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[9:10], v[4:5], off offset:-4
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v12, 31, v9
	v_mov_b32_e32 v11, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[11:12], 2, v[11:12]
	v_add_co_u32 v11, vcc_lo, s2, v11
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v12, vcc_lo, s3, v12, vcc_lo
	s_clause 0x1
	global_load_b32 v9, v[0:1], off
	global_load_b32 v11, v[11:12], off
	s_waitcnt vmcnt(1)
	v_add_nc_u32_e32 v9, v9, v10
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 v11, v9
	s_cbranch_execz .LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	global_store_b32 v7, v8, s[4:5]
	global_load_b64 v[9:10], v[4:5], off offset:-4
	global_load_b32 v6, v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v6, v6, v10
	v_ashrrev_i32_e32 v10, 31, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[9:10], 2, v[9:10]
	v_add_co_u32 v9, vcc_lo, s2, v9
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v10, vcc_lo, s3, v10, vcc_lo
	global_store_b32 v[9:10], v6, off
	global_load_b32 v6, v[2:3], off
.LBB0_5:                                ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	s_add_i32 s1, s1, 1
	v_add_co_u32 v4, s0, v4, 8
	s_waitcnt vmcnt(0)
	v_cmp_ge_i32_e32 vcc_lo, s1, v6
	v_add_co_ci_u32_e64 v5, s0, 0, v5, s0
	s_or_b32 s6, vcc_lo, s6
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s6
	s_cbranch_execnz .LBB0_3
.LBB0_6:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4ssspPSt4pairIiiEPiS2_S2_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 13
		.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	_Z4ssspPSt4pairIiiEPiS2_S2_, .Lfunc_end0-_Z4ssspPSt4pairIiiEPiS2_S2_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 452
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z4ssspPSt4pairIiiEPiS2_S2_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4ssspPSt4pairIiiEPiS2_S2_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
