#include <stdio.h>
#include <iostream>
#include <cuda.h>
#include <math.h>
#include <chrono>
#include <random>
#include <bits/stdc++.h>
using namespace std;

int random_in_range( int minimum, int maximum )
{
  thread_local std::ranlux48 rng( 
    std::chrono::system_clock::now().time_since_epoch().count() );
  return std::uniform_int_distribution <int> ( minimum, maximum )( rng );
}

__global__ void add(int *i, int *j, int *k) {
    int bid = blockIdx.x;
    k[bid] = i[bid] + j[bid];
}

void random_init(int *arr, int n) {
    for(int i = 0 ; i < n ; i++) {
        arr[i] = random_in_range(100,400);
    }
}

void add_cpu(int *i, int *j, int *k, int n) {
    for(int p = 0 ; p < n ; p++) {
        k[p] = i[p] + j[p]; 
    }
}

int main() {
    int n = 20000;
    int *a, *b;
    int c[n];
    int *i, *j, *k;
    int size = n * sizeof(int);

    a = new int[n];
    b = new int[n];
    random_init(a,n);
    random_init(b,n);

    cout<<"First: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<a[i]<<" ";
    }
    cout<<endl;
    
    cout<<"Second: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<b[i]<<" ";
    }
    cout<<endl;
    
    cudaMalloc((void **)&i,size);
    cudaMalloc((void **)&j,size);
    cudaMalloc((void **)&k,size);

    cudaMemcpy(i,a,size,cudaMemcpyHostToDevice);
    cudaMemcpy(j,b,size,cudaMemcpyHostToDevice);

    float gpu_elapsed_time;
    cudaEvent_t gpu_start,gpu_stop;
    cudaEventCreate(&gpu_start);
    cudaEventCreate(&gpu_stop);
    cudaEventRecord(gpu_start,0);
    add<<<n,1>>>(i,j,k);
    cudaEventRecord(gpu_stop, 0);
    cudaEventSynchronize(gpu_stop);
    cudaEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    cudaEventDestroy(gpu_start);
    cudaEventDestroy(gpu_stop);

    cudaMemcpy(c,k,size,cudaMemcpyDeviceToHost);

    cout<<endl;
    cout<<"GPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds";
    cout<<endl;
    cout<<"Parallel Result: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<c[i]<<" ";
    }
    cout<<endl;
    cout<<endl;

    cudaEventCreate(&gpu_start);
    cudaEventCreate(&gpu_stop);
    cudaEventRecord(gpu_start,0);
    add_cpu(a,b,c,n);
    cudaEventRecord(gpu_stop, 0);
    cudaEventSynchronize(gpu_stop);
    cudaEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    cudaEventDestroy(gpu_start);
    cudaEventDestroy(gpu_stop);

    cout<<"CPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds";
    cout<<endl;

    cout<<"Serial Result: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<c[i]<<" ";
    }
    cout<<endl;

    cudaFree(i);
    cudaFree(j);
    cudaFree(k);

    return 0;
}
	.file	"tmpxft_002ae462_00000000-6_part1.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB10831:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE10831:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB12593:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE12593:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z7add_cpuPiS_S_i
	.type	_Z7add_cpuPiS_S_i, @function
_Z7add_cpuPiS_S_i:
.LFB10827:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L4:
	cmpl	%eax, %ecx
	jle	.L7
	movl	(%rsi,%rax,4), %r8d
	addl	(%rdi,%rax,4), %r8d
	movl	%r8d, (%rdx,%rax,4)
	incq	%rax
	jmp	.L4
.L7:
	ret
	.cfi_endproc
.LFE10827:
	.size	_Z7add_cpuPiS_S_i, .-_Z7add_cpuPiS_S_i
	.globl	_Z26__device_stub__Z3addPiS_S_PiS_S_
	.type	_Z26__device_stub__Z3addPiS_S_PiS_S_, @function
_Z26__device_stub__Z3addPiS_S_PiS_S_:
.LFB10853:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z3addPiS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L8:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10853:
	.size	_Z26__device_stub__Z3addPiS_S_PiS_S_, .-_Z26__device_stub__Z3addPiS_S_PiS_S_
	.globl	_Z3addPiS_S_
	.type	_Z3addPiS_S_, @function
_Z3addPiS_S_:
.LFB10854:
	.cfi_startproc
	endbr64
	jmp	_Z26__device_stub__Z3addPiS_S_PiS_S_
	.cfi_endproc
.LFE10854:
	.size	_Z3addPiS_S_, .-_Z3addPiS_S_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z3addPiS_S_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB10856:
	.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	_Z3addPiS_S_(%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
.LFE10856:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv,"axG",@progbits,_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv,comdat
	.align 2
	.weak	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	.type	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv, @function
_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv:
.LFB12319:
	.cfi_startproc
	endbr64
	movq	104(%rdi), %rdx
	movq	%rdx, %rax
	subq	$5, %rax
	jns	.L16
	leaq	7(%rdx), %rax
.L16:
	movq	(%rdi,%rax,8), %rax
	movq	96(%rdi), %rcx
	addq	(%rdi,%rdx,8), %rcx
	cmpq	%rcx, %rax
	jb	.L17
	subq	%rcx, %rax
	xorl	%ecx, %ecx
	jmp	.L18
.L17:
	movl	$1, %esi
	salq	$48, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %rax
.L18:
	movq	%rcx, 96(%rdi)
	movq	%rax, (%rdi,%rdx,8)
	incq	%rdx
	cmpq	$11, %rdx
	jbe	.L19
	xorl	%edx, %edx
.L19:
	movq	%rdx, 104(%rdi)
	ret
	.cfi_endproc
.LFE12319:
	.size	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv, .-_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	.section	.text._ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,"axG",@progbits,_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,comdat
	.align 2
	.weak	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.type	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv, @function
_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv:
.LFB12172:
	.cfi_startproc
	endbr64
	movq	112(%rdi), %rax
	cmpq	$10, %rax
	jbe	.L25
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$389, %ebp
	subq	%rax, %rbp
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
.L22:
	testq	%rbp, %rbp
	je	.L29
	movq	%rdi, 8(%rsp)
	decq	%rbp
	call	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	movq	8(%rsp), %rdi
	jmp	.L22
.L29:
	xorl	%eax, %eax
	movq	%rax, 112(%rdi)
	incq	112(%rdi)
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	.L28
.L25:
	incq	112(%rdi)
.L28:
	jmp	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	.cfi_endproc
.LFE12172:
	.size	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv, .-_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.text
	.align 2
	.type	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0, @function
_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0:
.LFB12596:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%esi, %rax
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	subq	%rax, %r13
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rax, %rbp
	movabsq	$281474976710654, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rcx
	.cfi_def_cfa_offset 48
	cmpq	%r13, %rax
	jb	.L36
	incq	%r13
	incq	%rax
	xorl	%edx, %edx
	divq	%r13
	imulq	%rax, %r13
	movq	%rax, %rbx
.L32:
	movq	%r12, %rdi
	call	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	cmpq	%r13, %rax
	jnb	.L32
	xorl	%edx, %edx
	divq	%rbx
	jmp	.L33
.L40:
	testq	%rdx, %rdx
	je	.L33
.L36:
	movl	$65535, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0
	movq	%r12, %rdi
	movl	%eax, %ebx
	call	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	movq	%rbx, %rdx
	salq	$48, %rdx
	addq	%rdx, %rax
	setc	%dl
	movzbl	%dl, %edx
	cmpq	%rax, %r13
	jnb	.L40
	jmp	.L36
.L33:
	popq	%rdx
	.cfi_def_cfa_offset 40
	addl	%ebp, %eax
	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
.LFE12596:
	.size	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0, .-_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0
	.globl	_Z15random_in_rangeii
	.type	_Z15random_in_rangeii, @function
_Z15random_in_rangeii:
.LFB10825:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 32
	cmpb	$0, %fs:_ZGVZ15random_in_rangeiiE3rng@tpoff
	jne	.L42
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$19780503, %edx
	testq	%rax, %rax
	je	.L43
	movl	$2147483563, %ecx
	xorl	%edx, %edx
	divq	%rcx
.L43:
	testl	%edx, %edx
	movl	$1, %eax
	movl	$53668, %edi
	movabsq	$281474976710655, %r8
	cmovne	%edx, %eax
	xorl	%esi, %esi
.L44:
	xorl	%edx, %edx
	divl	%edi
	imull	$40014, %edx, %edx
	imull	$12211, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%ecx, %edx
	jnb	.L48
	leal	2147483563(%rdx), %eax
	subl	%ecx, %eax
.L48:
	xorl	%edx, %edx
	movl	%eax, %r9d
	divl	%edi
	imull	$40014, %edx, %edx
	imull	$12211, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%ecx, %edx
	jnb	.L45
	leal	2147483563(%rdx), %eax
	subl	%ecx, %eax
.L45:
	movq	%rax, %rdx
	salq	$32, %rdx
	addq	%r9, %rdx
	andq	%r8, %rdx
	movq	%rdx, %fs:_ZZ15random_in_rangeiiE3rng@tpoff(,%rsi,8)
	incq	%rsi
	cmpq	$12, %rsi
	jne	.L44
	movb	$1, %fs:_ZGVZ15random_in_rangeiiE3rng@tpoff
	xorl	%eax, %eax
	cmpq	$0, %fs:88+_ZZ15random_in_rangeiiE3rng@tpoff
	sete	%al
	xorl	%edx, %edx
	movq	%rax, %fs:96+_ZZ15random_in_rangeiiE3rng@tpoff
	movq	%rdx, %fs:104+_ZZ15random_in_rangeiiE3rng@tpoff
	movq	%rdx, %fs:112+_ZZ15random_in_rangeiiE3rng@tpoff
.L42:
	movq	%fs:0, %rax
	movl	%ebp, %edx
	movl	%ebx, %esi
	leaq	_ZZ15random_in_rangeiiE3rng@tpoff(%rax), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0
	.cfi_endproc
.LFE10825:
	.size	_Z15random_in_rangeii, .-_Z15random_in_rangeii
	.globl	_Z11random_initPii
	.type	_Z11random_initPii, @function
_Z11random_initPii:
.LFB10826:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
.L56:
	cmpl	%ebx, %ebp
	jle	.L59
	movl	$400, %esi
	movl	$100, %edi
	call	_Z15random_in_rangeii
	movl	%eax, (%r12,%rbx,4)
	incq	%rbx
	jmp	.L56
.L59:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10826:
	.size	_Z11random_initPii, .-_Z11random_initPii
	.section	.rodata.str1.1
.LC1:
	.string	"First: "
.LC2:
	.string	" "
.LC3:
	.string	"Second: "
.LC4:
	.string	"GPU Elapsed time is: "
.LC5:
	.string	" milliseconds"
.LC6:
	.string	"Parallel Result: "
.LC7:
	.string	"CPU Elapsed time is: "
.LC8:
	.string	"Serial Result: "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB10828:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-77824(%rsp), %rax
.L61:
	cmpq	%rax, %rsp
	je	.L62
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L61
.L62:
	subq	$2176, %rsp
	orq	$0, 2168(%rsp)
	movl	$80000, %edi
	xorl	%r14d, %r14d
	call	_Znam@PLT
	movl	$80000, %edi
	movq	%rsp, %r13
	movq	%rax, %rbx
	call	_Znam@PLT
	movl	$20000, %esi
	movq	%rbx, %rdi
	movq	%rax, %r12
	call	_Z11random_initPii
	movl	$20000, %esi
	movq	%r12, %rdi
	call	_Z11random_initPii
	leaq	.LC1(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L64:
	movl	(%rbx,%r14,4), %esi
	leaq	_ZSt4cout(%rip), %rdi
	incq	%r14
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$20000, %r14
	jne	.L64
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	xorl	%r14d, %r14d
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC3(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L65:
	movl	(%r12,%r14,4), %esi
	leaq	_ZSt4cout(%rip), %rdi
	incq	%r14
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$20000, %r14
	jne	.L65
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	leaq	-96(%rbp), %r15
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	-120(%rbp), %rdi
	movl	$80000, %esi
	call	cudaMalloc@PLT
	leaq	-112(%rbp), %rdi
	movl	$80000, %esi
	call	cudaMalloc@PLT
	leaq	-104(%rbp), %rdi
	movl	$80000, %esi
	call	cudaMalloc@PLT
	movq	-120(%rbp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	movl	$80000, %edx
	call	cudaMemcpy@PLT
	movq	-112(%rbp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	movl	$80000, %edx
	call	cudaMemcpy@PLT
	movq	%r15, %rdi
	call	cudaEventCreate@PLT
	leaq	-88(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -136(%rbp)
	call	cudaEventCreate@PLT
	movq	-96(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$134218353, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$5, %rdi
	movl	$1, %ecx
	movabsq	$4294967297, %rdx
	movl	$1, %esi
	movq	%rdx, -68(%rbp)
	movl	$1, -60(%rbp)
	movq	%rdi, -80(%rbp)
	movl	$1, -72(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L66
	movq	-104(%rbp), %rdx
	movq	-112(%rbp), %rsi
	movq	-120(%rbp), %rdi
	call	_Z26__device_stub__Z3addPiS_S_PiS_S_
.L66:
	movq	-88(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%r14d, %r14d
	call	cudaEventRecord@PLT
	movq	-88(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-88(%rbp), %rdx
	movq	-96(%rbp), %rsi
	leaq	-68(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -144(%rbp)
	call	cudaEventElapsedTime@PLT
	movq	-96(%rbp), %rdi
	call	cudaEventDestroy@PLT
	movq	-88(%rbp), %rdi
	call	cudaEventDestroy@PLT
	movq	-104(%rbp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdi
	movl	$80000, %edx
	call	cudaMemcpy@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	-68(%rbp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L67:
	movl	0(%r13,%r14,4), %esi
	leaq	_ZSt4cout(%rip), %rdi
	incq	%r14
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$20000, %r14
	jne	.L67
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r15, %rdi
	call	cudaEventCreate@PLT
	movq	-136(%rbp), %rdi
	call	cudaEventCreate@PLT
	movq	-96(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$20000, %ecx
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%ebx, %ebx
	call	_Z7add_cpuPiS_S_i
	movq	-88(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-88(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-88(%rbp), %rdx
	movq	-96(%rbp), %rsi
	movq	-144(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	-96(%rbp), %rdi
	call	cudaEventDestroy@PLT
	movq	-88(%rbp), %rdi
	call	cudaEventDestroy@PLT
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	-68(%rbp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L68:
	movl	0(%r13,%rbx,4), %esi
	leaq	_ZSt4cout(%rip), %rdi
	incq	%rbx
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$20000, %rbx
	jne	.L68
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	-120(%rbp), %rdi
	call	cudaFree@PLT
	movq	-112(%rbp), %rdi
	call	cudaFree@PLT
	movq	-104(%rbp), %rdi
	call	cudaFree@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L69
	call	__stack_chk_fail@PLT
.L69:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10828:
	.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	.tbss,"awT",@nobits
	.align 8
	.type	_ZGVZ15random_in_rangeiiE3rng, @object
	.size	_ZGVZ15random_in_rangeiiE3rng, 8
_ZGVZ15random_in_rangeiiE3rng:
	.zero	8
	.align 8
	.type	_ZZ15random_in_rangeiiE3rng, @object
	.size	_ZZ15random_in_rangeiiE3rng, 120
_ZZ15random_in_rangeiiE3rng:
	.zero	120
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <iostream>
#include <hip/hip_runtime.h>
#include <math.h>
#include <chrono>
#include <random>
#include <bits/stdc++.h>
using namespace std;

int random_in_range( int minimum, int maximum )
{
  thread_local std::ranlux48 rng( 
    std::chrono::system_clock::now().time_since_epoch().count() );
  return std::uniform_int_distribution <int> ( minimum, maximum )( rng );
}

__global__ void add(int *i, int *j, int *k) {
    int bid = blockIdx.x;
    k[bid] = i[bid] + j[bid];
}

void random_init(int *arr, int n) {
    for(int i = 0 ; i < n ; i++) {
        arr[i] = random_in_range(100,400);
    }
}

void add_cpu(int *i, int *j, int *k, int n) {
    for(int p = 0 ; p < n ; p++) {
        k[p] = i[p] + j[p]; 
    }
}

int main() {
    int n = 20000;
    int *a, *b;
    int c[n];
    int *i, *j, *k;
    int size = n * sizeof(int);

    a = new int[n];
    b = new int[n];
    random_init(a,n);
    random_init(b,n);

    cout<<"First: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<a[i]<<" ";
    }
    cout<<endl;
    
    cout<<"Second: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<b[i]<<" ";
    }
    cout<<endl;
    
    hipMalloc((void **)&i,size);
    hipMalloc((void **)&j,size);
    hipMalloc((void **)&k,size);

    hipMemcpy(i,a,size,hipMemcpyHostToDevice);
    hipMemcpy(j,b,size,hipMemcpyHostToDevice);

    float gpu_elapsed_time;
    hipEvent_t gpu_start,gpu_stop;
    hipEventCreate(&gpu_start);
    hipEventCreate(&gpu_stop);
    hipEventRecord(gpu_start,0);
    add<<<n,1>>>(i,j,k);
    hipEventRecord(gpu_stop, 0);
    hipEventSynchronize(gpu_stop);
    hipEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    hipEventDestroy(gpu_start);
    hipEventDestroy(gpu_stop);

    hipMemcpy(c,k,size,hipMemcpyDeviceToHost);

    cout<<endl;
    cout<<"GPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds";
    cout<<endl;
    cout<<"Parallel Result: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<c[i]<<" ";
    }
    cout<<endl;
    cout<<endl;

    hipEventCreate(&gpu_start);
    hipEventCreate(&gpu_stop);
    hipEventRecord(gpu_start,0);
    add_cpu(a,b,c,n);
    hipEventRecord(gpu_stop, 0);
    hipEventSynchronize(gpu_stop);
    hipEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    hipEventDestroy(gpu_start);
    hipEventDestroy(gpu_stop);

    cout<<"CPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds";
    cout<<endl;

    cout<<"Serial Result: ";
    for(int i = 0 ; i < n ; i++) {
        cout<<c[i]<<" ";
    }
    cout<<endl;

    hipFree(i);
    hipFree(j);
    hipFree(k);

    return 0;
}
	.text
	.file	"part1.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z15random_in_rangeii           # -- Begin function _Z15random_in_rangeii
	.type	_Z15random_in_rangeii,@function
_Z15random_in_rangeii:                  # @_Z15random_in_rangeii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.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 %rbp, -16
	movl	%esi, %ebx
	movl	%edi, %ebp
	cmpb	$0, %fs:_ZGVZ15random_in_rangeiiE3rng@TPOFF
	je	.LBB0_1
.LBB0_2:
	movq	%rsp, %rdi
	movl	%ebp, (%rdi)
	movl	%ebx, 4(%rdi)
	movq	%fs:0, %rax
	leaq	_ZZ15random_in_rangeiiE3rng@TPOFF(%rax), %rsi
	movq	%rdi, %rdx
	callq	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_1:
	.cfi_def_cfa_offset 32
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%fs:0, %rcx
	leaq	_ZZ15random_in_rangeiiE3rng@TPOFF(%rcx), %rdi
	movq	%rax, %rsi
	callq	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	movq	$0, %fs:_ZZ15random_in_rangeiiE3rng@TPOFF+112
	movb	$1, %fs:_ZGVZ15random_in_rangeiiE3rng@TPOFF
	jmp	.LBB0_2
.Lfunc_end0:
	.size	_Z15random_in_rangeii, .Lfunc_end0-_Z15random_in_rangeii
	.cfi_endproc
                                        # -- End function
	.globl	_Z18__device_stub__addPiS_S_    # -- Begin function _Z18__device_stub__addPiS_S_
	.type	_Z18__device_stub__addPiS_S_,@function
_Z18__device_stub__addPiS_S_:           # @_Z18__device_stub__addPiS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z3addPiS_S_, %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	_Z18__device_stub__addPiS_S_, .Lfunc_end1-_Z18__device_stub__addPiS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z11random_initPii              # -- Begin function _Z11random_initPii
	.type	_Z11random_initPii,@function
_Z11random_initPii:                     # @_Z11random_initPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB2_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$100, %edi
	movl	$400, %esi                      # imm = 0x190
	callq	_Z15random_in_rangeii
	movl	%eax, (%rbx,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB2_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB2_4:                                # %._crit_edge
	retq
.Lfunc_end2:
	.size	_Z11random_initPii, .Lfunc_end2-_Z11random_initPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z7add_cpuPiS_S_i               # -- Begin function _Z7add_cpuPiS_S_i
	.type	_Z7add_cpuPiS_S_i,@function
_Z7add_cpuPiS_S_i:                      # @_Z7add_cpuPiS_S_i
	.cfi_startproc
# %bb.0:
	testl	%ecx, %ecx
	jle	.LBB3_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ecx, %eax
	xorl	%ecx, %ecx
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rcx,4), %r8d
	addl	(%rdi,%rcx,4), %r8d
	movl	%r8d, (%rdx,%rcx,4)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB3_2
.LBB3_3:                                # %._crit_edge
	retq
.Lfunc_end3:
	.size	_Z7add_cpuPiS_S_i, .Lfunc_end3-_Z7add_cpuPiS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.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	$80048, %rsp                    # imm = 0x138B0
	.cfi_def_cfa_offset 80096
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$80000, %edi                    # imm = 0x13880
	callq	_Znam
	movq	%rax, %rbx
	movl	$80000, %edi                    # imm = 0x13880
	callq	_Znam
	movq	%rax, %r14
	xorl	%r15d, %r15d
.LBB4_1:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movl	$100, %edi
	movl	$400, %esi                      # imm = 0x190
	callq	_Z15random_in_rangeii
	movl	%eax, (%rbx,%r15,4)
	incq	%r15
	cmpq	$20000, %r15                    # imm = 0x4E20
	jne	.LBB4_1
# %bb.2:                                # %.lr.ph.i44.preheader
	xorl	%r15d, %r15d
.LBB4_3:                                # %.lr.ph.i44
                                        # =>This Inner Loop Header: Depth=1
	movl	$100, %edi
	movl	$400, %esi                      # imm = 0x190
	callq	_Z15random_in_rangeii
	movl	%eax, (%r14,%r15,4)
	incq	%r15
	cmpq	$20000, %r15                    # imm = 0x4E20
	jne	.LBB4_3
# %bb.4:                                # %_Z11random_initPii.exit48
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorl	%r15d, %r15d
.LBB4_5:                                # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r15,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r15
	cmpq	$20000, %r15                    # imm = 0x4E20
	jne	.LBB4_5
# %bb.6:
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorl	%r15d, %r15d
.LBB4_7:                                # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r15
	cmpq	$20000, %r15                    # imm = 0x4E20
	jne	.LBB4_7
# %bb.8:
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %r13d
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	40(%rsp), %r15
	movl	$80000, %esi                    # imm = 0x13880
	movq	%r15, %rdi
	callq	hipMalloc
	leaq	32(%rsp), %r12
	movl	$80000, %esi                    # imm = 0x13880
	movq	%r12, %rdi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movl	$80000, %esi                    # imm = 0x13880
	callq	hipMalloc
	movq	(%r15), %rdi
	movl	$80000, %edx                    # imm = 0x13880
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r12), %rdi
	movl	$80000, %edx                    # imm = 0x13880
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %r15
	movq	%r15, %rdi
	callq	hipEventCreate
	movq	%rsp, %rdi
	callq	hipEventCreate
	movq	(%r15), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movabsq	$4294967297, %rdx               # imm = 0x100000001
	leaq	19999(%rdx), %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_10
# %bb.9:
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	16(%rsp), %rdx
	callq	_Z18__device_stub__addPiS_S_
.LBB4_10:
	movq	(%rsp), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	leaq	28(%rsp), %r15
	movq	%r15, %rdi
	callq	hipEventElapsedTime
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
	movq	(%rsp), %rdi
	callq	hipEventDestroy
	movq	16(%rsp), %rsi
	leaq	48(%rsp), %rdi
	movl	$80000, %edx                    # imm = 0x13880
	movl	$2, %ecx
	callq	hipMemcpy
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvtss2sd	(%r15), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.4, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB4_11:                               # =>This Inner Loop Header: Depth=1
	movl	48(%rsp,%r12,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	$20000, %r12                    # imm = 0x4E20
	jne	.LBB4_11
# %bb.12:
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %r15d
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	8(%rsp), %r15
	movq	%r15, %rdi
	callq	hipEventCreate
	movq	%rsp, %rdi
	callq	hipEventCreate
	movq	(%r15), %rdi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	hipEventRecord
.LBB4_13:                               # %.lr.ph.i49
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %eax
	addl	(%rbx,%r15,4), %eax
	movl	%eax, 48(%rsp,%r15,4)
	incq	%r15
	cmpq	$20000, %r15                    # imm = 0x4E20
	jne	.LBB4_13
# %bb.14:                               # %_Z7add_cpuPiS_S_i.exit
	movq	(%rsp), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	leaq	28(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
	movq	(%rsp), %rdi
	callq	hipEventDestroy
	movl	$_ZSt4cout, %r15d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvtss2sd	(%rbx), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.4, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB4_15:                               # =>This Inner Loop Header: Depth=1
	movl	48(%rsp,%r14,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r14
	cmpq	$20000, %r14                    # imm = 0x4E20
	jne	.LBB4_15
# %bb.16:
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$80048, %rsp                    # imm = 0x138B0
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm,"axG",@progbits,_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm,comdat
	.weak	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm # -- Begin function _ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	.p2align	1, 0x90
	.type	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm,@function
_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm: # @_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	.cfi_startproc
# %bb.0:
	movabsq	$730144469221, %rcx             # imm = 0xAA000070E5
	movq	%rsi, %rax
	mulq	%rcx
	movq	%rsi, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$30, %rax
	imull	$2147483563, %eax, %eax         # imm = 0x7FFFFFAB
	movl	%esi, %edx
	subl	%eax, %edx
	cmpl	$1, %edx
	adcl	$0, %edx
	testq	%rsi, %rsi
	movl	$19780503, %ecx                 # imm = 0x12DD397
	cmovnel	%edx, %ecx
	xorl	%eax, %eax
	movabsq	$281474976710655, %rdx          # imm = 0xFFFFFFFFFFFF
.LBB5_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_2 Depth 2
	movl	$1, %esi
	movb	$1, %r9b
	xorl	%r8d, %r8d
.LBB5_2:                                #   Parent Loop BB5_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, %r10d
	shrl	$2, %r10d
	imulq	$327796565, %r10, %r10          # imm = 0x1389C755
	shrq	$42, %r10
	imull	$53668, %r10d, %r11d            # imm = 0xD1A4
	subl	%r11d, %ecx
	imull	$40014, %ecx, %r11d             # imm = 0x9C4E
	imull	$12211, %r10d, %ecx             # imm = 0x2FB3
	subl	%ecx, %r11d
	leal	2147483563(%r11), %ecx
	cmovael	%r11d, %ecx
	movq	%rcx, %r10
	imulq	%rsi, %r10
	addq	%r10, %r8
	shlq	$32, %rsi
	testb	$1, %r9b
	movl	$0, %r9d
	jne	.LBB5_2
# %bb.3:                                #   in Loop: Header=BB5_1 Depth=1
	andq	%rdx, %r8
	movq	%r8, (%rdi,%rax,8)
	incq	%rax
	cmpq	$12, %rax
	jne	.LBB5_1
# %bb.4:
	xorl	%eax, %eax
	cmpq	$0, 88(%rdi)
	sete	%al
	movq	%rax, 96(%rdi)
	movq	$0, 104(%rdi)
	retq
.Lfunc_end5:
	.size	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm, .Lfunc_end5-_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE,"axG",@progbits,_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE,comdat
	.weak	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE # -- Begin function _ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	.p2align	1, 0x90
	.type	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE,@function
_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE: # @_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.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, %r14
	movslq	4(%rdx), %rbp
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movslq	(%rdx), %rax
	subq	%rax, %rbp
	movabsq	$281474976710655, %rax          # imm = 0xFFFFFFFFFFFF
	cmpq	%rax, %rbp
	jae	.LBB6_1
# %bb.4:
	incq	%rbp
	xorl	%edx, %edx
	divq	%rbp
	movq	%rax, %r15
	imulq	%rax, %rbp
.LBB6_5:                                # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	cmpq	%rbp, %rax
	jae	.LBB6_5
# %bb.6:
	xorl	%edx, %edx
	divq	%r15
	jmp	.LBB6_7
.LBB6_1:
	movq	%rdi, %r15
	movabsq	$281470681743360, %rbx          # imm = 0xFFFF00000000
	leaq	16(%rsp), %r12
.LBB6_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rbx, 16(%rsp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	movl	%eax, %r13d
	shlq	$48, %r13
	movq	%r14, %rdi
	callq	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	addq	%r13, %rax
	setb	%cl
	cmpq	%rbp, %rax
	ja	.LBB6_2
# %bb.3:                                #   in Loop: Header=BB6_2 Depth=1
	testb	%cl, %cl
	jne	.LBB6_2
.LBB6_7:                                # %.loopexit
	movq	8(%rsp), %rcx                   # 8-byte Reload
	addl	(%rcx), %eax
                                        # kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE, .Lfunc_end6-_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,"axG",@progbits,_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,comdat
	.weak	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv # -- Begin function _ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.p2align	1, 0x90
	.type	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,@function
_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv: # @_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	112(%rdi), %rax
	cmpq	$11, %rax
	jb	.LBB7_2
# %bb.1:
	movl	$389, %esi                      # imm = 0x185
	subq	%rax, %rsi
	movq	%rbx, %rdi
	callq	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	xorl	%eax, %eax
.LBB7_2:
	incq	%rax
	movq	%rax, 112(%rbx)
	movq	96(%rbx), %rcx
	movq	104(%rbx), %rdx
	leaq	-5(%rdx), %rax
	leaq	7(%rdx), %rsi
	testq	%rax, %rax
	cmovnsq	%rax, %rsi
	movq	(%rbx,%rsi,8), %rsi
	addq	(%rbx,%rdx,8), %rcx
	movabsq	$281474976710656, %rax          # imm = 0x1000000000000
	addq	%rsi, %rax
	xorl	%edi, %edi
	cmpq	%rcx, %rsi
	cmovaeq	%rsi, %rax
	setb	%dil
	subq	%rcx, %rax
	movq	%rdi, 96(%rbx)
	movq	%rax, (%rbx,%rdx,8)
	movq	104(%rbx), %rcx
	incq	%rcx
	xorl	%edx, %edx
	cmpq	$12, %rcx
	cmovbq	%rcx, %rdx
	movq	%rdx, 104(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv, .Lfunc_end7-_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy,"axG",@progbits,_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy,comdat
	.weak	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy # -- Begin function _ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	.p2align	1, 0x90
	.type	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy,@function
_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy: # @_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	.cfi_startproc
# %bb.0:
	testq	%rsi, %rsi
	je	.LBB8_3
# %bb.1:                                # %.lr.ph
	movq	104(%rdi), %rcx
	movabsq	$281474976710656, %rax          # imm = 0x1000000000000
	xorl	%edx, %edx
.LBB8_2:                                # =>This Inner Loop Header: Depth=1
	leaq	-5(%rcx), %r8
	leaq	7(%rcx), %r9
	testq	%r8, %r8
	cmovnsq	%r8, %r9
	movq	(%rdi,%r9,8), %r8
	movq	96(%rdi), %r9
	addq	(%rdi,%rcx,8), %r9
	leaq	(%r8,%rax), %r10
	xorl	%r11d, %r11d
	cmpq	%r9, %r8
	setb	%r11b
	cmovaeq	%r8, %r10
	subq	%r9, %r10
	movq	%r11, 96(%rdi)
	movq	%r10, (%rdi,%rcx,8)
	movq	104(%rdi), %rcx
	incq	%rcx
	cmpq	$12, %rcx
	cmovaeq	%rdx, %rcx
	movq	%rcx, 104(%rdi)
	decq	%rsi
	jne	.LBB8_2
.LBB8_3:                                # %._crit_edge
	retq
.Lfunc_end8:
	.size	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy, .Lfunc_end8-_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	.cfi_endproc
                                        # -- 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	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z3addPiS_S_, %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_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__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	.LBB10_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
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZZ15random_in_rangeiiE3rng,@object # @_ZZ15random_in_rangeiiE3rng
	.section	.tbss,"awT",@nobits
	.p2align	3, 0x0
_ZZ15random_in_rangeiiE3rng:
	.zero	120
	.size	_ZZ15random_in_rangeiiE3rng, 120

	.type	_ZGVZ15random_in_rangeiiE3rng,@object # @_ZGVZ15random_in_rangeiiE3rng
_ZGVZ15random_in_rangeiiE3rng:
	.byte	0                               # 0x0
	.size	_ZGVZ15random_in_rangeiiE3rng, 1

	.type	_Z3addPiS_S_,@object            # @_Z3addPiS_S_
	.section	.rodata,"a",@progbits
	.globl	_Z3addPiS_S_
	.p2align	3, 0x0
_Z3addPiS_S_:
	.quad	_Z18__device_stub__addPiS_S_
	.size	_Z3addPiS_S_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"First: "
	.size	.L.str, 8

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Second: "
	.size	.L.str.2, 9

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"GPU Elapsed time is: "
	.size	.L.str.3, 22

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	" milliseconds"
	.size	.L.str.4, 14

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Parallel Result: "
	.size	.L.str.5, 18

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"CPU Elapsed time is: "
	.size	.L.str.6, 22

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Serial Result: "
	.size	.L.str.7, 16

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z3addPiS_S_"
	.size	.L__unnamed_1, 13

	.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 _Z18__device_stub__addPiS_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z3addPiS_S_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z3addPiS_S_            ; -- Begin function _Z3addPiS_S_
	.globl	_Z3addPiS_S_
	.p2align	8
	.type	_Z3addPiS_S_,@function
_Z3addPiS_S_:                           ; @_Z3addPiS_S_
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x0
	s_mov_b32 s2, s15
	s_ashr_i32 s3, s15, 31
	s_load_b64 s[0:1], s[0:1], 0x10
	s_lshl_b64 s[2:3], s[2:3], 2
	s_waitcnt lgkmcnt(0)
	s_add_u32 s4, s4, s2
	s_addc_u32 s5, s5, s3
	s_add_u32 s6, s6, s2
	s_addc_u32 s7, s7, s3
	s_load_b32 s4, s[4:5], 0x0
	s_load_b32 s5, s[6:7], 0x0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s4, s5, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s4
	s_add_u32 s0, s0, s2
	s_addc_u32 s1, s1, s3
	global_store_b32 v0, v1, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z3addPiS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.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 2
		.amdhsa_next_free_sgpr 16
		.amdhsa_reserve_vcc 0
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z3addPiS_S_, .Lfunc_end0-_Z3addPiS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 112
; NumSgprs: 16
; NumVgprs: 2
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 16
; NumVGPRsForWavesPerEU: 2
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z3addPiS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     16
    .sgpr_spill_count: 0
    .symbol:         _Z3addPiS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     2
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
