//
//  COVID_spread.c 
//  Parallel Programming, Spring 2020 
//

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<stdbool.h>
#include<cuda.h>
#include<cuda_runtime.h>


//use random number generator to initialize the Graph
//this init function is after the initialization of MPI
//initialize Graph, G_data, G_resultdata and Day_of_cure

// Global function #1: Initialization 
__global__ void gol_init(const int population, unsigned int** Graph, unsigned int* G_data, unsigned int* G_resultdata, unsigned int * Day_of_cure, unsigned int* Num_of_connections_per_person, int max_connections ){
		int i;
		// Initialize G_data, G_resultData and Day_of_cure on the CPU/GPU
		for (i = 0; i < population; i ++){
			G_data[i] = 0;
			G_resultdata[i] = 0;
			Day_of_cure[i] = -1; 
		}
	  
		return;
}


extern "C" void gol_init_master(const int population, unsigned int** Graph, unsigned int* G_data, unsigned int* G_resultdata, unsigned int * Day_of_cure, int myrank, unsigned int* Num_of_connections_per_person, int threadsCount, int max_connections ){

    int N=population;
    int numBlocks = (N+threadsCount-1) / threadsCount;
		
		// Initialize memory 
		cudaMallocManaged(&Graph, (population * sizeof(unsigned int*)));
		cudaMallocManaged(&G_data, (population * sizeof(unsigned int)));
		cudaMallocManaged(&G_resultdata, (population * sizeof(unsigned int)));
		cudaMallocManaged(&Day_of_cure, (population * sizeof(unsigned int)));
		cudaMallocManaged(&Num_of_connections_per_person, (population * sizeof(unsigned int)));
		
		int i;
		for (i = 0; i < population; i++){
			int num_connections = rand() % max_connections + 1; 
			Num_of_connections_per_person[i] = num_connections;
			cudaMallocManaged(&Graph[i], (num_connections * sizeof(unsigned int)));
		}
		
		// Initialize Graph on the CPU/GPU
		for (i = 0; i < population; i++){
				// Generate connections for this indiviudal
				int j;
				for (j = 0; j < Num_of_connections_per_person[j]; j++){
						int curr_connection = rand() % population + 1;
						Graph[i][j] = curr_connection; 
				}			
		}	
		
    gol_init<<<numBlocks, threadsCount>>>(population,Graph,G_data,G_resultdata,Day_of_cure,Num_of_connections_per_person, max_connections);
    
    int cE, cudaDeviceCount;
    if( (cE = cudaGetDeviceCount( &cudaDeviceCount)) != cudaSuccess )
    {
      printf(" Unable to determine cuda device count, error is %d, count is %d\n",
             cE, cudaDeviceCount );
      exit(-1); 
    }
	
    if( (cE = cudaSetDevice( myrank % cudaDeviceCount )) != cudaSuccess )
    {
      printf(" Unable to have rank %d set to cuda device %d, error is %d \n",
             myrank, (myrank % cudaDeviceCount), cE);
      exit(-1); 
    }
} 

//Generate G_resultdata from current G_data and current Day_of_cure, update Day_of_cure

// Global Function #2: Iteration 
__global__ void gol_kernel(const unsigned int* G_data, unsigned int* G_resultData, unsigned int** Graph, unsigned int* Day_of_cure, int threshold, int threadsCount, int currDay, const int population, unsigned int* Num_of_connections_per_person, const int recovery_period, unsigned int* invunerable_individuals){
	
	int index = blockIdx.x * blockDim.x + threadIdx.x;

	
	// 1 -> invunerable
	// 2 -> vunerable 
	
	// Cure individuals that recover on this day 
	int j;
	for (j = index; j < population; j += blockDim.x * gridDim.x){
		
		// If the individual is infected 
		if (G_data[j] == 1){
			// In the case today is the day this individual is to be cured 
			if (Day_of_cure[j] == currDay){
		
				G_resultData[j] = 0;
				invunerable_individuals[j] = 1;
			}		
		}
	}
	
	// Process individuals that are infected 
	for (j = index; j < population; j+= blockDim.x * gridDim.x){
		
		// In the case that the current indiviudal is infected 
		if (G_data[j] == 1){
			
			// Process his/her connections and note its spread 
			int i;
			for (i = 0; i < Num_of_connections_per_person[j]; i++){
				
				// If the connection is not currently infected 
				if (G_data[i] == 0 && invunerable_individuals[i] != 1){
					
					G_resultData[i] = 1;
					Day_of_cure[i] = currDay + recovery_period;
				}				
			}
		}
	}
	
	return;
}

//count the number of infected people in one iteration
__global__ void countInfectedPeople (unsigned int* G_data, const int population, int* count){

	int i;
	int index = blockIdx.x *blockDim.x + threadIdx.x;
	for (i=index;i<population;i+=blockDim.x * gridDim.x){
		if (G_data[i]==1) *count++;
	}
	return; 
}

extern "C"  int getInfectedPeople(unsigned int* G_data, const int population, int threadsCount){
	int N=population;
	int numBlocks= (N+threadsCount-1)/threadsCount;
	int count = 0;
	countInfectedPeople<<<numBlocks, threadsCount>>>(G_data, population, &count);
	return count;
}

extern "C"  void gol_swap( unsigned int **G_data, unsigned int **G_resultdata)
{
    // You write this function - it should swap the pointers of pA and pB.
    
    unsigned int * tmp;
    //reset all elements in pB to 0
    tmp=*G_data;
    *G_data=*G_resultdata;
    *G_resultdata=tmp;
}

//gol_kernelLaunch returns the number of iterations to let the number infected people be larger than threshold
extern "C" int gol_kernelLaunch(unsigned int** G_data,
                              	unsigned int** G_resultData,
																unsigned int*** Graph,
                              	unsigned int** Day_of_cure,
			      										const int population,
                              	const int threshold,
                              	int threadsCount,
																unsigned int** Num_of_connections_per_person,
																const int recovery_period
														){

unsigned int* D_data = *G_data;
unsigned int* D_resultData = *G_resultData;
int N=population;
int numBlocks= (N+threadsCount-1)/threadsCount;

int infected = getInfectedPeople(D_data,population,threadsCount);

int i=0;
    
    while(infected<=threshold)
    {
				unsigned int* invunerable_individuals;
				cudaMallocManaged(&invunerable_individuals, population * sizeof(unsigned int));
				int j;
				for (j = 0; j < population; j++){
					invunerable_individuals[j] = 0;
				}
				
			
        gol_kernel<<<numBlocks, threadsCount>>>(D_data, D_resultData, *Graph, *Day_of_cure, threshold, threadsCount, i, population, *Num_of_connections_per_person, recovery_period, invunerable_individuals);
        infected=getInfectedPeople(D_resultData,population,threadsCount);
        cudaDeviceSynchronize();
				gol_swap(&D_data, &D_resultData);
				i++;
  
				cudaFree(&invunerable_individuals);
				
		}
		
		G_data = &D_data;
		G_resultData = &D_resultData;
		
    cudaDeviceSynchronize();
    return i;
}



// print the indexes of infected people when the number of infected people is larger than threshold

extern "C"  void gol_print_infected(unsigned int* G_data, const int population)
{
    int i;
    
    for( i = 0; i < population; i++)
    {
        
        printf("%d ",G_data[i]);
	//print 100 indexes in each line
	if (i+1% 100==0){
	    printf("\n");
	} 
    }
    
    printf("\n\n");
}

extern "C"  void gol_print_cured(unsigned int** Day_of_cure, const int population){


}



	.file	"tmpxft_002c5dcc_00000000-6_COVID_spread.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2048:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2048:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	gol_swap
	.type	gol_swap, @function
gol_swap:
.LFB2042:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movq	%rdx, (%rdi)
	movq	%rax, (%rsi)
	ret
	.cfi_endproc
.LFE2042:
	.size	gol_swap, .-gol_swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d "
.LC1:
	.string	"\n\n"
	.text
	.globl	gol_print_infected
	.type	gol_print_infected, @function
gol_print_infected:
.LFB2044:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L4:
	cmpl	%ebx, %ebp
	jle	.L8
	movl	(%r12,%rbx,4), %edx
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L4
.L8:
	popq	%rdx
	.cfi_def_cfa_offset 40
	leaq	.LC1(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2044:
	.size	gol_print_infected, .-gol_print_infected
	.globl	gol_print_cured
	.type	gol_print_cured, @function
gol_print_cured:
.LFB2045:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2045:
	.size	gol_print_cured, .-gol_print_cured
	.globl	_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i
	.type	_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i, @function
_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i:
.LFB2070:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movq	%rsp, %rax
	movq	%rax, 152(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z8gol_initiPPjS_S_S_S_i(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 208
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L10:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i, .-_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i
	.globl	_Z8gol_initiPPjS_S_S_S_i
	.type	_Z8gol_initiPPjS_S_S_S_i, @function
_Z8gol_initiPPjS_S_S_S_i:
.LFB2071:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i
	.cfi_endproc
.LFE2071:
	.size	_Z8gol_initiPPjS_S_S_S_i, .-_Z8gol_initiPPjS_S_S_S_i
	.section	.rodata.str1.1
.LC2:
	.string	" Unable to determine cuda device count, error is %d, count is %d\n"
.LC3:
	.string	" Unable to have rank %d set to cuda device %d, error is %d \n"
	.text
	.globl	gol_init_master
	.type	gol_init_master, @function
gol_init_master:
.LFB2040:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r15, %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	144(%rsp), %rax
	movq	%rcx, 24(%rsp)
	leaq	40(%rsp), %rdi
	movq	%r8, 16(%rsp)
	movl	152(%rsp), %r13d
	movl	%r9d, 4(%rsp)
	movq	%rsi, 40(%rsp)
	leaq	0(,%r15,8), %rsi
	movq	%rdx, 32(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leal	-1(%r15,%r13), %eax
	salq	$2, %r15
	cltd
	idivl	%r13d
	movl	$1, %edx
	movl	%eax, %r12d
	call	cudaMallocManaged@PLT
	movq	%r15, %rsi
	leaq	32(%rsp), %rdi
	movl	$1, %edx
	call	cudaMallocManaged@PLT
	movq	%r15, %rsi
	leaq	24(%rsp), %rdi
	movl	$1, %edx
	call	cudaMallocManaged@PLT
	movq	%r15, %rsi
	leaq	16(%rsp), %rdi
	movl	$1, %edx
	call	cudaMallocManaged@PLT
	movq	%r15, %rsi
	leaq	8(%rsp), %rdi
	xorl	%r15d, %r15d
	movl	$1, %edx
	call	cudaMallocManaged@PLT
.L16:
	cmpl	%r15d, %ebx
	jle	.L28
	call	rand@PLT
	cltd
	idivl	160(%rsp)
	movq	8(%rsp), %rax
	incl	%edx
	movl	%edx, (%rax,%r15,4)
	movq	40(%rsp), %rax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movl	$1, %edx
	leaq	(%rax,%r15,8), %rdi
	incq	%r15
	call	cudaMallocManaged@PLT
	jmp	.L16
.L28:
	xorl	%ebp, %ebp
.L18:
	cmpl	%ebp, %ebx
	jle	.L20
	leaq	0(,%rbp,8), %r14
	xorl	%r15d, %r15d
.L21:
	movq	8(%rsp), %rax
	cmpl	(%rax,%r15,4), %r15d
	jnb	.L29
	call	rand@PLT
	movq	40(%rsp), %rdx
	movq	(%rdx,%r14), %rdi
	cltd
	idivl	%ebx
	incl	%edx
	movl	%edx, (%rdi,%r15,4)
	incq	%r15
	jmp	.L21
.L29:
	incq	%rbp
	jmp	.L18
.L20:
	movabsq	$4294967297, %rax
	movl	%r13d, 60(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, 64(%rsp)
	movl	68(%rsp), %ecx
	movq	%rax, 52(%rsp)
	movq	60(%rsp), %rdx
	movl	%r12d, 48(%rsp)
	movl	56(%rsp), %esi
	movq	48(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L22
	pushq	%rax
	.cfi_def_cfa_offset 152
	movl	168(%rsp), %eax
	movl	%ebx, %edi
	pushq	%rax
	.cfi_def_cfa_offset 160
	movq	24(%rsp), %r9
	movq	32(%rsp), %r8
	movq	40(%rsp), %rcx
	movq	48(%rsp), %rdx
	movq	56(%rsp), %rsi
	call	_Z38__device_stub__Z8gol_initiPPjS_S_S_S_iiPPjS_S_S_S_i
	popq	%rdx
	.cfi_def_cfa_offset 152
	popq	%rcx
	.cfi_def_cfa_offset 144
.L22:
	leaq	60(%rsp), %rdi
	call	cudaGetDeviceCount@PLT
	movl	%eax, %edx
	testl	%eax, %eax
	je	.L23
	movl	60(%rsp), %ecx
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L27
.L23:
	movl	4(%rsp), %eax
	cltd
	idivl	60(%rsp)
	movl	%edx, %edi
	call	cudaSetDevice@PLT
	movl	%eax, %r8d
	testl	%eax, %eax
	je	.L15
	movl	4(%rsp), %eax
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	cltd
	idivl	60(%rsp)
	xorl	%eax, %eax
	movl	%edx, %ecx
	movl	4(%rsp), %edx
	call	__printf_chk@PLT
.L27:
	orl	$-1, %edi
	call	exit@PLT
.L15:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$88, %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
.LFE2040:
	.size	gol_init_master, .-gol_init_master
	.globl	_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_
	.type	_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_, @function
_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_:
.LFB2072:
	.cfi_startproc
	endbr64
	subq	$232, %rsp
	.cfi_def_cfa_offset 240
	movq	256(%rsp), %rax
	movq	%rdi, 56(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rax, 16(%rsp)
	movq	272(%rsp), %rax
	movq	%rdx, 40(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	72(%rsp), %rcx
	movl	%r8d, 28(%rsp)
	movl	%r9d, 24(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	240(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	248(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 192(%rsp)
	leaq	264(%rsp), %rax
	movq	%rax, 200(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 208(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	pushq	72(%rsp)
	.cfi_def_cfa_offset 248
	leaq	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 256
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 248
	popq	%rdx
	.cfi_def_cfa_offset 240
.L30:
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$232, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2072:
	.size	_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_, .-_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_
	.globl	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.type	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_, @function
_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_:
.LFB2073:
	.cfi_startproc
	endbr64
	jmp	_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_
	.cfi_endproc
.LFE2073:
	.size	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_, .-_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.globl	_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi
	.type	_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi, @function
_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi:
.LFB2074:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L35
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z19countInfectedPeoplePjiPi(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L35:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2074:
	.size	_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi, .-_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi
	.globl	_Z19countInfectedPeoplePjiPi
	.type	_Z19countInfectedPeoplePjiPi, @function
_Z19countInfectedPeoplePjiPi:
.LFB2075:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi
	.cfi_endproc
.LFE2075:
	.size	_Z19countInfectedPeoplePjiPi, .-_Z19countInfectedPeoplePjiPi
	.globl	getInfectedPeople
	.type	getInfectedPeople, @function
getInfectedPeople:
.LFB2041:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edx, %ecx
	movq	%rdi, %rbp
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rsi
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	movl	%edx, 28(%rsp)
	movl	%eax, 12(%rsp)
	leal	-1(%rbx,%rdx), %eax
	cltd
	movq	%rsi, 32(%rsp)
	idivl	%ecx
	movl	36(%rsp), %ecx
	movq	28(%rsp), %rdx
	movq	%rsi, 20(%rsp)
	movl	24(%rsp), %esi
	movl	%eax, 16(%rsp)
	movq	16(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	leaq	12(%rsp), %rdx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	_Z42__device_stub__Z19countInfectedPeoplePjiPiPjiPi
.L41:
	movl	12(%rsp), %eax
	movq	40(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2041:
	.size	getInfectedPeople, .-getInfectedPeople
	.globl	gol_kernelLaunch
	.type	gol_kernelLaunch, @function
gol_kernelLaunch:
.LFB2043:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movabsq	$4294967297, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r8d, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	(%rdi), %r12
	movq	(%rsi), %r13
	movl	%r8d, %esi
	movq	%rdx, 24(%rsp)
	movq	168(%rsp), %r15
	movq	%rcx, 32(%rsp)
	movq	%r12, %rdi
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	movl	160(%rsp), %eax
	leal	-1(%r8,%rax), %eax
	cltd
	idivl	160(%rsp)
	movl	160(%rsp), %edx
	movl	%eax, 40(%rsp)
	call	getInfectedPeople
	movl	%eax, %edx
	movslq	%ebx, %rax
	salq	$2, %rax
	movq	%rax, 16(%rsp)
.L45:
	movl	12(%rsp), %eax
	cmpl	%eax, %edx
	jg	.L53
	movq	16(%rsp), %rsi
	movl	$1, %edx
	leaq	56(%rsp), %rdi
	call	cudaMallocManaged@PLT
	movq	56(%rsp), %rdx
	xorl	%eax, %eax
.L46:
	cmpl	%eax, %ebx
	jle	.L54
	xorl	%ecx, %ecx
	movl	%ecx, (%rdx,%rax,4)
	incq	%rax
	jmp	.L46
.L54:
	movl	160(%rsp), %eax
	movq	%r14, 80(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 68(%rsp)
	movl	84(%rsp), %ecx
	movl	%eax, 76(%rsp)
	movl	40(%rsp), %eax
	movq	76(%rsp), %rdx
	movl	72(%rsp), %esi
	movl	%eax, 64(%rsp)
	movq	64(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L48
.L49:
	movl	160(%rsp), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	incl	%ebp
	xchgq	%r13, %r12
	call	getInfectedPeople
	movl	%eax, 44(%rsp)
	call	cudaDeviceSynchronize@PLT
	leaq	56(%rsp), %rdi
	call	cudaFree@PLT
	movl	44(%rsp), %edx
	jmp	.L45
.L48:
	pushq	%rax
	.cfi_def_cfa_offset 168
	movq	%r13, %rsi
	movq	%r12, %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 176
	movl	192(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 184
	pushq	(%r15)
	.cfi_def_cfa_offset 192
	pushq	%rbx
	.cfi_def_cfa_offset 200
	pushq	%rbp
	.cfi_def_cfa_offset 208
	movq	80(%rsp), %rax
	movl	208(%rsp), %r9d
	movl	60(%rsp), %r8d
	movq	(%rax), %rcx
	movq	72(%rsp), %rax
	movq	(%rax), %rdx
	call	_Z51__device_stub__Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_PKjPjPS1_S1_iiiiS1_iS1_
	addq	$48, %rsp
	.cfi_def_cfa_offset 160
	jmp	.L49
.L53:
	call	cudaDeviceSynchronize@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2043:
	.size	gol_kernelLaunch, .-gol_kernelLaunch
	.section	.rodata.str1.1
.LC4:
	.string	"_Z19countInfectedPeoplePjiPi"
.LC5:
	.string	"_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_"
.LC6:
	.string	"_Z8gol_initiPPjS_S_S_S_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2077:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -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	.LC4(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z19countInfectedPeoplePjiPi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC5(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8gol_initiPPjS_S_S_S_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	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	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2077:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.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:

//
//  COVID_spread.c 
//  Parallel Programming, Spring 2020 
//

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<stdbool.h>
#include<hip/hip_runtime.h>



//use random number generator to initialize the Graph
//this init function is after the initialization of MPI
//initialize Graph, G_data, G_resultdata and Day_of_cure

// Global function #1: Initialization 
__global__ void gol_init(const int population, unsigned int** Graph, unsigned int* G_data, unsigned int* G_resultdata, unsigned int * Day_of_cure, unsigned int* Num_of_connections_per_person, int max_connections ){
		int i;
		// Initialize G_data, G_resultData and Day_of_cure on the CPU/GPU
		for (i = 0; i < population; i ++){
			G_data[i] = 0;
			G_resultdata[i] = 0;
			Day_of_cure[i] = -1; 
		}
	  
		return;
}


extern "C" void gol_init_master(const int population, unsigned int** Graph, unsigned int* G_data, unsigned int* G_resultdata, unsigned int * Day_of_cure, int myrank, unsigned int* Num_of_connections_per_person, int threadsCount, int max_connections ){

    int N=population;
    int numBlocks = (N+threadsCount-1) / threadsCount;
		
		// Initialize memory 
		hipMallocManaged(&Graph, (population * sizeof(unsigned int*)));
		hipMallocManaged(&G_data, (population * sizeof(unsigned int)));
		hipMallocManaged(&G_resultdata, (population * sizeof(unsigned int)));
		hipMallocManaged(&Day_of_cure, (population * sizeof(unsigned int)));
		hipMallocManaged(&Num_of_connections_per_person, (population * sizeof(unsigned int)));
		
		int i;
		for (i = 0; i < population; i++){
			int num_connections = rand() % max_connections + 1; 
			Num_of_connections_per_person[i] = num_connections;
			hipMallocManaged(&Graph[i], (num_connections * sizeof(unsigned int)));
		}
		
		// Initialize Graph on the CPU/GPU
		for (i = 0; i < population; i++){
				// Generate connections for this indiviudal
				int j;
				for (j = 0; j < Num_of_connections_per_person[j]; j++){
						int curr_connection = rand() % population + 1;
						Graph[i][j] = curr_connection; 
				}			
		}	
		
    gol_init<<<numBlocks, threadsCount>>>(population,Graph,G_data,G_resultdata,Day_of_cure,Num_of_connections_per_person, max_connections);
    
    int cE, cudaDeviceCount;
    if( (cE = hipGetDeviceCount( &cudaDeviceCount)) != hipSuccess )
    {
      printf(" Unable to determine cuda device count, error is %d, count is %d\n",
             cE, cudaDeviceCount );
      exit(-1); 
    }
	
    if( (cE = hipSetDevice( myrank % cudaDeviceCount )) != hipSuccess )
    {
      printf(" Unable to have rank %d set to cuda device %d, error is %d \n",
             myrank, (myrank % cudaDeviceCount), cE);
      exit(-1); 
    }
} 

//Generate G_resultdata from current G_data and current Day_of_cure, update Day_of_cure

// Global Function #2: Iteration 
__global__ void gol_kernel(const unsigned int* G_data, unsigned int* G_resultData, unsigned int** Graph, unsigned int* Day_of_cure, int threshold, int threadsCount, int currDay, const int population, unsigned int* Num_of_connections_per_person, const int recovery_period, unsigned int* invunerable_individuals){
	
	int index = blockIdx.x * blockDim.x + threadIdx.x;

	
	// 1 -> invunerable
	// 2 -> vunerable 
	
	// Cure individuals that recover on this day 
	int j;
	for (j = index; j < population; j += blockDim.x * gridDim.x){
		
		// If the individual is infected 
		if (G_data[j] == 1){
			// In the case today is the day this individual is to be cured 
			if (Day_of_cure[j] == currDay){
		
				G_resultData[j] = 0;
				invunerable_individuals[j] = 1;
			}		
		}
	}
	
	// Process individuals that are infected 
	for (j = index; j < population; j+= blockDim.x * gridDim.x){
		
		// In the case that the current indiviudal is infected 
		if (G_data[j] == 1){
			
			// Process his/her connections and note its spread 
			int i;
			for (i = 0; i < Num_of_connections_per_person[j]; i++){
				
				// If the connection is not currently infected 
				if (G_data[i] == 0 && invunerable_individuals[i] != 1){
					
					G_resultData[i] = 1;
					Day_of_cure[i] = currDay + recovery_period;
				}				
			}
		}
	}
	
	return;
}

//count the number of infected people in one iteration
__global__ void countInfectedPeople (unsigned int* G_data, const int population, int* count){

	int i;
	int index = blockIdx.x *blockDim.x + threadIdx.x;
	for (i=index;i<population;i+=blockDim.x * gridDim.x){
		if (G_data[i]==1) *count++;
	}
	return; 
}

extern "C"  int getInfectedPeople(unsigned int* G_data, const int population, int threadsCount){
	int N=population;
	int numBlocks= (N+threadsCount-1)/threadsCount;
	int count = 0;
	countInfectedPeople<<<numBlocks, threadsCount>>>(G_data, population, &count);
	return count;
}

extern "C"  void gol_swap( unsigned int **G_data, unsigned int **G_resultdata)
{
    // You write this function - it should swap the pointers of pA and pB.
    
    unsigned int * tmp;
    //reset all elements in pB to 0
    tmp=*G_data;
    *G_data=*G_resultdata;
    *G_resultdata=tmp;
}

//gol_kernelLaunch returns the number of iterations to let the number infected people be larger than threshold
extern "C" int gol_kernelLaunch(unsigned int** G_data,
                              	unsigned int** G_resultData,
																unsigned int*** Graph,
                              	unsigned int** Day_of_cure,
			      										const int population,
                              	const int threshold,
                              	int threadsCount,
																unsigned int** Num_of_connections_per_person,
																const int recovery_period
														){

unsigned int* D_data = *G_data;
unsigned int* D_resultData = *G_resultData;
int N=population;
int numBlocks= (N+threadsCount-1)/threadsCount;

int infected = getInfectedPeople(D_data,population,threadsCount);

int i=0;
    
    while(infected<=threshold)
    {
				unsigned int* invunerable_individuals;
				hipMallocManaged(&invunerable_individuals, population * sizeof(unsigned int));
				int j;
				for (j = 0; j < population; j++){
					invunerable_individuals[j] = 0;
				}
				
			
        gol_kernel<<<numBlocks, threadsCount>>>(D_data, D_resultData, *Graph, *Day_of_cure, threshold, threadsCount, i, population, *Num_of_connections_per_person, recovery_period, invunerable_individuals);
        infected=getInfectedPeople(D_resultData,population,threadsCount);
        hipDeviceSynchronize();
				gol_swap(&D_data, &D_resultData);
				i++;
  
				hipFree(&invunerable_individuals);
				
		}
		
		G_data = &D_data;
		G_resultData = &D_resultData;
		
    hipDeviceSynchronize();
    return i;
}



// print the indexes of infected people when the number of infected people is larger than threshold

extern "C"  void gol_print_infected(unsigned int* G_data, const int population)
{
    int i;
    
    for( i = 0; i < population; i++)
    {
        
        printf("%d ",G_data[i]);
	//print 100 indexes in each line
	if (i+1% 100==0){
	    printf("\n");
	} 
    }
    
    printf("\n\n");
}

extern "C"  void gol_print_cured(unsigned int** Day_of_cure, const int population){


}



	.text
	.file	"COVID_spread.hip"
	.globl	_Z23__device_stub__gol_initiPPjS_S_S_S_i # -- Begin function _Z23__device_stub__gol_initiPPjS_S_S_S_i
	.type	_Z23__device_stub__gol_initiPPjS_S_S_S_i,@function
_Z23__device_stub__gol_initiPPjS_S_S_S_i: # @_Z23__device_stub__gol_initiPPjS_S_S_S_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%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	$_Z8gol_initiPPjS_S_S_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	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	_Z23__device_stub__gol_initiPPjS_S_S_S_i, .Lfunc_end0-_Z23__device_stub__gol_initiPPjS_S_S_S_i
	.cfi_endproc
                                        # -- End function
	.globl	gol_init_master                 # -- Begin function gol_init_master
	.type	gol_init_master,@function
gol_init_master:                        # @gol_init_master
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, 20(%rsp)                  # 4-byte Spill
	movl	%edi, %r14d
	movl	128(%rsp), %ebp
	movl	120(%rsp), %r9d
	leaq	8(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %r12
	movq	%rdx, (%r12)
	leaq	40(%rsp), %r13
	movq	%rcx, (%r13)
	leaq	32(%rsp), %rax
	movq	%r8, (%rax)
	leal	(%r14,%r9), %eax
	decl	%eax
	cltd
	idivl	%r9d
	movl	%eax, 24(%rsp)                  # 4-byte Spill
	movslq	%r14d, %r15
	leaq	(,%r15,8), %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	leaq	(,%r15,4), %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	leaq	32(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	leaq	112(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	testl	%r15d, %r15d
	jle	.LBB1_9
# %bb.1:                                # %.lr.ph.preheader
	movl	%r14d, %ebx
	xorl	%r15d, %r15d
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltd
	idivl	%ebp
                                        # kill: def $edx killed $edx def $rdx
	leal	1(%rdx), %eax
	movq	112(%rsp), %rcx
	movl	%eax, (%rcx,%r15,4)
	leaq	(,%r15,8), %rdi
	addq	8(%rsp), %rdi
	movslq	%edx, %rax
	leaq	4(,%rax,4), %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	incq	%r15
	cmpq	%rbx, %r15
	jne	.LBB1_2
# %bb.3:                                # %.preheader47
	testl	%r14d, %r14d
	jle	.LBB1_9
# %bb.4:                                # %.preheader.preheader
	movq	112(%rsp), %rax
	xorl	%r15d, %r15d
.LBB1_5:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_7 Depth 2
	cmpl	$0, (%rax)
	je	.LBB1_8
# %bb.6:                                # %.lr.ph50.preheader
                                        #   in Loop: Header=BB1_5 Depth=1
	xorl	%r12d, %r12d
.LBB1_7:                                # %.lr.ph50
                                        #   Parent Loop BB1_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	cltd
	idivl	%r14d
	incl	%edx
	movq	8(%rsp), %rax
	movq	(%rax,%r15,8), %rax
	movl	%edx, (%rax,%r12,4)
	movq	112(%rsp), %rax
	movl	4(%rax,%r12,4), %ecx
	incq	%r12
	cmpq	%rcx, %r12
	jb	.LBB1_7
.LBB1_8:                                # %._crit_edge
                                        #   in Loop: Header=BB1_5 Depth=1
	incq	%r15
	cmpq	%rbx, %r15
	jne	.LBB1_5
.LBB1_9:                                # %._crit_edge52
	movl	24(%rsp), %edi                  # 4-byte Reload
	btsq	$32, %rdi
	movl	120(%rsp), %eax
	movl	%eax, %edx
	btsq	$32, %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_11
# %bb.10:
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rcx
	movq	32(%rsp), %r8
	movq	112(%rsp), %r9
	movl	%ebp, (%rsp)
	movl	%r14d, %edi
	callq	_Z23__device_stub__gol_initiPPjS_S_S_S_i
.LBB1_11:
	leaq	28(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	movl	(%rbx), %ecx
	testl	%eax, %eax
	jne	.LBB1_14
# %bb.12:
	movl	20(%rsp), %ebx                  # 4-byte Reload
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%edx, %edi
	callq	hipSetDevice
	testl	%eax, %eax
	jne	.LBB1_16
# %bb.13:
	addq	$56, %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
.LBB1_14:
	.cfi_def_cfa_offset 112
	movl	$.L.str, %edi
	movl	%eax, %esi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB1_15
.LBB1_16:
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	28(%rsp)
	movl	$.L.str.1, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
.LBB1_15:
	movl	$-1, %edi
	callq	exit
.Lfunc_end1:
	.size	gol_init_master, .Lfunc_end1-gol_init_master
	.cfi_endproc
                                        # -- End function
	.globl	_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_ # -- Begin function _Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.type	_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_,@function
_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_: # @_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.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	$192, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	248(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	256(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	264(%rsp), %rax
	movq	%rax, 72(%rbx)
	leaq	272(%rsp), %rax
	movq	%rax, 80(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%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	$_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$208, %rsp
	.cfi_adjust_cfa_offset -208
	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_end2:
	.size	_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_, .Lfunc_end2-_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__countInfectedPeoplePjiPi # -- Begin function _Z34__device_stub__countInfectedPeoplePjiPi
	.type	_Z34__device_stub__countInfectedPeoplePjiPi,@function
_Z34__device_stub__countInfectedPeoplePjiPi: # @_Z34__device_stub__countInfectedPeoplePjiPi
	.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	12(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z19countInfectedPeoplePjiPi, %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_end3:
	.size	_Z34__device_stub__countInfectedPeoplePjiPi, .Lfunc_end3-_Z34__device_stub__countInfectedPeoplePjiPi
	.cfi_endproc
                                        # -- End function
	.globl	getInfectedPeople               # -- Begin function getInfectedPeople
	.type	getInfectedPeople,@function
getInfectedPeople:                      # @getInfectedPeople
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%edx, %ecx
	movl	%esi, %ebx
	movq	%rdi, %r14
	leal	(%rbx,%rcx), %eax
	decl	%eax
	cltd
	idivl	%ecx
                                        # kill: def $eax killed $eax def $rax
	movl	$0, 12(%rsp)
	btsq	$32, %rax
	movl	%ecx, %edx
	btsq	$32, %rdx
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_2
# %bb.1:
	leaq	12(%rsp), %r15
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_Z34__device_stub__countInfectedPeoplePjiPi
	movl	(%r15), %r15d
.LBB4_2:
	movl	%r15d, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	getInfectedPeople, .Lfunc_end4-getInfectedPeople
	.cfi_endproc
                                        # -- End function
	.globl	gol_swap                        # -- Begin function gol_swap
	.type	gol_swap,@function
gol_swap:                               # @gol_swap
	.cfi_startproc
# %bb.0:
	movq	(%rdi), %rax
	movq	(%rsi), %rcx
	movq	%rcx, (%rdi)
	movq	%rax, (%rsi)
	retq
.Lfunc_end5:
	.size	gol_swap, .Lfunc_end5-gol_swap
	.cfi_endproc
                                        # -- End function
	.globl	gol_kernelLaunch                # -- Begin function gol_kernelLaunch
	.type	gol_kernelLaunch,@function
gol_kernelLaunch:                       # @gol_kernelLaunch
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %ebx
	movl	%r8d, %r14d
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
	movl	128(%rsp), %edx
	movq	(%rdi), %r15
	movq	(%rsi), %r12
	movq	%r15, %rdi
	movl	%r8d, %esi
                                        # kill: def $edx killed $edx killed $rdx
	callq	getInfectedPeople
	xorl	%r13d, %r13d
	movl	%ebx, 12(%rsp)                  # 4-byte Spill
	cmpl	%ebx, %eax
	jg	.LBB6_7
# %bb.1:                                # %.lr.ph51
	movl	128(%rsp), %eax
	movq	%rax, %rcx
	addl	%r14d, %eax
	decl	%eax
	cltd
	idivl	%ecx
                                        # kill: def $eax killed $eax def $rax
	movslq	%r14d, %rdx
	shlq	$2, %rdx
	movq	%rdx, 56(%rsp)                  # 8-byte Spill
	btsq	$32, %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movl	%ecx, %eax
	btsq	$32, %rax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movl	%r14d, %eax
	shlq	$2, %rax
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	xorl	%r13d, %r13d
	leaq	16(%rsp), %rbp
.LBB6_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rbp, %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %edx
	callq	hipMallocManaged
	testl	%r14d, %r14d
	jle	.LBB6_4
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	movq	40(%rsp), %rdx                  # 8-byte Reload
	callq	memset@PLT
.LBB6_4:                                # %._crit_edge
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_6
# %bb.5:                                #   in Loop: Header=BB6_2 Depth=1
	movq	24(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rdx
	movq	32(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rcx
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	20(%rsp), %r8d                  # 4-byte Reload
	movl	136(%rsp), %r9d
                                        # kill: def $r9d killed $r9d killed $r9
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	movl	160(%rsp), %eax
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	movq	160(%rsp), %rax
	pushq	(%rax)
	.cfi_adjust_cfa_offset 8
	pushq	%r14
	.cfi_adjust_cfa_offset 8
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	callq	_Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	addq	$48, %rsp
	.cfi_adjust_cfa_offset -48
.LBB6_6:                                #   in Loop: Header=BB6_2 Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	128(%rsp), %edx
                                        # kill: def $edx killed $edx killed $rdx
	callq	getInfectedPeople
	movl	%eax, %ebx
	callq	hipDeviceSynchronize
	incl	%r13d
	movq	%rbp, %rdi
	callq	hipFree
	movq	%r15, %rax
	movq	%r12, %r15
	movq	%rax, %r12
	cmpl	12(%rsp), %ebx                  # 4-byte Folded Reload
	jle	.LBB6_2
.LBB6_7:                                # %._crit_edge52
	callq	hipDeviceSynchronize
	movl	%r13d, %eax
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	gol_kernelLaunch, .Lfunc_end6-gol_kernelLaunch
	.cfi_endproc
                                        # -- End function
	.globl	gol_print_infected              # -- Begin function gol_print_infected
	.type	gol_print_infected,@function
gol_print_infected:                     # @gol_print_infected
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB7_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB7_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r15,4), %esi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB7_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB7_4:                                # %._crit_edge
	movl	$.Lstr, %edi
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end7:
	.size	gol_print_infected, .Lfunc_end7-gol_print_infected
	.cfi_endproc
                                        # -- End function
	.globl	gol_print_cured                 # -- Begin function gol_print_cured
	.type	gol_print_cured,@function
gol_print_cured:                        # @gol_print_cured
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end8:
	.size	gol_print_cured, .Lfunc_end8-gol_print_cured
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8gol_initiPPjS_S_S_S_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19countInfectedPeoplePjiPi, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB10_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z8gol_initiPPjS_S_S_S_i,@object # @_Z8gol_initiPPjS_S_S_S_i
	.section	.rodata,"a",@progbits
	.globl	_Z8gol_initiPPjS_S_S_S_i
	.p2align	3, 0x0
_Z8gol_initiPPjS_S_S_S_i:
	.quad	_Z23__device_stub__gol_initiPPjS_S_S_S_i
	.size	_Z8gol_initiPPjS_S_S_S_i, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	" Unable to determine cuda device count, error is %d, count is %d\n"
	.size	.L.str, 66

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	" Unable to have rank %d set to cuda device %d, error is %d \n"
	.size	.L.str.1, 61

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

	.type	_Z19countInfectedPeoplePjiPi,@object # @_Z19countInfectedPeoplePjiPi
	.globl	_Z19countInfectedPeoplePjiPi
	.p2align	3, 0x0
_Z19countInfectedPeoplePjiPi:
	.quad	_Z34__device_stub__countInfectedPeoplePjiPi
	.size	_Z19countInfectedPeoplePjiPi, 8

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"%d "
	.size	.L.str.2, 4

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8gol_initiPPjS_S_S_S_i"
	.size	.L__unnamed_1, 25

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_"
	.size	.L__unnamed_2, 38

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z19countInfectedPeoplePjiPi"
	.size	.L__unnamed_3, 29

	.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	"\n"
	.size	.Lstr, 2

	.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 _Z23__device_stub__gol_initiPPjS_S_S_S_i
	.addrsig_sym _Z25__device_stub__gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.addrsig_sym _Z34__device_stub__countInfectedPeoplePjiPi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z8gol_initiPPjS_S_S_S_i
	.addrsig_sym _Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.addrsig_sym _Z19countInfectedPeoplePjiPi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8gol_initiPPjS_S_S_S_i ; -- Begin function _Z8gol_initiPPjS_S_S_S_i
	.globl	_Z8gol_initiPPjS_S_S_S_i
	.p2align	8
	.type	_Z8gol_initiPPjS_S_S_S_i,@function
_Z8gol_initiPPjS_S_S_S_i:               ; @_Z8gol_initiPPjS_S_S_S_i
; %bb.0:
	s_load_b32 s2, s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB0_3
; %bb.1:                                ; %.lr.ph.preheader
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x10
	s_load_b64 s[0:1], s[0:1], 0x20
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, -1
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_add_i32 s2, s2, -1
	s_waitcnt lgkmcnt(0)
	s_clause 0x2
	global_store_b32 v0, v0, s[4:5]
	global_store_b32 v0, v0, s[6:7]
	global_store_b32 v0, v1, s[0:1]
	s_add_u32 s4, s4, 4
	s_addc_u32 s5, s5, 0
	s_add_u32 s6, s6, 4
	s_addc_u32 s7, s7, 0
	s_add_u32 s0, s0, 4
	s_addc_u32 s1, s1, 0
	s_cmp_lg_u32 s2, 0
	s_cbranch_scc1 .LBB0_2
.LBB0_3:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8gol_initiPPjS_S_S_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 52
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 2
		.amdhsa_next_free_sgpr 8
		.amdhsa_reserve_vcc 0
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z8gol_initiPPjS_S_S_S_i, .Lfunc_end0-_Z8gol_initiPPjS_S_S_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 128
; NumSgprs: 8
; NumVgprs: 2
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 8
; NumVGPRsForWavesPerEU: 2
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_ ; -- Begin function _Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.globl	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
	.p2align	8
	.type	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_,@function
_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_:  ; @_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
; %bb.0:
	s_clause 0x1
	s_load_b32 s6, s[0:1], 0x54
	s_load_b64 s[2:3], s[0:1], 0x28
	s_add_u32 s4, s0, 0x48
	s_addc_u32 s5, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s12, s6, 0xffff
	s_mov_b32 s6, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s12, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB1_15
; %bb.1:                                ; %.lr.ph
	s_load_b32 s20, s[4:5], 0x0
	s_clause 0x2
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x18
	s_load_b64 s[10:11], s[0:1], 0x40
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v5, 1
	v_mov_b32_e32 v2, v1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s20, s20, s12
	s_mov_b32 s12, 0
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	s_mov_b32 s13, exec_lo
	v_lshlrev_b64 v[3:4], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v4, vcc_lo
	global_load_b32 v6, v[6:7], off
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 1, v6
	s_cbranch_execz .LBB1_5
; %bb.3:                                ;   in Loop: Header=BB1_2 Depth=1
	v_add_co_u32 v6, vcc_lo, s8, v3
	v_add_co_ci_u32_e32 v7, vcc_lo, s9, v4, vcc_lo
	global_load_b32 v6, v[6:7], off
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, s2, v6
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_5
; %bb.4:                                ;   in Loop: Header=BB1_2 Depth=1
	v_add_co_u32 v6, vcc_lo, s6, v3
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v4, vcc_lo
	v_add_co_u32 v3, vcc_lo, s10, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s11, v4, vcc_lo
	global_store_b32 v[6:7], v0, off
	global_store_b32 v[3:4], v5, off
.LBB1_5:                                ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	v_add_nc_u32_e32 v2, s20, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s3, v2
	s_or_b32 s12, vcc_lo, s12
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB1_2
; %bb.6:                                ; %.preheader40
	s_or_b32 exec_lo, exec_lo, s12
	s_clause 0x1
	s_load_b32 s12, s[0:1], 0x38
	s_load_b64 s[0:1], s[0:1], 0x30
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v4, 1
	s_mov_b32 s21, 0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s2, s12, s2
.LBB1_7:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_10 Depth 2
	v_ashrrev_i32_e32 v2, 31, v1
	s_mov_b32 s22, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_co_u32 v5, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v3, vcc_lo
	global_load_b32 v5, v[5:6], off
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 1, v5
	s_cbranch_execz .LBB1_14
; %bb.8:                                ; %.preheader
                                        ;   in Loop: Header=BB1_7 Depth=1
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	global_load_b32 v5, v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, 0, v5
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_14
; %bb.9:                                ; %.lr.ph43.preheader
                                        ;   in Loop: Header=BB1_7 Depth=1
	s_mov_b32 s23, 0
	s_mov_b64 s[12:13], s[8:9]
	s_mov_b64 s[14:15], s[6:7]
	s_mov_b64 s[16:17], s[10:11]
	s_mov_b64 s[18:19], s[4:5]
	s_mov_b32 s24, 0
.LBB1_10:                               ; %.lr.ph43
                                        ;   Parent Loop BB1_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b32 v6, v0, s[18:19]
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, 0, v6
	s_cbranch_vccnz .LBB1_13
; %bb.11:                               ;   in Loop: Header=BB1_10 Depth=2
	global_load_b32 v6, v0, s[16:17]
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, 1, v6
	s_cbranch_vccnz .LBB1_13
; %bb.12:                               ;   in Loop: Header=BB1_10 Depth=2
	v_mov_b32_e32 v5, s2
	s_clause 0x1
	global_store_b32 v0, v4, s[14:15]
	global_store_b32 v0, v5, s[12:13]
	global_load_b32 v5, v[2:3], off
.LBB1_13:                               ;   in Loop: Header=BB1_10 Depth=2
	s_add_i32 s24, s24, 1
	s_add_u32 s18, s18, 4
	s_addc_u32 s19, s19, 0
	s_add_u32 s16, s16, 4
	s_addc_u32 s17, s17, 0
	s_waitcnt vmcnt(0)
	v_cmp_ge_u32_e32 vcc_lo, s24, v5
	s_add_u32 s14, s14, 4
	s_addc_u32 s15, s15, 0
	s_add_u32 s12, s12, 4
	s_addc_u32 s13, s13, 0
	s_or_b32 s23, vcc_lo, s23
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s23
	s_cbranch_execnz .LBB1_10
.LBB1_14:                               ; %.loopexit
                                        ;   in Loop: Header=BB1_7 Depth=1
	s_or_b32 exec_lo, exec_lo, s22
	v_add_nc_u32_e32 v1, s20, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s3, v1
	s_or_b32 s21, vcc_lo, s21
	s_and_not1_b32 exec_lo, exec_lo, s21
	s_cbranch_execnz .LBB1_7
.LBB1_15:                               ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 328
		.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 8
		.amdhsa_next_free_sgpr 25
		.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_end1:
	.size	_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_, .Lfunc_end1-_Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 624
; NumSgprs: 27
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 27
; NumVGPRsForWavesPerEU: 8
; 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
	.protected	_Z19countInfectedPeoplePjiPi ; -- Begin function _Z19countInfectedPeoplePjiPi
	.globl	_Z19countInfectedPeoplePjiPi
	.p2align	8
	.type	_Z19countInfectedPeoplePjiPi,@function
_Z19countInfectedPeoplePjiPi:           ; @_Z19countInfectedPeoplePjiPi
; %bb.0:                                ; %._crit_edge
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19countInfectedPeoplePjiPi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z19countInfectedPeoplePjiPi, .Lfunc_end2-_Z19countInfectedPeoplePjiPi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 52
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8gol_initiPPjS_S_S_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     8
    .sgpr_spill_count: 0
    .symbol:         _Z8gol_initiPPjS_S_S_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     2
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         44
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .offset:         56
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         64
        .size:           8
        .value_kind:     global_buffer
      - .offset:         72
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         76
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         80
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         84
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         86
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         88
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         90
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         92
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         94
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         120
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         128
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         136
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 328
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_
    .private_segment_fixed_size: 0
    .sgpr_count:     27
    .sgpr_spill_count: 0
    .symbol:         _Z10gol_kernelPKjPjPS1_S1_iiiiS1_iS1_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19countInfectedPeoplePjiPi
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z19countInfectedPeoplePjiPi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
