#include "cuda_runtime.h"
#include "device_launch_parameters.h"
# include <iostream>
# include <fstream>
# include <cstdlib>
# include <cmath>
# include <vector>

using namespace std;

struct number{		//struktura wykorzystywana w wektorze danych - zawiera informacje o wartosci liczby oraz o tym czy jest pierwsza
   unsigned long int value;
    bool prime;
};

__global__ void primeTesting (number* tab, uint sqr, uint d)         //Funkcja testująca pierwszoć liczb, przyjmuje jako argumenty wskaźnik na zbior do tesowania, pierwiastek do ktorego testujemy oraz wielkosc zbioru testowanego
{    
uint tid=blockIdx.x;                                                                          //Pobranie numeru bloku w jakim się znajdujemy
uint i,j;                                                                                     //Zmienne pomocnicze
for (i=2;i<=sqr;i++) {			// kolejne liczby od 2 do pierwiastka kwadratowego z najwiekszego elementu zbioru wczytywanego
        for (j = tid; j <d; j+=gridDim.x) {		//petla wewnetrzna sprawdzajaca czy kolejne liczby wektora tab dziela sie przez aktualna wartosc zmiennej i (zmienna j inkrementowana o rozmiar siatki blokow)
                if((tab[j].value%i==0)&&(tab[j].value!=i)) //jesli tak liczba uznawana jest za zlozona, dodatkowo sprawdzamy czy liczba nie jest rowna obecnemu dzielnikowi (zasada pierwszosci)
                    tab[j].prime=false;    
        }
    }                                      
}

int main(int argc, char** argv) {
    int blockNumber=1000;      //liczba blokow
    
    ifstream file;  	//plik wejsciowy
    unsigned int maxval=0;  //zmienna przechowująca wartosc maksymalna z testowanego pliku
    number fromfile;	      // pojedyncza liczba z pliku wraz z informacja o pierwszosci
    
    cudaEvent_t start, stop; //deklaracja zmiennych licznika
    float elapsedTime;       //czas wynikowy
    cudaEventCreate(&start); //zdarzenia CUDA
    cudaEventCreate(&stop);

    

    if (argc != 2) {				//sprawdzenie ilosci argumentow podanych przy wywolaniu programu
        cout << "The number of arguments is invalid"<<endl;
        exit(1);
    }
    
    file.open(argv[1]);
	if (file.fail()){			//Sprawdzenie poprawnosci otwartego pliku
		cout<<"Could not open file to read."<<endl;
		exit(1);
	}

    vector<number> tab;				//utworzenie wektora liczb

    while (file >> fromfile.value) {		//pobranie danych z pliku do wektora tab
        fromfile.prime=true;			//domniemanie pierwszosci liczby
        tab.push_back(fromfile);		//zapisanie liczby w wektorze tab
        if(fromfile.value>maxval)		//poszukiwanie liczby maksymalnej ze zbioru
            maxval=fromfile.value;

    }

   				
    uint sqr=sqrt(maxval);			//pierwiastek z liczby maksymalnej
    uint d=tab.size();          //zmienna pomocnicza rozmiar wektora danych

    number* tab2;               //wskaźnik na typ number
    number* temp = tab.data();  //konwersja wektora do tablicy 
            
    cudaMalloc( (void**)&tab2, d * sizeof(number) );                     //alokacja miejsca w pamięci urządzenia
    cudaMemcpy(tab2, temp, d * sizeof(number), cudaMemcpyHostToDevice);  //kopiowanie danych z pamięci RAM do pamięci GPU
    cudaEventRecord(start);                                              //rozpoczęcie liczenia czasu
    primeTesting <<< blockNumber, 1 >>> (tab2, sqr,d);                   //wywolanie funkcji na urządzeniu 

    cudaEventRecord(stop);                                              //zatrzymanie licznika czasu
    cudaEventSynchronize(stop);                                         //synchronizacja zdarzenia stop

    number * result;                                                            //wskaźnik na typ number do przechowywania wyniku
    result= (number *) malloc (d*sizeof(number));                               //alokacja miejsca
    cudaMemcpy(result, tab2, d * sizeof(number), cudaMemcpyDeviceToHost);       //kopiowanie danych wynikowych z pamięci urzadzenia do pamięci Hosta
    cudaEventElapsedTime(&elapsedTime, start, stop);                            //obliczenie czasu pracy programu
    printf("Czas : %f ms\n", elapsedTime);                                      //wypisanie czasu obliczeń
    

       
    for (uint i=0;i<d;i++)				//wypisanie liczb z  wektora tab wraz z informacją czy są pierwsze
        if(result[i].prime==true)
            cout<< result[i].value<<": prime"<<endl;
        else
            cout<< result[i].value<<": composite"<<endl;   
    cudaFree(tab2);                                                             // zwolnienie pamięci na urządzeniu
    free(result);                                                               // zwolnienie pamięci na hoscie
    return 0;                  

}

	.file	"tmpxft_0020299f_00000000-6_primes_gpu.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4142:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4142:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj
	.type	_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj, @function
_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj:
.LFB4164:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	32(%rsp), %rdi
	movl	%esi, 4(%rsp)
	leaq	44(%rsp), %rsi
	movl	%edx, (%rsp)
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z12primeTestingP6numberjj(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L2:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4164:
	.size	_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj, .-_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj
	.globl	_Z12primeTestingP6numberjj
	.type	_Z12primeTestingP6numberjj, @function
_Z12primeTestingP6numberjj:
.LFB4165:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj
	.cfi_endproc
.LFE4165:
	.size	_Z12primeTestingP6numberjj, .-_Z12primeTestingP6numberjj
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z12primeTestingP6numberjj"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4167:
	.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	_Z12primeTestingP6numberjj(%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
.LFE4167:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorI6numberSaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorI6numberSaIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorI6numberSaIS0_EED2Ev
	.type	_ZNSt6vectorI6numberSaIS0_EED2Ev, @function
_ZNSt6vectorI6numberSaIS0_EED2Ev:
.LFB4505:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L10
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L10:
	ret
	.cfi_endproc
.LFE4505:
	.size	_ZNSt6vectorI6numberSaIS0_EED2Ev, .-_ZNSt6vectorI6numberSaIS0_EED2Ev
	.weak	_ZNSt6vectorI6numberSaIS0_EED1Ev
	.set	_ZNSt6vectorI6numberSaIS0_EED1Ev,_ZNSt6vectorI6numberSaIS0_EED2Ev
	.section	.rodata._ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_.str1.1,"aMS",@progbits,1
.LC1:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"axG",@progbits,_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.type	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, @function
_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_:
.LFB4693:
	.cfi_startproc
	endbr64
	movabsq	$576460752303423487, %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	$4, %rbx
	cmpq	%rcx, %rbx
	jne	.L13
	leaq	.LC1(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L13:
	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	.L23
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L18
	movabsq	$576460752303423487, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L17
.L23:
	movq	%rcx, %rbx
.L17:
	movq	%rbx, %rdi
	movq	%rdx, 8(%rsp)
	salq	$4, %rdi
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L18:
	movups	(%rdx), %xmm0
	movups	%xmm0, (%r12,%r15)
	testq	%r15, %r15
	jle	.L19
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L19:
	movq	(%rsp), %rax
	leaq	16(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L20
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L20:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L21
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L21:
	salq	$4, %rbx
	movq	%r12, 0(%r13)
	leaq	(%r12,%rbx), %r8
	movq	%rbp, 8(%r13)
	movq	%r8, 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
.LFE4693:
	.size	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, .-_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.section	.rodata.str1.1
.LC2:
	.string	"The number of arguments is invalid"
.LC3:
	.string	"Could not open file to read."
.LC4:
	.string	"Czas : %f ms\n"
.LC5:
	.string	": prime"
.LC6:
	.string	": composite"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4129:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4129
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rsi, %rbx
	subq	$624, %rsp
	.cfi_def_cfa_offset 672
	movq	%fs:40, %rax
	movq	%rax, 616(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rbp
	movq	%rbp, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE0:
	leaq	8(%rsp), %rdi
.LEHB1:
	call	cudaEventCreate@PLT
	leaq	16(%rsp), %rdi
	call	cudaEventCreate@PLT
	cmpl	$2, %r12d
	je	.L31
	leaq	.LC2(%rip), %rsi
.L59:
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movl	$1, %edi
	call	exit@PLT
.L31:
	movq	8(%rbx), %rsi
	movl	$8, %edx
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
.LEHE1:
	leaq	.LC3(%rip), %rsi
	testb	$5, 384(%rsp)
	jne	.L59
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	56(%rsp), %r13
	movq	%rax, 72(%rsp)
	movq	%rax, 80(%rsp)
	movq	%rax, 88(%rsp)
.L34:
	movq	%r13, %rsi
	movq	%rbp, %rdi
.LEHB2:
	call	_ZNSi10_M_extractImEERSiRT_@PLT
	movq	(%rax), %rdx
	movq	80(%rsp), %rbx
	movl	%r12d, %r14d
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L62
	movb	$1, 64(%rsp)
	cmpq	88(%rsp), %rbx
	je	.L35
	movups	56(%rsp), %xmm1
	addq	$16, %rbx
	movups	%xmm1, -16(%rbx)
	movq	%rbx, 80(%rsp)
	jmp	.L36
.L35:
	leaq	72(%rsp), %rdi
	movq	%r13, %rdx
	movq	%rbx, %rsi
	call	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
.L36:
	movq	56(%rsp), %rax
	cmpq	%rax, %r14
	cmovb	%eax, %r12d
	jmp	.L34
.L62:
	cvtsi2sdq	%r14, %xmm0
	call	sqrt@PLT
	movq	72(%rsp), %r12
	leaq	24(%rsp), %rdi
	movq	%xmm0, %r14
	subq	%r12, %rbx
	sarq	$4, %rbx
	movl	%ebx, %r13d
	salq	$4, %r13
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rdx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$536871037, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdx
	salq	$3, %rdi
	movl	$1, %esi
	movl	$1, 52(%rsp)
	movq	%rdx, 44(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	movq	%r14, %xmm2
	movq	24(%rsp), %rdi
	movl	%ebx, %edx
	cvttsd2siq	%xmm2, %rsi
	call	_Z40__device_stub__Z12primeTestingP6numberjjP6numberjj
.L41:
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	16(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	%r13, %rdi
	call	malloc@PLT
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rsi
	leaq	44(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	44(%rsp), %xmm0
	call	__printf_chk@PLT
	movq	%rbx, %r12
	addq	%rbx, %r13
	leaq	_ZSt4cout(%rip), %r14
.L42:
	cmpq	%r13, %r12
	je	.L63
	cmpb	$0, 8(%r12)
	movq	(%r12), %rsi
	movq	%r14, %rdi
	je	.L43
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC5(%rip), %rsi
	jmp	.L61
.L43:
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC6(%rip), %rsi
.L61:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	addq	$16, %r12
	jmp	.L42
.L63:
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
.LEHE2:
	movq	%rbx, %rdi
	call	free@PLT
	leaq	72(%rsp), %rdi
	call	_ZNSt6vectorI6numberSaIS0_EED1Ev
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	616(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	jmp	.L52
.L51:
	endbr64
	movq	%rax, %rbx
.L46:
	leaq	72(%rsp), %rdi
	call	_ZNSt6vectorI6numberSaIS0_EED1Ev
	jmp	.L47
.L50:
	endbr64
	movq	%rax, %rbx
.L47:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	616(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L52:
	call	__stack_chk_fail@PLT
.L49:
	addq	$624, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4129:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4129:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4129-.LLSDACSB4129
.LLSDACSB4129:
	.uleb128 .LEHB0-.LFB4129
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4129
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L50-.LFB4129
	.uleb128 0
	.uleb128 .LEHB2-.LFB4129
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L51-.LFB4129
	.uleb128 0
	.uleb128 .LEHB3-.LFB4129
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE4129:
	.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.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include "hip/hip_runtime.h"

# include <iostream>
# include <fstream>
# include <cstdlib>
# include <cmath>
# include <vector>

using namespace std;

struct number{		//struktura wykorzystywana w wektorze danych - zawiera informacje o wartosci liczby oraz o tym czy jest pierwsza
   unsigned long int value;
    bool prime;
};

__global__ void primeTesting (number* tab, uint sqr, uint d)         //Funkcja testująca pierwszoć liczb, przyjmuje jako argumenty wskaźnik na zbior do tesowania, pierwiastek do ktorego testujemy oraz wielkosc zbioru testowanego
{    
uint tid=blockIdx.x;                                                                          //Pobranie numeru bloku w jakim się znajdujemy
uint i,j;                                                                                     //Zmienne pomocnicze
for (i=2;i<=sqr;i++) {			// kolejne liczby od 2 do pierwiastka kwadratowego z najwiekszego elementu zbioru wczytywanego
        for (j = tid; j <d; j+=gridDim.x) {		//petla wewnetrzna sprawdzajaca czy kolejne liczby wektora tab dziela sie przez aktualna wartosc zmiennej i (zmienna j inkrementowana o rozmiar siatki blokow)
                if((tab[j].value%i==0)&&(tab[j].value!=i)) //jesli tak liczba uznawana jest za zlozona, dodatkowo sprawdzamy czy liczba nie jest rowna obecnemu dzielnikowi (zasada pierwszosci)
                    tab[j].prime=false;    
        }
    }                                      
}

int main(int argc, char** argv) {
    int blockNumber=1000;      //liczba blokow
    
    ifstream file;  	//plik wejsciowy
    unsigned int maxval=0;  //zmienna przechowująca wartosc maksymalna z testowanego pliku
    number fromfile;	      // pojedyncza liczba z pliku wraz z informacja o pierwszosci
    
    hipEvent_t start, stop; //deklaracja zmiennych licznika
    float elapsedTime;       //czas wynikowy
    hipEventCreate(&start); //zdarzenia CUDA
    hipEventCreate(&stop);

    

    if (argc != 2) {				//sprawdzenie ilosci argumentow podanych przy wywolaniu programu
        cout << "The number of arguments is invalid"<<endl;
        exit(1);
    }
    
    file.open(argv[1]);
	if (file.fail()){			//Sprawdzenie poprawnosci otwartego pliku
		cout<<"Could not open file to read."<<endl;
		exit(1);
	}

    vector<number> tab;				//utworzenie wektora liczb

    while (file >> fromfile.value) {		//pobranie danych z pliku do wektora tab
        fromfile.prime=true;			//domniemanie pierwszosci liczby
        tab.push_back(fromfile);		//zapisanie liczby w wektorze tab
        if(fromfile.value>maxval)		//poszukiwanie liczby maksymalnej ze zbioru
            maxval=fromfile.value;

    }

   				
    uint sqr=sqrt(maxval);			//pierwiastek z liczby maksymalnej
    uint d=tab.size();          //zmienna pomocnicza rozmiar wektora danych

    number* tab2;               //wskaźnik na typ number
    number* temp = tab.data();  //konwersja wektora do tablicy 
            
    hipMalloc( (void**)&tab2, d * sizeof(number) );                     //alokacja miejsca w pamięci urządzenia
    hipMemcpy(tab2, temp, d * sizeof(number), hipMemcpyHostToDevice);  //kopiowanie danych z pamięci RAM do pamięci GPU
    hipEventRecord(start);                                              //rozpoczęcie liczenia czasu
    primeTesting <<< blockNumber, 1 >>> (tab2, sqr,d);                   //wywolanie funkcji na urządzeniu 

    hipEventRecord(stop);                                              //zatrzymanie licznika czasu
    hipEventSynchronize(stop);                                         //synchronizacja zdarzenia stop

    number * result;                                                            //wskaźnik na typ number do przechowywania wyniku
    result= (number *) malloc (d*sizeof(number));                               //alokacja miejsca
    hipMemcpy(result, tab2, d * sizeof(number), hipMemcpyDeviceToHost);       //kopiowanie danych wynikowych z pamięci urzadzenia do pamięci Hosta
    hipEventElapsedTime(&elapsedTime, start, stop);                            //obliczenie czasu pracy programu
    printf("Czas : %f ms\n", elapsedTime);                                      //wypisanie czasu obliczeń
    

       
    for (uint i=0;i<d;i++)				//wypisanie liczb z  wektora tab wraz z informacją czy są pierwsze
        if(result[i].prime==true)
            cout<< result[i].value<<": prime"<<endl;
        else
            cout<< result[i].value<<": composite"<<endl;   
    hipFree(tab2);                                                             // zwolnienie pamięci na urządzeniu
    free(result);                                                               // zwolnienie pamięci na hoscie
    return 0;                  

}

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

                                        # End of file scope inline assembly
	.globl	_Z27__device_stub__primeTestingP6numberjj # -- Begin function _Z27__device_stub__primeTestingP6numberjj
	.type	_Z27__device_stub__primeTestingP6numberjj,@function
_Z27__device_stub__primeTestingP6numberjj: # @_Z27__device_stub__primeTestingP6numberjj
	.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	$96, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	movq	%rsp, %rsi
	movl	%edx, (%rsi)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z12primeTestingP6numberjj, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z27__device_stub__primeTestingP6numberjj, .Lfunc_end0-_Z27__device_stub__primeTestingP6numberjj
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$592, %rsp                      # imm = 0x250
	.cfi_def_cfa_offset 640
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movl	%edi, %ebp
	leaq	72(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
.Ltmp0:
	leaq	24(%rsp), %rdi
	callq	hipEventCreate
.Ltmp1:
# %bb.1:
.Ltmp2:
	leaq	8(%rsp), %rdi
	callq	hipEventCreate
.Ltmp3:
# %bb.2:
	cmpl	$2, %ebp
	jne	.LBB1_3
# %bb.7:
	movq	8(%rbx), %rsi
.Ltmp8:
	leaq	72(%rsp), %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp9:
# %bb.8:
	movq	72(%rsp), %rax
	movq	-24(%rax), %rax
	testb	$5, 104(%rsp,%rax)
	jne	.LBB1_9
# %bb.11:
	xorpd	%xmm0, %xmm0
	leaq	32(%rsp), %rbx
	movapd	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%ebp, %ebp
	leaq	72(%rsp), %r14
	leaq	56(%rsp), %r15
.LBB1_12:                               # =>This Inner Loop Header: Depth=1
.Ltmp15:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZNSi10_M_extractImEERSiRT_
.Ltmp16:
# %bb.13:                               #   in Loop: Header=BB1_12 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB1_19
# %bb.14:                               #   in Loop: Header=BB1_12 Depth=1
	movb	$1, 64(%rsp)
	movq	40(%rsp), %rsi
	cmpq	48(%rsp), %rsi
	je	.LBB1_16
# %bb.15:                               #   in Loop: Header=BB1_12 Depth=1
	movupd	56(%rsp), %xmm0
	movupd	%xmm0, (%rsi)
	addq	$16, 40(%rsp)
	jmp	.LBB1_17
.LBB1_16:                               #   in Loop: Header=BB1_12 Depth=1
.Ltmp56:
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
.Ltmp57:
.LBB1_17:                               # %_ZNSt6vectorI6numberSaIS0_EE9push_backERKS0_.exit
                                        #   in Loop: Header=BB1_12 Depth=1
	movq	56(%rsp), %rax
	movl	%ebp, %ecx
	cmpq	%rcx, %rax
	cmovbel	%ebp, %eax
	movl	%eax, %ebp
	jmp	.LBB1_12
.LBB1_19:
	movq	32(%rsp), %rbx
	movq	40(%rsp), %r14
	subq	%rbx, %r14
	movabsq	$68719476720, %r15              # imm = 0xFFFFFFFF0
	andq	%r14, %r15
.Ltmp17:
	movq	%rsp, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
.Ltmp18:
# %bb.20:
	movq	(%rsp), %rdi
.Ltmp19:
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp20:
# %bb.21:
	movq	24(%rsp), %rdi
.Ltmp21:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp22:
# %bb.22:
.Ltmp23:
	movabsq	$4294968296, %rdi               # imm = 0x1000003E8
	movabsq	$4294967297, %rdx               # imm = 0x100000001
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp24:
# %bb.23:
	shrq	$4, %r14
	testl	%eax, %eax
	jne	.LBB1_25
# %bb.24:
	movl	%ebp, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	sqrtsd	%xmm0, %xmm0
	cvttsd2si	%xmm0, %rsi
	movq	(%rsp), %rdi
.Ltmp25:
                                        # kill: def $esi killed $esi killed $rsi
	movl	%r14d, %edx
	callq	_Z27__device_stub__primeTestingP6numberjj
.Ltmp26:
.LBB1_25:
	movq	8(%rsp), %rdi
.Ltmp27:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp28:
# %bb.26:
	movq	8(%rsp), %rdi
.Ltmp29:
	callq	hipEventSynchronize
.Ltmp30:
# %bb.27:
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %rbx
	movq	(%rsp), %rsi
.Ltmp32:
	movq	%rax, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp33:
# %bb.28:
	movq	24(%rsp), %rsi
	movq	8(%rsp), %rdx
.Ltmp34:
	leaq	20(%rsp), %rdi
	callq	hipEventElapsedTime
.Ltmp35:
# %bb.29:
	xorps	%xmm0, %xmm0
	cvtss2sd	20(%rsp), %xmm0
	movl	$.L.str.2, %edi
	movb	$1, %al
	callq	printf
	testl	%r14d, %r14d
	je	.LBB1_42
# %bb.30:                               # %.lr.ph.preheader
	movl	%r14d, %r15d
	shlq	$4, %r15
	xorl	%r12d, %r12d
.LBB1_31:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	cmpb	$0, 8(%rbx,%r12)
	movq	(%rbx,%r12), %rsi
	je	.LBB1_36
# %bb.32:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp36:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertImEERSoT_
.Ltmp37:
# %bb.33:                               # %_ZNSolsEm.exit
                                        #   in Loop: Header=BB1_31 Depth=1
.Ltmp38:
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$7, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp39:
# %bb.34:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit48
                                        #   in Loop: Header=BB1_31 Depth=1
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp40:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp41:
	jmp	.LBB1_39
.LBB1_36:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp42:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertImEERSoT_
.Ltmp43:
# %bb.37:                               # %_ZNSolsEm.exit52
                                        #   in Loop: Header=BB1_31 Depth=1
.Ltmp44:
	movq	%rax, %r14
	movl	$.L.str.4, %esi
	movl	$11, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp45:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit54
                                        #   in Loop: Header=BB1_31 Depth=1
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp46:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp47:
.LBB1_39:                               # %.noexc62.invoke
                                        #   in Loop: Header=BB1_31 Depth=1
.Ltmp48:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp49:
# %bb.40:                               # %.noexc63.invoke
                                        #   in Loop: Header=BB1_31 Depth=1
.Ltmp50:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp51:
# %bb.41:                               # %_ZNSolsEPFRSoS_E.exit50
                                        #   in Loop: Header=BB1_31 Depth=1
	addq	$16, %r12
	cmpq	%r12, %r15
	jne	.LBB1_31
.LBB1_42:                               # %._crit_edge
	movq	(%rsp), %rdi
.Ltmp53:
	callq	hipFree
.Ltmp54:
# %bb.43:
	movq	%rbx, %rdi
	callq	free
	movq	32(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB1_45
# %bb.44:
	callq	_ZdlPv
.LBB1_45:                               # %_ZNSt6vectorI6numberSaIS0_EED2Ev.exit
	leaq	72(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	xorl	%eax, %eax
	addq	$592, %rsp                      # imm = 0x250
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_3:
	.cfi_def_cfa_offset 640
.Ltmp4:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$34, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp5:
# %bb.4:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp6:
	movl	$_ZSt4cout, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp7:
	jmp	.LBB1_5
.LBB1_9:
.Ltmp10:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$28, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp11:
# %bb.10:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit43
.Ltmp12:
	movl	$_ZSt4cout, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp13:
.LBB1_5:                                # %_ZNSolsEPFRSoS_E.exit
	movl	$1, %edi
	callq	exit
.LBB1_50:
.Ltmp55:
	jmp	.LBB1_47
.LBB1_6:
.Ltmp14:
	movq	%rax, %rbx
	jmp	.LBB1_49
.LBB1_46:
.Ltmp31:
	jmp	.LBB1_47
.LBB1_18:
.Ltmp58:
	jmp	.LBB1_47
.LBB1_35:
.Ltmp52:
.LBB1_47:
	movq	%rax, %rbx
	movq	32(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB1_49
# %bb.48:
	callq	_ZdlPv
.LBB1_49:
	leaq	72(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	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 .Ltmp9-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp9
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp57-.Ltmp15                #   Call between .Ltmp15 and .Ltmp57
	.uleb128 .Ltmp58-.Lfunc_begin0          #     jumps to .Ltmp58
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp30-.Ltmp17                #   Call between .Ltmp17 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp35-.Ltmp32                #   Call between .Ltmp32 and .Ltmp35
	.uleb128 .Ltmp55-.Lfunc_begin0          #     jumps to .Ltmp55
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp51-.Ltmp36                #   Call between .Ltmp36 and .Ltmp51
	.uleb128 .Ltmp52-.Lfunc_begin0          #     jumps to .Ltmp52
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp53-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp54-.Ltmp53                #   Call between .Ltmp53 and .Ltmp54
	.uleb128 .Ltmp55-.Lfunc_begin0          #     jumps to .Ltmp55
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 8 <<
	.uleb128 .Ltmp13-.Ltmp4                 #   Call between .Ltmp4 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Lfunc_end1-.Ltmp13            #   Call between .Ltmp13 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"axG",@progbits,_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.weak	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_ # -- Begin function _ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,@function
_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_: # @_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_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, 8(%rsp)                   # 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.5, %edx
	callq	_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	8(%rbx), %r15
	movq	%r13, 16(%rsp)                  # 8-byte Spill
	movq	%rax, (%rsp)                    # 8-byte Spill
	subq	%rax, %r13
	movq	%r13, %r12
	sarq	$4, %r12
	testq	%r14, %r14
	je	.LBB2_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorI6numberE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB2_3
.LBB2_1:
	xorl	%ebp, %ebp
.LBB2_3:                                # %_ZNSt12_Vector_baseI6numberSaIS0_EE11_M_allocateEm.exit
	shlq	$4, %r12
	movq	8(%rsp), %rax                   # 8-byte Reload
	movups	(%rax), %xmm0
	movups	%xmm0, (%rbp,%r12)
	testq	%r13, %r13
	jle	.LBB2_5
# %bb.4:
	movq	%rbp, %rdi
	movq	(%rsp), %rsi                    # 8-byte Reload
	movq	%r13, %rdx
	callq	memmove@PLT
.LBB2_5:                                # %_ZNSt6vectorI6numberSaIS0_EE11_S_relocateEPS0_S3_S3_RS1_.exit
	leaq	16(,%r13), %r12
	addq	%rbp, %r12
	movq	16(%rsp), %rsi                  # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB2_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB2_7:                                # %_ZNSt6vectorI6numberSaIS0_EE11_S_relocateEPS0_S3_S3_RS1_.exit16
	movq	(%rsp), %rdi                    # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB2_9
# %bb.8:
	callq	_ZdlPv
.LBB2_9:                                # %_ZNSt12_Vector_baseI6numberSaIS0_EE13_M_deallocateEPS0_m.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	shlq	$4, %r14
	addq	%rbp, %r14
	movq	%r14, 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_end2:
	.size	_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, .Lfunc_end2-_ZNSt6vectorI6numberSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc,@function
_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc: # @_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$576460752303423487, %rcx       # imm = 0x7FFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$4, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB3_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
.LBB3_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end3:
	.size	_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc, .Lfunc_end3-_ZNKSt6vectorI6numberSaIS0_EE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorI6numberE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorI6numberE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorI6numberE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorI6numberE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorI6numberE8allocateEmPKv,@function
_ZNSt15__new_allocatorI6numberE8allocateEmPKv: # @_ZNSt15__new_allocatorI6numberE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$59, %rax
	jne	.LBB4_1
# %bb.3:
	shlq	$4, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB4_1:
	.cfi_def_cfa_offset 16
	shrq	$60, %rsi
	je	.LBB4_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB4_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end4:
	.size	_ZNSt15__new_allocatorI6numberE8allocateEmPKv, .Lfunc_end4-_ZNSt15__new_allocatorI6numberE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12primeTestingP6numberjj, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB6_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z12primeTestingP6numberjj,@object # @_Z12primeTestingP6numberjj
	.section	.rodata,"a",@progbits
	.globl	_Z12primeTestingP6numberjj
	.p2align	3, 0x0
_Z12primeTestingP6numberjj:
	.quad	_Z27__device_stub__primeTestingP6numberjj
	.size	_Z12primeTestingP6numberjj, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"The number of arguments is invalid"
	.size	.L.str, 35

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Could not open file to read."
	.size	.L.str.1, 29

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Czas : %f ms\n"
	.size	.L.str.2, 14

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

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

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z12primeTestingP6numberjj"
	.size	.L__unnamed_1, 27

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

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z12primeTestingP6numberjj ; -- Begin function _Z12primeTestingP6numberjj
	.globl	_Z12primeTestingP6numberjj
	.p2align	8
	.type	_Z12primeTestingP6numberjj,@function
_Z12primeTestingP6numberjj:             ; @_Z12primeTestingP6numberjj
; %bb.0:
	s_load_b64 s[2:3], s[0:1], 0x8
	s_mov_b32 s4, 2
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_u32 s2, 2
	s_cbranch_scc1 .LBB0_8
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b64 s[6:7], s[0:1], 0x0
	s_cmp_lt_u32 s15, s3
	s_mov_b32 s11, 0
	s_cselect_b32 s5, -1, 0
	s_add_u32 s8, s0, 16
	v_cndmask_b32_e64 v0, 0, 1, s5
	s_addc_u32 s9, s1, 0
	s_add_i32 s1, s2, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_max_u32 s2, s1, 3
	v_cmp_ne_u32_e64 s0, 1, v0
	v_mov_b32_e32 v0, 0
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccnz .LBB0_7
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_cvt_f32_u32_e32 v1, s4
	s_load_b32 s14, s[8:9], 0x0
	s_mov_b32 s5, s11
	s_mov_b32 s10, s15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e64 v1, 0, 0x4f800000
	v_rcp_f32_e32 v1, v1
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v1, 0x5f7ffffc, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, 0x2f800000, v1
	v_trunc_f32_e32 v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v1, 0xcf800000, v2
	v_cvt_u32_f32_e32 v2, v2
	v_cvt_u32_f32_e32 v1, v1
.LBB0_4:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_lshl_b64 s[12:13], s[10:11], 4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_readfirstlane_b32 s1, v1
	v_readfirstlane_b32 s18, v2
	s_waitcnt lgkmcnt(0)
	s_add_u32 s16, s6, s12
	s_addc_u32 s17, s7, s13
	s_sub_u32 s19, 0, s4
	s_subb_u32 s20, 0, 0
	s_mul_hi_u32 s21, s19, s1
	s_mul_i32 s22, s19, s18
	s_mul_i32 s23, s20, s1
	s_add_i32 s21, s21, s22
	s_mul_i32 s22, s19, s1
	s_add_i32 s21, s21, s23
	s_mul_hi_u32 s24, s1, s22
	s_mul_i32 s23, s1, s21
	s_mul_hi_u32 s1, s1, s21
	s_add_u32 s23, s24, s23
	s_mul_i32 s25, s18, s22
	s_addc_u32 s1, 0, s1
	s_mul_hi_u32 s22, s18, s22
	s_mul_hi_u32 s24, s18, s21
	s_add_u32 s23, s23, s25
	s_addc_u32 s1, s1, s22
	s_mul_i32 s21, s18, s21
	s_addc_u32 s22, s24, 0
	s_add_u32 s1, s1, s21
	s_addc_u32 s21, 0, s22
	v_add_co_u32 v3, s1, v1, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s1, 0
	s_load_b64 s[16:17], s[16:17], 0x0
	s_addc_u32 s18, s18, s21
	v_readfirstlane_b32 s1, v3
	s_mul_i32 s21, s19, s18
	s_delay_alu instid0(VALU_DEP_1)
	s_mul_hi_u32 s22, s19, s1
	s_mul_i32 s20, s20, s1
	s_add_i32 s21, s22, s21
	s_mul_i32 s19, s19, s1
	s_add_i32 s21, s21, s20
	s_mul_hi_u32 s22, s18, s19
	s_mul_i32 s23, s18, s19
	s_mul_i32 s24, s1, s21
	s_mul_hi_u32 s19, s1, s19
	s_mul_hi_u32 s1, s1, s21
	s_add_u32 s19, s19, s24
	s_addc_u32 s1, 0, s1
	s_mul_hi_u32 s20, s18, s21
	s_add_u32 s19, s19, s23
	s_addc_u32 s1, s1, s22
	s_mul_i32 s19, s18, s21
	s_addc_u32 s20, s20, 0
	s_add_u32 s1, s1, s19
	s_addc_u32 s19, 0, s20
	v_add_co_u32 v3, s1, v3, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s1, 0
	s_addc_u32 s18, s18, s19
	v_readfirstlane_b32 s1, v3
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s19, s16, s18
	s_mul_hi_u32 s21, s16, s18
	s_delay_alu instid0(VALU_DEP_1)
	s_mul_hi_u32 s20, s16, s1
	s_mul_i32 s22, s17, s1
	s_add_u32 s19, s20, s19
	s_addc_u32 s20, 0, s21
	s_mul_hi_u32 s1, s17, s1
	s_mul_hi_u32 s21, s17, s18
	s_add_u32 s19, s19, s22
	s_addc_u32 s1, s20, s1
	s_mul_i32 s18, s17, s18
	s_addc_u32 s19, s21, 0
	s_add_u32 s1, s1, s18
	s_addc_u32 s18, 0, s19
	s_mul_hi_u32 s19, s4, s1
	s_mul_i32 s1, s4, s1
	s_mul_i32 s18, s4, s18
	v_sub_co_u32 v3, s1, s16, s1
	s_add_i32 s19, s19, s18
	s_cmp_lg_u32 s1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_sub_co_u32 v4, s1, v3, s4
	s_subb_u32 s18, s17, s19
	s_cmp_lg_u32 s1, 0
	v_cmp_le_u32_e32 vcc_lo, s4, v4
	v_sub_co_u32 v5, s1, v4, s4
	s_subb_u32 s19, s18, 0
	s_cmp_lg_u32 s1, 0
	v_cndmask_b32_e64 v6, 0, -1, vcc_lo
	s_subb_u32 s1, s19, 0
	s_cmp_eq_u32 s19, 0
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s18, 0
	v_cndmask_b32_e32 v6, -1, v6, vcc_lo
	v_cmp_le_u32_e32 vcc_lo, s4, v3
	v_cndmask_b32_e64 v7, 0, -1, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cmp_ne_u32_e32 vcc_lo, 0, v6
	v_dual_cndmask_b32 v5, v4, v5 :: v_dual_mov_b32 v8, s1
	s_cselect_b32 s1, -1, 0
	s_cmp_eq_u64 s[16:17], s[4:5]
	v_cndmask_b32_e64 v6, -1, v7, s1
	s_cselect_b32 s1, -1, 0
	v_cndmask_b32_e32 v7, s19, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cmp_ne_u32_e32 vcc_lo, 0, v6
	v_cndmask_b32_e32 v3, v3, v5, vcc_lo
	v_cndmask_b32_e32 v4, s18, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_ne_u64_e32 vcc_lo, 0, v[3:4]
	s_or_b32 s1, s1, vcc_lo
	s_and_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccnz .LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	s_add_u32 s12, s6, s12
	s_addc_u32 s13, s7, s13
	global_store_b8 v0, v0, s[12:13] offset:8
.LBB0_6:                                ;   in Loop: Header=BB0_4 Depth=2
	s_add_i32 s10, s10, s14
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lt_u32 s10, s3
	s_cbranch_scc1 .LBB0_4
.LBB0_7:                                ; %._crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_add_i32 s4, s4, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s4, s2
	s_cbranch_scc1 .LBB0_2
.LBB0_8:                                ; %._crit_edge20
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12primeTestingP6numberjj
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 9
		.amdhsa_next_free_sgpr 26
		.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	_Z12primeTestingP6numberjj, .Lfunc_end0-_Z12primeTestingP6numberjj
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 748
; NumSgprs: 28
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 28
; NumVGPRsForWavesPerEU: 9
; 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
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12primeTestingP6numberjj
    .private_segment_fixed_size: 0
    .sgpr_count:     28
    .sgpr_spill_count: 0
    .symbol:         _Z12primeTestingP6numberjj.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
