#include <iostream>
#include <memory>
#include <chrono>
#include <random>

__global__ void add(float* vec_a, float* vec_b, float* vec_c, int n)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < n)
    {
        vec_c[i] = vec_a[i] + vec_b[i];
        i += blockDim.x * gridDim.x;
    }
}

int main(int args, char *argv[])
{
    int n;
    n = atoi(argv[1]);
    float *vec_a, *vec_b, *vec_c;

    std::unique_ptr<float[]> host_a(new float[n]);
    std::unique_ptr<float[]> host_b(new float[n]);
    std::unique_ptr<float[]> host_c(new float[n]);

    cudaMalloc((void**)&vec_a, n * sizeof(float));
    cudaMalloc((void**)&vec_b, n * sizeof(float));
    cudaMalloc((void**)&vec_c, n * sizeof(float));

    for (int i = 0; i < n; i++)
    {
        std::random_device rand{};
        host_a[i] = rand();
        host_b[i] = rand();
        host_c[i] = 0;
    }

    cudaMemcpy(vec_a, host_a.get(), n*sizeof(float), cudaMemcpyHostToDevice);
    cudaMemcpy(vec_b, host_b.get(), n*sizeof(float), cudaMemcpyHostToDevice);
    cudaMemcpy(vec_c, host_c.get(), n*sizeof(float), cudaMemcpyHostToDevice);

    int blocksize = 128;
    dim3 block (blocksize, 1, 1);
    dim3 grid  ((n + blocksize + 1) / block.x, 1, 1);
    
    std::chrono::system_clock::time_point start, end;
    start = std::chrono::system_clock::now();

    add<<<grid, block>>>(vec_a, vec_b, vec_c, n);

    end = std::chrono::system_clock::now();

    std::unique_ptr<float[]> host_result(new float[n]);

    cudaMemcpy(host_result.get(), vec_c, n * sizeof(n), cudaMemcpyDeviceToHost);

    int checker = 0;
    for (int i = 0; i < n; i++)
    {
        if (fabs(host_result[i] - (host_a[i] + host_b[i])) > 10e-8)
        {
            std::cout << "ng: " << host_result[i] << std::endl;
            checker++;
        }
    }
    
    if (checker == 0)
    {
        std::cout << "ok" << std::endl;
    }
    else
    {
        std::cout << checker << std::endl;
    }

    double time = static_cast<double>(std::chrono::duration_cast<std::chrono::microseconds>(end - start).count() / 1000.0);

    std::cout << "n: " << n << " threads: " << blocksize << std::endl;
    std::cout << "time: " << time << " [ms]" << std::endl;
    std::cout << "perf: " << n / time / 1e6 << " [Gflops/sec]" << std::endl;

    cudaFree(vec_a);
    cudaFree(vec_b);
    cudaFree(vec_c);
    return 0;
}


	.file	"tmpxft_0020f4b2_00000000-6_vectorAdd.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB5410:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE5410:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB6220:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE6220:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z27__device_stub__Z3addPfS_S_iPfS_S_i
	.type	_Z27__device_stub__Z3addPfS_S_iPfS_S_i, @function
_Z27__device_stub__Z3addPfS_S_iPfS_S_i:
.LFB5432:
	.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
	movl	%ecx, 4(%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)
	leaq	4(%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	.L3
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z3addPfS_S_i(%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
.L3:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5432:
	.size	_Z27__device_stub__Z3addPfS_S_iPfS_S_i, .-_Z27__device_stub__Z3addPfS_S_iPfS_S_i
	.globl	_Z3addPfS_S_i
	.type	_Z3addPfS_S_i, @function
_Z3addPfS_S_i:
.LFB5433:
	.cfi_startproc
	endbr64
	jmp	_Z27__device_stub__Z3addPfS_S_iPfS_S_i
	.cfi_endproc
.LFE5433:
	.size	_Z3addPfS_S_i, .-_Z3addPfS_S_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z3addPfS_S_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB5435:
	.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	_Z3addPfS_S_i(%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
.LFE5435:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev,"axG",@progbits,_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev
	.type	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev, @function
_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev:
.LFB5789:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L11
	jmp	_ZdaPv@PLT
.L11:
	ret
	.cfi_endproc
.LFE5789:
	.size	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev, .-_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev
	.weak	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	.set	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev,_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev
	.section	.rodata.str1.1
.LC1:
	.string	"default"
.LC5:
	.string	"ng: "
.LC6:
	.string	"ok"
.LC8:
	.string	"n: "
.LC9:
	.string	" threads: "
.LC10:
	.string	"time: "
.LC11:
	.string	" [ms]"
.LC12:
	.string	"perf: "
.LC14:
	.string	" [Gflops/sec]"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB5393:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5393
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$1064, %rsp
	.cfi_def_cfa_offset 5216
	movq	8(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 5144(%rsp)
	xorl	%eax, %eax
	call	atoi@PLT
	movabsq	$2305843009213693950, %rdx
	movl	%eax, %ebx
	cltq
	cmpq	%rax, %rdx
	jb	.L14
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB0:
	call	_Znam@PLT
.LEHE0:
	movq	8(%rsp), %rdi
	movq	%rax, 56(%rsp)
	movq	%rax, %r12
.LEHB1:
	call	_Znam@PLT
.LEHE1:
	movq	8(%rsp), %rdi
	movq	%rax, 64(%rsp)
	movq	%rax, %r13
.LEHB2:
	call	_Znam@PLT
.LEHE2:
	jmp	.L61
.L14:
	movq	5144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
.LEHB3:
	call	__cxa_throw_bad_array_new_length@PLT
.LEHE3:
.L61:
	movq	8(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%rax, 72(%rsp)
	movq	%rax, %r14
.LEHB4:
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	40(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	48(%rsp), %rdi
	call	cudaMalloc@PLT
.LEHE4:
	xorl	%ebp, %ebp
.L17:
	cmpl	%ebp, %ebx
	jle	.L62
	leaq	7+.LC1(%rip), %rdx
	leaq	128(%rsp), %rdi
	leaq	-7(%rdx), %rsi
	movq	%rdi, 112(%rsp)
	leaq	112(%rsp), %r15
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	112(%rsp), %rax
	movq	%r15, %rsi
	movq	$7, 120(%rsp)
	movb	$0, 7(%rax)
	leaq	144(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB5:
	call	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE5:
	movq	%r15, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdi
.LEHB6:
	call	_ZNSt13random_device9_M_getvalEv@PLT
	movl	%eax, %eax
	movq	16(%rsp), %rdi
	cvtsi2ssq	%rax, %xmm0
	movss	%xmm0, (%r12,%rbp,4)
	call	_ZNSt13random_device9_M_getvalEv@PLT
.LEHE6:
	movl	%eax, %eax
	movl	$0x00000000, (%r14,%rbp,4)
	movq	16(%rsp), %rdi
	cvtsi2ssq	%rax, %xmm0
	movss	%xmm0, 0(%r13,%rbp,4)
	incq	%rbp
	call	_ZNSt13random_device7_M_finiEv@PLT
	jmp	.L17
.L49:
	endbr64
	movq	%rax, %rbx
.L19:
	movq	%r15, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L20
.L62:
	movq	8(%rsp), %rdx
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
.LEHB7:
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	call	cudaMemcpy@PLT
	leal	129(%rbx), %eax
	shrl	$7, %eax
	movl	%eax, 100(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 104(%rsp)
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$33554433, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	100(%rsp), %rdi
	movl	108(%rsp), %esi
	salq	$7, %rdx
	movl	$1, %ecx
	movq	%rax, 16(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L26
.L28:
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	8(%rsp), %rdi
	movq	%rax, 24(%rsp)
	call	_Znam@PLT
.LEHE7:
	movq	8(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	%rax, %rdi
	movq	%rax, %r14
	movl	$2, %ecx
	movq	%rax, 80(%rsp)
.LEHB8:
	call	cudaMemcpy@PLT
.LEHE8:
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	jmp	.L29
.L26:
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	%ebx, %ecx
	movq	32(%rsp), %rdi
.LEHB9:
	call	_Z27__device_stub__Z3addPfS_S_iPfS_S_i
.LEHE9:
	jmp	.L28
.L32:
	movss	(%r12,%rbp,4), %xmm1
	addss	0(%r13,%rbp,4), %xmm1
	movss	(%r14,%rbp,4), %xmm0
	subss	%xmm1, %xmm0
	andps	.LC3(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	comisd	.LC4(%rip), %xmm0
	ja	.L63
.L30:
	incq	%rbp
.L29:
	cmpl	%ebp, %ebx
	jg	.L32
	jmp	.L64
.L63:
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB10:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	(%r14,%rbp,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	incl	%r15d
	jmp	.L30
.L64:
	testl	%r15d, %r15d
	leaq	_ZSt4cout(%rip), %rbp
	jne	.L33
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L59:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rax
	leaq	.LC8(%rip), %rsi
	movq	%rbp, %rdi
	subq	%rcx, %rax
	movl	$1000, %ecx
	cqto
	idivq	%rcx
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC7(%rip), %xmm0
	movsd	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	jmp	.L65
.L33:
	movl	%r15d, %esi
	movq	%rbp, %rdi
	call	_ZNSolsEi@PLT
	jmp	.L59
.L65:
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$128, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC10(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	8(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC12(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtsi2sdl	%ebx, %xmm0
	divsd	8(%rsp), %xmm0
	divsd	.LC13(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC14(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
.LEHE10:
	leaq	80(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	leaq	72(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	leaq	64(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	leaq	56(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	movq	5144(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	jmp	.L56
.L47:
	endbr64
	movq	%rax, %rbx
.L36:
	movq	16(%rsp), %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	jmp	.L20
.L48:
	endbr64
	movq	%rax, %rbx
.L37:
	leaq	80(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	jmp	.L20
.L46:
	endbr64
	movq	%rax, %rbx
.L20:
	leaq	72(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	jmp	.L38
.L45:
	endbr64
	movq	%rax, %rbx
.L38:
	leaq	64(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	jmp	.L39
.L44:
	endbr64
	movq	%rax, %rbx
.L39:
	leaq	56(%rsp), %rdi
	call	_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED1Ev
	movq	5144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	movq	%rbx, %rdi
.LEHB11:
	call	_Unwind_Resume@PLT
.LEHE11:
.L56:
	call	__stack_chk_fail@PLT
.L41:
	addq	$5160, %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
.LFE5393:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA5393:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE5393-.LLSDACSB5393
.LLSDACSB5393:
	.uleb128 .LEHB0-.LFB5393
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB5393
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L44-.LFB5393
	.uleb128 0
	.uleb128 .LEHB2-.LFB5393
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L45-.LFB5393
	.uleb128 0
	.uleb128 .LEHB3-.LFB5393
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB5393
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L46-.LFB5393
	.uleb128 0
	.uleb128 .LEHB5-.LFB5393
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L49-.LFB5393
	.uleb128 0
	.uleb128 .LEHB6-.LFB5393
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L47-.LFB5393
	.uleb128 0
	.uleb128 .LEHB7-.LFB5393
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L46-.LFB5393
	.uleb128 0
	.uleb128 .LEHB8-.LFB5393
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L48-.LFB5393
	.uleb128 0
	.uleb128 .LEHB9-.LFB5393
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L46-.LFB5393
	.uleb128 0
	.uleb128 .LEHB10-.LFB5393
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L48-.LFB5393
	.uleb128 0
	.uleb128 .LEHB11-.LFB5393
	.uleb128 .LEHE11-.LEHB11
	.uleb128 0
	.uleb128 0
.LLSDACSE5393:
	.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.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	-1698910392
	.long	1048238066
	.align 8
.LC7:
	.long	0
	.long	1083129856
	.align 8
.LC13:
	.long	0
	.long	1093567616
	.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 <memory>
#include <chrono>
#include <random>

__global__ void add(float* vec_a, float* vec_b, float* vec_c, int n)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < n)
    {
        vec_c[i] = vec_a[i] + vec_b[i];
        i += blockDim.x * gridDim.x;
    }
}

int main(int args, char *argv[])
{
    int n;
    n = atoi(argv[1]);
    float *vec_a, *vec_b, *vec_c;

    std::unique_ptr<float[]> host_a(new float[n]);
    std::unique_ptr<float[]> host_b(new float[n]);
    std::unique_ptr<float[]> host_c(new float[n]);

    hipMalloc((void**)&vec_a, n * sizeof(float));
    hipMalloc((void**)&vec_b, n * sizeof(float));
    hipMalloc((void**)&vec_c, n * sizeof(float));

    for (int i = 0; i < n; i++)
    {
        std::random_device rand{};
        host_a[i] = rand();
        host_b[i] = rand();
        host_c[i] = 0;
    }

    hipMemcpy(vec_a, host_a.get(), n*sizeof(float), hipMemcpyHostToDevice);
    hipMemcpy(vec_b, host_b.get(), n*sizeof(float), hipMemcpyHostToDevice);
    hipMemcpy(vec_c, host_c.get(), n*sizeof(float), hipMemcpyHostToDevice);

    int blocksize = 128;
    dim3 block (blocksize, 1, 1);
    dim3 grid  ((n + blocksize + 1) / block.x, 1, 1);
    
    std::chrono::system_clock::time_point start, end;
    start = std::chrono::system_clock::now();

    add<<<grid, block>>>(vec_a, vec_b, vec_c, n);

    end = std::chrono::system_clock::now();

    std::unique_ptr<float[]> host_result(new float[n]);

    hipMemcpy(host_result.get(), vec_c, n * sizeof(n), hipMemcpyDeviceToHost);

    int checker = 0;
    for (int i = 0; i < n; i++)
    {
        if (fabs(host_result[i] - (host_a[i] + host_b[i])) > 10e-8)
        {
            std::cout << "ng: " << host_result[i] << std::endl;
            checker++;
        }
    }
    
    if (checker == 0)
    {
        std::cout << "ok" << std::endl;
    }
    else
    {
        std::cout << checker << std::endl;
    }

    double time = static_cast<double>(std::chrono::duration_cast<std::chrono::microseconds>(end - start).count() / 1000.0);

    std::cout << "n: " << n << " threads: " << blocksize << std::endl;
    std::cout << "time: " << time << " [ms]" << std::endl;
    std::cout << "perf: " << n / time / 1e6 << " [Gflops/sec]" << std::endl;

    hipFree(vec_a);
    hipFree(vec_b);
    hipFree(vec_c);
    return 0;
}


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

                                        # End of file scope inline assembly
	.globl	_Z18__device_stub__addPfS_S_i   # -- Begin function _Z18__device_stub__addPfS_S_i
	.type	_Z18__device_stub__addPfS_S_i,@function
_Z18__device_stub__addPfS_S_i:          # @_Z18__device_stub__addPfS_S_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z3addPfS_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z18__device_stub__addPfS_S_i, .Lfunc_end0-_Z18__device_stub__addPfS_S_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI1_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI1_1:
	.quad	0x3e7ad7f29abcaf48              # double 9.9999999999999995E-8
.LCPI1_2:
	.quad	0x408f400000000000              # double 1000
.LCPI1_3:
	.quad	0x412e848000000000              # double 1.0E+6
	.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	$5064, %rsp                     # imm = 0x13C8
	.cfi_def_cfa_offset 5120
	.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	8(%rsi), %rdi
	callq	atoi
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rbp
	shlq	$2, %rbp
	movq	%rax, (%rsp)                    # 8-byte Spill
	testl	%eax, %eax
	movq	$-1, %r13
	cmovnsq	%rbp, %r13
	movq	%r13, %rdi
	callq	_Znam
	movq	%rax, 8(%rsp)                   # 8-byte Spill
.Ltmp0:
	movq	%r13, %rdi
	callq	_Znam
.Ltmp1:
# %bb.1:
.Ltmp3:
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_Znam
	movq	%rax, 16(%rsp)                  # 8-byte Spill
.Ltmp4:
# %bb.2:
.Ltmp6:
	leaq	48(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
.Ltmp7:
# %bb.3:
.Ltmp8:
	leaq	40(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
.Ltmp9:
# %bb.4:
.Ltmp10:
	leaq	24(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
.Ltmp11:
# %bb.5:                                # %.preheader155
	movq	(%rsp), %rax                    # 8-byte Reload
	movl	%eax, %r15d
	testl	%eax, %eax
	jle	.LBB1_12
# %bb.6:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
	leaq	64(%rsp), %r12
.LBB1_7:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp12:
	movq	%r12, %rdi
	callq	_ZNSt13random_deviceC2Ev
.Ltmp13:
# %bb.8:                                #   in Loop: Header=BB1_7 Depth=1
.Ltmp15:
	movq	%r12, %rdi
	callq	_ZNSt13random_device9_M_getvalEv
.Ltmp16:
# %bb.9:                                # %_ZNSt13random_deviceclEv.exit
                                        #   in Loop: Header=BB1_7 Depth=1
	movl	%eax, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	movq	8(%rsp), %rax                   # 8-byte Reload
	movss	%xmm0, (%rax,%rbx,4)
.Ltmp17:
	movq	%r12, %rdi
	callq	_ZNSt13random_device9_M_getvalEv
.Ltmp18:
# %bb.10:                               # %_ZNSt13random_deviceclEv.exit72
                                        #   in Loop: Header=BB1_7 Depth=1
	movl	%eax, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	movss	%xmm0, (%r14,%rbx,4)
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	$0, (%rax,%rbx,4)
.Ltmp23:
	movq	%r12, %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp24:
# %bb.11:                               # %_ZNSt13random_deviceD2Ev.exit
                                        #   in Loop: Header=BB1_7 Depth=1
	incq	%rbx
	cmpq	%rbx, %r15
	jne	.LBB1_7
.LBB1_12:                               # %._crit_edge
	movq	48(%rsp), %rdi
.Ltmp26:
	movq	8(%rsp), %rsi                   # 8-byte Reload
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp27:
# %bb.13:
	movq	40(%rsp), %rdi
.Ltmp28:
	movq	%r14, %rsi
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp29:
# %bb.14:
	movq	24(%rsp), %rdi
.Ltmp30:
	movq	16(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp31:
# %bb.15:
	movq	(%rsp), %rax                    # 8-byte Reload
	leal	129(%rax), %r12d
	shrl	$7, %r12d
	btsq	$32, %r12
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %rbx
.Ltmp33:
	movabsq	$4294967424, %rdx               # imm = 0x100000080
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp34:
# %bb.16:
	testl	%eax, %eax
	jne	.LBB1_18
# %bb.17:
	movq	48(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	24(%rsp), %rdx
.Ltmp35:
	movq	(%rsp), %rcx                    # 8-byte Reload
                                        # kill: def $ecx killed $ecx killed $rcx
	callq	_Z18__device_stub__addPfS_S_i
.Ltmp36:
.LBB1_18:
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, 32(%rsp)                  # 8-byte Spill
.Ltmp38:
	movq	%r13, %rdi
	callq	_Znam
.Ltmp39:
# %bb.19:
	movq	%rax, %r13
	movq	24(%rsp), %rsi
.Ltmp41:
	movq	%rax, %rdi
	movq	%rbp, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp42:
# %bb.20:                               # %.preheader
	cmpl	$0, (%rsp)                      # 4-byte Folded Reload
	jle	.LBB1_33
# %bb.21:                               # %.lr.ph160.preheader
	movq	%rbx, 56(%rsp)                  # 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
.LBB1_22:                               # %.lr.ph160
                                        # =>This Inner Loop Header: Depth=1
	movss	(%r13,%rbx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movq	8(%rsp), %rax                   # 8-byte Reload
	movss	(%rax,%rbx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	addss	(%r14,%rbx,4), %xmm1
	subss	%xmm1, %xmm0
	andps	.LCPI1_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	ucomisd	.LCPI1_1(%rip), %xmm0
	jbe	.LBB1_29
# %bb.23:                               #   in Loop: Header=BB1_22 Depth=1
.Ltmp44:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp45:
# %bb.24:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB1_22 Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r13,%rbx,4), %xmm0
.Ltmp46:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp47:
# %bb.25:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB1_22 Depth=1
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp48:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp49:
# %bb.26:                               # %.noexc
                                        #   in Loop: Header=BB1_22 Depth=1
.Ltmp50:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp51:
# %bb.27:                               # %.noexc108
                                        #   in Loop: Header=BB1_22 Depth=1
.Ltmp52:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp53:
# %bb.28:                               # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB1_22 Depth=1
	incl	%ebp
.LBB1_29:                               #   in Loop: Header=BB1_22 Depth=1
	incq	%rbx
	cmpq	%rbx, %r15
	jne	.LBB1_22
# %bb.30:                               # %._crit_edge161
	testl	%ebp, %ebp
	movq	56(%rsp), %rbx                  # 8-byte Reload
	je	.LBB1_33
# %bb.31:
.Ltmp55:
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp56:
# %bb.32:
	movq	%rax, %rbp
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
.Ltmp57:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp58:
	jmp	.LBB1_35
.LBB1_33:                               # %._crit_edge161.thread
.Ltmp59:
	movl	$_ZSt4cout, %ebp
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp60:
# %bb.34:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit74
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
.Ltmp61:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp62:
.LBB1_35:                               # %.noexc114.invoke
.Ltmp63:
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
.Ltmp64:
# %bb.36:                               # %.noexc115.invoke
.Ltmp65:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp66:
# %bb.37:
	movq	32(%rsp), %rax                  # 8-byte Reload
	subq	%rbx, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %r12
.Ltmp68:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp69:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit77
.Ltmp70:
	movl	$_ZSt4cout, %edi
	movq	(%rsp), %rsi                    # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	callq	_ZNSolsEi
.Ltmp71:
# %bb.39:
.Ltmp72:
	movq	%rax, %rbp
	movl	$.L.str.3, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp73:
# %bb.40:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit78
.Ltmp74:
	movq	%rbp, %rdi
	movl	$128, %esi
	callq	_ZNSolsEi
.Ltmp75:
# %bb.41:
	movq	%rax, %rbp
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
.Ltmp76:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp77:
# %bb.42:                               # %.noexc118
.Ltmp78:
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
.Ltmp79:
# %bb.43:                               # %.noexc119
.Ltmp80:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp81:
# %bb.44:                               # %_ZNSolsEPFRSoS_E.exit79
.Ltmp82:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp83:
# %bb.45:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit80
.Ltmp84:
	movq	%r12, %rax
	shrq	$63, %rax
	sarq	$7, %r12
	addq	%rax, %r12
	cvtsi2sd	%r12, %xmm0
	divsd	.LCPI1_2(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp85:
# %bb.46:                               # %_ZNSolsEd.exit
.Ltmp86:
	movq	%rax, %r12
	movl	$.L.str.5, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp87:
# %bb.47:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit81
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp88:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp89:
# %bb.48:                               # %.noexc122
.Ltmp90:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp91:
# %bb.49:                               # %.noexc123
.Ltmp92:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp93:
# %bb.50:                               # %_ZNSolsEPFRSoS_E.exit82
.Ltmp94:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp95:
# %bb.51:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit83
	xorps	%xmm0, %xmm0
	cvtsi2sdl	(%rsp), %xmm0           # 4-byte Folded Reload
	divsd	32(%rsp), %xmm0                 # 8-byte Folded Reload
	divsd	.LCPI1_3(%rip), %xmm0
.Ltmp96:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp97:
# %bb.52:                               # %_ZNSolsEd.exit84
.Ltmp98:
	movq	%rax, %r12
	movl	$.L.str.7, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp99:
# %bb.53:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit85
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp100:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp101:
# %bb.54:                               # %.noexc126
.Ltmp102:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp103:
# %bb.55:                               # %.noexc127
.Ltmp104:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp105:
# %bb.56:                               # %_ZNSolsEPFRSoS_E.exit86
	movq	48(%rsp), %rdi
.Ltmp106:
	callq	hipFree
.Ltmp107:
# %bb.57:
	movq	40(%rsp), %rdi
.Ltmp108:
	callq	hipFree
.Ltmp109:
# %bb.58:
	movq	24(%rsp), %rdi
.Ltmp110:
	callq	hipFree
.Ltmp111:
# %bb.59:                               # %_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev.exit95
	movq	%r13, %rdi
	callq	_ZdaPv
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	_ZdaPv
	xorl	%eax, %eax
	addq	$5064, %rsp                     # imm = 0x13C8
	.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
.LBB1_60:
	.cfi_def_cfa_offset 5120
.Ltmp43:
	jmp	.LBB1_75
.LBB1_61:
.Ltmp40:
	jmp	.LBB1_67
.LBB1_62:
.Ltmp5:
	movq	%rax, %r12
	jmp	.LBB1_77
.LBB1_63:
.Ltmp2:
	movq	%rax, %r12
	jmp	.LBB1_78
.LBB1_64:
.Ltmp37:
	jmp	.LBB1_67
.LBB1_65:
.Ltmp67:
	jmp	.LBB1_75
.LBB1_66:
.Ltmp32:
	jmp	.LBB1_67
.LBB1_68:
.Ltmp14:
.LBB1_67:                               # %_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev.exit101
	movq	%rax, %r12
	jmp	.LBB1_76
.LBB1_69:
.Ltmp25:
	jmp	.LBB1_70
.LBB1_71:
.Ltmp112:
	jmp	.LBB1_75
.LBB1_72:
.Ltmp19:
	movq	%rax, %r12
.Ltmp20:
	leaq	64(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp21:
	jmp	.LBB1_76
.LBB1_73:
.Ltmp22:
.LBB1_70:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.LBB1_74:
.Ltmp54:
.LBB1_75:                               # %_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev.exit98
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_ZdaPv
.LBB1_76:                               # %_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev.exit101
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	_ZdaPv
.LBB1_77:                               # %_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev.exit104
	movq	%r14, %rdi
	callq	_ZdaPv
.LBB1_78:                               # %_ZNSt10unique_ptrIA_fSt14default_deleteIS0_EED2Ev.exit107
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	_ZdaPv
	movq	%r12, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.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 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp11-.Ltmp6                 #   Call between .Ltmp6 and .Ltmp11
	.uleb128 .Ltmp32-.Lfunc_begin0          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp18-.Ltmp15                #   Call between .Ltmp15 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin0          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp23-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp24-.Ltmp23                #   Call between .Ltmp23 and .Ltmp24
	.uleb128 .Ltmp25-.Lfunc_begin0          #     jumps to .Ltmp25
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp26-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp31-.Ltmp26                #   Call between .Ltmp26 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin0          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp36-.Ltmp33                #   Call between .Ltmp33 and .Ltmp36
	.uleb128 .Ltmp37-.Lfunc_begin0          #     jumps to .Ltmp37
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp38-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp39-.Ltmp38                #   Call between .Ltmp38 and .Ltmp39
	.uleb128 .Ltmp40-.Lfunc_begin0          #     jumps to .Ltmp40
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp41-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp42-.Ltmp41                #   Call between .Ltmp41 and .Ltmp42
	.uleb128 .Ltmp43-.Lfunc_begin0          #     jumps to .Ltmp43
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp44-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp53-.Ltmp44                #   Call between .Ltmp44 and .Ltmp53
	.uleb128 .Ltmp54-.Lfunc_begin0          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp55-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp66-.Ltmp55                #   Call between .Ltmp55 and .Ltmp66
	.uleb128 .Ltmp67-.Lfunc_begin0          #     jumps to .Ltmp67
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp111-.Ltmp68               #   Call between .Ltmp68 and .Ltmp111
	.uleb128 .Ltmp112-.Lfunc_begin0         #     jumps to .Ltmp112
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp21-.Ltmp20                #   Call between .Ltmp20 and .Ltmp21
	.uleb128 .Ltmp22-.Lfunc_begin0          #     jumps to .Ltmp22
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp21-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Lfunc_end1-.Ltmp21            #   Call between .Ltmp21 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt13random_deviceC2Ev,"axG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.weak	_ZNSt13random_deviceC2Ev        # -- Begin function _ZNSt13random_deviceC2Ev
	.p2align	1, 0x90
	.type	_ZNSt13random_deviceC2Ev,@function
_ZNSt13random_deviceC2Ev:               # @_ZNSt13random_deviceC2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	leaq	16(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	%rsp, %r14
	movl	$.L.str.8, %esi
	movl	$.L.str.8+7, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp113:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp114:
# %bb.1:
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB2_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB2_4:
	.cfi_def_cfa_offset 64
.Ltmp115:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_6
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i4
	callq	_ZdlPv
.LBB2_6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit6
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_ZNSt13random_deviceC2Ev, .Lfunc_end2-_ZNSt13random_deviceC2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZNSt13random_deviceC2Ev,"aG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.p2align	2, 0x0
GCC_except_table2:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp113-.Lfunc_begin1         #   Call between .Lfunc_begin1 and .Ltmp113
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp113-.Lfunc_begin1         # >> Call Site 2 <<
	.uleb128 .Ltmp114-.Ltmp113              #   Call between .Ltmp113 and .Ltmp114
	.uleb128 .Ltmp115-.Lfunc_begin1         #     jumps to .Ltmp115
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp114-.Lfunc_begin1         # >> Call Site 3 <<
	.uleb128 .Lfunc_end2-.Ltmp114           #   Call between .Ltmp114 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB3_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB3_3
.LBB3_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB3_3:
	testq	%r14, %r14
	je	.LBB3_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB3_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB3_7
.LBB3_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB3_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end3-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end4:
	.size	__clang_call_terminate, .Lfunc_end4-__clang_call_terminate
	.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	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z3addPfS_S_i, %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_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z3addPfS_S_i,@object           # @_Z3addPfS_S_i
	.section	.rodata,"a",@progbits
	.globl	_Z3addPfS_S_i
	.p2align	3, 0x0
_Z3addPfS_S_i:
	.quad	_Z18__device_stub__addPfS_S_i
	.size	_Z3addPfS_S_i, 8

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

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

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"time: "
	.size	.L.str.4, 7

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	" [ms]"
	.size	.L.str.5, 6

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"perf: "
	.size	.L.str.6, 7

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	" [Gflops/sec]"
	.size	.L.str.7, 14

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"default"
	.size	.L.str.8, 8

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z3addPfS_S_i"
	.size	.L__unnamed_1, 14

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

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z3addPfS_S_i           ; -- Begin function _Z3addPfS_S_i
	.globl	_Z3addPfS_S_i
	.p2align	8
	.type	_Z3addPfS_S_i,@function
_Z3addPfS_S_i:                          ; @_Z3addPfS_S_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	global_load_b32 v2, v[2:3], off
	global_load_b32 v3, v[4:5], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v2, v3
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z3addPfS_S_i
		.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 6
		.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	_Z3addPfS_S_i, .Lfunc_end0-_Z3addPfS_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 180
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; 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
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .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:           _Z3addPfS_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z3addPfS_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
