#include <stdio.h>
#include <iostream>
#include <map>
#include <string>
#include <fstream>
#include <vector>

using namespace std;

#define ll long long

const int GRID_SIZE = 1;

// Use naive method
__device__ bool isPrime(ll n)
{
    if(n<2)
        return false;
        
    for(ll i=2;i*i<=n;i++)
        if(n%i==0)
            return false; 

    return true;
}

// Read numbers from file and add to vector
std::vector<ll> readFile(char* arg){
    vector<ll> numbersFromFile;
    std::ifstream infile(arg);
    ll number;

     if(!infile.is_open()) {
        throw std::invalid_argument("Problem with file");
    }

    while (infile >> number) {
        numbersFromFile.push_back(number);
    }

    return numbersFromFile;
}

__global__ void calculate(ll *Arr, bool *results, int sizeOfArray, int amountOfBlocks){

    int x = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (amountOfBlocks >= sizeOfArray){
        results[x] += isPrime(Arr[x]);
    } else{
        int sizeOfPart = sizeOfArray / amountOfBlocks;
        int restOfDivide = sizeOfArray%amountOfBlocks;

        int startPart = sizeOfPart * x;
        int endPart = sizeOfPart * (x + 1);

        if (endPart <= sizeOfArray) 
        {
            int restStart = sizeOfPart * amountOfBlocks;

            for (int i = startPart; i < endPart; i++){
                results[i] += isPrime(Arr[i]);
            }

            if (x < restOfDivide){
                results[restStart + x] += isPrime(Arr[restStart + x]);
            }
        }
    }
}
 
int main(int argc, char** argv )
{
    float time;

    if ( argc < 2 )
    {
        printf("Pass file path\n");
        return -1;
    }

    vector<ll> numbersFromFile;

    try {
        numbersFromFile = readFile(argv[1]);
    } catch ( const std::invalid_argument& ex ) {
        cout << ex.what() << endl;
        return -1;
    }

    int sizeOfArray = numbersFromFile.size();
    int sizeToAllocateLongLong = sizeOfArray * sizeof(ll);
    int sizeToAllocateBool = sizeOfArray * sizeof(bool);
	
    ll numbersFromFileArr[sizeOfArray];
    std::copy(numbersFromFile.begin(), numbersFromFile.end(), numbersFromFileArr);

    bool* results = (bool *) malloc (sizeToAllocateBool);

    ll* c_arr;
    bool* c_results;

    cudaMalloc((void**) &c_arr, sizeToAllocateLongLong);
    cudaMalloc((void**) &c_results, sizeToAllocateBool);

    cudaMemcpy((void *)c_arr, (void *)numbersFromFileArr, sizeToAllocateLongLong, cudaMemcpyHostToDevice);

    //Start timer
    cudaEvent_t start, stop;
	cudaEventCreate(&start);
	cudaEventCreate(&stop);
	cudaEventRecord(start, 0);

    int amountOfBlocks = sizeOfArray;

    calculate<<<amountOfBlocks, GRID_SIZE>>>(c_arr, c_results, sizeOfArray, amountOfBlocks);

    //End timer and put result into time variable
    cudaDeviceSynchronize();			 
	cudaEventRecord(stop, 0);
	cudaEventSynchronize(stop);
	cudaEventElapsedTime(&time, start, stop);

    printf("Czas: %.4fms\n", time);

    if (cudaMemcpy((void *)results, (void *)c_results , sizeToAllocateBool, cudaMemcpyDeviceToHost) != cudaSuccess) {
		cout<<"GPU to CPU copy error\n";
	}

    cudaFree(c_arr);
    cudaFree(c_results);

    for(int j = 0; j < sizeOfArray ; j++)
    {
        if (results[j]){
            cout << numbersFromFileArr[j] << " prime" << endl;
        } else {
            cout << numbersFromFileArr[j] << " composite" << endl;
        }       
    }

    free(results);
    return 0;
}

	.file	"tmpxft_002f48f8_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4557:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4557:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z7isPrimex
	.type	_Z7isPrimex, @function
_Z7isPrimex:
.LFB4533:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE4533:
	.size	_Z7isPrimex, .-_Z7isPrimex
	.globl	_Z32__device_stub__Z9calculatePxPbiiPxPbii
	.type	_Z32__device_stub__Z9calculatePxPbiiPxPbii, @function
_Z32__device_stub__Z9calculatePxPbiiPxPbii:
.LFB4579:
	.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	.L4
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9calculatePxPbii(%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
.L4:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4579:
	.size	_Z32__device_stub__Z9calculatePxPbiiPxPbii, .-_Z32__device_stub__Z9calculatePxPbiiPxPbii
	.globl	_Z9calculatePxPbii
	.type	_Z9calculatePxPbii, @function
_Z9calculatePxPbii:
.LFB4580:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z9calculatePxPbiiPxPbii
	.cfi_endproc
.LFE4580:
	.size	_Z9calculatePxPbii, .-_Z9calculatePxPbii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z9calculatePxPbii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4582:
	.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	_Z9calculatePxPbii(%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
.LFE4582:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIxSaIxEED2Ev,"axG",@progbits,_ZNSt6vectorIxSaIxEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIxSaIxEED2Ev
	.type	_ZNSt6vectorIxSaIxEED2Ev, @function
_ZNSt6vectorIxSaIxEED2Ev:
.LFB4908:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L12
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L12:
	ret
	.cfi_endproc
.LFE4908:
	.size	_ZNSt6vectorIxSaIxEED2Ev, .-_ZNSt6vectorIxSaIxEED2Ev
	.weak	_ZNSt6vectorIxSaIxEED1Ev
	.set	_ZNSt6vectorIxSaIxEED1Ev,_ZNSt6vectorIxSaIxEED2Ev
	.section	.rodata._ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC1:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_
	.type	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_, @function
_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_:
.LFB5110:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %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	$3, %rbx
	cmpq	%rcx, %rbx
	jne	.L15
	leaq	.LC1(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L15:
	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	.L25
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L20
	movabsq	$1152921504606846975, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L19
.L25:
	movq	%rcx, %rbx
.L19:
	leaq	0(,%rbx,8), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L20:
	movq	(%rdx), %rax
	movq	%rax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L21
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L21:
	movq	(%rsp), %rax
	leaq	8(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L22
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L22:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L23
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L23:
	leaq	(%r12,%rbx,8), %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
.LFE5110:
	.size	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_, .-_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_
	.section	.rodata.str1.1
.LC2:
	.string	"Problem with file"
	.text
	.globl	_Z8readFilePc
	.type	_Z8readFilePc, @function
_Z8readFilePc:
.LFB4534:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4534
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$8, %edx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$552, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	movq	%rax, (%rdi)
	movq	%rax, 8(%rdi)
	movq	%rax, 16(%rdi)
	movq	%r12, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	136(%rsp), %rdi
	leaq	8(%rsp), %rbx
	call	_ZNKSt12__basic_fileIcE7is_openEv@PLT
	testb	%al, %al
	jne	.L33
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, %r13
.LEHB1:
	call	_ZNSt16invalid_argumentC1EPKc@PLT
.LEHE1:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	movq	_ZNSt16invalid_argumentD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt16invalid_argument(%rip), %rsi
	movq	%r13, %rdi
.LEHB2:
	call	__cxa_throw@PLT
.L51:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L50
	movq	8(%rbp), %rsi
	cmpq	16(%rbp), %rsi
	je	.L35
	movq	8(%rsp), %rax
	addq	$8, %rsi
	movq	%rax, -8(%rsi)
	movq	%rsi, 8(%rbp)
.L33:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSi10_M_extractIxEERSiRT_@PLT
	jmp	.L51
.L35:
	movq	%rbx, %rdx
	movq	%rbp, %rdi
	call	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_
.LEHE2:
	jmp	.L33
.L50:
	movq	%r12, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	je	.L42
	jmp	.L47
.L44:
	endbr64
	movq	%rax, %rbx
.L38:
	movq	%r13, %rdi
	call	__cxa_free_exception@PLT
	jmp	.L39
.L45:
	endbr64
	movq	%rax, %rbx
.L39:
	movq	%r12, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L40
.L43:
	endbr64
	movq	%rax, %rbx
.L40:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIxSaIxEED1Ev
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L47:
	call	__stack_chk_fail@PLT
.L42:
	addq	$552, %rsp
	.cfi_def_cfa_offset 40
	movq	%rbp, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4534:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4534:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4534-.LLSDACSB4534
.LLSDACSB4534:
	.uleb128 .LEHB0-.LFB4534
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L43-.LFB4534
	.uleb128 0
	.uleb128 .LEHB1-.LFB4534
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L44-.LFB4534
	.uleb128 0
	.uleb128 .LEHB2-.LFB4534
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L45-.LFB4534
	.uleb128 0
	.uleb128 .LEHB3-.LFB4534
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE4534:
	.text
	.size	_Z8readFilePc, .-_Z8readFilePc
	.section	.rodata.str1.1
.LC3:
	.string	"Pass file path\n"
.LC4:
	.string	"Czas: %.4fms\n"
.LC5:
	.string	"GPU to CPU copy error\n"
.LC6:
	.string	" prime"
.LC7:
	.string	" composite"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4551:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4551
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	decl	%edi
	jg	.L53
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	orl	$-1, %ebx
.LEHB4:
	call	__printf_chk@PLT
.LEHE4:
	jmp	.L52
.L53:
	leaq	-104(%rbp), %r13
	movq	8(%rsi), %rsi
	xorl	%ecx, %ecx
	movq	%r13, %rdi
	movq	%rcx, -128(%rbp)
	movq	%rcx, -120(%rbp)
	movq	%rcx, -112(%rbp)
.LEHB5:
	call	_Z8readFilePc
.LEHE5:
	movq	-104(%rbp), %r12
	movq	-96(%rbp), %rbx
	xorl	%eax, %eax
	xorl	%edx, %edx
	movq	%rax, -80(%rbp)
	movq	%rax, -72(%rbp)
	movq	%rax, -64(%rbp)
	movq	-88(%rbp), %rax
	movq	%rbx, -120(%rbp)
	subq	%r12, %rbx
	movq	%rax, -112(%rbp)
	movq	%rbx, %r14
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	sarq	$3, %r14
	movq	%rdx, -104(%rbp)
	movq	%rdx, -96(%rbp)
	leal	0(,%r14,8), %r15d
	movq	%rdx, -88(%rbp)
	movq	%rax, -176(%rbp)
	movq	%r12, -128(%rbp)
	call	_ZNSt6vectorIxSaIxEED1Ev
	movq	%r13, %rdi
	movslq	%r14d, %r13
	call	_ZNSt6vectorIxSaIxEED1Ev
	leaq	15(,%r13,8), %rcx
	movq	%rsp, %rsi
	movq	%rbx, %rdx
	movl	%r14d, -164(%rbp)
	movq	%rcx, %rax
	andq	$-4096, %rcx
	andq	$-16, %rax
	subq	%rcx, %rsi
.L55:
	cmpq	%rsi, %rsp
	je	.L56
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L55
.L56:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L57
	orq	$0, -8(%rsp,%rax)
.L57:
	leaq	7(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-8, %rbx
	shrq	$3, %rax
	cmpq	$8, %rdx
	jle	.L58
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	memmove@PLT
	jmp	.L59
.L58:
	jne	.L59
	movq	(%r12), %rdx
	movq	%rdx, 0(,%rax,8)
.L59:
	movq	%r13, %rdi
	movslq	%r15d, %r15
	call	malloc@PLT
	leaq	-160(%rbp), %rdi
	movq	%r15, %rsi
	movq	%rax, %r12
.LEHB6:
	call	cudaMalloc@PLT
	leaq	-152(%rbp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	movq	-160(%rbp), %rdi
	movl	$1, %ecx
	movq	%r15, %rdx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	leaq	-144(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-136(%rbp), %rdi
	call	cudaEventCreate@PLT
	movq	-144(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	%r14d, -104(%rbp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdx
	movl	$1, -72(%rbp)
	movq	%rdx, -100(%rbp)
	movq	-104(%rbp), %rdi
	movl	-96(%rbp), %esi
	movq	%rdx, -80(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movl	-164(%rbp), %ecx
	movq	-152(%rbp), %rsi
	movq	-160(%rbp), %rdi
	movl	%ecx, %edx
	call	_Z32__device_stub__Z9calculatePxPbiiPxPbii
.L60:
	call	cudaDeviceSynchronize@PLT
	movq	-136(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-136(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-136(%rbp), %rdx
	movq	-144(%rbp), %rsi
	movq	-176(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	-80(%rbp), %xmm0
	call	__printf_chk@PLT
	movq	-152(%rbp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L61
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L61:
	movq	-160(%rbp), %rdi
	call	cudaFree@PLT
	movq	-152(%rbp), %rdi
	call	cudaFree@PLT
	xorl	%r13d, %r13d
	leaq	_ZSt4cout(%rip), %r14
.L62:
	cmpl	%r13d, -164(%rbp)
	jle	.L90
	cmpb	$0, (%r12,%r13)
	movq	(%rbx,%r13,8), %rsi
	movq	%r14, %rdi
	je	.L63
	call	_ZNSo9_M_insertIxEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC6(%rip), %rsi
	jmp	.L89
.L63:
	call	_ZNSo9_M_insertIxEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
.L89:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE6:
	incq	%r13
	jmp	.L62
.L90:
	movq	%r12, %rdi
	xorl	%ebx, %ebx
	call	free@PLT
.L69:
	leaq	-128(%rbp), %rdi
	call	_ZNSt6vectorIxSaIxEED1Ev
	jmp	.L52
.L74:
	endbr64
	movq	%rax, %rdi
.L66:
	decq	%rdx
	movq	%rax, %rbx
	jne	.L68
	call	__cxa_begin_catch@PLT
	movq	%rax, %rdi
	movq	(%rax), %rax
	call	*16(%rax)
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rsi
.LEHB7:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE7:
	call	__cxa_end_catch@PLT
	orl	$-1, %ebx
	jmp	.L69
.L76:
	endbr64
	movq	%rax, %rbx
.L70:
	call	__cxa_end_catch@PLT
	jmp	.L68
.L75:
	endbr64
	movq	%rax, %rbx
.L68:
	leaq	-128(%rbp), %rdi
	call	_ZNSt6vectorIxSaIxEED1Ev
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L87
	movq	%rbx, %rdi
.LEHB8:
	call	_Unwind_Resume@PLT
.LEHE8:
.L52:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L72
.L87:
	call	__stack_chk_fail@PLT
.L72:
	leaq	-40(%rbp), %rsp
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4551:
	.section	.gcc_except_table
	.align 4
.LLSDA4551:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT4551-.LLSDATTD4551
.LLSDATTD4551:
	.byte	0x1
	.uleb128 .LLSDACSE4551-.LLSDACSB4551
.LLSDACSB4551:
	.uleb128 .LEHB4-.LFB4551
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB5-.LFB4551
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L74-.LFB4551
	.uleb128 0x3
	.uleb128 .LEHB6-.LFB4551
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L75-.LFB4551
	.uleb128 0
	.uleb128 .LEHB7-.LFB4551
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L76-.LFB4551
	.uleb128 0
	.uleb128 .LEHB8-.LFB4551
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
.LLSDACSE4551:
	.byte	0
	.byte	0
	.byte	0x1
	.byte	0x7d
	.align 4
	.long	DW.ref._ZTISt16invalid_argument-.
.LLSDATT4551:
	.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
	.hidden	DW.ref._ZTISt16invalid_argument
	.weak	DW.ref._ZTISt16invalid_argument
	.section	.data.rel.local.DW.ref._ZTISt16invalid_argument,"awG",@progbits,DW.ref._ZTISt16invalid_argument,comdat
	.align 8
	.type	DW.ref._ZTISt16invalid_argument, @object
	.size	DW.ref._ZTISt16invalid_argument, 8
DW.ref._ZTISt16invalid_argument:
	.quad	_ZTISt16invalid_argument
	.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 <stdio.h>
#include <iostream>
#include <map>
#include <string>
#include <fstream>
#include <vector>

using namespace std;

#define ll long long

const int GRID_SIZE = 1;

// Use naive method
__device__ bool isPrime(ll n)
{
    if(n<2)
        return false;
        
    for(ll i=2;i*i<=n;i++)
        if(n%i==0)
            return false; 

    return true;
}

// Read numbers from file and add to vector
std::vector<ll> readFile(char* arg){
    vector<ll> numbersFromFile;
    std::ifstream infile(arg);
    ll number;

     if(!infile.is_open()) {
        throw std::invalid_argument("Problem with file");
    }

    while (infile >> number) {
        numbersFromFile.push_back(number);
    }

    return numbersFromFile;
}

__global__ void calculate(ll *Arr, bool *results, int sizeOfArray, int amountOfBlocks){

    int x = (blockIdx.x * blockDim.x) + threadIdx.x;

    if (amountOfBlocks >= sizeOfArray){
        results[x] += isPrime(Arr[x]);
    } else{
        int sizeOfPart = sizeOfArray / amountOfBlocks;
        int restOfDivide = sizeOfArray%amountOfBlocks;

        int startPart = sizeOfPart * x;
        int endPart = sizeOfPart * (x + 1);

        if (endPart <= sizeOfArray) 
        {
            int restStart = sizeOfPart * amountOfBlocks;

            for (int i = startPart; i < endPart; i++){
                results[i] += isPrime(Arr[i]);
            }

            if (x < restOfDivide){
                results[restStart + x] += isPrime(Arr[restStart + x]);
            }
        }
    }
}
 
int main(int argc, char** argv )
{
    float time;

    if ( argc < 2 )
    {
        printf("Pass file path\n");
        return -1;
    }

    vector<ll> numbersFromFile;

    try {
        numbersFromFile = readFile(argv[1]);
    } catch ( const std::invalid_argument& ex ) {
        cout << ex.what() << endl;
        return -1;
    }

    int sizeOfArray = numbersFromFile.size();
    int sizeToAllocateLongLong = sizeOfArray * sizeof(ll);
    int sizeToAllocateBool = sizeOfArray * sizeof(bool);
	
    ll numbersFromFileArr[sizeOfArray];
    std::copy(numbersFromFile.begin(), numbersFromFile.end(), numbersFromFileArr);

    bool* results = (bool *) malloc (sizeToAllocateBool);

    ll* c_arr;
    bool* c_results;

    hipMalloc((void**) &c_arr, sizeToAllocateLongLong);
    hipMalloc((void**) &c_results, sizeToAllocateBool);

    hipMemcpy((void *)c_arr, (void *)numbersFromFileArr, sizeToAllocateLongLong, hipMemcpyHostToDevice);

    //Start timer
    hipEvent_t start, stop;
	hipEventCreate(&start);
	hipEventCreate(&stop);
	hipEventRecord(start, 0);

    int amountOfBlocks = sizeOfArray;

    calculate<<<amountOfBlocks, GRID_SIZE>>>(c_arr, c_results, sizeOfArray, amountOfBlocks);

    //End timer and put result into time variable
    hipDeviceSynchronize();			 
	hipEventRecord(stop, 0);
	hipEventSynchronize(stop);
	hipEventElapsedTime(&time, start, stop);

    printf("Czas: %.4fms\n", time);

    if (hipMemcpy((void *)results, (void *)c_results , sizeToAllocateBool, hipMemcpyDeviceToHost) != hipSuccess) {
		cout<<"GPU to CPU copy error\n";
	}

    hipFree(c_arr);
    hipFree(c_results);

    for(int j = 0; j < sizeOfArray ; j++)
    {
        if (results[j]){
            cout << numbersFromFileArr[j] << " prime" << endl;
        } else {
            cout << numbersFromFileArr[j] << " composite" << endl;
        }       
    }

    free(results);
    return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z8readFilePc                   # -- Begin function _Z8readFilePc
	.type	_Z8readFilePc,@function
_Z8readFilePc:                          # @_Z8readFilePc
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$528, %rsp                      # imm = 0x210
	.cfi_def_cfa_offset 560
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	leaq	8(%rsp), %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	leaq	128(%rsp), %rdi
	callq	_ZNKSt12__basic_fileIcE7is_openEv
	testb	%al, %al
	je	.LBB0_6
# %bb.1:
	leaq	8(%rsp), %r14
	movq	%rsp, %r15
.LBB0_2:                                # %_ZNSt6vectorIxSaIxEE9push_backERKx.exit
                                        # =>This Inner Loop Header: Depth=1
.Ltmp6:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZNSi10_M_extractIxEERSiRT_
.Ltmp7:
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB0_11
# %bb.4:                                #   in Loop: Header=BB0_2 Depth=1
	movq	8(%rbx), %rsi
	cmpq	16(%rbx), %rsi
	je	.LBB0_10
# %bb.5:                                #   in Loop: Header=BB0_2 Depth=1
	movq	(%rsp), %rax
	movq	%rax, (%rsi)
	addq	$8, %rsi
	movq	%rsi, 8(%rbx)
	jmp	.LBB0_2
.LBB0_10:                               #   in Loop: Header=BB0_2 Depth=1
.Ltmp8:
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_
.Ltmp9:
	jmp	.LBB0_2
.LBB0_11:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rax
	addq	$528, %rsp                      # imm = 0x210
	.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
.LBB0_6:
	.cfi_def_cfa_offset 560
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r15
.Ltmp0:
	movl	$.L.str, %esi
	movq	%rax, %rdi
	callq	_ZNSt16invalid_argumentC1EPKc
.Ltmp1:
# %bb.7:
.Ltmp3:
	movl	$_ZTISt16invalid_argument, %esi
	movl	$_ZNSt16invalid_argumentD1Ev, %edx
	movq	%r15, %rdi
	callq	__cxa_throw
.Ltmp4:
# %bb.17:
.LBB0_8:                                # %.loopexit.split-lp
.Ltmp5:
	jmp	.LBB0_13
.LBB0_9:
.Ltmp2:
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	__cxa_free_exception
	jmp	.LBB0_14
.LBB0_12:                               # %.loopexit
.Ltmp10:
.LBB0_13:
	movq	%rax, %r14
.LBB0_14:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB0_16
# %bb.15:
	callq	_ZdlPv
.LBB0_16:                               # %_ZNSt6vectorIxSaIxEED2Ev.exit
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	_Z8readFilePc, .Lfunc_end0-_Z8readFilePc
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.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 .Ltmp6-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp9-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp9
	.uleb128 .Ltmp10-.Lfunc_begin0          #     jumps to .Ltmp10
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp0-.Ltmp9                  #   Call between .Ltmp9 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 4 <<
	.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 5 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Lfunc_end0-.Ltmp4             #   Call between .Ltmp4 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z24__device_stub__calculatePxPbii # -- Begin function _Z24__device_stub__calculatePxPbii
	.type	_Z24__device_stub__calculatePxPbii,@function
_Z24__device_stub__calculatePxPbii:     # @_Z24__device_stub__calculatePxPbii
	.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	$_Z9calculatePxPbii, %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__calculatePxPbii, .Lfunc_end1-_Z24__device_stub__calculatePxPbii
	.cfi_endproc
                                        # -- End function
	.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
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$1, %edi
	jg	.LBB2_2
# %bb.1:
	movl	$.Lstr, %edi
	callq	puts@PLT
.LBB2_35:                               # %_ZNSt6vectorIxSaIxEED2Ev.exit58
	movl	$-1, %ebx
	jmp	.LBB2_36
.LBB2_2:
	movq	8(%rsi), %rsi
.Ltmp11:
	leaq	-112(%rbp), %rdi
	callq	_Z8readFilePc
.Ltmp12:
# %bb.3:                                # %_ZNSt6vectorIxSaIxEEaSEOS1_.exit
	movq	%rsp, -120(%rbp)                # 8-byte Spill
	movq	-112(%rbp), %r15
	movq	-104(%rbp), %r12
	subq	%r15, %r12
	movq	%r12, %r13
	sarq	$3, %r13
	movq	%r12, %rax
	shrq	$3, %rax
	cltq
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	movl	%r13d, %ebx
	movq	%rsp, %r14
	leaq	15(,%rbx,8), %rax
	andq	$-16, %rax
	subq	%rax, %r14
	movq	%r14, %rsp
	cmpq	$9, %r12
	jl	.LBB2_5
# %bb.4:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB2_7:                                # %_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEES2_ET0_T_S8_S7_.exit
	movq	%r15, -48(%rbp)                 # 8-byte Spill
	movq	-56(%rbp), %rdi                 # 8-byte Reload
	callq	malloc
	movq	%rax, %r15
	movslq	%r12d, %r12
.Ltmp22:
	leaq	-112(%rbp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
.Ltmp23:
# %bb.8:
.Ltmp24:
	leaq	-72(%rbp), %rdi
	movq	-56(%rbp), %rsi                 # 8-byte Reload
	callq	hipMalloc
.Ltmp25:
# %bb.9:
	movq	-112(%rbp), %rdi
.Ltmp26:
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp27:
# %bb.10:
.Ltmp29:
	leaq	-88(%rbp), %rdi
	callq	hipEventCreate
.Ltmp30:
# %bb.11:
.Ltmp31:
	leaq	-64(%rbp), %rdi
	callq	hipEventCreate
.Ltmp32:
# %bb.12:
	movq	-88(%rbp), %rdi
.Ltmp33:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp34:
# %bb.13:
	btsq	$32, %rbx
.Ltmp36:
	movabsq	$4294967297, %rdx               # imm = 0x100000001
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp37:
# %bb.14:
	testl	%eax, %eax
	jne	.LBB2_16
# %bb.15:
	movq	-112(%rbp), %rdi
	movq	-72(%rbp), %rsi
.Ltmp38:
	movl	%r13d, %edx
	movl	%r13d, %ecx
	callq	_Z24__device_stub__calculatePxPbii
.Ltmp39:
.LBB2_16:
.Ltmp40:
	callq	hipDeviceSynchronize
.Ltmp41:
# %bb.17:
	movq	-64(%rbp), %rdi
.Ltmp42:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp43:
# %bb.18:
	movq	-64(%rbp), %rdi
.Ltmp44:
	callq	hipEventSynchronize
.Ltmp45:
# %bb.19:
	movq	-88(%rbp), %rsi
	movq	-64(%rbp), %rdx
.Ltmp46:
	leaq	-76(%rbp), %rdi
	callq	hipEventElapsedTime
.Ltmp47:
# %bb.20:
	cvtss2sd	-76(%rbp), %xmm0
	movl	$.L.str.2, %edi
	movb	$1, %al
	callq	printf
	movq	-72(%rbp), %rsi
.Ltmp48:
	movq	%r15, %rdi
	movq	-56(%rbp), %rdx                 # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp49:
# %bb.21:
	testl	%eax, %eax
	je	.LBB2_23
# %bb.22:
.Ltmp50:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp51:
.LBB2_23:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	-112(%rbp), %rdi
.Ltmp52:
	callq	hipFree
.Ltmp53:
# %bb.24:
	movq	-72(%rbp), %rdi
.Ltmp54:
	callq	hipFree
.Ltmp55:
# %bb.25:                               # %.preheader
	testl	%r13d, %r13d
	jle	.LBB2_47
# %bb.26:                               # %.lr.ph.preheader
	movl	%r13d, %r12d
	xorl	%r13d, %r13d
.LBB2_27:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	cmpb	$0, (%r15,%r13)
	movq	(%r14,%r13,8), %rsi
	je	.LBB2_41
# %bb.28:                               #   in Loop: Header=BB2_27 Depth=1
.Ltmp57:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIxEERSoT_
.Ltmp58:
# %bb.29:                               # %_ZNSolsEx.exit
                                        #   in Loop: Header=BB2_27 Depth=1
.Ltmp59:
	movq	%rax, %rbx
	movl	$.L.str.4, %esi
	movl	$6, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp60:
# %bb.30:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit52
                                        #   in Loop: Header=BB2_27 Depth=1
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp61:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp62:
	jmp	.LBB2_44
.LBB2_41:                               #   in Loop: Header=BB2_27 Depth=1
.Ltmp63:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIxEERSoT_
.Ltmp64:
# %bb.42:                               # %_ZNSolsEx.exit54
                                        #   in Loop: Header=BB2_27 Depth=1
.Ltmp65:
	movq	%rax, %rbx
	movl	$.L.str.5, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp66:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit55
                                        #   in Loop: Header=BB2_27 Depth=1
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp67:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp68:
.LBB2_44:                               # %.noexc63.invoke
                                        #   in Loop: Header=BB2_27 Depth=1
.Ltmp69:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp70:
# %bb.45:                               # %.noexc64.invoke
                                        #   in Loop: Header=BB2_27 Depth=1
.Ltmp71:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp72:
# %bb.46:                               # %_ZNSolsEPFRSoS_E.exit53
                                        #   in Loop: Header=BB2_27 Depth=1
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB2_27
.LBB2_47:                               # %._crit_edge
	movq	%r15, %rdi
	callq	free
	movq	-120(%rbp), %rsp                # 8-byte Reload
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rdi                 # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB2_36
# %bb.48:
	callq	_ZdlPv
.LBB2_36:                               # %_ZNSt6vectorIxSaIxEED2Ev.exit58
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB2_5:
	.cfi_def_cfa %rbp, 16
	cmpq	$8, %r12
	jne	.LBB2_7
# %bb.6:
	movq	(%r15), %rax
	movq	%rax, (%r14)
	jmp	.LBB2_7
.LBB2_31:
.Ltmp13:
	movq	%rax, %rbx
	cmpl	$1, %edx
	jne	.LBB2_52
# %bb.32:
	movq	%rbx, %rdi
	callq	__cxa_begin_catch
	movq	(%rax), %rcx
	movq	%rax, %rdi
	callq	*16(%rcx)
.Ltmp14:
	movl	$_ZSt4cout, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp15:
# %bb.33:
.Ltmp16:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp17:
# %bb.34:                               # %_ZNSolsEPFRSoS_E.exit
	callq	__cxa_end_catch
	jmp	.LBB2_35
.LBB2_37:
.Ltmp18:
	movq	%rax, %rbx
.Ltmp19:
	callq	__cxa_end_catch
.Ltmp20:
	jmp	.LBB2_52
.LBB2_53:
.Ltmp21:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.LBB2_38:
.Ltmp35:
	jmp	.LBB2_50
.LBB2_49:
.Ltmp28:
	jmp	.LBB2_50
.LBB2_39:
.Ltmp56:
	jmp	.LBB2_50
.LBB2_40:
.Ltmp73:
.LBB2_50:
	movq	%rax, %rbx
	cmpq	$0, -48(%rbp)                   # 8-byte Folded Reload
	je	.LBB2_52
# %bb.51:
	movq	-48(%rbp), %rdi                 # 8-byte Reload
	callq	_ZdlPv
.LBB2_52:                               # %_ZNSt6vectorIxSaIxEED2Ev.exit60
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp11-.Lfunc_begin1          # >> Call Site 1 <<
	.uleb128 .Ltmp12-.Ltmp11                #   Call between .Ltmp11 and .Ltmp12
	.uleb128 .Ltmp13-.Lfunc_begin1          #     jumps to .Ltmp13
	.byte	3                               #   On action: 2
	.uleb128 .Ltmp12-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp22-.Ltmp12                #   Call between .Ltmp12 and .Ltmp22
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp22-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp27-.Ltmp22                #   Call between .Ltmp22 and .Ltmp27
	.uleb128 .Ltmp28-.Lfunc_begin1          #     jumps to .Ltmp28
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp34-.Ltmp29                #   Call between .Ltmp29 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin1          #     jumps to .Ltmp35
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp55-.Ltmp36                #   Call between .Ltmp36 and .Ltmp55
	.uleb128 .Ltmp56-.Lfunc_begin1          #     jumps to .Ltmp56
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp57-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp72-.Ltmp57                #   Call between .Ltmp57 and .Ltmp72
	.uleb128 .Ltmp73-.Lfunc_begin1          #     jumps to .Ltmp73
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Ltmp14-.Ltmp72                #   Call between .Ltmp72 and .Ltmp14
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp14-.Lfunc_begin1          # >> Call Site 8 <<
	.uleb128 .Ltmp17-.Ltmp14                #   Call between .Ltmp14 and .Ltmp17
	.uleb128 .Ltmp18-.Lfunc_begin1          #     jumps to .Ltmp18
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin1          # >> Call Site 9 <<
	.uleb128 .Ltmp19-.Ltmp17                #   Call between .Ltmp17 and .Ltmp19
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp19-.Lfunc_begin1          # >> Call Site 10 <<
	.uleb128 .Ltmp20-.Ltmp19                #   Call between .Ltmp19 and .Ltmp20
	.uleb128 .Ltmp21-.Lfunc_begin1          #     jumps to .Ltmp21
	.byte	5                               #   On action: 3
	.uleb128 .Ltmp20-.Lfunc_begin1          # >> Call Site 11 <<
	.uleb128 .Lfunc_end2-.Ltmp20            #   Call between .Ltmp20 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.byte	0                               # >> Action Record 1 <<
                                        #   Cleanup
	.byte	0                               #   No further actions
	.byte	1                               # >> Action Record 2 <<
                                        #   Catch TypeInfo 1
	.byte	125                             #   Continue to action 1
	.byte	2                               # >> Action Record 3 <<
                                        #   Catch TypeInfo 2
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 2
	.long	_ZTISt16invalid_argument        # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- 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_end3:
	.size	__clang_call_terminate, .Lfunc_end3-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_ # -- Begin function _ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_,@function
_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_: # @_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_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.6, %edx
	callq	_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$3, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB4_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIxE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB4_3
.LBB4_1:
	xorl	%ebp, %ebp
.LBB4_3:                                # %_ZNSt12_Vector_baseIxSaIxEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, (%rbp,%r14,8)
	testq	%r12, %r12
	jle	.LBB4_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB4_5:                                # %_ZNSt6vectorIxSaIxEE11_S_relocateEPxS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$8, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB4_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB4_7:                                # %_ZNSt6vectorIxSaIxEE11_S_relocateEPxS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB4_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB4_9:                                # %_ZNSt12_Vector_baseIxSaIxEE13_M_deallocateEPxm.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,8), %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_end4:
	.size	_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_, .Lfunc_end4-_ZNSt6vectorIxSaIxEE17_M_realloc_insertIJRKxEEEvN9__gnu_cxx17__normal_iteratorIPxS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$1152921504606846975, %rcx      # imm = 0xFFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$3, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB5_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
.LBB5_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end5:
	.size	_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc, .Lfunc_end5-_ZNKSt6vectorIxSaIxEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIxE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIxE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIxE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIxE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIxE8allocateEmPKv,@function
_ZNSt15__new_allocatorIxE8allocateEmPKv: # @_ZNSt15__new_allocatorIxE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB6_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB6_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB6_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB6_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end6:
	.size	_ZNSt15__new_allocatorIxE8allocateEmPKv, .Lfunc_end6-_ZNSt15__new_allocatorIxE8allocateEmPKv
	.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	.LBB7_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB7_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9calculatePxPbii, %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_end7:
	.size	__hip_module_ctor, .Lfunc_end7-__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	.LBB8_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
.LBB8_2:
	retq
.Lfunc_end8:
	.size	__hip_module_dtor, .Lfunc_end8-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Problem with file"
	.size	.L.str, 18

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

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"Czas: %.4fms\n"
	.size	.L.str.2, 14

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"GPU to CPU copy error\n"
	.size	.L.str.3, 23

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

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

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9calculatePxPbii"
	.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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Pass file path"
	.size	.Lstr, 15

	.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 __gxx_personality_v0
	.addrsig_sym _Z24__device_stub__calculatePxPbii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZTISt16invalid_argument
	.addrsig_sym _Z9calculatePxPbii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9calculatePxPbii      ; -- Begin function _Z9calculatePxPbii
	.globl	_Z9calculatePxPbii
	.p2align	8
	.type	_Z9calculatePxPbii,@function
_Z9calculatePxPbii:                     ; @_Z9calculatePxPbii
; %bb.0:
	s_clause 0x2
	s_load_b32 s8, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x10
	s_load_b128 s[4:7], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, s8, 0xffff
	s_cmp_lt_i32 s3, s2
	v_mad_u64_u32 v[1:2], null, s15, s0, v[0:1]
	s_cbranch_scc1 .LBB0_8
; %bb.1:
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	s_mov_b32 s10, 0
	s_mov_b32 s0, 0
	s_mov_b32 s1, exec_lo
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i64_e32 1, v[3:4]
	s_cbranch_execz .LBB0_7
; %bb.2:                                ; %.preheader.i.preheader
	s_mov_b64 s[8:9], 2
	s_mov_b32 s11, 0
                                        ; implicit-def: $sgpr12
                                        ; implicit-def: $sgpr13
                                        ; implicit-def: $sgpr14
.LBB0_3:                                ; %.preheader.i
                                        ; =>This Inner Loop Header: Depth=1
	s_mul_i32 s0, s8, s9
	s_mul_hi_u32 s15, s8, s8
	s_mul_i32 s16, s8, s8
	s_add_i32 s15, s15, s0
	s_and_not1_b32 s14, s14, exec_lo
	s_add_i32 s17, s15, s0
	s_or_b32 s13, s13, exec_lo
	v_cmp_gt_i64_e32 vcc_lo, s[16:17], v[3:4]
	s_and_b32 s15, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s14, s14, s15
	s_mov_b32 s15, exec_lo
	v_cmpx_le_i64_e64 s[16:17], v[3:4]
	s_cbranch_execz .LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	v_cvt_f32_u32_e32 v0, s8
	v_cvt_f32_u32_e32 v5, s9
	s_sub_u32 s0, 0, s8
	s_subb_u32 s16, 0, s9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, 0x4f800000, v5
	v_rcp_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v0, 0x5f7ffffc, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, 0x2f800000, v0
	v_trunc_f32_e32 v5, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v0, 0xcf800000, v5
	v_cvt_u32_f32_e32 v5, v5
	v_cvt_u32_f32_e32 v0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v6, s0, v5
	v_mul_hi_u32 v7, s0, v0
	v_mul_lo_u32 v8, s16, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v6, v7, v6
	v_mul_lo_u32 v7, s0, v0
	v_add_nc_u32_e32 v6, v6, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v8, v0, v7
	v_mul_lo_u32 v9, v0, v6
	v_mul_hi_u32 v10, v0, v6
	v_mul_hi_u32 v11, v5, v7
	v_mul_lo_u32 v7, v5, v7
	v_mul_hi_u32 v12, v5, v6
	v_mul_lo_u32 v6, v5, v6
	v_add_co_u32 v8, vcc_lo, v8, v9
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v7, vcc_lo, v8, v7
	v_add_co_ci_u32_e32 v7, vcc_lo, v9, v11, vcc_lo
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, v7, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v6, s0, v0
	v_mul_lo_u32 v8, s16, v0
	v_mul_lo_u32 v7, s0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v6, v6, v7
	v_mul_lo_u32 v7, s0, v0
	v_add_nc_u32_e32 v6, v6, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v8, v0, v7
	v_mul_lo_u32 v9, v0, v6
	v_mul_hi_u32 v10, v0, v6
	v_mul_hi_u32 v11, v5, v7
	v_mul_lo_u32 v7, v5, v7
	v_mul_hi_u32 v12, v5, v6
	v_mul_lo_u32 v6, v5, v6
	v_add_co_u32 v8, vcc_lo, v8, v9
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v7, vcc_lo, v8, v7
	v_add_co_ci_u32_e32 v7, vcc_lo, v9, v11, vcc_lo
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, v7, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v6
	v_add_co_ci_u32_e32 v11, vcc_lo, v5, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v12, v3, v0
	v_mad_u64_u32 v[7:8], null, v4, v0, 0
	v_mad_u64_u32 v[5:6], null, v3, v11, 0
	v_mad_u64_u32 v[9:10], null, v4, v11, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, v12, v5
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v7
	v_add_co_ci_u32_e32 v0, vcc_lo, v5, v8, vcc_lo
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v9
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v8, s9, v0
	v_mad_u64_u32 v[5:6], null, s8, v0, 0
	v_mul_lo_u32 v0, s8, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_co_u32 v5, vcc_lo, v3, v5
	v_add3_u32 v0, v6, v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v6, v4, v0
	v_subrev_co_ci_u32_e64 v6, s0, s9, v6, vcc_lo
	v_sub_co_ci_u32_e32 v0, vcc_lo, v4, v0, vcc_lo
	v_sub_co_u32 v7, vcc_lo, v5, s8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_subrev_co_ci_u32_e64 v8, s0, 0, v6, vcc_lo
	v_cmp_le_u32_e64 s0, s8, v5
	v_subrev_co_ci_u32_e32 v6, vcc_lo, s9, v6, vcc_lo
	v_cmp_le_u32_e32 vcc_lo, s9, v0
	v_cndmask_b32_e64 v9, 0, -1, s0
	v_cmp_le_u32_e64 s0, s8, v7
	v_cndmask_b32_e64 v12, 0, -1, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, s9, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v10, 0, -1, s0
	v_cmp_le_u32_e64 s0, s9, v8
	v_cndmask_b32_e64 v11, 0, -1, s0
	v_cmp_eq_u32_e64 s0, s9, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v10, v11, v10, vcc_lo
	v_sub_co_u32 v11, vcc_lo, v7, s8
	v_subrev_co_ci_u32_e32 v6, vcc_lo, 0, v6, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, 0, v10
	v_cndmask_b32_e64 v9, v12, v9, s0
	s_add_u32 s8, s8, 1
	s_addc_u32 s9, s9, 0
	s_and_not1_b32 s0, s13, exec_lo
	v_dual_cndmask_b32 v6, v8, v6 :: v_dual_cndmask_b32 v7, v7, v11
	v_cmp_ne_u32_e32 vcc_lo, 0, v9
	s_and_not1_b32 s14, s14, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v6, v0, v6 :: v_dual_cndmask_b32 v5, v5, v7
	v_cmp_eq_u64_e32 vcc_lo, 0, v[5:6]
	s_and_b32 s13, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s13, s0, s13
.LBB0_5:                                ; %Flow
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s15
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, exec_lo, s13
	s_or_b32 s11, s0, s11
	s_and_not1_b32 s0, s12, exec_lo
	s_and_b32 s12, s14, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s12, s0, s12
	s_and_not1_b32 exec_lo, exec_lo, s11
	s_cbranch_execnz .LBB0_3
; %bb.6:                                ; %Flow70
	s_or_b32 exec_lo, exec_lo, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s0, s12, exec_lo
.LBB0_7:                                ; %Flow71
	s_or_b32 exec_lo, exec_lo, s1
	s_mov_b32 s1, -1
	s_branch .LBB0_9
.LBB0_8:
	s_mov_b32 s10, -1
	s_mov_b32 s1, 0
                                        ; implicit-def: $sgpr0
.LBB0_9:                                ; %Flow80
	s_and_not1_b32 vcc_lo, exec_lo, s10
	s_cbranch_vccnz .LBB0_30
; %bb.10:
	s_ashr_i32 s0, s3, 31
	s_ashr_i32 s11, s2, 31
	s_add_i32 s8, s3, s0
	s_add_i32 s12, s2, s11
	s_xor_b32 s8, s8, s0
	s_xor_b32 s12, s12, s11
	v_cvt_f32_u32_e32 v0, s8
	s_sub_i32 s10, 0, s8
	s_xor_b32 s0, s11, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v0, 0x4f7ffffe, v0
	v_cvt_u32_f32_e32 v0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_readfirstlane_b32 s9, v0
	s_mul_i32 s10, s10, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_mul_hi_u32 s10, s9, s10
	s_add_i32 s9, s9, s10
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_mul_hi_u32 s9, s12, s9
	s_mul_i32 s10, s9, s8
	s_add_i32 s11, s9, 1
	s_sub_i32 s10, s12, s10
	s_delay_alu instid0(SALU_CYCLE_1)
	s_sub_i32 s12, s10, s8
	s_cmp_ge_u32 s10, s8
	s_cselect_b32 s9, s11, s9
	s_cselect_b32 s10, s12, s10
	s_add_i32 s11, s9, 1
	s_cmp_ge_u32 s10, s8
	s_cselect_b32 s8, s11, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s8, s8, s0
	s_sub_i32 s8, s8, s0
                                        ; implicit-def: $sgpr0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s8, v1, s[8:9]
	s_mov_b32 s9, exec_lo
	v_cmpx_ge_i32_e64 s2, v2
	s_cbranch_execz .LBB0_29
; %bb.11:
	v_mul_lo_u32 v3, s8, v1
	s_mov_b32 s12, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e64 v3, v2
	s_cbranch_execz .LBB0_20
; %bb.12:                               ; %.lr.ph.preheader
	s_mov_b32 s13, 0
.LBB0_13:                               ; %.lr.ph
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	v_ashrrev_i32_e32 v4, 31, v3
	s_mov_b32 s0, 0
	s_mov_b32 s14, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 3, v[3:4]
	v_add_co_u32 v5, vcc_lo, s4, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v6, vcc_lo
	global_load_b64 v[5:6], v[5:6], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i64_e32 1, v[5:6]
	s_cbranch_execz .LBB0_19
; %bb.14:                               ; %.preheader.i40.preheader
                                        ;   in Loop: Header=BB0_13 Depth=1
	s_mov_b64 s[10:11], 2
	s_mov_b32 s15, 0
                                        ; implicit-def: $sgpr16
                                        ; implicit-def: $sgpr17
                                        ; implicit-def: $sgpr18
.LBB0_15:                               ; %.preheader.i40
                                        ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_mul_i32 s0, s10, s11
	s_mul_hi_u32 s19, s10, s10
	s_mul_i32 s20, s10, s10
	s_add_i32 s19, s19, s0
	s_and_not1_b32 s18, s18, exec_lo
	s_add_i32 s21, s19, s0
	s_or_b32 s17, s17, exec_lo
	v_cmp_gt_i64_e32 vcc_lo, s[20:21], v[5:6]
	s_and_b32 s19, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s18, s18, s19
	s_mov_b32 s19, exec_lo
	v_cmpx_le_i64_e64 s[20:21], v[5:6]
	s_cbranch_execz .LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	v_cvt_f32_u32_e32 v0, s10
	v_cvt_f32_u32_e32 v7, s11
	s_sub_u32 s0, 0, s10
	s_subb_u32 s20, 0, s11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, 0x4f800000, v7
	v_rcp_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v0, 0x5f7ffffc, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v7, 0x2f800000, v0
	v_trunc_f32_e32 v7, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v0, 0xcf800000, v7
	v_cvt_u32_f32_e32 v7, v7
	v_cvt_u32_f32_e32 v0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v8, s0, v7
	v_mul_hi_u32 v9, s0, v0
	v_mul_lo_u32 v10, s20, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v8, v9, v8
	v_mul_lo_u32 v9, s0, v0
	v_add_nc_u32_e32 v8, v8, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v10, v0, v9
	v_mul_lo_u32 v11, v0, v8
	v_mul_hi_u32 v12, v0, v8
	v_mul_hi_u32 v13, v7, v9
	v_mul_lo_u32 v9, v7, v9
	v_mul_hi_u32 v14, v7, v8
	v_mul_lo_u32 v8, v7, v8
	v_add_co_u32 v10, vcc_lo, v10, v11
	v_add_co_ci_u32_e32 v11, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, v10, v9
	v_add_co_ci_u32_e32 v9, vcc_lo, v11, v13, vcc_lo
	v_add_co_ci_u32_e32 v10, vcc_lo, 0, v14, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v8, vcc_lo, v9, v8
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v8
	v_add_co_ci_u32_e32 v7, vcc_lo, v7, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v8, s0, v0
	v_mul_lo_u32 v10, s20, v0
	v_mul_lo_u32 v9, s0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v8, v8, v9
	v_mul_lo_u32 v9, s0, v0
	v_add_nc_u32_e32 v8, v8, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v10, v0, v9
	v_mul_lo_u32 v11, v0, v8
	v_mul_hi_u32 v12, v0, v8
	v_mul_hi_u32 v13, v7, v9
	v_mul_lo_u32 v9, v7, v9
	v_mul_hi_u32 v14, v7, v8
	v_mul_lo_u32 v8, v7, v8
	v_add_co_u32 v10, vcc_lo, v10, v11
	v_add_co_ci_u32_e32 v11, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, v10, v9
	v_add_co_ci_u32_e32 v9, vcc_lo, v11, v13, vcc_lo
	v_add_co_ci_u32_e32 v10, vcc_lo, 0, v14, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v8, vcc_lo, v9, v8
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v8
	v_add_co_ci_u32_e32 v13, vcc_lo, v7, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v14, v5, v0
	v_mad_u64_u32 v[9:10], null, v6, v0, 0
	v_mad_u64_u32 v[7:8], null, v5, v13, 0
	v_mad_u64_u32 v[11:12], null, v6, v13, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, v14, v7
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v9
	v_add_co_ci_u32_e32 v0, vcc_lo, v7, v10, vcc_lo
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v11
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v10, s11, v0
	v_mad_u64_u32 v[7:8], null, s10, v0, 0
	v_mul_lo_u32 v0, s10, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_co_u32 v7, vcc_lo, v5, v7
	v_add3_u32 v0, v8, v0, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v8, v6, v0
	v_subrev_co_ci_u32_e64 v8, s0, s11, v8, vcc_lo
	v_sub_co_ci_u32_e32 v0, vcc_lo, v6, v0, vcc_lo
	v_sub_co_u32 v9, vcc_lo, v7, s10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_subrev_co_ci_u32_e64 v10, s0, 0, v8, vcc_lo
	v_cmp_le_u32_e64 s0, s10, v7
	v_subrev_co_ci_u32_e32 v8, vcc_lo, s11, v8, vcc_lo
	v_cmp_le_u32_e32 vcc_lo, s11, v0
	v_cndmask_b32_e64 v11, 0, -1, s0
	v_cmp_le_u32_e64 s0, s10, v9
	v_cndmask_b32_e64 v14, 0, -1, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, s11, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v12, 0, -1, s0
	v_cmp_le_u32_e64 s0, s11, v10
	v_cndmask_b32_e64 v13, 0, -1, s0
	v_cmp_eq_u32_e64 s0, s11, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v12, v13, v12, vcc_lo
	v_sub_co_u32 v13, vcc_lo, v9, s10
	v_subrev_co_ci_u32_e32 v8, vcc_lo, 0, v8, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, 0, v12
	v_cndmask_b32_e64 v11, v14, v11, s0
	s_add_u32 s10, s10, 1
	s_addc_u32 s11, s11, 0
	s_and_not1_b32 s0, s17, exec_lo
	v_dual_cndmask_b32 v8, v10, v8 :: v_dual_cndmask_b32 v9, v9, v13
	v_cmp_ne_u32_e32 vcc_lo, 0, v11
	s_and_not1_b32 s18, s18, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v8, v0, v8 :: v_dual_cndmask_b32 v7, v7, v9
	v_cmp_eq_u64_e32 vcc_lo, 0, v[7:8]
	s_and_b32 s17, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s17, s0, s17
.LBB0_17:                               ; %Flow75
                                        ;   in Loop: Header=BB0_15 Depth=2
	s_or_b32 exec_lo, exec_lo, s19
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, exec_lo, s17
	s_or_b32 s15, s0, s15
	s_and_not1_b32 s0, s16, exec_lo
	s_and_b32 s16, s18, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s16, s0, s16
	s_and_not1_b32 exec_lo, exec_lo, s15
	s_cbranch_execnz .LBB0_15
; %bb.18:                               ; %Flow76
                                        ;   in Loop: Header=BB0_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s15
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s0, s16, exec_lo
.LBB0_19:                               ; %Flow77
                                        ;   in Loop: Header=BB0_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	v_add_co_u32 v5, vcc_lo, s6, v3
	v_add_co_ci_u32_e32 v6, vcc_lo, s7, v4, vcc_lo
	v_cndmask_b32_e64 v4, 0, -1, s0
	v_add_nc_u32_e32 v3, 1, v3
	global_load_u8 v0, v[5:6], off
	v_and_b32_e32 v4, 0xff, v4
	v_cmp_eq_u32_e32 vcc_lo, v3, v2
	s_or_b32 s13, vcc_lo, s13
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ne_u16_e64 s0, v0, v4
	v_cndmask_b32_e64 v0, 0, 1, s0
	global_store_b8 v[5:6], v0, off
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB0_13
.LBB0_20:                               ; %Flow79
	s_or_b32 exec_lo, exec_lo, s12
	s_mul_i32 s3, s8, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_sub_i32 s0, s2, s3
	s_mov_b32 s2, s1
	v_cmp_gt_i32_e32 vcc_lo, s0, v1
                                        ; implicit-def: $sgpr0
	s_and_saveexec_b32 s8, vcc_lo
	s_cbranch_execz .LBB0_28
; %bb.21:
	v_add_nc_u32_e32 v1, s3, v1
	s_mov_b32 s0, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
	s_mov_b32 s4, exec_lo
	global_load_b64 v[3:4], v[3:4], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i64_e32 1, v[3:4]
	s_cbranch_execz .LBB0_27
; %bb.22:                               ; %.preheader.i45.preheader
	s_mov_b64 s[2:3], 2
	s_mov_b32 s5, 0
                                        ; implicit-def: $sgpr10
                                        ; implicit-def: $sgpr11
                                        ; implicit-def: $sgpr12
.LBB0_23:                               ; %.preheader.i45
                                        ; =>This Inner Loop Header: Depth=1
	s_mul_i32 s0, s2, s3
	s_mul_hi_u32 s13, s2, s2
	s_mul_i32 s14, s2, s2
	s_add_i32 s13, s13, s0
	s_and_not1_b32 s12, s12, exec_lo
	s_add_i32 s15, s13, s0
	s_or_b32 s11, s11, exec_lo
	v_cmp_gt_i64_e32 vcc_lo, s[14:15], v[3:4]
	s_and_b32 s13, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s12, s12, s13
	s_mov_b32 s13, exec_lo
	v_cmpx_le_i64_e64 s[14:15], v[3:4]
	s_cbranch_execz .LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	v_cvt_f32_u32_e32 v0, s2
	v_cvt_f32_u32_e32 v5, s3
	s_sub_u32 s0, 0, s2
	s_subb_u32 s14, 0, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, 0x4f800000, v5
	v_rcp_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v0, 0x5f7ffffc, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, 0x2f800000, v0
	v_trunc_f32_e32 v5, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v0, 0xcf800000, v5
	v_cvt_u32_f32_e32 v5, v5
	v_cvt_u32_f32_e32 v0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v6, s0, v5
	v_mul_hi_u32 v7, s0, v0
	v_mul_lo_u32 v8, s14, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v6, v7, v6
	v_mul_lo_u32 v7, s0, v0
	v_add_nc_u32_e32 v6, v6, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v8, v0, v7
	v_mul_lo_u32 v9, v0, v6
	v_mul_hi_u32 v10, v0, v6
	v_mul_hi_u32 v11, v5, v7
	v_mul_lo_u32 v7, v5, v7
	v_mul_hi_u32 v12, v5, v6
	v_mul_lo_u32 v6, v5, v6
	v_add_co_u32 v8, vcc_lo, v8, v9
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v7, vcc_lo, v8, v7
	v_add_co_ci_u32_e32 v7, vcc_lo, v9, v11, vcc_lo
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, v7, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v6, s0, v0
	v_mul_lo_u32 v8, s14, v0
	v_mul_lo_u32 v7, s0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v6, v6, v7
	v_mul_lo_u32 v7, s0, v0
	v_add_nc_u32_e32 v6, v6, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v8, v0, v7
	v_mul_lo_u32 v9, v0, v6
	v_mul_hi_u32 v10, v0, v6
	v_mul_hi_u32 v11, v5, v7
	v_mul_lo_u32 v7, v5, v7
	v_mul_hi_u32 v12, v5, v6
	v_mul_lo_u32 v6, v5, v6
	v_add_co_u32 v8, vcc_lo, v8, v9
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v7, vcc_lo, v8, v7
	v_add_co_ci_u32_e32 v7, vcc_lo, v9, v11, vcc_lo
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v12, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, v7, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v6
	v_add_co_ci_u32_e32 v11, vcc_lo, v5, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v12, v3, v0
	v_mad_u64_u32 v[7:8], null, v4, v0, 0
	v_mad_u64_u32 v[5:6], null, v3, v11, 0
	v_mad_u64_u32 v[9:10], null, v4, v11, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, v12, v5
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v7
	v_add_co_ci_u32_e32 v0, vcc_lo, v5, v8, vcc_lo
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, v0, v9
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v8, s3, v0
	v_mad_u64_u32 v[5:6], null, s2, v0, 0
	v_mul_lo_u32 v0, s2, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_co_u32 v5, vcc_lo, v3, v5
	v_add3_u32 v0, v6, v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v6, v4, v0
	v_subrev_co_ci_u32_e64 v6, s0, s3, v6, vcc_lo
	v_sub_co_ci_u32_e32 v0, vcc_lo, v4, v0, vcc_lo
	v_sub_co_u32 v7, vcc_lo, v5, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_subrev_co_ci_u32_e64 v8, s0, 0, v6, vcc_lo
	v_cmp_le_u32_e64 s0, s2, v5
	v_subrev_co_ci_u32_e32 v6, vcc_lo, s3, v6, vcc_lo
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e64 v9, 0, -1, s0
	v_cmp_le_u32_e64 s0, s2, v7
	v_cndmask_b32_e64 v12, 0, -1, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, s3, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v10, 0, -1, s0
	v_cmp_le_u32_e64 s0, s3, v8
	v_cndmask_b32_e64 v11, 0, -1, s0
	v_cmp_eq_u32_e64 s0, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v10, v11, v10, vcc_lo
	v_sub_co_u32 v11, vcc_lo, v7, s2
	v_subrev_co_ci_u32_e32 v6, vcc_lo, 0, v6, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, 0, v10
	v_cndmask_b32_e64 v9, v12, v9, s0
	s_add_u32 s2, s2, 1
	s_addc_u32 s3, s3, 0
	s_and_not1_b32 s0, s11, exec_lo
	v_dual_cndmask_b32 v6, v8, v6 :: v_dual_cndmask_b32 v7, v7, v11
	v_cmp_ne_u32_e32 vcc_lo, 0, v9
	s_and_not1_b32 s12, s12, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v6, v0, v6 :: v_dual_cndmask_b32 v5, v5, v7
	v_cmp_eq_u64_e32 vcc_lo, 0, v[5:6]
	s_and_b32 s11, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s11, s0, s11
.LBB0_25:                               ; %Flow72
                                        ;   in Loop: Header=BB0_23 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, exec_lo, s11
	s_or_b32 s5, s0, s5
	s_and_not1_b32 s0, s10, exec_lo
	s_and_b32 s10, s12, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s10, s0, s10
	s_and_not1_b32 exec_lo, exec_lo, s5
	s_cbranch_execnz .LBB0_23
; %bb.26:                               ; %Flow73
	s_or_b32 exec_lo, exec_lo, s5
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s0, s10, exec_lo
.LBB0_27:                               ; %Flow74
	s_or_b32 exec_lo, exec_lo, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s0, s0, exec_lo
	s_or_b32 s2, s1, exec_lo
.LBB0_28:                               ; %Flow83
	s_or_b32 exec_lo, exec_lo, s8
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s1, s1, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_and_b32 s0, s0, exec_lo
	s_or_b32 s1, s1, s2
.LBB0_29:                               ; %Flow82
	s_or_b32 exec_lo, exec_lo, s9
.LBB0_30:                               ; %Flow81
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB0_32
; %bb.31:                               ; %.sink.split
	v_add_co_u32 v0, vcc_lo, s6, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v2, vcc_lo
	v_cndmask_b32_e64 v3, 0, -1, s0
	global_load_u8 v2, v[0:1], off
	v_and_b32_e32 v3, 0xff, v3
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u16_e32 vcc_lo, v2, v3
	v_cndmask_b32_e64 v2, 0, 1, vcc_lo
	global_store_b8 v[0:1], v2, off
.LBB0_32:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9calculatePxPbii
		.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 15
		.amdhsa_next_free_sgpr 22
		.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	_Z9calculatePxPbii, .Lfunc_end0-_Z9calculatePxPbii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 3396
; NumSgprs: 24
; NumVgprs: 15
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 24
; NumVGPRsForWavesPerEU: 15
; 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
    .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:           _Z9calculatePxPbii
    .private_segment_fixed_size: 0
    .sgpr_count:     24
    .sgpr_spill_count: 0
    .symbol:         _Z9calculatePxPbii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     15
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
