#include <stdio.h>
#include <sys/time.h>
#include <vector>
#include <iostream>


using namespace std;

int problem_size = 20000000;


float random_float(float a, float b)
{
    float random = ((float) rand()) / (float) RAND_MAX;
    float diff = b - a;
    float r = random * diff;
    return a + r;
}

int random_int(int min, int max)    
{    
    return rand() % (max - min) + min + 1;     
}


__global__
void infect_sweep(int *InfStats, int *Travelling, float *HouseInf, int *Absent, float *WAIFW_Matrix, float *AgeSusceptibility, 
        int *Age, float *Susceptibility, int *Treated, int *Vaccinated, float *Results)
{
    int i =  (blockIdx.x * blockDim.x) + threadIdx.x;
    float FOI = HouseInf[i];

    for (int j = i * 10; j < (i + 1) * 10; j++)
    {
        FOI *= (1 + 2 * Absent[j]);
    }
        
    for (int j = i * 10; j < (i + 1) * 10; j++)
    {
        int host_age_group = Age[j] / 17;
        int infector_age_group = Age[i] / 17;
        float infectee_susceptibility = AgeSusceptibility[host_age_group] * Susceptibility[j];
        FOI *= WAIFW_Matrix[host_age_group * 17 + infector_age_group] * infectee_susceptibility;
        FOI *= (1.0 - Treated[j] * 2) * (1.0 - Vaccinated[j] * 2) * Travelling[i] * InfStats[i];
        Results[j] = FOI;
    }
}

int main(void)
{

        int *InfStats_h = (int *)malloc(problem_size*sizeof(int));
        int *Travelling_h = (int *)malloc(problem_size*sizeof(int));
        int *HouseInf_h = (int *)malloc(problem_size*sizeof(float));
    
        float *WAIFW_Matrix_h = (float *)malloc(100*sizeof(float));
        float *AgeSusceptibility_h = (float *)malloc(100*sizeof(float));
    
        int *Absent_h = (int *)malloc(15*problem_size*sizeof(int));
        int *Age_h = (int *)malloc(15*problem_size*sizeof(int));
        int *Treated_h = (int *)malloc(15*problem_size*sizeof(int));
        int *Vaccinated_h = (int *)malloc(15*problem_size*sizeof(int));
    
        int *Susceptibility_h = (int *)malloc(15*problem_size*sizeof(float));    
        int *Results_h = (int *)malloc(15*problem_size*sizeof(float));    
    
    
        {
            for (int i = 0; i < problem_size; i++)
            {
                InfStats_h[i] = 1;
                Travelling_h[i] = 0;
                HouseInf_h[i] = random_float(0.1, 1);
            }
        
            for (int i = 0; i < 100; i++)
            {
                AgeSusceptibility_h[i] = random_float(0.1, 1);
                WAIFW_Matrix_h[i] = random_float(0.1, 1);
            }
        
            for (int i = 0; i < problem_size * 10; i++)
            {
                Age_h[i] = random_int(0, 100);
                Susceptibility_h[i] = random_float(0.1, 1);
                Treated_h[i] =  0;
                Vaccinated_h[i] = 1;
                Results_h[i] = 0;
            }
         
        }
    
     
    
      
        int *InfStats_d, *Travelling_d, *Absent_d, *Age_d, *Treated_d, *Vaccinated_d;
        float *HouseInf_d,  *WAIFW_Matrix_d, *AgeSusceptibility_d, *Susceptibility_d, *Results_d;
    
        cudaMalloc(&InfStats_d, problem_size*sizeof(int)); 
        cudaMalloc(&Travelling_d, problem_size*sizeof(int)); 
        cudaMalloc(&Absent_d, 15*problem_size*sizeof(int)); 
        cudaMalloc(&Age_d, 15*problem_size*sizeof(int)); 
        cudaMalloc(&Treated_d, 15*problem_size*sizeof(int)); 
        cudaMalloc(&Vaccinated_d, 15*problem_size*sizeof(int)); 
    
        cudaMalloc(&HouseInf_d, problem_size*sizeof(float)); 
        cudaMalloc(&WAIFW_Matrix_d, 100*sizeof(float)); 
        cudaMalloc(&AgeSusceptibility_d, 100*sizeof(float)); 
        cudaMalloc(&Susceptibility_d, 15*problem_size*sizeof(float)); 
        cudaMalloc(&Results_d, 15*problem_size*sizeof(float)); 
    
        struct timeval t1, t2;
        gettimeofday(&t1, 0);
    
        cudaMemcpy(InfStats_d, InfStats_h, problem_size*sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(Travelling_d, Travelling_h, problem_size*sizeof(int), cudaMemcpyHostToDevice);
        cudaMemcpy(Absent_d, Absent_h, problem_size*sizeof(int)*15, cudaMemcpyHostToDevice);
        cudaMemcpy(Age_d, Age_h, problem_size*sizeof(int)*15, cudaMemcpyHostToDevice);
        cudaMemcpy(Treated_d, Treated_h, problem_size*sizeof(int)*15, cudaMemcpyHostToDevice);
        cudaMemcpy(Vaccinated_d, Vaccinated_h, problem_size*sizeof(int)*15, cudaMemcpyHostToDevice);
        cudaMemcpy(HouseInf_d, HouseInf_h, problem_size*sizeof(float), cudaMemcpyHostToDevice);
        cudaMemcpy(WAIFW_Matrix_d, WAIFW_Matrix_h, 100*sizeof(float), cudaMemcpyHostToDevice);
        cudaMemcpy(AgeSusceptibility_d, AgeSusceptibility_h, 100*sizeof(float), cudaMemcpyHostToDevice);
        cudaMemcpy(Susceptibility_d, Susceptibility_h, problem_size*sizeof(float)*15, cudaMemcpyHostToDevice);
        cudaMemcpy(Results_d, Results_h, problem_size*sizeof(float)*15, cudaMemcpyHostToDevice);
    
    
      infect_sweep<<<(problem_size+255)/256, 256>>>(InfStats_d, Travelling_d, HouseInf_d, Absent_d, WAIFW_Matrix_d, AgeSusceptibility_d, 
        Age_d, Susceptibility_d, Treated_d, Vaccinated_d, Results_d);
    
      cudaMemcpy(Results_h, Results_d, problem_size*15*sizeof(float), cudaMemcpyDeviceToHost);
      gettimeofday(&t2, 0);
      double time = (1000000.0*(t2.tv_sec-t1.tv_sec) + t2.tv_usec-t1.tv_usec)/1000.0;
      printf("Population size: %d. Time to generate:  %3.1f ms.\n", (problem_size*10), time);
    
      free(InfStats_h);
      free(Travelling_h);
      free(HouseInf_h);
      free(WAIFW_Matrix_h);
      free(AgeSusceptibility_h);
      free(Absent_h);
      free(Age_h);
      free(Treated_h);
      free(Vaccinated_h);
      free(Susceptibility_h);
      free(Results_h);
    
      cudaFree(InfStats_d);
      cudaFree(Travelling_d);
      cudaFree(Absent_d);
      cudaFree(Age_d);
      cudaFree(Treated_d);
      cudaFree(Vaccinated_d);
      cudaFree(InfStats_d);
    
      cudaFree(HouseInf_d);
      cudaFree(WAIFW_Matrix_d);
      cudaFree(AgeSusceptibility_d);
      cudaFree(Susceptibility_d);
      cudaFree(Results_d);
   

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4003:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4003:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0:
.LFB4649:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE4649:
	.size	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	.globl	_Z12random_floatff
	.type	_Z12random_floatff, @function
_Z12random_floatff:
.LFB3998:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movss	%xmm0, 12(%rsp)
	movss	%xmm1, 8(%rsp)
	call	rand@PLT
	movss	12(%rsp), %xmm2
	movss	8(%rsp), %xmm1
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC0(%rip), %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	addss	%xmm2, %xmm0
	ret
	.cfi_endproc
.LFE3998:
	.size	_Z12random_floatff, .-_Z12random_floatff
	.globl	_Z10random_intii
	.type	_Z10random_intii, @function
_Z10random_intii:
.LFB3999:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	pushq	%rax
	.cfi_def_cfa_offset 32
	subl	%ebp, %ebx
	call	rand@PLT
	cltd
	idivl	%ebx
	leal	1(%rbp,%rdx), %eax
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3999:
	.size	_Z10random_intii, .-_Z10random_intii
	.globl	_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_
	.type	_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_, @function
_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_:
.LFB4025:
	.cfi_startproc
	endbr64
	subq	$264, %rsp
	.cfi_def_cfa_offset 272
	movq	272(%rsp), %rax
	movq	%rdi, 88(%rsp)
	leaq	112(%rsp), %rdi
	movq	%rsi, 80(%rsp)
	leaq	124(%rsp), %rsi
	movq	%rax, 40(%rsp)
	movq	280(%rsp), %rax
	movq	%rdx, 72(%rsp)
	leaq	96(%rsp), %rdx
	movq	%rax, 32(%rsp)
	movq	288(%rsp), %rax
	movq	%rcx, 64(%rsp)
	leaq	104(%rsp), %rcx
	movq	%rax, 24(%rsp)
	movq	296(%rsp), %rax
	movq	%r8, 56(%rsp)
	movq	%rax, 16(%rsp)
	movq	304(%rsp), %rax
	movq	%r9, 48(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 248(%rsp)
	xorl	%eax, %eax
	leaq	88(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 192(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 200(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 208(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 216(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 224(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 232(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 240(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 112(%rsp)
	movl	$1, 120(%rsp)
	movq	%rax, 124(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L7
	pushq	104(%rsp)
	.cfi_def_cfa_offset 280
	leaq	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_(%rip), %rdi
	pushq	104(%rsp)
	.cfi_def_cfa_offset 288
	movq	140(%rsp), %rcx
	movl	148(%rsp), %r8d
	movq	128(%rsp), %rsi
	movl	136(%rsp), %edx
	leaq	176(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 280
	popq	%rdx
	.cfi_def_cfa_offset 272
.L7:
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	addq	$264, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4025:
	.size	_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_, .-_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_
	.globl	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.type	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_, @function
_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_:
.LFB4026:
	.cfi_startproc
	endbr64
	jmp	_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_
	.cfi_endproc
.LFE4026:
	.size	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_, .-_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"Population size: %d. Time to generate:  %3.1f ms.\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB4000:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movslq	problem_size(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	movq	%rbp, %rbx
	salq	$2, %rbp
	movq	%rbp, %rdi
	imull	$15, %ebx, %ebx
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, %r15
	call	malloc@PLT
	movq	%rbp, %rdi
	movslq	%ebx, %rbx
	movq	%rax, %r14
	salq	$2, %rbx
	call	malloc@PLT
	movl	$400, %edi
	movq	%rax, %r13
	call	malloc@PLT
	movl	$400, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	%rbx, %rdi
	xorl	%ebx, %ebx
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	movq	%rax, (%rsp)
.L14:
	cmpl	%ebx, problem_size(%rip)
	jle	.L23
	xorl	%esi, %esi
	movl	$1, (%r15,%rbx,4)
	movss	.LC1(%rip), %xmm1
	movl	%esi, (%r14,%rbx,4)
	movss	.LC2(%rip), %xmm0
	call	_Z12random_floatff
	cvttss2sil	%xmm0, %edx
	movl	%edx, 0(%r13,%rbx,4)
	incq	%rbx
	jmp	.L14
.L23:
	xorl	%ebx, %ebx
.L16:
	movss	.LC1(%rip), %xmm1
	movss	.LC2(%rip), %xmm0
	call	_Z12random_floatff
	movss	.LC1(%rip), %xmm1
	movss	%xmm0, 0(%rbp,%rbx)
	movss	.LC2(%rip), %xmm0
	call	_Z12random_floatff
	movss	%xmm0, (%r12,%rbx)
	addq	$4, %rbx
	cmpq	$400, %rbx
	jne	.L16
	xorl	%ebx, %ebx
.L17:
	movslq	problem_size(%rip), %rsi
	imull	$10, %esi, %eax
	cmpl	%ebx, %eax
	jle	.L24
	movl	$100, %esi
	xorl	%edi, %edi
	call	_Z10random_intii
	movq	8(%rsp), %rcx
	movss	.LC1(%rip), %xmm1
	movss	.LC2(%rip), %xmm0
	movl	%eax, (%rcx,%rbx,4)
	call	_Z12random_floatff
	movq	32(%rsp), %rcx
	xorl	%edx, %edx
	cvttss2sil	%xmm0, %eax
	movl	%eax, (%rcx,%rbx,4)
	movq	16(%rsp), %rax
	xorl	%ecx, %ecx
	movl	%edx, (%rax,%rbx,4)
	movq	24(%rsp), %rax
	movl	$1, (%rax,%rbx,4)
	movq	(%rsp), %rax
	movl	%ecx, (%rax,%rbx,4)
	incq	%rbx
	jmp	.L17
.L24:
	salq	$2, %rsi
	leaq	48(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	problem_size(%rip), %rsi
	leaq	56(%rsp), %rdi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	imull	$15, problem_size(%rip), %esi
	leaq	64(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	imull	$15, problem_size(%rip), %esi
	leaq	72(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	imull	$15, problem_size(%rip), %esi
	leaq	80(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	imull	$15, problem_size(%rip), %esi
	leaq	88(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	problem_size(%rip), %rsi
	leaq	96(%rsp), %rdi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	104(%rsp), %rdi
	movl	$400, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	112(%rsp), %rdi
	movl	$400, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	imull	$15, problem_size(%rip), %esi
	leaq	120(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	imull	$15, problem_size(%rip), %esi
	leaq	128(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	xorl	%esi, %esi
	leaq	152(%rsp), %rdi
	call	gettimeofday@PLT
	movslq	problem_size(%rip), %rdx
	movq	48(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	problem_size(%rip), %rdx
	movq	56(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rsi
	movq	64(%rsp), %rdi
	movl	$1, %ecx
	movslq	problem_size(%rip), %rdx
	imulq	$60, %rdx, %rdx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movslq	problem_size(%rip), %rdx
	imulq	$60, %rdx, %rdx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rsi
	movq	80(%rsp), %rdi
	movl	$1, %ecx
	movslq	problem_size(%rip), %rdx
	imulq	$60, %rdx, %rdx
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rsi
	movq	88(%rsp), %rdi
	movl	$1, %ecx
	movslq	problem_size(%rip), %rdx
	imulq	$60, %rdx, %rdx
	call	cudaMemcpy@PLT
	movslq	problem_size(%rip), %rdx
	movq	96(%rsp), %rdi
	movq	%r13, %rsi
	movl	$1, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	104(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	movl	$400, %edx
	call	cudaMemcpy@PLT
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$400, %edx
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rsi
	movq	120(%rsp), %rdi
	movl	$1, %ecx
	movslq	problem_size(%rip), %rdx
	imulq	$60, %rdx, %rdx
	call	cudaMemcpy@PLT
	movslq	problem_size(%rip), %rdx
	movq	(%rsp), %rsi
	movl	$1, %ecx
	movq	128(%rsp), %rdi
	imulq	$60, %rdx, %rdx
	call	cudaMemcpy@PLT
	movl	$256, %esi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	problem_size(%rip), %eax
	movl	$16777217, %ecx
	movl	$1, 176(%rsp)
	salq	$8, %rcx
	addl	$255, %eax
	movq	%rcx, 168(%rsp)
	cltd
	idivl	%esi
	movq	%rcx, %rdx
	movl	$1, %ecx
	movl	%eax, 140(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 144(%rsp)
	movq	140(%rsp), %rdi
	movl	148(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L19
	pushq	%rax
	.cfi_def_cfa_offset 264
	pushq	136(%rsp)
	.cfi_def_cfa_offset 272
	pushq	104(%rsp)
	.cfi_def_cfa_offset 280
	pushq	104(%rsp)
	.cfi_def_cfa_offset 288
	pushq	152(%rsp)
	.cfi_def_cfa_offset 296
	pushq	112(%rsp)
	.cfi_def_cfa_offset 304
	movq	160(%rsp), %r9
	movq	152(%rsp), %r8
	movq	112(%rsp), %rcx
	movq	144(%rsp), %rdx
	movq	104(%rsp), %rsi
	movq	96(%rsp), %rdi
	call	_Z56__device_stub__Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_PiS_PfS_S0_S0_S_S0_S_S_S0_
	addq	$48, %rsp
	.cfi_def_cfa_offset 256
.L19:
	imull	$15, problem_size(%rip), %edx
	movq	(%rsp), %rdi
	movl	$2, %ecx
	movq	128(%rsp), %rsi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	xorl	%esi, %esi
	leaq	168(%rsp), %rdi
	call	gettimeofday@PLT
	movq	168(%rsp), %rax
	movl	$2, %edi
	subq	152(%rsp), %rax
	cvtsi2sdq	%rax, %xmm0
	leaq	.LC5(%rip), %rsi
	movb	$1, %al
	mulsd	.LC3(%rip), %xmm0
	imull	$10, problem_size(%rip), %edx
	cvtsi2sdq	176(%rsp), %xmm1
	addsd	%xmm1, %xmm0
	cvtsi2sdq	160(%rsp), %xmm1
	subsd	%xmm1, %xmm0
	divsd	.LC4(%rip), %xmm0
	call	__printf_chk@PLT
	movq	%r15, %rdi
	call	free@PLT
	movq	%r14, %rdi
	call	free@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	24(%rsp), %rdi
	call	free@PLT
	movq	32(%rsp), %rdi
	call	free@PLT
	movq	(%rsp), %rdi
	call	free@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaFree@PLT
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$200, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4000:
	.size	main, .-main
	.section	.rodata.str1.1
.LC6:
	.string	"_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4028:
	.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	.LC6(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_(%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
.LFE4028:
	.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
	.globl	problem_size
	.data
	.align 4
	.type	problem_size, @object
	.size	problem_size, 4
problem_size:
	.long	20000000
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	805306368
	.align 4
.LC1:
	.long	1065353216
	.align 4
.LC2:
	.long	1036831949
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1093567616
	.align 8
.LC4:
	.long	0
	.long	1083129856
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <sys/time.h>
#include <vector>
#include <iostream>


using namespace std;

int problem_size = 20000000;


float random_float(float a, float b)
{
    float random = ((float) rand()) / (float) RAND_MAX;
    float diff = b - a;
    float r = random * diff;
    return a + r;
}

int random_int(int min, int max)    
{    
    return rand() % (max - min) + min + 1;     
}


__global__
void infect_sweep(int *InfStats, int *Travelling, float *HouseInf, int *Absent, float *WAIFW_Matrix, float *AgeSusceptibility, 
        int *Age, float *Susceptibility, int *Treated, int *Vaccinated, float *Results)
{
    int i =  (blockIdx.x * blockDim.x) + threadIdx.x;
    float FOI = HouseInf[i];

    for (int j = i * 10; j < (i + 1) * 10; j++)
    {
        FOI *= (1 + 2 * Absent[j]);
    }
        
    for (int j = i * 10; j < (i + 1) * 10; j++)
    {
        int host_age_group = Age[j] / 17;
        int infector_age_group = Age[i] / 17;
        float infectee_susceptibility = AgeSusceptibility[host_age_group] * Susceptibility[j];
        FOI *= WAIFW_Matrix[host_age_group * 17 + infector_age_group] * infectee_susceptibility;
        FOI *= (1.0 - Treated[j] * 2) * (1.0 - Vaccinated[j] * 2) * Travelling[i] * InfStats[i];
        Results[j] = FOI;
    }
}

int main(void)
{

        int *InfStats_h = (int *)malloc(problem_size*sizeof(int));
        int *Travelling_h = (int *)malloc(problem_size*sizeof(int));
        int *HouseInf_h = (int *)malloc(problem_size*sizeof(float));
    
        float *WAIFW_Matrix_h = (float *)malloc(100*sizeof(float));
        float *AgeSusceptibility_h = (float *)malloc(100*sizeof(float));
    
        int *Absent_h = (int *)malloc(15*problem_size*sizeof(int));
        int *Age_h = (int *)malloc(15*problem_size*sizeof(int));
        int *Treated_h = (int *)malloc(15*problem_size*sizeof(int));
        int *Vaccinated_h = (int *)malloc(15*problem_size*sizeof(int));
    
        int *Susceptibility_h = (int *)malloc(15*problem_size*sizeof(float));    
        int *Results_h = (int *)malloc(15*problem_size*sizeof(float));    
    
    
        {
            for (int i = 0; i < problem_size; i++)
            {
                InfStats_h[i] = 1;
                Travelling_h[i] = 0;
                HouseInf_h[i] = random_float(0.1, 1);
            }
        
            for (int i = 0; i < 100; i++)
            {
                AgeSusceptibility_h[i] = random_float(0.1, 1);
                WAIFW_Matrix_h[i] = random_float(0.1, 1);
            }
        
            for (int i = 0; i < problem_size * 10; i++)
            {
                Age_h[i] = random_int(0, 100);
                Susceptibility_h[i] = random_float(0.1, 1);
                Treated_h[i] =  0;
                Vaccinated_h[i] = 1;
                Results_h[i] = 0;
            }
         
        }
    
     
    
      
        int *InfStats_d, *Travelling_d, *Absent_d, *Age_d, *Treated_d, *Vaccinated_d;
        float *HouseInf_d,  *WAIFW_Matrix_d, *AgeSusceptibility_d, *Susceptibility_d, *Results_d;
    
        hipMalloc(&InfStats_d, problem_size*sizeof(int)); 
        hipMalloc(&Travelling_d, problem_size*sizeof(int)); 
        hipMalloc(&Absent_d, 15*problem_size*sizeof(int)); 
        hipMalloc(&Age_d, 15*problem_size*sizeof(int)); 
        hipMalloc(&Treated_d, 15*problem_size*sizeof(int)); 
        hipMalloc(&Vaccinated_d, 15*problem_size*sizeof(int)); 
    
        hipMalloc(&HouseInf_d, problem_size*sizeof(float)); 
        hipMalloc(&WAIFW_Matrix_d, 100*sizeof(float)); 
        hipMalloc(&AgeSusceptibility_d, 100*sizeof(float)); 
        hipMalloc(&Susceptibility_d, 15*problem_size*sizeof(float)); 
        hipMalloc(&Results_d, 15*problem_size*sizeof(float)); 
    
        struct timeval t1, t2;
        gettimeofday(&t1, 0);
    
        hipMemcpy(InfStats_d, InfStats_h, problem_size*sizeof(int), hipMemcpyHostToDevice);
        hipMemcpy(Travelling_d, Travelling_h, problem_size*sizeof(int), hipMemcpyHostToDevice);
        hipMemcpy(Absent_d, Absent_h, problem_size*sizeof(int)*15, hipMemcpyHostToDevice);
        hipMemcpy(Age_d, Age_h, problem_size*sizeof(int)*15, hipMemcpyHostToDevice);
        hipMemcpy(Treated_d, Treated_h, problem_size*sizeof(int)*15, hipMemcpyHostToDevice);
        hipMemcpy(Vaccinated_d, Vaccinated_h, problem_size*sizeof(int)*15, hipMemcpyHostToDevice);
        hipMemcpy(HouseInf_d, HouseInf_h, problem_size*sizeof(float), hipMemcpyHostToDevice);
        hipMemcpy(WAIFW_Matrix_d, WAIFW_Matrix_h, 100*sizeof(float), hipMemcpyHostToDevice);
        hipMemcpy(AgeSusceptibility_d, AgeSusceptibility_h, 100*sizeof(float), hipMemcpyHostToDevice);
        hipMemcpy(Susceptibility_d, Susceptibility_h, problem_size*sizeof(float)*15, hipMemcpyHostToDevice);
        hipMemcpy(Results_d, Results_h, problem_size*sizeof(float)*15, hipMemcpyHostToDevice);
    
    
      infect_sweep<<<(problem_size+255)/256, 256>>>(InfStats_d, Travelling_d, HouseInf_d, Absent_d, WAIFW_Matrix_d, AgeSusceptibility_d, 
        Age_d, Susceptibility_d, Treated_d, Vaccinated_d, Results_d);
    
      hipMemcpy(Results_h, Results_d, problem_size*15*sizeof(float), hipMemcpyDeviceToHost);
      gettimeofday(&t2, 0);
      double time = (1000000.0*(t2.tv_sec-t1.tv_sec) + t2.tv_usec-t1.tv_usec)/1000.0;
      printf("Population size: %d. Time to generate:  %3.1f ms.\n", (problem_size*10), time);
    
      free(InfStats_h);
      free(Travelling_h);
      free(HouseInf_h);
      free(WAIFW_Matrix_h);
      free(AgeSusceptibility_h);
      free(Absent_h);
      free(Age_h);
      free(Treated_h);
      free(Vaccinated_h);
      free(Susceptibility_h);
      free(Results_h);
    
      hipFree(InfStats_d);
      hipFree(Travelling_d);
      hipFree(Absent_d);
      hipFree(Age_d);
      hipFree(Treated_d);
      hipFree(Vaccinated_d);
      hipFree(InfStats_d);
    
      hipFree(HouseInf_d);
      hipFree(WAIFW_Matrix_d);
      hipFree(AgeSusceptibility_d);
      hipFree(Susceptibility_d);
      hipFree(Results_d);
   

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

                                        # End of file scope inline assembly
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z12random_floatff
.LCPI0_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z12random_floatff
	.type	_Z12random_floatff,@function
_Z12random_floatff:                     # @_Z12random_floatff
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movss	%xmm1, 4(%rsp)                  # 4-byte Spill
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	mulss	.LCPI0_0(%rip), %xmm1
	movss	4(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	(%rsp), %xmm2                   # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm0
	mulss	%xmm1, %xmm0
	addss	%xmm2, %xmm0
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z12random_floatff, .Lfunc_end0-_Z12random_floatff
	.cfi_endproc
                                        # -- End function
	.globl	_Z10random_intii                # -- Begin function _Z10random_intii
	.type	_Z10random_intii,@function
_Z10random_intii:                       # @_Z10random_intii
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %ebx
	movl	%edi, %r14d
	callq	rand
	subl	%r14d, %ebx
	cltd
	idivl	%ebx
                                        # kill: def $edx killed $edx def $rdx
	leal	(%r14,%rdx), %eax
	incl	%eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z10random_intii, .Lfunc_end1-_Z10random_intii
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_ # -- Begin function _Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.type	_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_,@function
_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_: # @_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.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	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%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	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	8(%rsp), %r12
	movq	%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	$_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_, %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	_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_, .Lfunc_end2-_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI3_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI3_1:
	.long	0x3f666666                      # float 0.899999976
.LCPI3_2:
	.long	0x3dcccccd                      # float 0.100000001
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI3_3:
	.quad	0x412e848000000000              # double 1.0E+6
.LCPI3_4:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.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	$216, %rsp
	.cfi_def_cfa_offset 272
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movslq	problem_size(%rip), %rax
	leaq	(,%rax,4), %rbx
	movq	%rax, %rbp
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 120(%rsp)                 # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r14
	movl	$400, %edi                      # imm = 0x190
	callq	malloc
	movq	%rax, %r12
	movl	$400, %edi                      # imm = 0x190
	callq	malloc
	movq	%rax, %r13
	movq	%rbp, %rbx
	imulq	$60, %rbp, %rbp
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 112(%rsp)                 # 8-byte Spill
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	testq	%rbx, %rbx
	movq	120(%rsp), %rbp                 # 8-byte Reload
	jle	.LBB3_3
# %bb.1:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$1, (%rbp,%rbx,4)
	movl	$0, (%r15,%rbx,4)
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI3_0(%rip), %xmm0
	mulss	.LCPI3_1(%rip), %xmm0
	addss	.LCPI3_2(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movl	%eax, (%r14,%rbx,4)
	incq	%rbx
	movslq	problem_size(%rip), %rax
	cmpq	%rax, %rbx
	jl	.LBB3_2
.LBB3_3:                                # %.preheader57.preheader
	movq	%r14, 144(%rsp)                 # 8-byte Spill
	movq	%r15, 128(%rsp)                 # 8-byte Spill
	xorl	%ebx, %ebx
.LBB3_4:                                # %.preheader57
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI3_0(%rip), %xmm0
	mulss	.LCPI3_1(%rip), %xmm0
	addss	.LCPI3_2(%rip), %xmm0
	movss	%xmm0, (%r13,%rbx,4)
	callq	rand
	movss	.LCPI3_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	%xmm1, %xmm0
	movss	.LCPI3_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	movss	.LCPI3_2(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	movss	%xmm0, (%r12,%rbx,4)
	incq	%rbx
	cmpq	$100, %rbx
	jne	.LBB3_4
# %bb.5:                                # %.preheader
	movl	problem_size(%rip), %eax
	testl	%eax, %eax
	jle	.LBB3_9
# %bb.6:                                # %.lr.ph61.preheader
	movq	%r13, 168(%rsp)                 # 8-byte Spill
	movq	%r12, 176(%rsp)                 # 8-byte Spill
	xorl	%r14d, %r14d
	movq	32(%rsp), %rbp                  # 8-byte Reload
	movq	24(%rsp), %r12                  # 8-byte Reload
	movq	16(%rsp), %r15                  # 8-byte Reload
	movq	112(%rsp), %r13                 # 8-byte Reload
	movq	104(%rsp), %rbx                 # 8-byte Reload
.LBB3_7:                                # %.lr.ph61
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1374389535, %rax, %rcx         # imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	imull	$100, %ecx, %ecx
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
	movl	%eax, (%rbp,%r14,4)
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI3_0(%rip), %xmm0
	mulss	.LCPI3_1(%rip), %xmm0
	addss	.LCPI3_2(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movl	%eax, (%r13,%r14,4)
	xorl	%eax, %eax
	movl	%eax, (%r12,%r14,4)
	movl	$1, (%r15,%r14,4)
	movl	%eax, (%rbx,%r14,4)
	incq	%r14
	movslq	problem_size(%rip), %rax
	leaq	(%rax,%rax), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	cmpq	%rcx, %r14
	jl	.LBB3_7
# %bb.8:
	movq	120(%rsp), %rbp                 # 8-byte Reload
	movq	176(%rsp), %r12                 # 8-byte Reload
	movq	168(%rsp), %r13                 # 8-byte Reload
.LBB3_9:                                # %._crit_edge
	movslq	%eax, %rsi
	shlq	$2, %rsi
	leaq	8(%rsp), %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rsi
	shlq	$2, %rsi
	leaq	96(%rsp), %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rsi
	leaq	88(%rsp), %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rsi
	leaq	80(%rsp), %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rsi
	leaq	72(%rsp), %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rsi
	leaq	64(%rsp), %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rsi
	shlq	$2, %rsi
	leaq	56(%rsp), %rdi
	callq	hipMalloc
	leaq	48(%rsp), %rdi
	movl	$400, %esi                      # imm = 0x190
	callq	hipMalloc
	leaq	160(%rsp), %r15
	movl	$400, %esi                      # imm = 0x190
	movq	%r15, %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rsi
	leaq	152(%rsp), %r14
	movq	%r14, %rdi
	callq	hipMalloc
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rsi
	leaq	40(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipMalloc
	leaq	184(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	leaq	8(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rdx
	shlq	$2, %rdx
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	96(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rdx
	shlq	$2, %rdx
	movq	128(%rsp), %rsi                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	88(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	136(%rsp), %rsi                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	80(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	72(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	64(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	16(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	56(%rsp), %rax
	movq	(%rax), %rdi
	movslq	problem_size(%rip), %rdx
	shlq	$2, %rdx
	movq	144(%rsp), %rsi                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	48(%rsp), %rax
	movq	(%rax), %rdi
	movl	$400, %edx                      # imm = 0x190
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r15), %rdi
	movl	$400, %edx                      # imm = 0x190
	movq	%r13, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r14), %rdi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	112(%rsp), %r14                 # 8-byte Reload
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbx), %rdi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	104(%rsp), %r15                 # 8-byte Reload
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	problem_size(%rip), %edi
	leal	255(%rdi), %eax
	addl	$510, %edi                      # imm = 0x1FE
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$8, %edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$256, %rdx                      # imm = 0x100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_11
# %bb.10:
	movq	8(%rsp), %rdi
	movq	96(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	88(%rsp), %rcx
	movq	48(%rsp), %r8
	movq	160(%rsp), %r9
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	pushq	48(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	80(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	96(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	184(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	120(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z27__device_stub__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	addq	$48, %rsp
	.cfi_adjust_cfa_offset -48
.LBB3_11:
	movq	40(%rsp), %rsi
	movslq	problem_size(%rip), %rax
	imulq	$60, %rax, %rdx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	leaq	200(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	subq	184(%rsp), %rax
	cvtsi2sd	%rax, %xmm1
	mulsd	.LCPI3_3(%rip), %xmm1
	cvtsi2sdq	8(%rbx), %xmm0
	cvtsi2sdq	192(%rsp), %xmm2
	addsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	divsd	.LCPI3_4(%rip), %xmm0
	movl	problem_size(%rip), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %esi
	movl	$.L.str, %edi
	movb	$1, %al
	callq	printf
	movq	%rbp, %rdi
	callq	free
	movq	128(%rsp), %rdi                 # 8-byte Reload
	callq	free
	movq	144(%rsp), %rdi                 # 8-byte Reload
	callq	free
	movq	%r12, %rdi
	callq	free
	movq	%r13, %rdi
	callq	free
	movq	136(%rsp), %rdi                 # 8-byte Reload
	callq	free
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	24(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	%r15, %rdi
	callq	free
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	96(%rsp), %rdi
	callq	hipFree
	movq	88(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi
	callq	hipFree
	movq	72(%rsp), %rdi
	callq	hipFree
	movq	64(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	160(%rsp), %rdi
	callq	hipFree
	movq	152(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$216, %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_end3:
	.size	main, .Lfunc_end3-main
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_, %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_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	problem_size,@object            # @problem_size
	.data
	.globl	problem_size
	.p2align	2, 0x0
problem_size:
	.long	20000000                        # 0x1312d00
	.size	problem_size, 4

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Population size: %d. Time to generate:  %3.1f ms.\n"
	.size	.L.str, 51

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_"
	.size	.L__unnamed_1, 43

	.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__infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_ ; -- Begin function _Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.globl	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
	.p2align	8
	.type	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_,@function
_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_: ; @_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x64
	s_load_b512 s[16:31], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_ashrrev_i32_e32 v2, 31, v1
	v_mul_lo_u32 v0, v1, 10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_nc_u32_e32 v16, 10, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v4, vcc_lo, s20, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s21, v3, vcc_lo
	v_cmp_gt_i32_e32 vcc_lo, 0x7ffffff6, v0
	global_load_b32 v17, v[4:5], off
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB0_4
; %bb.1:                                ; %.lr.ph.preheader
	v_lshlrev_b64 v[4:5], 2, v[0:1]
	v_mov_b32_e32 v6, v0
	s_mov_b32 s5, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v4, s2, s22, v4
	v_add_co_ci_u32_e64 v5, s2, s23, v5, s2
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v7, v[4:5], off
	v_add_co_u32 v4, s2, v4, 4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v5, s2, 0, v5, s2
	s_waitcnt vmcnt(0)
	v_lshl_or_b32 v7, v7, 1, 1
	v_cvt_f32_i32_e32 v7, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mul_f32 v17, v17, v7 :: v_dual_add_nc_u32 v6, 1, v6
	v_cmp_ge_i32_e64 s3, v6, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s5, s3, s5
	s_and_not1_b32 exec_lo, exec_lo, s5
	s_cbranch_execnz .LBB0_2
; %bb.3:                                ; %Flow106
	s_or_b32 exec_lo, exec_lo, s5
.LBB0_4:                                ; %Flow107
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s4
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_7
; %bb.5:                                ; %.lr.ph56
	v_add_co_u32 v4, vcc_lo, s28, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s29, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, s18, v2
	v_add_co_ci_u32_e32 v7, vcc_lo, s19, v3, vcc_lo
	v_add_co_u32 v2, vcc_lo, s16, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s17, v3, vcc_lo
	global_load_b32 v4, v[4:5], off
	global_load_b32 v5, v[6:7], off
	global_load_b32 v6, v[2:3], off
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x40
	s_load_b64 s[0:1], s[0:1], 0x50
	v_lshlrev_b64 v[14:15], 2, v[0:1]
	s_waitcnt vmcnt(2)
	v_mul_hi_i32 v7, 0x78787879, v4
	s_waitcnt vmcnt(1)
	v_cvt_f64_i32_e32 v[2:3], v5
	s_waitcnt vmcnt(0)
	v_cvt_f64_i32_e32 v[4:5], v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshrrev_b32_e32 v6, 31, v7
	v_ashrrev_i32_e32 v7, 3, v7
	v_add_nc_u32_e32 v1, v7, v6
	v_add_co_u32 v6, vcc_lo, s28, v14
	v_add_co_ci_u32_e32 v7, vcc_lo, s29, v15, vcc_lo
	v_add_co_u32 v8, vcc_lo, s30, v14
	v_add_co_ci_u32_e32 v9, vcc_lo, s31, v15, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v10, vcc_lo, s4, v14
	v_add_co_ci_u32_e32 v11, vcc_lo, s5, v15, vcc_lo
	v_add_co_u32 v12, vcc_lo, s6, v14
	v_add_co_ci_u32_e32 v13, vcc_lo, s7, v15, vcc_lo
	v_add_co_u32 v14, vcc_lo, s0, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s1, v15, vcc_lo
	s_mov_b32 s1, 0
.LBB0_6:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v18, v[6:7], off
	global_load_b32 v22, v[10:11], off
	global_load_b32 v23, v[12:13], off
	global_load_b32 v24, v[8:9], off
	v_add_nc_u32_e32 v0, 1, v0
	s_waitcnt vmcnt(3)
	v_mul_hi_i32 v18, 0x78787879, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshrrev_b32_e32 v19, 31, v18
	v_ashrrev_i32_e32 v18, 3, v18
	v_add_nc_u32_e32 v18, v18, v19
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[20:21], null, v18, 17, v[1:2]
	v_ashrrev_i32_e32 v19, 31, v18
	v_lshlrev_b64 v[18:19], 2, v[18:19]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v21, 31, v20
	v_add_co_u32 v18, vcc_lo, s26, v18
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_lshlrev_b64 v[20:21], 2, v[20:21]
	v_add_co_ci_u32_e32 v19, vcc_lo, s27, v19, vcc_lo
	global_load_b32 v25, v[18:19], off
	v_add_co_u32 v18, vcc_lo, s24, v20
	v_add_co_ci_u32_e32 v19, vcc_lo, s25, v21, vcc_lo
	s_waitcnt vmcnt(2)
	v_lshlrev_b32_e32 v20, 1, v23
	v_add_co_u32 v6, vcc_lo, v6, 4
	global_load_b32 v26, v[18:19], off
	v_lshlrev_b32_e32 v18, 1, v22
	v_cvt_f64_i32_e32 v[20:21], v20
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	v_add_co_u32 v8, vcc_lo, v8, 4
	s_delay_alu instid0(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[18:19], v18
	v_add_co_ci_u32_e32 v9, vcc_lo, 0, v9, vcc_lo
	v_add_co_u32 v10, vcc_lo, v10, 4
	v_add_co_ci_u32_e32 v11, vcc_lo, 0, v11, vcc_lo
	v_add_co_u32 v12, vcc_lo, v12, 4
	v_add_co_ci_u32_e32 v13, vcc_lo, 0, v13, vcc_lo
	v_cmp_ge_i32_e32 vcc_lo, v0, v16
	s_or_b32 s1, vcc_lo, s1
	v_add_f64 v[20:21], -v[20:21], 1.0
	v_add_f64 v[18:19], -v[18:19], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[18:19], v[18:19], v[20:21]
	v_mul_f64 v[18:19], v[18:19], v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_mul_f64 v[18:19], v[18:19], v[4:5]
	s_waitcnt vmcnt(1)
	v_mul_f32_e32 v20, v25, v24
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v20, v26, v20
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v17, v17, v20
	v_cvt_f64_f32_e32 v[20:21], v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[17:18], v[18:19], v[20:21]
	v_cvt_f32_f64_e32 v17, v[17:18]
	global_store_b32 v[14:15], v17, off
	v_add_co_u32 v14, s0, v14, 4
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v15, s0, 0, v15, s0
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_6
.LBB0_7:                                ; %Flow105
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 344
		.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 27
		.amdhsa_next_free_sgpr 32
		.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	_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_, .Lfunc_end0-_Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 828
; NumSgprs: 34
; NumVgprs: 27
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 4
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 34
; NumVGPRsForWavesPerEU: 27
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         56
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         64
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         72
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         80
        .size:           8
        .value_kind:     global_buffer
      - .offset:         88
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         92
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         96
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         100
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         102
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         104
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         106
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         108
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         110
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         128
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         136
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         144
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         152
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 344
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_
    .private_segment_fixed_size: 0
    .sgpr_count:     34
    .sgpr_spill_count: 0
    .symbol:         _Z12infect_sweepPiS_PfS_S0_S0_S_S0_S_S_S0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     27
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
