// %%cu
// as data type is int, sum might overflow (depending on rand(), but the seq and parallel answers are still equal, or change int to long long (too lazy sorry))
#include<iostream>
#include<vector>
#include<cstdlib>
#include<cstdio>
#include<limits>
#include<cuda.h>
#define THREADS_PER_BLOCK 256
using namespace std;

void seq(vector<int>v){
    clock_t st = clock();
    int sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    clock_t en = clock();

    cout<<"Sequential Sum: "<<sum<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";

    st= clock();
    int maxx=-1e9;
    for(int i=0;i<v.size();i++){
        maxx=max(maxx,v[i]);
    }
    en = clock();
    cout<<"Sequential Maximum: "<<maxx<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";

    st = clock();
    int minn=1e9;
    for(int i=0;i<v.size();i++){
        minn=min(minn,v[i]);
    }
    en = clock();
    cout<<"Sequential Minimum: "<<minn<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";


    st = clock();
    sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    sum=sum/(int)v.size();
    en = clock();

    cout<<"Sequential Average: "<<sum<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";
}

__global__ void calculate(int *arr_in, int* arr_out, int sz, int option){
    int ind = threadIdx.x;
    int dim = blockDim.x;
    extern __shared__ int shared_mem[];
    int actual_ind = blockIdx.x*blockDim.x + ind;
    if(actual_ind < sz){
        shared_mem[ind] = arr_in[actual_ind];
    }else{
        if(option == 0 || option == 3)
            shared_mem[ind] = 0;
        else if(option == 1){//maximum
            shared_mem[ind] = -INT_MAX;
        }else{//minimum
            shared_mem[ind] = INT_MAX;
        }
    }
    __syncthreads();
    for(int i=dim/2 ; i > 0 ; i=i/2){
        if(ind<i){
            if(option == 0 || option == 3)
                shared_mem[ind]+=shared_mem[ind+i];
            else if(option == 1){
                shared_mem[ind]=max(shared_mem[ind],shared_mem[ind+i]);
            }else{
                shared_mem[ind]=min(shared_mem[ind],shared_mem[ind+i]);
            }
        }
        __syncthreads();
    }
    arr_out[blockIdx.x]=shared_mem[0];
}

void parll(vector<int>v){
    int *h_in, *h_out, *d_in, *d_out;
    h_in = new int[v.size()];
    copy(v.begin(),v.end(),h_in);
    string opt[] = {"Sum", "Maximum", "Minimum", "Average"};
    h_out = new int[1];
    int actual_size = v.size();
    for(int option = 0; option<4; option++){
        cudaMalloc(&d_in,sizeof(int)*v.size());
        cudaMalloc(&d_out,sizeof(int)*v.size());
        cudaMemcpy(d_in,h_in,sizeof(int)*v.size(),cudaMemcpyHostToDevice);
        int d_in_size = v.size();
        int num_blocks = 1+(d_in_size-1)/THREADS_PER_BLOCK;
        clock_t st = clock();
        while(num_blocks>1){
            calculate<<<num_blocks,THREADS_PER_BLOCK,sizeof(int)*THREADS_PER_BLOCK>>>(d_in,d_out,d_in_size,option);
            d_in_size = num_blocks;
            cudaFree(d_in);
            cudaMalloc(&d_in,sizeof(int)*d_in_size);
            cudaMemcpy(d_in,d_out,sizeof(int)*d_in_size,cudaMemcpyDeviceToDevice);
            cudaFree(d_out);
            num_blocks = 1+(num_blocks-1)/THREADS_PER_BLOCK;
            cudaMalloc(&d_out,sizeof(int)*num_blocks);
        }
        calculate<<<1,THREADS_PER_BLOCK,sizeof(int)*THREADS_PER_BLOCK>>>(d_in,d_out,d_in_size,option);
        clock_t en = clock();
        cudaMemcpy(h_out,d_out,sizeof(int)*1,cudaMemcpyDeviceToHost);
        if(option==3){
            h_out[0] = h_out[0]/actual_size;
        }
        cout<<"Parallel "<<opt[option]<<" : "<<h_out[0]<<"\n";
        cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";
        cudaFree(d_in);
        cudaFree(d_out);
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    vector<int>v;
    srand(time(NULL));
    for(int i=0;i<100000000;i++){
        v.push_back(1+rand()%1000);
    }
    seq(v);
    parll(v);
}

	.file	"tmpxft_003a9d54_00000000-6_cuda1.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4013:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4013:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Sequential Sum: "
.LC1:
	.string	"\n"
.LC2:
	.string	"Time taken: "
.LC4:
	.string	"Sequential Maximum: "
.LC5:
	.string	"Sequential Minimum: "
.LC6:
	.string	"Sequential Average: "
	.text
	.globl	_Z3seqSt6vectorIiSaIiEE
	.type	_Z3seqSt6vectorIiSaIiEE, @function
_Z3seqSt6vectorIiSaIiEE:
.LFB3998:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 64
	call	clock@PLT
	movq	(%rbx), %rcx
	xorl	%edx, %edx
	movq	%rax, %r15
	movq	8(%rbx), %rax
	subq	%rcx, %rax
	sarq	$2, %rax
.L3:
	cmpq	%rdx, %rax
	je	.L13
	addl	(%rcx,%rdx,4), %ebp
	incq	%rdx
	jmp	.L3
.L13:
	leaq	_ZSt4cout(%rip), %r12
	leaq	.LC2(%rip), %r13
	call	clock@PLT
	leaq	.LC0(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %r14
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	subq	%r15, %r14
	movl	$-1000000000, %r15d
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r14, %xmm0
	divsd	.LC3(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	call	clock@PLT
	movq	(%rbx), %rsi
	xorl	%edx, %edx
	movq	%rax, %rbp
	movq	8(%rbx), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
.L5:
	cmpq	%rdx, %rax
	je	.L14
	movl	(%rsi,%rdx,4), %edi
	cmpl	%edi, %r15d
	cmovl	%edi, %r15d
	incq	%rdx
	jmp	.L5
.L14:
	call	clock@PLT
	leaq	.LC4(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %r14
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r15d, %esi
	subq	%rbp, %r14
	movl	$1000000000, %r15d
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r14, %xmm0
	divsd	.LC3(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	call	clock@PLT
	movq	(%rbx), %rsi
	xorl	%edx, %edx
	movq	%rax, %rbp
	movq	8(%rbx), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
.L7:
	cmpq	%rdx, %rax
	je	.L15
	movl	(%rsi,%rdx,4), %edi
	cmpl	%edi, %r15d
	cmovg	%edi, %r15d
	incq	%rdx
	jmp	.L7
.L15:
	call	clock@PLT
	leaq	.LC5(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %r14
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r15d, %esi
	subq	%rbp, %r14
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r14, %xmm0
	divsd	.LC3(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	call	clock@PLT
	movq	(%rbx), %rsi
	movq	8(%rbx), %rcx
	xorl	%edx, %edx
	movq	%rax, %r15
	xorl	%eax, %eax
	subq	%rsi, %rcx
	sarq	$2, %rcx
.L9:
	cmpq	%rdx, %rcx
	je	.L16
	addl	(%rsi,%rdx,4), %eax
	incq	%rdx
	jmp	.L9
.L16:
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	call	clock@PLT
	movq	%r12, %rdi
	leaq	.LC6(%rip), %rsi
	movq	%rax, %r14
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	subq	%r15, %r14
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r14, %xmm0
	divsd	.LC3(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	popq	%rax
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE3998:
	.size	_Z3seqSt6vectorIiSaIiEE, .-_Z3seqSt6vectorIiSaIiEE
	.globl	_Z32__device_stub__Z9calculatePiS_iiPiS_ii
	.type	_Z32__device_stub__Z9calculatePiS_iiPiS_ii, @function
_Z32__device_stub__Z9calculatePiS_iiPiS_ii:
.LFB4035:
	.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
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%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	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%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	.L17
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9calculatePiS_ii(%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
.L17:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4035:
	.size	_Z32__device_stub__Z9calculatePiS_iiPiS_ii, .-_Z32__device_stub__Z9calculatePiS_iiPiS_ii
	.globl	_Z9calculatePiS_ii
	.type	_Z9calculatePiS_ii, @function
_Z9calculatePiS_ii:
.LFB4036:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z9calculatePiS_iiPiS_ii
	.cfi_endproc
.LFE4036:
	.size	_Z9calculatePiS_ii, .-_Z9calculatePiS_ii
	.section	.rodata.str1.1
.LC7:
	.string	"_Z9calculatePiS_ii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4038:
	.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	.LC7(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9calculatePiS_ii(%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
.LFE4038:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC8:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4346:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L25
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	.LC8(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L25:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L27
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L27:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
.L30:
	call	__stack_chk_fail@PLT
.L28:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4346:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC9:
	.string	"Sum"
.LC10:
	.string	"Maximum"
.LC11:
	.string	"Minimum"
.LC12:
	.string	"Average"
.LC13:
	.string	"Parallel "
.LC14:
	.string	" : "
	.text
	.globl	_Z5parllSt6vectorIiSaIiEE
	.type	_Z5parllSt6vectorIiSaIiEE, @function
_Z5parllSt6vectorIiSaIiEE:
.LFB3999:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3999
	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
	movq	%rdi, %rbx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	8(%rdi), %rdi
	subq	(%rbx), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movabsq	$9223372036854775800, %rax
	cmpq	%rdi, %rax
	jb	.L32
.LEHB0:
	call	_Znam@PLT
.LEHE0:
	movq	(%rbx), %rsi
	movq	8(%rbx), %rdx
	movq	%rax, (%rsp)
	subq	%rsi, %rdx
	cmpq	$4, %rdx
	jle	.L33
	movq	%rax, %rdi
	call	memmove@PLT
	jmp	.L34
.L33:
	jne	.L34
	movl	(%rsi), %eax
	movq	(%rsp), %rcx
	movl	%eax, (%rcx)
.L34:
	leaq	60(%rsp), %r12
	leaq	72(%rsp), %rbp
	movq	%r12, %rdx
	leaq	.LC9(%rip), %rsi
	movq	%rbp, %rdi
.LEHB1:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE1:
	jmp	.L76
.L32:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
.LEHB2:
	call	__cxa_throw_bad_array_new_length@PLT
.LEHE2:
.L76:
	leaq	104(%rsp), %rdi
	movq	%r12, %rdx
	leaq	.LC10(%rip), %rsi
.LEHB3:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE3:
	jmp	.L77
.L62:
	endbr64
	movq	%rax, %rbx
.L38:
	movl	$2, %eax
	jmp	.L39
.L77:
	leaq	136(%rsp), %rdi
	movq	%r12, %rdx
	leaq	.LC11(%rip), %rsi
.LEHB4:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE4:
	jmp	.L78
.L63:
	endbr64
	movq	%rax, %rbx
.L41:
	movl	$1, %eax
	jmp	.L39
.L78:
	leaq	168(%rsp), %rdi
	movq	%r12, %rdx
	leaq	.LC12(%rip), %rsi
.LEHB5:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE5:
	jmp	.L79
.L59:
	endbr64
	movq	%rax, %rbx
.L43:
	xorl	%eax, %eax
	jmp	.L39
.L79:
	movl	$4, %edi
.LEHB6:
	call	_Znam@PLT
	movq	%rax, %r12
	movq	8(%rbx), %rax
	subq	(%rbx), %rax
	movq	%rbp, 8(%rsp)
	movabsq	$4294967552, %r14
	sarq	$2, %rax
	xorl	%ebp, %ebp
	movl	%eax, 20(%rsp)
.L49:
	movq	8(%rbx), %rsi
	leaq	32(%rsp), %rdi
	subq	(%rbx), %rsi
	call	cudaMalloc@PLT
	movq	8(%rbx), %rsi
	leaq	40(%rsp), %rdi
	subq	(%rbx), %rsi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movq	8(%rbx), %rdx
	subq	(%rbx), %rdx
	call	cudaMemcpy@PLT
	movq	8(%rbx), %rax
	subq	(%rbx), %rax
	movl	$256, %ecx
	sarq	$2, %rax
	movl	%eax, %r15d
	decl	%eax
	cltd
	idivl	%ecx
	leal	1(%rax), %r13d
	call	clock@PLT
	movq	%rax, 24(%rsp)
.L44:
	movq	%r14, 60(%rsp)
	movl	$1, 68(%rsp)
	cmpl	$1, %r13d
	jle	.L80
	movl	%r13d, 48(%rsp)
	xorl	%r9d, %r9d
	movq	%r14, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rax
	movl	$1024, %r8d
	movq	%rax, 52(%rsp)
	movq	48(%rsp), %rdi
	movl	56(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	movq	32(%rsp), %rdi
	testl	%eax, %eax
	jne	.L45
	movq	40(%rsp), %rsi
	movl	%ebp, %ecx
	movl	%r15d, %edx
	call	_Z32__device_stub__Z9calculatePiS_iiPiS_ii
.L45:
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movslq	%r13d, %rax
	leaq	32(%rsp), %rdi
	leaq	0(,%rax,4), %r15
	movq	%r15, %rsi
	call	cudaMalloc@PLT
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$3, %ecx
	movq	%r15, %rdx
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	leal	-1(%r13), %r15d
	leaq	40(%rsp), %rdi
	sarl	$8, %r15d
	leal	1(%r15), %eax
	movl	%r13d, %r15d
	movslq	%eax, %rsi
	movl	%eax, 16(%rsp)
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	16(%rsp), %r13d
	jmp	.L44
.L80:
	xorl	%r9d, %r9d
	movq	%r14, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1024, %r8d
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	%ebp, %ecx
	movl	%r15d, %edx
	call	_Z32__device_stub__Z9calculatePiS_iiPiS_ii
.L47:
	call	clock@PLT
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movq	%r12, %rdi
	movl	$4, %edx
	movq	%rax, %r13
	call	cudaMemcpy@PLT
	cmpl	$3, %ebp
	jne	.L48
	movl	(%r12), %eax
	cltd
	idivl	20(%rsp)
	movl	%eax, (%r12)
.L48:
	leaq	_ZSt4cout(%rip), %r15
	leaq	.LC13(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	8(%rsp), %rsi
	movq	%rax, %rdi
	call	_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%rax, %rdi
	leaq	.LC14(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r12), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC1(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC2(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	24(%rsp), %rax
	subq	%rax, %r13
	cvtsi2sdq	%r13, %xmm0
	divsd	.LC3(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC1(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
.LEHE6:
	incl	%ebp
	addq	$32, 8(%rsp)
	cmpl	$4, %ebp
	jne	.L49
	leaq	200(%rsp), %rbx
	leaq	72(%rsp), %rbp
.L50:
	subq	$32, %rbx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	cmpq	%rbp, %rbx
	jne	.L50
	jmp	.L81
.L61:
	endbr64
	movq	%rax, %rbx
.L51:
	movl	$3, %eax
.L39:
	movl	$3, %r12d
	subq	%rax, %r12
	salq	$5, %r12
	addq	%rbp, %r12
.L53:
	cmpq	%rbp, %r12
	je	.L52
	subq	$32, %r12
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L53
.L52:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	movq	%rbx, %rdi
	je	.L75
	jmp	.L74
.L60:
	endbr64
	movq	%rax, %rbp
.L55:
	leaq	200(%rsp), %rbx
	leaq	72(%rsp), %r12
.L56:
	subq	$32, %rbx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	cmpq	%r12, %rbx
	jne	.L56
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	movq	%rbp, %rdi
	jne	.L74
.L75:
.LEHB7:
	call	_Unwind_Resume@PLT
.LEHE7:
.L81:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L58
.L74:
	call	__stack_chk_fail@PLT
.L58:
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3999:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3999:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3999-.LLSDACSB3999
.LLSDACSB3999:
	.uleb128 .LEHB0-.LFB3999
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3999
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L61-.LFB3999
	.uleb128 0
	.uleb128 .LEHB2-.LFB3999
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB3-.LFB3999
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L62-.LFB3999
	.uleb128 0
	.uleb128 .LEHB4-.LFB3999
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L63-.LFB3999
	.uleb128 0
	.uleb128 .LEHB5-.LFB3999
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L59-.LFB3999
	.uleb128 0
	.uleb128 .LEHB6-.LFB3999
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L60-.LFB3999
	.uleb128 0
	.uleb128 .LEHB7-.LFB3999
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
.LLSDACSE3999:
	.text
	.size	_Z5parllSt6vectorIiSaIiEE, .-_Z5parllSt6vectorIiSaIiEE
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4361:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L82
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L82:
	ret
	.cfi_endproc
.LFE4361:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.text._ZNSt6vectorIiSaIiEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC5ERKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEEC2ERKS1_
	.type	_ZNSt6vectorIiSaIiEEC2ERKS1_, @function
_ZNSt6vectorIiSaIiEEC2ERKS1_:
.LFB4365:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	8(%rsi), %rbp
	movq	%rdi, %rbx
	subq	(%rsi), %rbp
	movq	$0, (%rdi)
	movq	$0, 8(%rdi)
	movq	$0, 16(%rdi)
	je	.L89
	movabsq	$9223372036854775804, %rax
	cmpq	%rbp, %rax
	jnb	.L86
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L86:
	movq	%rbp, %rdi
	call	_Znwm@PLT
	movq	%rax, %rcx
	jmp	.L85
.L89:
	xorl	%ecx, %ecx
.L85:
	addq	%rcx, %rbp
	movq	%rcx, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rbp, 16(%rbx)
	movq	(%r12), %rsi
	movq	8(%r12), %rbp
	subq	%rsi, %rbp
	cmpq	$4, %rbp
	jle	.L87
	movq	%rcx, %rdi
	movq	%rbp, %rdx
	call	memmove@PLT
	movq	%rax, %rcx
	jmp	.L88
.L87:
	jne	.L88
	movl	(%rsi), %eax
	movl	%eax, (%rcx)
.L88:
	addq	%rbp, %rcx
	movq	%rcx, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4365:
	.size	_ZNSt6vectorIiSaIiEEC2ERKS1_, .-_ZNSt6vectorIiSaIiEEC2ERKS1_
	.weak	_ZNSt6vectorIiSaIiEEC1ERKS1_
	.set	_ZNSt6vectorIiSaIiEEC1ERKS1_,_ZNSt6vectorIiSaIiEEC2ERKS1_
	.section	.rodata._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC15:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, @function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_:
.LFB4638:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L92
	leaq	.LC15(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L92:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L102
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L97
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L96
.L102:
	movq	%rcx, %rbx
.L96:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L97:
	movl	(%rdx), %eax
	movl	%eax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L98
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L98:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L99
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L99:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L100
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L100:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4638:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4000:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4000
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%edi, %edi
	movl	$1000, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	$100000000, %ebx
	subq	$72, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
.LEHB8:
	call	_ZNSt8ios_base15sync_with_stdioEb@PLT
.LEHE8:
	xorl	%eax, %eax
	xorl	%edi, %edi
	movq	%rax, 232+_ZSt3cin(%rip)
	movq	%rax, 224+_ZSt4cout(%rip)
	movq	%rax, 8(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
.L112:
	call	rand@PLT
	movq	16(%rsp), %rsi
	cltd
	idivl	%ebp
	incl	%edx
	movl	%edx, 32(%rsp)
	cmpq	24(%rsp), %rsi
	je	.L110
	movl	%edx, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 16(%rsp)
	jmp	.L111
.L110:
	leaq	32(%rsp), %rdx
	leaq	8(%rsp), %rdi
.LEHB9:
	call	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.L111:
	decl	%ebx
	jne	.L112
	leaq	8(%rsp), %rbx
	leaq	32(%rsp), %rbp
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	_ZNSt6vectorIiSaIiEEC1ERKS1_
.LEHE9:
	movq	%rbp, %rdi
.LEHB10:
	call	_Z3seqSt6vectorIiSaIiEE
.LEHE10:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	%rbx, %rsi
	movq	%rbp, %rdi
.LEHB11:
	call	_ZNSt6vectorIiSaIiEEC1ERKS1_
.LEHE11:
	movq	%rbp, %rdi
.LEHB12:
	call	_Z5parllSt6vectorIiSaIiEE
.LEHE12:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	%rbx, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L117
	jmp	.L122
.L119:
	endbr64
	jmp	.L124
.L120:
	endbr64
.L124:
	movq	%rax, %rbx
.L115:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L114
.L118:
	endbr64
	movq	%rax, %rbx
.L114:
	leaq	8(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L122
	movq	%rbx, %rdi
.LEHB13:
	call	_Unwind_Resume@PLT
.LEHE13:
.L122:
	call	__stack_chk_fail@PLT
.L117:
	addq	$72, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4000:
	.section	.gcc_except_table
.LLSDA4000:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4000-.LLSDACSB4000
.LLSDACSB4000:
	.uleb128 .LEHB8-.LFB4000
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB9-.LFB4000
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L118-.LFB4000
	.uleb128 0
	.uleb128 .LEHB10-.LFB4000
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L119-.LFB4000
	.uleb128 0
	.uleb128 .LEHB11-.LFB4000
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L118-.LFB4000
	.uleb128 0
	.uleb128 .LEHB12-.LFB4000
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L120-.LFB4000
	.uleb128 0
	.uleb128 .LEHB13-.LFB4000
	.uleb128 .LEHE13-.LEHB13
	.uleb128 0
	.uleb128 0
.LLSDACSE4000:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.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:

// %%cu
// as data type is int, sum might overflow (depending on rand(), but the seq and parallel answers are still equal, or change int to long long (too lazy sorry))
#include<iostream>
#include<vector>
#include<cstdlib>
#include<cstdio>
#include<limits>
#include<hip/hip_runtime.h>
#define THREADS_PER_BLOCK 256
using namespace std;

void seq(vector<int>v){
    clock_t st = clock();
    int sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    clock_t en = clock();

    cout<<"Sequential Sum: "<<sum<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";

    st= clock();
    int maxx=-1e9;
    for(int i=0;i<v.size();i++){
        maxx=max(maxx,v[i]);
    }
    en = clock();
    cout<<"Sequential Maximum: "<<maxx<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";

    st = clock();
    int minn=1e9;
    for(int i=0;i<v.size();i++){
        minn=min(minn,v[i]);
    }
    en = clock();
    cout<<"Sequential Minimum: "<<minn<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";


    st = clock();
    sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    sum=sum/(int)v.size();
    en = clock();

    cout<<"Sequential Average: "<<sum<<"\n";

    cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";
}

__global__ void calculate(int *arr_in, int* arr_out, int sz, int option){
    int ind = threadIdx.x;
    int dim = blockDim.x;
    extern __shared__ int shared_mem[];
    int actual_ind = blockIdx.x*blockDim.x + ind;
    if(actual_ind < sz){
        shared_mem[ind] = arr_in[actual_ind];
    }else{
        if(option == 0 || option == 3)
            shared_mem[ind] = 0;
        else if(option == 1){//maximum
            shared_mem[ind] = -INT_MAX;
        }else{//minimum
            shared_mem[ind] = INT_MAX;
        }
    }
    __syncthreads();
    for(int i=dim/2 ; i > 0 ; i=i/2){
        if(ind<i){
            if(option == 0 || option == 3)
                shared_mem[ind]+=shared_mem[ind+i];
            else if(option == 1){
                shared_mem[ind]=max(shared_mem[ind],shared_mem[ind+i]);
            }else{
                shared_mem[ind]=min(shared_mem[ind],shared_mem[ind+i]);
            }
        }
        __syncthreads();
    }
    arr_out[blockIdx.x]=shared_mem[0];
}

void parll(vector<int>v){
    int *h_in, *h_out, *d_in, *d_out;
    h_in = new int[v.size()];
    copy(v.begin(),v.end(),h_in);
    string opt[] = {"Sum", "Maximum", "Minimum", "Average"};
    h_out = new int[1];
    int actual_size = v.size();
    for(int option = 0; option<4; option++){
        hipMalloc(&d_in,sizeof(int)*v.size());
        hipMalloc(&d_out,sizeof(int)*v.size());
        hipMemcpy(d_in,h_in,sizeof(int)*v.size(),hipMemcpyHostToDevice);
        int d_in_size = v.size();
        int num_blocks = 1+(d_in_size-1)/THREADS_PER_BLOCK;
        clock_t st = clock();
        while(num_blocks>1){
            calculate<<<num_blocks,THREADS_PER_BLOCK,sizeof(int)*THREADS_PER_BLOCK>>>(d_in,d_out,d_in_size,option);
            d_in_size = num_blocks;
            hipFree(d_in);
            hipMalloc(&d_in,sizeof(int)*d_in_size);
            hipMemcpy(d_in,d_out,sizeof(int)*d_in_size,hipMemcpyDeviceToDevice);
            hipFree(d_out);
            num_blocks = 1+(num_blocks-1)/THREADS_PER_BLOCK;
            hipMalloc(&d_out,sizeof(int)*num_blocks);
        }
        calculate<<<1,THREADS_PER_BLOCK,sizeof(int)*THREADS_PER_BLOCK>>>(d_in,d_out,d_in_size,option);
        clock_t en = clock();
        hipMemcpy(h_out,d_out,sizeof(int)*1,hipMemcpyDeviceToHost);
        if(option==3){
            h_out[0] = h_out[0]/actual_size;
        }
        cout<<"Parallel "<<opt[option]<<" : "<<h_out[0]<<"\n";
        cout<<"Time taken: "<<double(en-st)/CLOCKS_PER_SEC<<"\n";
        hipFree(d_in);
        hipFree(d_out);
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    vector<int>v;
    srand(time(NULL));
    for(int i=0;i<100000000;i++){
        v.push_back(1+rand()%1000);
    }
    seq(v);
    parll(v);
}

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

                                        # End of file scope inline assembly
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z3seqSt6vectorIiSaIiEE
.LCPI0_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z3seqSt6vectorIiSaIiEE
	.type	_Z3seqSt6vectorIiSaIiEE,@function
_Z3seqSt6vectorIiSaIiEE:                # @_Z3seqSt6vectorIiSaIiEE
	.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	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	callq	clock
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	subq	%rax, %rcx
	je	.LBB0_1
# %bb.8:                                # %.lr.ph.preheader
	sarq	$2, %rcx
	cmpq	$1, %rcx
	adcq	$0, %rcx
	xorl	%edx, %edx
	xorl	%ebp, %ebp
.LBB0_9:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addl	(%rax,%rdx,4), %ebp
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB0_9
	jmp	.LBB0_2
.LBB0_1:
	xorl	%ebp, %ebp
.LBB0_2:                                # %._crit_edge
	callq	clock
	movq	%rax, %r15
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	%r14, %r15
	cvtsi2sd	%r15, %xmm0
	divsd	.LCPI0_0(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	callq	clock
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	subq	%rax, %rcx
	je	.LBB0_3
# %bb.10:                               # %.lr.ph45.preheader
	sarq	$2, %rcx
	cmpq	$1, %rcx
	adcq	$0, %rcx
	movl	$-1000000000, %esi              # imm = 0xC4653600
	xorl	%edx, %edx
.LBB0_11:                               # %.lr.ph45
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rax,%rdx,4), %ebp
	cmpl	%ebp, %esi
	cmovgl	%esi, %ebp
	incq	%rdx
	movl	%ebp, %esi
	cmpq	%rdx, %rcx
	jne	.LBB0_11
	jmp	.LBB0_4
.LBB0_3:
	movl	$-1000000000, %ebp              # imm = 0xC4653600
.LBB0_4:                                # %._crit_edge46
	callq	clock
	movq	%rax, %r15
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	%r14, %r15
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15, %xmm0
	divsd	.LCPI0_0(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	callq	clock
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	subq	%rax, %rcx
	je	.LBB0_5
# %bb.12:                               # %.lr.ph51.preheader
	sarq	$2, %rcx
	cmpq	$1, %rcx
	adcq	$0, %rcx
	movl	$1000000000, %esi               # imm = 0x3B9ACA00
	xorl	%edx, %edx
.LBB0_13:                               # %.lr.ph51
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rax,%rdx,4), %ebp
	cmpl	%ebp, %esi
	cmovll	%esi, %ebp
	incq	%rdx
	movl	%ebp, %esi
	cmpq	%rdx, %rcx
	jne	.LBB0_13
	jmp	.LBB0_6
.LBB0_5:
	movl	$1000000000, %ebp               # imm = 0x3B9ACA00
.LBB0_6:                                # %._crit_edge52
	callq	clock
	movq	%rax, %r15
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	%r14, %r15
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15, %xmm0
	divsd	.LCPI0_0(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	callq	clock
	movq	%rax, %r14
	movq	(%rbx), %rdx
	movq	8(%rbx), %rax
	movq	%rax, %rcx
	subq	%rdx, %rcx
	sarq	$2, %rcx
	cmpq	%rdx, %rax
	je	.LBB0_7
# %bb.14:                               # %.lr.ph57.preheader
	cmpq	$1, %rcx
	movq	%rcx, %rsi
	adcq	$0, %rsi
	xorl	%edi, %edi
	xorl	%eax, %eax
.LBB0_15:                               # %.lr.ph57
                                        # =>This Inner Loop Header: Depth=1
	addl	(%rdx,%rdi,4), %eax
	incq	%rdi
	cmpq	%rdi, %rsi
	jne	.LBB0_15
	jmp	.LBB0_16
.LBB0_7:
	xorl	%eax, %eax
.LBB0_16:                               # %._crit_edge58
	cltd
	idivl	%ecx
	movl	%eax, %ebp
	callq	clock
	movq	%rax, %rbx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	%r14, %rbx
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rbx, %xmm0
	divsd	.LCPI0_0(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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
	jmp	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l # TAILCALL
.Lfunc_end0:
	.size	_Z3seqSt6vectorIiSaIiEE, .Lfunc_end0-_Z3seqSt6vectorIiSaIiEE
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__calculatePiS_ii # -- Begin function _Z24__device_stub__calculatePiS_ii
	.type	_Z24__device_stub__calculatePiS_ii,@function
_Z24__device_stub__calculatePiS_ii:     # @_Z24__device_stub__calculatePiS_ii
	.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	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9calculatePiS_ii, %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	_Z24__device_stub__calculatePiS_ii, .Lfunc_end1-_Z24__device_stub__calculatePiS_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z5parllSt6vectorIiSaIiEE
.LCPI2_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z5parllSt6vectorIiSaIiEE
	.type	_Z5parllSt6vectorIiSaIiEE,@function
_Z5parllSt6vectorIiSaIiEE:              # @_Z5parllSt6vectorIiSaIiEE
.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	$200, %rsp
	.cfi_def_cfa_offset 256
	.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	%rdi, %r12
	movq	(%rdi), %rbx
	movq	8(%rdi), %r14
	subq	%rbx, %r14
	movq	$-1, %rdi
	cmovnsq	%r14, %rdi
	callq	_Znam
	movq	%rax, %r13
	cmpq	$5, %r14
	jl	.LBB2_2
# %bb.1:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB2_4:                                # %_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEES2_ET0_T_S8_S7_.exit
	leaq	80(%rsp), %rax
	movq	%rax, -16(%rax)
	leaq	64(%rsp), %r14
	movl	$.L.str.6, %esi
	movl	$.L.str.6+3, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	leaq	96(%rsp), %r15
	leaq	112(%rsp), %rax
	movq	%rax, -16(%rax)
.Ltmp0:
	movl	$.L.str.7, %esi
	movl	$.L.str.7+7, %edx
	movq	%r15, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp1:
# %bb.5:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit60
	leaq	128(%rsp), %r15
	leaq	144(%rsp), %rax
	movq	%rax, -16(%rax)
.Ltmp3:
	movl	$.L.str.8, %esi
	movl	$.L.str.8+7, %edx
	movq	%r15, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp4:
# %bb.6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit61
	leaq	160(%rsp), %r15
	leaq	176(%rsp), %rax
	movq	%rax, -16(%rax)
.Ltmp6:
	movl	$.L.str.9, %esi
	movl	$.L.str.9+7, %edx
	movq	%r15, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp7:
# %bb.7:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit62
.Ltmp9:
	movq	%r13, 40(%rsp)                  # 8-byte Spill
	movl	$4, %edi
	callq	_Znam
	movq	%rax, 24(%rsp)                  # 8-byte Spill
.Ltmp10:
# %bb.8:
	movq	8(%r12), %rax
	movq	%r12, 48(%rsp)                  # 8-byte Spill
	subq	(%r12), %rax
	shrq	$2, %rax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	xorl	%r12d, %r12d
	leaq	16(%rsp), %rbp
	movabsq	$4294967552, %r14               # imm = 0x100000100
.LBB2_9:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_13 Depth 2
	movq	48(%rsp), %rbx                  # 8-byte Reload
	movq	8(%rbx), %rsi
	subq	(%rbx), %rsi
.Ltmp12:
	leaq	8(%rsp), %rdi
	callq	hipMalloc
.Ltmp13:
# %bb.10:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
                                        #   in Loop: Header=BB2_9 Depth=1
	movq	8(%rbx), %rsi
	subq	(%rbx), %rsi
.Ltmp14:
	movq	%rbp, %rdi
	callq	hipMalloc
.Ltmp15:
# %bb.11:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit63
                                        #   in Loop: Header=BB2_9 Depth=1
	movq	8(%rsp), %rdi
	movq	8(%rbx), %rdx
	subq	(%rbx), %rdx
.Ltmp16:
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp17:
# %bb.12:                               #   in Loop: Header=BB2_9 Depth=1
	movq	8(%rbx), %r13
	subq	(%rbx), %r13
	shrq	$2, %r13
	leal	-1(%r13), %eax
	leal	254(%r13), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$8, %ebx
	incl	%ebx
	callq	clock
	movq	%rax, 56(%rsp)                  # 8-byte Spill
.LBB2_13:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit65
                                        #   Parent Loop BB2_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	$2, %ebx
	jl	.LBB2_32
# %bb.14:                               #   in Loop: Header=BB2_13 Depth=2
	movl	%ebx, %r15d
	movl	%ebx, %ebx
	movq	%rbx, %rdi
	btsq	$32, %rdi
.Ltmp47:
	movl	$1024, %r8d                     # imm = 0x400
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp48:
# %bb.15:                               #   in Loop: Header=BB2_13 Depth=2
	testl	%eax, %eax
	jne	.LBB2_17
# %bb.16:                               #   in Loop: Header=BB2_13 Depth=2
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp49:
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_Z24__device_stub__calculatePiS_ii
.Ltmp50:
.LBB2_17:                               #   in Loop: Header=BB2_13 Depth=2
	movq	8(%rsp), %rdi
.Ltmp51:
	callq	hipFree
.Ltmp52:
# %bb.18:                               #   in Loop: Header=BB2_13 Depth=2
	shlq	$2, %rbx
.Ltmp53:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
.Ltmp54:
# %bb.19:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit64
                                        #   in Loop: Header=BB2_13 Depth=2
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp55:
	movq	%rbx, %rdx
	movl	$3, %ecx
	callq	hipMemcpy
.Ltmp56:
# %bb.20:                               #   in Loop: Header=BB2_13 Depth=2
	movq	16(%rsp), %rdi
.Ltmp57:
	callq	hipFree
.Ltmp58:
# %bb.21:                               #   in Loop: Header=BB2_13 Depth=2
	leal	-1(%r15), %eax
	shrl	$8, %eax
	leal	4(,%rax,4), %esi
	movl	%eax, %ebx
	incl	%ebx
.Ltmp59:
	movq	%rbp, %rdi
	callq	hipMalloc
.Ltmp60:
	movl	%r15d, %r13d
	jmp	.LBB2_13
.LBB2_32:                               #   in Loop: Header=BB2_9 Depth=1
.Ltmp19:
	movl	$1024, %r8d                     # imm = 0x400
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp20:
# %bb.33:                               #   in Loop: Header=BB2_9 Depth=1
	testl	%eax, %eax
	jne	.LBB2_35
# %bb.34:                               #   in Loop: Header=BB2_9 Depth=1
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp21:
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_Z24__device_stub__calculatePiS_ii
.Ltmp22:
.LBB2_35:                               #   in Loop: Header=BB2_9 Depth=1
	callq	clock
	movq	%rax, %r15
	movq	16(%rsp), %rsi
.Ltmp24:
	movl	$4, %edx
	movq	24(%rsp), %rdi                  # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp25:
# %bb.36:                               #   in Loop: Header=BB2_9 Depth=1
	cmpq	$3, %r12
	jne	.LBB2_38
# %bb.37:                               #   in Loop: Header=BB2_9 Depth=1
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movl	(%rcx), %eax
	cltd
	idivl	32(%rsp)                        # 4-byte Folded Reload
	movl	%eax, (%rcx)
.LBB2_38:                               #   in Loop: Header=BB2_9 Depth=1
.Ltmp26:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp27:
# %bb.39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB2_9 Depth=1
	movq	%r12, %rax
	shlq	$5, %rax
	movq	64(%rsp,%rax), %rsi
	movq	72(%rsp,%rax), %rdx
.Ltmp28:
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp29:
# %bb.40:                               # %_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
                                        #   in Loop: Header=BB2_9 Depth=1
.Ltmp30:
	movq	%rax, %rbx
	movl	$.L.str.11, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp31:
# %bb.41:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit66
                                        #   in Loop: Header=BB2_9 Depth=1
	movq	24(%rsp), %rax                  # 8-byte Reload
	movl	(%rax), %esi
.Ltmp32:
	movq	%rbx, %rdi
	callq	_ZNSolsEi
.Ltmp33:
# %bb.42:                               #   in Loop: Header=BB2_9 Depth=1
.Ltmp34:
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp35:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit67
                                        #   in Loop: Header=BB2_9 Depth=1
.Ltmp36:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp37:
# %bb.44:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit68
                                        #   in Loop: Header=BB2_9 Depth=1
	subq	56(%rsp), %r15                  # 8-byte Folded Reload
	cvtsi2sd	%r15, %xmm0
	divsd	.LCPI2_0(%rip), %xmm0
.Ltmp38:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp39:
# %bb.45:                               # %_ZNSolsEd.exit
                                        #   in Loop: Header=BB2_9 Depth=1
.Ltmp40:
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp41:
# %bb.46:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit69
                                        #   in Loop: Header=BB2_9 Depth=1
	movq	8(%rsp), %rdi
.Ltmp42:
	callq	hipFree
.Ltmp43:
# %bb.47:                               #   in Loop: Header=BB2_9 Depth=1
	movq	16(%rsp), %rdi
.Ltmp44:
	callq	hipFree
.Ltmp45:
# %bb.48:                               #   in Loop: Header=BB2_9 Depth=1
	incq	%r12
	cmpq	$4, %r12
	jne	.LBB2_9
# %bb.49:
	movq	$-128, %rbx
	leaq	192(%rsp), %r14
.LBB2_50:                               # =>This Inner Loop Header: Depth=1
	movq	-32(%r14), %rdi
	leaq	-16(%r14), %rax
	cmpq	%rdi, %rax
	je	.LBB2_52
# %bb.51:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i70
                                        #   in Loop: Header=BB2_50 Depth=1
	callq	_ZdlPv
.LBB2_52:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit72
                                        #   in Loop: Header=BB2_50 Depth=1
	addq	$-32, %r14
	addq	$32, %rbx
	jne	.LBB2_50
# %bb.53:
	addq	$200, %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
.LBB2_2:
	.cfi_def_cfa_offset 256
	cmpq	$4, %r14
	jne	.LBB2_4
# %bb.3:
	movl	(%rbx), %eax
	movl	%eax, (%r13)
	jmp	.LBB2_4
.LBB2_54:
.Ltmp11:
	jmp	.LBB2_55
.LBB2_24:
.Ltmp8:
	jmp	.LBB2_25
.LBB2_23:
.Ltmp5:
	jmp	.LBB2_25
.LBB2_22:
.Ltmp2:
.LBB2_25:
	movq	%rax, %rbx
	addq	$-16, %r15
.LBB2_26:                               # =>This Inner Loop Header: Depth=1
	movq	-16(%r15), %rdi
	cmpq	%rdi, %r15
	je	.LBB2_28
# %bb.27:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
                                        #   in Loop: Header=BB2_26 Depth=1
	callq	_ZdlPv
.LBB2_28:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
                                        #   in Loop: Header=BB2_26 Depth=1
	leaq	-32(%r15), %rax
	addq	$-16, %r15
	cmpq	%r14, %r15
	movq	%rax, %r15
	jne	.LBB2_26
	jmp	.LBB2_59
.LBB2_31:                               # %.loopexit.split-lp
.Ltmp23:
	jmp	.LBB2_55
.LBB2_29:
.Ltmp18:
	jmp	.LBB2_55
.LBB2_60:
.Ltmp46:
	jmp	.LBB2_55
.LBB2_30:                               # %.loopexit91
.Ltmp61:
.LBB2_55:
	movq	%rax, %rbx
	movq	$-128, %r14
	leaq	192(%rsp), %r15
.LBB2_56:                               # =>This Inner Loop Header: Depth=1
	movq	-32(%r15), %rdi
	leaq	-16(%r15), %rax
	cmpq	%rdi, %rax
	je	.LBB2_58
# %bb.57:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i73
                                        #   in Loop: Header=BB2_56 Depth=1
	callq	_ZdlPv
.LBB2_58:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit75
                                        #   in Loop: Header=BB2_56 Depth=1
	addq	$-32, %r15
	addq	$32, %r14
	jne	.LBB2_56
.LBB2_59:                               # %.loopexit
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z5parllSt6vectorIiSaIiEE, .Lfunc_end2-_Z5parllSt6vectorIiSaIiEE
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .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 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp17-.Ltmp12                #   Call between .Ltmp12 and .Ltmp17
	.uleb128 .Ltmp18-.Lfunc_begin0          #     jumps to .Ltmp18
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp47-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp60-.Ltmp47                #   Call between .Ltmp47 and .Ltmp60
	.uleb128 .Ltmp61-.Lfunc_begin0          #     jumps to .Ltmp61
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp19-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp22-.Ltmp19                #   Call between .Ltmp19 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin0          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp45-.Ltmp24                #   Call between .Ltmp24 and .Ltmp45
	.uleb128 .Ltmp46-.Lfunc_begin0          #     jumps to .Ltmp46
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Lfunc_end2-.Ltmp45            #   Call between .Ltmp45 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$96, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_ZNSt8ios_base15sync_with_stdioEb
	movq	_ZSt3cin(%rip), %rax
	movq	-24(%rax), %rax
	movq	%r14, _ZSt3cin+216(%rax)
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	movq	%r14, _ZSt4cout+216(%rax)
	leaq	16(%rsp), %rbx
	movq	%r14, 16(%rbx)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, (%rbx)
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	$100000000, %ebp                # imm = 0x5F5E100
	leaq	12(%rsp), %r14
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
	movl	%eax, 12(%rsp)
	movq	24(%rsp), %rsi
	cmpq	32(%rsp), %rsi
	je	.LBB3_3
# %bb.2:                                #   in Loop: Header=BB3_1 Depth=1
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 24(%rsp)
	jmp	.LBB3_4
.LBB3_3:                                #   in Loop: Header=BB3_1 Depth=1
.Ltmp62:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp63:
.LBB3_4:                                # %_ZNSt6vectorIiSaIiEE9push_backEOi.exit
                                        #   in Loop: Header=BB3_1 Depth=1
	decl	%ebp
	jne	.LBB3_1
# %bb.5:
.Ltmp65:
	leaq	72(%rsp), %rdi
	leaq	16(%rsp), %rsi
	callq	_ZNSt6vectorIiSaIiEEC2ERKS1_
.Ltmp66:
# %bb.6:
.Ltmp67:
	leaq	72(%rsp), %rdi
	callq	_Z3seqSt6vectorIiSaIiEE
.Ltmp68:
# %bb.7:
	movq	72(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_9
# %bb.8:
	callq	_ZdlPv
.LBB3_9:                                # %_ZNSt6vectorIiSaIiEED2Ev.exit
.Ltmp70:
	leaq	48(%rsp), %rdi
	leaq	16(%rsp), %rsi
	callq	_ZNSt6vectorIiSaIiEEC2ERKS1_
.Ltmp71:
# %bb.10:
.Ltmp73:
	leaq	48(%rsp), %rdi
	callq	_Z5parllSt6vectorIiSaIiEE
.Ltmp74:
# %bb.11:
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_13
# %bb.12:
	callq	_ZdlPv
.LBB3_13:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit8
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_15
# %bb.14:
	callq	_ZdlPv
.LBB3_15:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit10
	xorl	%eax, %eax
	addq	$96, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB3_16:
	.cfi_def_cfa_offset 128
.Ltmp75:
	movq	%rax, %rbx
	movq	48(%rsp), %rdi
	jmp	.LBB3_18
.LBB3_17:
.Ltmp69:
	movq	%rax, %rbx
	movq	72(%rsp), %rdi
.LBB3_18:
	testq	%rdi, %rdi
	je	.LBB3_23
# %bb.19:
	callq	_ZdlPv
	jmp	.LBB3_23
.LBB3_20:
.Ltmp72:
	jmp	.LBB3_22
.LBB3_21:
.Ltmp64:
.LBB3_22:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit12
	movq	%rax, %rbx
.LBB3_23:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit12
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_25
# %bb.24:
	callq	_ZdlPv
.LBB3_25:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit16
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.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 .Ltmp62-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp62
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp63-.Ltmp62                #   Call between .Ltmp62 and .Ltmp63
	.uleb128 .Ltmp64-.Lfunc_begin1          #     jumps to .Ltmp64
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp65-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp66-.Ltmp65                #   Call between .Ltmp65 and .Ltmp66
	.uleb128 .Ltmp72-.Lfunc_begin1          #     jumps to .Ltmp72
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp68-.Ltmp67                #   Call between .Ltmp67 and .Ltmp68
	.uleb128 .Ltmp69-.Lfunc_begin1          #     jumps to .Ltmp69
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp71-.Ltmp70                #   Call between .Ltmp70 and .Ltmp71
	.uleb128 .Ltmp72-.Lfunc_begin1          #     jumps to .Ltmp72
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp73-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp74-.Ltmp73                #   Call between .Ltmp73 and .Ltmp74
	.uleb128 .Ltmp75-.Lfunc_begin1          #     jumps to .Ltmp75
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp74-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Lfunc_end3-.Ltmp74            #   Call between .Ltmp74 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2ERKS1_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2ERKS1_    # -- Begin function _ZNSt6vectorIiSaIiEEC2ERKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2ERKS1_,@function
_ZNSt6vectorIiSaIiEEC2ERKS1_:           # @_ZNSt6vectorIiSaIiEEC2ERKS1_
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	movq	(%rsi), %rcx
	movq	%rax, %r12
	subq	%rcx, %r12
	sarq	$2, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	cmpq	%rcx, %rax
	je	.LBB4_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %r15
	jmp	.LBB4_3
.LBB4_1:
	xorl	%r15d, %r15d
.LBB4_3:
	movq	%r15, (%rbx)
	movq	%r15, 8(%rbx)
	leaq	(%r15,%r12,4), %rax
	movq	%rax, 16(%rbx)
	movq	(%r14), %rsi
	movq	8(%r14), %r14
	subq	%rsi, %r14
	cmpq	$5, %r14
	jl	.LBB4_5
# %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB4_7:
	addq	%r14, %r15
	movq	%r15, 8(%rbx)
	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
.LBB4_5:
	.cfi_def_cfa_offset 48
	cmpq	$4, %r14
	jne	.LBB4_7
# %bb.6:
	movl	(%rsi), %eax
	movl	%eax, (%r15)
	jmp	.LBB4_7
.Lfunc_end4:
	.size	_ZNSt6vectorIiSaIiEEC2ERKS1_, .Lfunc_end4-_ZNSt6vectorIiSaIiEEC2ERKS1_
	.cfi_endproc
                                        # -- 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	.LBB5_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	.LBB5_3
.LBB5_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB5_3:
	testq	%r14, %r14
	je	.LBB5_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB5_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB5_7
.LBB5_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB5_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_end5:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end5-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_ # -- Begin function _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,@function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_: # @_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.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	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.13, %edx
	callq	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB6_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB6_3
.LBB6_1:
	xorl	%ebp, %ebp
.LBB6_3:                                # %_ZNSt12_Vector_baseIiSaIiEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB6_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB6_5:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB6_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB6_7:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB6_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB6_9:                                # %_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPim.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	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	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .Lfunc_end6-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB7_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB7_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end7:
	.size	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc, .Lfunc_end7-_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB8_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB8_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB8_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB8_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end8:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end8-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.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	$_Z9calculatePiS_ii, %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	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Sequential Sum: "
	.size	.L.str, 17

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Time taken: "
	.size	.L.str.2, 13

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Sequential Maximum: "
	.size	.L.str.3, 21

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Sequential Minimum: "
	.size	.L.str.4, 21

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Sequential Average: "
	.size	.L.str.5, 21

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

	.type	.L.str.6,@object                # @.str.6
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.6:
	.asciz	"Sum"
	.size	.L.str.6, 4

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

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

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

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Parallel "
	.size	.L.str.10, 10

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

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.13, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9calculatePiS_ii"
	.size	.L__unnamed_1, 19

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

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9calculatePiS_ii      ; -- Begin function _Z9calculatePiS_ii
	.globl	_Z9calculatePiS_ii
	.p2align	8
	.type	_Z9calculatePiS_ii,@function
_Z9calculatePiS_ii:                     ; @_Z9calculatePiS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[6:7], s[0:1], 0x10
	s_mov_b32 s4, s15
	s_waitcnt lgkmcnt(0)
	s_and_b32 s5, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s4, s5, v[0:1]
	v_cmp_le_i32_e32 vcc_lo, s6, v1
                                        ; implicit-def: $sgpr6
	s_and_saveexec_b32 s2, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s2, exec_lo, s2
	s_cbranch_execz .LBB0_16
; %bb.1:                                ; %NodeBlock59
	s_cmp_lt_i32 s7, 1
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %NodeBlock
	s_cmp_gt_i32 s7, 2
	s_cbranch_scc0 .LBB0_5
; %bb.3:                                ; %LeafBlock57
	s_cmp_lg_u32 s7, 3
	s_mov_b32 s8, 0
	s_mov_b32 s6, 0
	s_cselect_b32 s3, -1, 0
	s_branch .LBB0_6
.LBB0_4:
	s_mov_b32 s8, -1
	s_mov_b32 s3, 0
                                        ; implicit-def: $sgpr6
	s_branch .LBB0_11
.LBB0_5:
	s_mov_b32 s8, -1
	s_mov_b32 s3, 0
                                        ; implicit-def: $sgpr6
.LBB0_6:                                ; %Flow80
	s_and_not1_b32 vcc_lo, exec_lo, s8
	s_cbranch_vccnz .LBB0_10
; %bb.7:                                ; %LeafBlock55
	s_cmp_eq_u32 s7, 1
	s_cbranch_scc0 .LBB0_9
; %bb.8:
	s_mov_b32 s3, 0
	s_mov_b32 s6, 0x80000001
	s_branch .LBB0_10
.LBB0_9:
	s_mov_b32 s3, -1
                                        ; implicit-def: $sgpr6
.LBB0_10:                               ; %Flow81
	s_mov_b32 s8, 0
.LBB0_11:                               ; %Flow79
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 vcc_lo, exec_lo, s8
	s_cbranch_vccz .LBB0_13
; %bb.12:                               ; %LeafBlock
	s_cmp_lg_u32 s7, 0
	s_mov_b32 s6, 0
	s_cselect_b32 s3, -1, 0
.LBB0_13:                               ; %Flow83
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_cbranch_vccnz .LBB0_15
; %bb.14:
	s_brev_b32 s6, -2
.LBB0_15:                               ; %Flow84
                                        ; implicit-def: $vgpr1_vgpr2
.LBB0_16:                               ; %Flow85
	s_or_saveexec_b32 s8, s2
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mov_b32_e32 v2, s6
	s_xor_b32 exec_lo, exec_lo, s8
	s_cbranch_execz .LBB0_18
; %bb.17:
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, vcc_lo, s0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	global_load_b32 v2, v[1:2], off
.LBB0_18:
	s_or_b32 exec_lo, exec_lo, s8
	v_lshl_add_u32 v1, v0, 2, 0
	s_cmp_lt_u32 s5, 2
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v2
	s_waitcnt lgkmcnt(0)
	s_barrier
.LBB0_19:                               ; =>This Inner Loop Header: Depth=1
	buffer_gl0_inv
	s_cbranch_scc1 .LBB0_39
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	s_lshr_b32 s0, s5, 1
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u32_e64 s0, v0
	s_cbranch_execz .LBB0_38
; %bb.21:                               ; %NodeBlock69
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_cmp_lt_i32 s7, 1
	s_cbranch_scc1 .LBB0_24
; %bb.22:                               ; %NodeBlock67
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_cmp_gt_i32 s7, 2
	s_cbranch_scc0 .LBB0_25
; %bb.23:                               ; %LeafBlock65
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_cmp_lg_u32 s7, 3
	s_mov_b32 s9, 0
	s_mov_b32 s6, -1
	s_cselect_b32 s8, -1, 0
	s_branch .LBB0_26
.LBB0_24:                               ;   in Loop: Header=BB0_19 Depth=1
	s_mov_b32 s9, -1
	s_mov_b32 s6, 0
	s_mov_b32 s8, 0
                                        ; implicit-def: $vgpr2
	s_branch .LBB0_31
.LBB0_25:                               ;   in Loop: Header=BB0_19 Depth=1
	s_mov_b32 s9, -1
	s_mov_b32 s6, 0
	s_mov_b32 s8, 0
.LBB0_26:                               ; %Flow71
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s9
                                        ; implicit-def: $vgpr2
	s_cbranch_vccnz .LBB0_30
; %bb.27:                               ; %LeafBlock63
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_cmp_eq_u32 s7, 1
	s_cbranch_scc0 .LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_19 Depth=1
	v_lshl_add_u32 v2, s0, 2, v1
	s_mov_b32 s8, 0
	ds_load_b32 v3, v1
	ds_load_b32 v2, v2
	s_waitcnt lgkmcnt(0)
	v_max_i32_e32 v2, v3, v2
	s_branch .LBB0_30
.LBB0_29:                               ;   in Loop: Header=BB0_19 Depth=1
	s_mov_b32 s8, -1
                                        ; implicit-def: $vgpr2
.LBB0_30:                               ; %Flow72
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_mov_b32 s9, 0
.LBB0_31:                               ; %Flow
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccz .LBB0_33
; %bb.32:                               ; %LeafBlock61
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_cmp_eq_u32 s7, 0
                                        ; implicit-def: $vgpr2
	s_cselect_b32 s6, -1, 0
	s_cmp_lg_u32 s7, 0
	s_cselect_b32 s8, -1, 0
.LBB0_33:                               ; %Flow74
                                        ;   in Loop: Header=BB0_19 Depth=1
	v_lshl_add_u32 v3, s0, 2, v1
	s_and_not1_b32 vcc_lo, exec_lo, s8
	s_cbranch_vccnz .LBB0_35
; %bb.34:                               ;   in Loop: Header=BB0_19 Depth=1
	ds_load_b32 v2, v1
	ds_load_b32 v4, v3
	s_mov_b32 s6, 0
	s_waitcnt lgkmcnt(0)
	v_min_i32_e32 v2, v2, v4
.LBB0_35:                               ; %Flow75
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s6
	s_cbranch_vccnz .LBB0_37
; %bb.36:                               ;   in Loop: Header=BB0_19 Depth=1
	ds_load_b32 v2, v3
	ds_load_b32 v3, v1
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v2, v3, v2
.LBB0_37:                               ; %.sink.split
                                        ;   in Loop: Header=BB0_19 Depth=1
	ds_store_b32 v1, v2
.LBB0_38:                               ; %Flow76
                                        ;   in Loop: Header=BB0_19 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_cmp_lt_u32 s5, 4
	s_mov_b32 s5, s0
	s_branch .LBB0_19
.LBB0_39:                               ; %._crit_edge
	v_mov_b32_e32 v0, 0
	s_mov_b32 s5, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[4:5], 2
	s_add_u32 s0, s2, s0
	ds_load_b32 v1, v0
	s_addc_u32 s1, s3, s1
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v1, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9calculatePiS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 5
		.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	_Z9calculatePiS_ii, .Lfunc_end0-_Z9calculatePiS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 660
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
