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

#define size 6
#define MAX_RAY_DEPTH 3
const unsigned int window_width = 512;
const unsigned int window_height = 512;

struct Sphere{

	float3 color;
	float radius;
	float3 center;
	float3 emissionColor;
	float transparency;
	float reflection;

	__device__ bool hit(float3 origin, float3 direct, float *t0, float *t1) {
		float3 l = make_float3(center.x - origin.x, center.y-origin.y, center.z-origin.z);
		float tca = l.x*direct.x + l.y*direct.y+ l.z*direct.z;
		if(tca <0) return false;
		float d2 = l.x*l.x + l.y*l.y + l.z*l.z - tca*tca;
		if(d2 > radius*radius) return false;
		float thc = sqrtf(radius*radius - d2);
		*t0 = tca -thc;
                *t1 = tca +thc;
		return true;
	}
};

__constant__ Sphere s[size];

__device__ void normalize(float3 &f)
{
	float temp = sqrtf(f.x*f.x + f.y*f.y + f.z*f.z);
	f.x = f.x/temp; 
	f.y = f.y/temp;
	f.z = f.z/temp;
}

__device__ float mix(float a, float b, float mix)
{
    return b * mix + a * (1 - mix);
}

__device__ float3 trace(float3 origin, float3 direct, int depth)
{
    float dist = INFINITY;
    int intersect_object = -1;
    for(unsigned i=0; i<size; i++){
	float t0 = INFINITY, t1 = INFINITY; 
	if(s[i].hit(origin, direct, &t0, &t1))
	{
	    if(t0<0) t0 = t1;
	    if(t0< dist){
 		dist = t0;
		intersect_object = i;
	    }
	}
     }

    if(intersect_object == -1){
  	float3 result = make_float3(2, 2, 2);
	return result;
    }
    float3 surfaceColor = make_float3(0,0,0);
    float3 phit = make_float3(origin.x + direct.x*dist,origin.y + direct.y*dist,origin.z + direct.z*dist);
    float3 nhit = make_float3(phit.x-s[intersect_object].center.x, phit.y-s[intersect_object].center.y, phit.z-s[intersect_object].center.z);
    normalize(nhit);

    float bias = 1e-4;
    bool inside = false;
    if( (direct.x*nhit.x+direct.y*nhit.y+direct.z*nhit.z) > 0){
	nhit.x = (-1)*nhit.x;
	nhit.y = (-1)*nhit.y;
	nhit.z = (-1)*nhit.z;
	inside = true;
    }
 
    if((s[intersect_object].transparency > 0 || s[intersect_object].reflection > 0 ) && depth < MAX_RAY_DEPTH)
    {
	float tmp = direct.x*nhit.x + direct.y*nhit.y + direct.z*nhit.z;
	float facingratio = (-1)*tmp;
	float fresneleffect = mix(pow(1-facingratio, 3), 1, 0.1);
	float3 refldir = make_float3(direct.x - 2*tmp*nhit.x, direct.y - 2*tmp*nhit.y, direct.z - 2*tmp*nhit.z);
	normalize(refldir);
	float3 newReflRay = make_float3(phit.x + nhit.x*bias, phit.y + nhit.y*bias, phit.z + nhit.z*bias);
	float3 reflection = trace(newReflRay, refldir, depth+1);
	float3 refraction = make_float3(0,0,0);
	if(s[intersect_object].transparency){
	    float ior = 1.1, eta;
	    if(inside) eta = ior; else eta = 1/ior;
	    float cosi = (-1)*(nhit.x*direct.x + nhit.y*direct.y + nhit.z*direct.z);
	    float k = 1 -eta*eta*(1-cosi*cosi);
	    float3 refrdir = make_float3(direct.x*eta+nhit.x*(eta*cosi-sqrt(k)), direct.y*eta+nhit.y*(eta*cosi-sqrt(k)), direct.z*eta+nhit.z*(eta*cosi-sqrt(k)));
	    normalize(refrdir);
	    float3 newRefrRay = make_float3(phit.x-bias*nhit.x, phit.y-bias*nhit.y, phit.z-bias*nhit.z);
	    refraction = trace(newRefrRay, refrdir, depth+1);
	}

	surfaceColor.x = (reflection.x * fresneleffect + refraction.x * (1 - fresneleffect) * s[intersect_object].transparency )*s[intersect_object].color.x;
	surfaceColor.y = (reflection.y * fresneleffect + refraction.y * (1 - fresneleffect) * s[intersect_object].transparency )*s[intersect_object].color.y;
	surfaceColor.z = (reflection.z * fresneleffect + refraction.z * (1 - fresneleffect) * s[intersect_object].transparency )*s[intersect_object].color.z;
     } 
    else{
    // diffuse 
    	for(unsigned i=0; i<size; i++){
	    if(s[i].emissionColor.x>0){
	    	float3 transmission = make_float3(1,1,1);
	    	float3 lightDirection = make_float3(s[i].center.x-phit.x, s[i].center.y-phit.y, s[i].center.z-phit.z);
	    	normalize(lightDirection);
	    	for(unsigned j=0; j< size; j++){
		    if(i!=j){
		    	float t0, t1;
		    	float3 newRay = make_float3(phit.x+bias*nhit.x, phit.y+bias*nhit.y, phit.z+bias*nhit.z);
		    	if(s[j].hit(newRay, lightDirection, &t0, &t1)){
			    transmission.x = 0; transmission.y=0; transmission.z=0;
			    break;
		    	}
                    }  
                }
	        float tmp = nhit.x*lightDirection.x+nhit.y*lightDirection.y+nhit.z*lightDirection.z;
	        if(tmp<0) tmp = 0;

	       surfaceColor.x = surfaceColor.x+ s[intersect_object].color.x*transmission.x*tmp*s[i].emissionColor.x;
	       surfaceColor.y = surfaceColor.y+ s[intersect_object].color.y*transmission.y*tmp*s[i].emissionColor.y;
	       surfaceColor.z = surfaceColor.z+ s[intersect_object].color.z*transmission.z*tmp*s[i].emissionColor.z;
	  }
       }
    }
 

   float3 result2 = make_float3(surfaceColor.x+s[intersect_object].emissionColor.x, 
					 surfaceColor.y+s[intersect_object].emissionColor.y,
					 surfaceColor.z+s[intersect_object].emissionColor.z);
   return result2;
}

__global__ void tracer_kernel(float3 *image)
{
  int x = blockIdx.x*blockDim.x + threadIdx.x;
  int y = blockIdx.y*blockDim.y + threadIdx.y;
   if(x < window_width && y < window_height)
  {
    //----------compute ray----------------/
    float window_ratio = window_width / float(window_height);
    float fov = 90;
    float angle = tan(fov * 0.5 * M_PI / 180.0);
    float u = (2.0 * (x+0.5)/(float)window_width -1) * angle * window_ratio;
    float v = (1 - 2.0 * (y+0.5) / (float) window_height) * angle;
   
    float3 origin = make_float3(0,0,0);
    float3 direct = make_float3(u,v,-1);
    normalize(direct);
    //----------compute ray--------------//
    image[x+y*window_height] = trace(origin, direct, 0);
  }
}

void init_kernel()
{
  Sphere *temp_s = (Sphere*)malloc(sizeof(Sphere)*size);
  temp_s[0].center = make_float3(0, 0, -20);
  temp_s[0].radius = 4;
  temp_s[0].color = make_float3(1.00, 0.32, 0.36);
  temp_s[0].emissionColor = make_float3(0,0,0);
  temp_s[0].transparency = 0.5;
  temp_s[0].reflection = 1;

  temp_s[1].center = make_float3(0, 20, -30);
  temp_s[1].radius = 3;
  temp_s[1].color = make_float3(0, 0, 0);
  temp_s[1].emissionColor = make_float3(3, 3, 3);
  temp_s[1].transparency = 0;
  temp_s[1].reflection = 0;

  temp_s[2].center = make_float3(0, -10004, -20);
  temp_s[2].radius = 10000;
  temp_s[2].color = make_float3(0.2, 0.2, 0.2);
  temp_s[2].emissionColor = make_float3(0, 0, 0);
  temp_s[2].transparency = 0;
  temp_s[2].reflection = 0;

  temp_s[3].center = make_float3(5, -1, -15);
  temp_s[3].radius = 2;
  temp_s[3].color = make_float3(0.9, 0.76, 0.46);
  temp_s[3].emissionColor = make_float3(0, 0, 0);
  temp_s[3].transparency = 0;
  temp_s[3].reflection = 1;

  temp_s[4].center = make_float3(5, 0, -25);
  temp_s[4].radius = 3;
  temp_s[4].color = make_float3(0.65, 0.77, 0.97);
  temp_s[4].emissionColor = make_float3(0, 0, 0);
  temp_s[4].transparency = 0;
  temp_s[4].reflection = 1;

  temp_s[5].center = make_float3(-5.5, -0, -15);
  temp_s[5].radius = 3;
  temp_s[5].color = make_float3(0.9, 0.9, 0.9);
  temp_s[5].emissionColor = make_float3(0, 0, 0);
  temp_s[5].transparency = 0;
  temp_s[5].reflection = 1;
  for(int i=0; i<size; i++){
	printf("x,y,z: %f, %f, %f, radius: %f\n", temp_s[i].center.x, temp_s[i].center.y,temp_s[i].center.z,temp_s[i].radius);
  }
  size_t sz = size*sizeof(Sphere);
  cudaMemcpyToSymbol(s, temp_s, sz, size_t(0), cudaMemcpyHostToDevice);
 
  free(temp_s);
}

int main(void)
{
  init_kernel();

  float3 *image;
  cudaMalloc((void **)&image, sizeof(float3)*window_width*window_height);
  
  dim3 block(8,8,1);
  dim3 grid(window_width / block.x, window_height / block.y, 1);
  tracer_kernel<<<grid, block>>>(image);
  cudaDeviceSynchronize();

  float3 h_image[window_width*window_height];
  cudaMemcpy(&h_image[0], image, sizeof(float3)*window_width*window_height, cudaMemcpyDeviceToHost);
  std::ofstream ofs("./yuxin.ppm", std::ios::out | std::ios::binary);
    ofs << "P6\n" << window_width << " " << window_height << "\n255\n";
    for (unsigned i = 0; i < window_width * window_height; ++i) {
        ofs << (unsigned char)(std::min(float(1), h_image[i].x) *255) <<
               (unsigned char)(std::min(float(1), h_image[i].y) *255) <<
               (unsigned char)(std::min(float(1), h_image[i].z) *255);
    }
    ofs.close();

}



	.file	"tmpxft_0022a890_00000000-6_raytrace.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4137:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4137:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z9normalizeR6float3
	.type	_Z9normalizeR6float3, @function
_Z9normalizeR6float3:
.LFB4130:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE4130:
	.size	_Z9normalizeR6float3, .-_Z9normalizeR6float3
	.globl	_Z3mixfff
	.type	_Z3mixfff, @function
_Z3mixfff:
.LFB4131:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE4131:
	.size	_Z3mixfff, .-_Z3mixfff
	.globl	_Z5trace6float3S_i
	.type	_Z5trace6float3S_i, @function
_Z5trace6float3S_i:
.LFB4132:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	movl	$1, 44(%rsp)
	movl	44(%rsp), %edi
	movq	%xmm0, 16(%rsp)
	movss	%xmm1, 24(%rsp)
	movq	%xmm2, (%rsp)
	movss	%xmm3, 8(%rsp)
	call	exit@PLT
	.cfi_endproc
.LFE4132:
	.size	_Z5trace6float3S_i, .-_Z5trace6float3S_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"x,y,z: %f, %f, %f, radius: %f\n"
	.text
	.globl	_Z11init_kernelv
	.type	_Z11init_kernelv, @function
_Z11init_kernelv:
.LFB4133:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$288, %edi
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rdx
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	xorl	%edi, %edi
	movq	%rax, %rbx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%r10d, %r10d
	movq	%rcx, 16(%rbx)
	movl	$257, %ecx
	xorl	%r11d, %r11d
	movabsq	$4513687690570366976, %rax
	movq	%rax, (%rbx)
	salq	$54, %rcx
	movabsq	$4647714816498618860, %rax
	movabsq	$4575657222465388544, %rdx
	movq	%rax, 8(%rbx)
	movl	$3248488448, %eax
	leaq	300(%rbx), %r12
	movq	%rax, 24(%rbx)
	movq	%rsi, 32(%rbx)
	movl	$525, %esi
	movq	%rax, 120(%rbx)
	salq	$53, %rsi
	movabsq	$4558363399215801958, %rax
	movq	%rax, 144(%rbx)
	movabsq	$4611686019483010335, %rax
	movq	%rcx, 56(%rbx)
	addq	$1077936128, %rcx
	movq	%rsi, 64(%rbx)
	movabsq	$4489188110467124429, %rsi
	movq	%rax, 152(%rbx)
	movabsq	$-4647714814362124288, %rax
	movq	%rdx, 40(%rbx)
	movabsq	$4629700420190601216, %rdx
	movq	%rcx, 80(%rbx)
	movl	$811461, %ecx
	movq	%rsi, 96(%rbx)
	salq	$44, %rcx
	movabsq	$4559083974464792166, %rsi
	movq	%rax, 160(%rbx)
	movl	$3245342720, %eax
	movq	%rdi, 48(%rbx)
	movabsq	$4629700418001719788, %rdi
	movq	%rdx, 72(%rbx)
	movabsq	$5051983251792252109, %rdx
	movq	%rax, 168(%rbx)
	movl	$127, %eax
	movq	%rsi, 192(%rbx)
	movl	$3095, %esi
	salq	$55, %rax
	movq	%rdx, 104(%rbx)
	salq	$52, %rsi
	movl	$3251109888, %edx
	movq	%rcx, 112(%rbx)
	movabsq	$-4562146421448376320, %rcx
	movq	%rdi, 200(%rbx)
	movabsq	$4568451461350319718, %rdi
	movq	%r8, 88(%rbx)
	movq	%r9, 128(%rbx)
	movq	%r9, 136(%rbx)
	movq	%r10, 176(%rbx)
	movq	%rax, 184(%rbx)
	movq	$1084227584, 208(%rbx)
	movq	%rdx, 216(%rbx)
	movq	%r11, 224(%rbx)
	movq	%rax, 232(%rbx)
	movq	%rcx, 252(%rbx)
	movq	%rsi, 260(%rbx)
	movq	%rdi, 240(%rbx)
	movl	$0x3f666666, 248(%rbx)
	movl	$0x00000000, 268(%rbx)
	movq	%rax, 280(%rbx)
	movq	%rbp, 272(%rbx)
	leaq	12(%rbx), %rbp
.L9:
	cvtss2sd	4(%rbp), %xmm0
	cvtss2sd	0(%rbp), %xmm3
	cvtss2sd	12(%rbp), %xmm2
	movq	%r13, %rsi
	cvtss2sd	8(%rbp), %xmm1
	movl	$2, %edi
	movb	$4, %al
	addq	$48, %rbp
	call	__printf_chk@PLT
	cmpq	%r12, %rbp
	jne	.L9
	movq	%rbx, %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$288, %edx
	leaq	_ZL1s(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	popq	%rax
	.cfi_def_cfa_offset 40
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE4133:
	.size	_Z11init_kernelv, .-_Z11init_kernelv
	.globl	_Z39__device_stub__Z13tracer_kernelP6float3P6float3
	.type	_Z39__device_stub__Z13tracer_kernelP6float3P6float3, @function
_Z39__device_stub__Z13tracer_kernelP6float3P6float3:
.LFB4159:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L13
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z13tracer_kernelP6float3(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L13:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4159:
	.size	_Z39__device_stub__Z13tracer_kernelP6float3P6float3, .-_Z39__device_stub__Z13tracer_kernelP6float3P6float3
	.globl	_Z13tracer_kernelP6float3
	.type	_Z13tracer_kernelP6float3, @function
_Z13tracer_kernelP6float3:
.LFB4160:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z13tracer_kernelP6float3P6float3
	.cfi_endproc
.LFE4160:
	.size	_Z13tracer_kernelP6float3, .-_Z13tracer_kernelP6float3
	.section	.rodata.str1.1
.LC3:
	.string	"_Z13tracer_kernelP6float3"
.LC4:
	.string	"s"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4162:
	.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	.LC3(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z13tracer_kernelP6float3(%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	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	movl	$288, %r9d
	leaq	_ZL1s(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.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
.LFE4162:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC6:
	.string	"./yuxin.ppm"
.LC7:
	.string	"P6\n"
.LC8:
	.string	" "
.LC9:
	.string	"\n255\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4134:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4134
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-3145728(%rsp), %r11
	.cfi_def_cfa 11, 3145760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$560, %rsp
	.cfi_def_cfa_offset 3146320
	movq	%fs:40, %rax
	movq	%rax, 3146280(%rsp)
	xorl	%eax, %eax
.LEHB0:
	call	_Z11init_kernelv
	leaq	8(%rsp), %rdi
	movl	$3145728, %esi
	call	cudaMalloc@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$274877907008, %rdi
	movl	$1, %esi
	movabsq	$34359738376, %rdx
	movl	$1, 36(%rsp)
	movq	%rdi, 28(%rsp)
	movq	%rdx, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	movq	8(%rsp), %rdi
	call	_Z39__device_stub__Z13tracer_kernelP6float3P6float3
.L21:
	call	cudaDeviceSynchronize@PLT
	movq	8(%rsp), %rsi
	movl	$2, %ecx
	leaq	552(%rsp), %rbx
	movl	$3145728, %edx
	movq	%rbx, %rdi
	leaq	40(%rsp), %rbp
	call	cudaMemcpy@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	movl	$20, %edx
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	.LC7(%rip), %rsi
	movq	%rbp, %rdi
.LEHB1:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$512, %esi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC8(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$512, %esi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	3146280(%rsp), %r12
.L28:
	movss	(%rbx), %xmm0
	minss	.LC5(%rip), %xmm0
	movq	%rbp, %rdi
	mulss	.LC10(%rip), %xmm0
	cvttss2sil	%xmm0, %esi
	movsbl	%sil, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movss	4(%rbx), %xmm0
	minss	.LC5(%rip), %xmm0
	movq	%rax, %rdi
	mulss	.LC10(%rip), %xmm0
	cvttss2sil	%xmm0, %esi
	movsbl	%sil, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movss	8(%rbx), %xmm0
	minss	.LC5(%rip), %xmm0
	movq	%rax, %rdi
	mulss	.LC10(%rip), %xmm0
	cvttss2sil	%xmm0, %esi
	movsbl	%sil, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	addq	$12, %rbx
	cmpq	%r12, %rbx
	jne	.L28
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE1:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	3146280(%rsp), %rax
	subq	%fs:40, %rax
	je	.L31
	jmp	.L37
.L35:
	endbr64
	movq	%rax, %rbx
.L29:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	3146280(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L37:
	call	__stack_chk_fail@PLT
.L31:
	addq	$3146288, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4134:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4134:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4134-.LLSDACSB4134
.LLSDACSB4134:
	.uleb128 .LEHB0-.LFB4134
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4134
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L35-.LFB4134
	.uleb128 0
	.uleb128 .LEHB2-.LFB4134
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4134:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.local	_ZL1s
	.comm	_ZL1s,288,32
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC5:
	.long	1065353216
	.align 4
.LC10:
	.long	1132396544
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <fstream>
#include <vector>
#include <iostream>
#include <cassert>

#define size 6
#define MAX_RAY_DEPTH 3
const unsigned int window_width = 512;
const unsigned int window_height = 512;

struct Sphere{

	float3 color;
	float radius;
	float3 center;
	float3 emissionColor;
	float transparency;
	float reflection;

	__device__ bool hit(float3 origin, float3 direct, float *t0, float *t1) {
		float3 l = make_float3(center.x - origin.x, center.y-origin.y, center.z-origin.z);
		float tca = l.x*direct.x + l.y*direct.y+ l.z*direct.z;
		if(tca <0) return false;
		float d2 = l.x*l.x + l.y*l.y + l.z*l.z - tca*tca;
		if(d2 > radius*radius) return false;
		float thc = sqrtf(radius*radius - d2);
		*t0 = tca -thc;
                *t1 = tca +thc;
		return true;
	}
};

__constant__ Sphere s[size];

__device__ void normalize(float3 &f)
{
	float temp = sqrtf(f.x*f.x + f.y*f.y + f.z*f.z);
	f.x = f.x/temp; 
	f.y = f.y/temp;
	f.z = f.z/temp;
}

__device__ float mix(float a, float b, float mix)
{
    return b * mix + a * (1 - mix);
}

__device__ float3 trace(float3 origin, float3 direct, int depth)
{
    float dist = INFINITY;
    int intersect_object = -1;
    for(unsigned i=0; i<size; i++){
	float t0 = INFINITY, t1 = INFINITY; 
	if(s[i].hit(origin, direct, &t0, &t1))
	{
	    if(t0<0) t0 = t1;
	    if(t0< dist){
 		dist = t0;
		intersect_object = i;
	    }
	}
     }

    if(intersect_object == -1){
  	float3 result = make_float3(2, 2, 2);
	return result;
    }
    float3 surfaceColor = make_float3(0,0,0);
    float3 phit = make_float3(origin.x + direct.x*dist,origin.y + direct.y*dist,origin.z + direct.z*dist);
    float3 nhit = make_float3(phit.x-s[intersect_object].center.x, phit.y-s[intersect_object].center.y, phit.z-s[intersect_object].center.z);
    normalize(nhit);

    float bias = 1e-4;
    bool inside = false;
    if( (direct.x*nhit.x+direct.y*nhit.y+direct.z*nhit.z) > 0){
	nhit.x = (-1)*nhit.x;
	nhit.y = (-1)*nhit.y;
	nhit.z = (-1)*nhit.z;
	inside = true;
    }
 
    if((s[intersect_object].transparency > 0 || s[intersect_object].reflection > 0 ) && depth < MAX_RAY_DEPTH)
    {
	float tmp = direct.x*nhit.x + direct.y*nhit.y + direct.z*nhit.z;
	float facingratio = (-1)*tmp;
	float fresneleffect = mix(pow(1-facingratio, 3), 1, 0.1);
	float3 refldir = make_float3(direct.x - 2*tmp*nhit.x, direct.y - 2*tmp*nhit.y, direct.z - 2*tmp*nhit.z);
	normalize(refldir);
	float3 newReflRay = make_float3(phit.x + nhit.x*bias, phit.y + nhit.y*bias, phit.z + nhit.z*bias);
	float3 reflection = trace(newReflRay, refldir, depth+1);
	float3 refraction = make_float3(0,0,0);
	if(s[intersect_object].transparency){
	    float ior = 1.1, eta;
	    if(inside) eta = ior; else eta = 1/ior;
	    float cosi = (-1)*(nhit.x*direct.x + nhit.y*direct.y + nhit.z*direct.z);
	    float k = 1 -eta*eta*(1-cosi*cosi);
	    float3 refrdir = make_float3(direct.x*eta+nhit.x*(eta*cosi-sqrt(k)), direct.y*eta+nhit.y*(eta*cosi-sqrt(k)), direct.z*eta+nhit.z*(eta*cosi-sqrt(k)));
	    normalize(refrdir);
	    float3 newRefrRay = make_float3(phit.x-bias*nhit.x, phit.y-bias*nhit.y, phit.z-bias*nhit.z);
	    refraction = trace(newRefrRay, refrdir, depth+1);
	}

	surfaceColor.x = (reflection.x * fresneleffect + refraction.x * (1 - fresneleffect) * s[intersect_object].transparency )*s[intersect_object].color.x;
	surfaceColor.y = (reflection.y * fresneleffect + refraction.y * (1 - fresneleffect) * s[intersect_object].transparency )*s[intersect_object].color.y;
	surfaceColor.z = (reflection.z * fresneleffect + refraction.z * (1 - fresneleffect) * s[intersect_object].transparency )*s[intersect_object].color.z;
     } 
    else{
    // diffuse 
    	for(unsigned i=0; i<size; i++){
	    if(s[i].emissionColor.x>0){
	    	float3 transmission = make_float3(1,1,1);
	    	float3 lightDirection = make_float3(s[i].center.x-phit.x, s[i].center.y-phit.y, s[i].center.z-phit.z);
	    	normalize(lightDirection);
	    	for(unsigned j=0; j< size; j++){
		    if(i!=j){
		    	float t0, t1;
		    	float3 newRay = make_float3(phit.x+bias*nhit.x, phit.y+bias*nhit.y, phit.z+bias*nhit.z);
		    	if(s[j].hit(newRay, lightDirection, &t0, &t1)){
			    transmission.x = 0; transmission.y=0; transmission.z=0;
			    break;
		    	}
                    }  
                }
	        float tmp = nhit.x*lightDirection.x+nhit.y*lightDirection.y+nhit.z*lightDirection.z;
	        if(tmp<0) tmp = 0;

	       surfaceColor.x = surfaceColor.x+ s[intersect_object].color.x*transmission.x*tmp*s[i].emissionColor.x;
	       surfaceColor.y = surfaceColor.y+ s[intersect_object].color.y*transmission.y*tmp*s[i].emissionColor.y;
	       surfaceColor.z = surfaceColor.z+ s[intersect_object].color.z*transmission.z*tmp*s[i].emissionColor.z;
	  }
       }
    }
 

   float3 result2 = make_float3(surfaceColor.x+s[intersect_object].emissionColor.x, 
					 surfaceColor.y+s[intersect_object].emissionColor.y,
					 surfaceColor.z+s[intersect_object].emissionColor.z);
   return result2;
}

__global__ void tracer_kernel(float3 *image)
{
  int x = blockIdx.x*blockDim.x + threadIdx.x;
  int y = blockIdx.y*blockDim.y + threadIdx.y;
   if(x < window_width && y < window_height)
  {
    //----------compute ray----------------/
    float window_ratio = window_width / float(window_height);
    float fov = 90;
    float angle = tan(fov * 0.5 * M_PI / 180.0);
    float u = (2.0 * (x+0.5)/(float)window_width -1) * angle * window_ratio;
    float v = (1 - 2.0 * (y+0.5) / (float) window_height) * angle;
   
    float3 origin = make_float3(0,0,0);
    float3 direct = make_float3(u,v,-1);
    normalize(direct);
    //----------compute ray--------------//
    image[x+y*window_height] = trace(origin, direct, 0);
  }
}

void init_kernel()
{
  Sphere *temp_s = (Sphere*)malloc(sizeof(Sphere)*size);
  temp_s[0].center = make_float3(0, 0, -20);
  temp_s[0].radius = 4;
  temp_s[0].color = make_float3(1.00, 0.32, 0.36);
  temp_s[0].emissionColor = make_float3(0,0,0);
  temp_s[0].transparency = 0.5;
  temp_s[0].reflection = 1;

  temp_s[1].center = make_float3(0, 20, -30);
  temp_s[1].radius = 3;
  temp_s[1].color = make_float3(0, 0, 0);
  temp_s[1].emissionColor = make_float3(3, 3, 3);
  temp_s[1].transparency = 0;
  temp_s[1].reflection = 0;

  temp_s[2].center = make_float3(0, -10004, -20);
  temp_s[2].radius = 10000;
  temp_s[2].color = make_float3(0.2, 0.2, 0.2);
  temp_s[2].emissionColor = make_float3(0, 0, 0);
  temp_s[2].transparency = 0;
  temp_s[2].reflection = 0;

  temp_s[3].center = make_float3(5, -1, -15);
  temp_s[3].radius = 2;
  temp_s[3].color = make_float3(0.9, 0.76, 0.46);
  temp_s[3].emissionColor = make_float3(0, 0, 0);
  temp_s[3].transparency = 0;
  temp_s[3].reflection = 1;

  temp_s[4].center = make_float3(5, 0, -25);
  temp_s[4].radius = 3;
  temp_s[4].color = make_float3(0.65, 0.77, 0.97);
  temp_s[4].emissionColor = make_float3(0, 0, 0);
  temp_s[4].transparency = 0;
  temp_s[4].reflection = 1;

  temp_s[5].center = make_float3(-5.5, -0, -15);
  temp_s[5].radius = 3;
  temp_s[5].color = make_float3(0.9, 0.9, 0.9);
  temp_s[5].emissionColor = make_float3(0, 0, 0);
  temp_s[5].transparency = 0;
  temp_s[5].reflection = 1;
  for(int i=0; i<size; i++){
	printf("x,y,z: %f, %f, %f, radius: %f\n", temp_s[i].center.x, temp_s[i].center.y,temp_s[i].center.z,temp_s[i].radius);
  }
  size_t sz = size*sizeof(Sphere);
  hipMemcpyToSymbol(HIP_SYMBOL(s), temp_s, sz, size_t(0), hipMemcpyHostToDevice);
 
  free(temp_s);
}

int main(void)
{
  init_kernel();

  float3 *image;
  hipMalloc((void **)&image, sizeof(float3)*window_width*window_height);
  
  dim3 block(8,8,1);
  dim3 grid(window_width / block.x, window_height / block.y, 1);
  tracer_kernel<<<grid, block>>>(image);
  hipDeviceSynchronize();

  float3 h_image[window_width*window_height];
  hipMemcpy(&h_image[0], image, sizeof(float3)*window_width*window_height, hipMemcpyDeviceToHost);
  std::ofstream ofs("./yuxin.ppm", std::ios::out | std::ios::binary);
    ofs << "P6\n" << window_width << " " << window_height << "\n255\n";
    for (unsigned i = 0; i < window_width * window_height; ++i) {
        ofs << (unsigned char)(std::min(float(1), h_image[i].x) *255) <<
               (unsigned char)(std::min(float(1), h_image[i].y) *255) <<
               (unsigned char)(std::min(float(1), h_image[i].z) *255);
    }
    ofs.close();

}



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

                                        # End of file scope inline assembly
	.globl	_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE # -- Begin function _Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE
	.type	_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE,@function
_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE: # @_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE
	.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	$64, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	movq	%rsp, %rbx
	movq	%rax, (%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z13tracer_kernelP15HIP_vector_typeIfLj3EE, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$80, %rsp
	.cfi_adjust_cfa_offset -80
	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	_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE, .Lfunc_end0-_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z11init_kernelv
.LCPI1_0:
	.long	0x3f800000                      # float 1
	.long	0x3ea3d70a                      # float 0.319999993
	.zero	4
	.zero	4
.LCPI1_1:
	.long	0x00000000                      # float 0
	.long	0x41a00000                      # float 20
	.zero	4
	.zero	4
.LCPI1_2:
	.long	0x40400000                      # float 3
	.long	0x40400000                      # float 3
	.zero	4
	.zero	4
.LCPI1_3:
	.long	0x00000000                      # float 0
	.long	0xc61c5000                      # float -10004
	.zero	4
	.zero	4
.LCPI1_4:
	.long	0x3e4ccccd                      # float 0.200000003
	.long	0x3e4ccccd                      # float 0.200000003
	.zero	4
	.zero	4
.LCPI1_5:
	.long	0x40a00000                      # float 5
	.long	0xbf800000                      # float -1
	.zero	4
	.zero	4
.LCPI1_6:
	.long	0x3f666666                      # float 0.899999976
	.long	0x3f428f5c                      # float 0.75999999
	.zero	4
	.zero	4
.LCPI1_8:
	.long	0x3f266666                      # float 0.649999976
	.long	0x3f451eb8                      # float 0.76999998
	.zero	4
	.zero	4
.LCPI1_10:
	.long	0x3f666666                      # float 0.899999976
	.long	0x3f666666                      # float 0.899999976
	.zero	4
	.zero	4
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI1_7:
	.long	0x40a00000                      # float 5
.LCPI1_9:
	.long	0xc0b00000                      # float -5.5
	.text
	.globl	_Z11init_kernelv
	.type	_Z11init_kernelv,@function
_Z11init_kernelv:                       # @_Z11init_kernelv
	.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	$288, %edi                      # imm = 0x120
	callq	malloc
	movq	%rax, %rbx
	xorl	%ecx, %ecx
	movq	%rcx, 16(%rax)
	movl	$-1046478848, %edx              # imm = 0xC1A00000
	movl	%edx, 24(%rax)
	movsd	.LCPI1_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	%xmm0, (%rax)
	movabsq	$4647714816498618860, %rax      # imm = 0x408000003EB851EC
	movq	%rax, 8(%rbx)
	movq	%rcx, 28(%rbx)
	movabsq	$4539628424389459968, %rax      # imm = 0x3F00000000000000
	movq	%rax, 36(%rbx)
	movl	$1065353216, %eax               # imm = 0x3F800000
	movl	%eax, 44(%rbx)
	movsd	.LCPI1_1(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	%xmm0, 64(%rbx)
	movl	$-1041235968, 72(%rbx)          # imm = 0xC1F00000
	movq	%rcx, 48(%rbx)
	movabsq	$4629700416936869888, %rsi      # imm = 0x4040000000000000
	movq	%rsi, 56(%rbx)
	movsd	.LCPI1_2(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	%xmm0, 76(%rbx)
	movq	$1077936128, 84(%rbx)           # imm = 0x40400000
	movl	%ecx, 92(%rbx)
	movsd	.LCPI1_3(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	%xmm0, 112(%rbx)
	movl	%edx, 120(%rbx)
	movsd	.LCPI1_4(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	%xmm0, 96(%rbx)
	movabsq	$5051983251792252109, %rdx      # imm = 0x461C40003E4CCCCD
	movq	%rdx, 104(%rbx)
	movl	%ecx, 140(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 124(%rbx)
	movsd	.LCPI1_5(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	%xmm1, 160(%rbx)
	movl	$-1049624576, %ecx              # imm = 0xC1700000
	movl	%ecx, 168(%rbx)
	movsd	.LCPI1_6(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	%xmm1, 144(%rbx)
	movabsq	$4611686019483010335, %rdx      # imm = 0x400000003EEB851F
	movq	%rdx, 152(%rbx)
	movups	%xmm0, 172(%rbx)
	movl	%eax, 188(%rbx)
	movss	.LCPI1_7(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movlps	%xmm1, 208(%rbx)
	movl	$-1043857408, 216(%rbx)         # imm = 0xC1C80000
	movsd	.LCPI1_8(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	%xmm1, 192(%rbx)
	movabsq	$4629700418001719788, %rdx      # imm = 0x404000003F7851EC
	movq	%rdx, 200(%rbx)
	movups	%xmm0, 220(%rbx)
	movl	%eax, 236(%rbx)
	movss	.LCPI1_9(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movlps	%xmm1, 256(%rbx)
	movl	%ecx, 264(%rbx)
	movsd	.LCPI1_10(%rip), %xmm1          # xmm1 = mem[0],zero
	movsd	%xmm1, 240(%rbx)
	movabsq	$4629700418000545382, %rcx      # imm = 0x404000003F666666
	movq	%rcx, 248(%rbx)
	movups	%xmm0, 268(%rbx)
	movl	%eax, 284(%rbx)
	movl	$24, %r14d
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	-8(%rbx,%r14), %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	-4(%rbx,%r14), %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	(%rbx,%r14), %xmm2
	xorps	%xmm3, %xmm3
	cvtss2sd	-12(%rbx,%r14), %xmm3
	movl	$.L.str, %edi
	movb	$4, %al
	callq	printf
	addq	$48, %r14
	cmpq	$312, %r14                      # imm = 0x138
	jne	.LBB1_1
# %bb.2:
	movl	$s, %edi
	movl	$288, %edx                      # imm = 0x120
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movq	%rbx, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	free                            # TAILCALL
.Lfunc_end1:
	.size	_Z11init_kernelv, .Lfunc_end1-_Z11init_kernelv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI2_0:
	.long	0x3f800000                      # float 1
.LCPI2_1:
	.long	0x437f0000                      # float 255
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$3146264, %rsp                  # imm = 0x300218
	.cfi_def_cfa_offset 3146304
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	callq	_Z11init_kernelv
	leaq	8(%rsp), %rdi
	movl	$3145728, %esi                  # imm = 0x300000
	callq	hipMalloc
	movabsq	$274877907008, %rdi             # imm = 0x4000000040
	movabsq	$34359738376, %rdx              # imm = 0x800000008
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.1:
	movq	8(%rsp), %rdi
	callq	_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE
.LBB2_2:
	callq	hipDeviceSynchronize
	movq	8(%rsp), %rsi
	leaq	528(%rsp), %rdi
	movl	$3145728, %edx                  # imm = 0x300000
	movl	$2, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %rbx
	movl	$.L.str.1, %esi
	movq	%rbx, %rdi
	movl	$20, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp0:
	movl	$.L.str.2, %esi
	movl	$3, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp1:
# %bb.3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp2:
	leaq	16(%rsp), %rbx
	movl	$512, %esi                      # imm = 0x200
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertImEERSoT_
.Ltmp3:
# %bb.4:                                # %_ZNSolsEj.exit
.Ltmp4:
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp5:
# %bb.5:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit20
.Ltmp6:
	movl	$512, %esi                      # imm = 0x200
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertImEERSoT_
.Ltmp7:
# %bb.6:                                # %_ZNSolsEj.exit21
.Ltmp8:
	movl	$.L.str.4, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp9:
# %bb.7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit22.preheader
	movl	$8, %r12d
	leaq	7(%rsp), %r14
.LBB2_8:                                # =>This Inner Loop Header: Depth=1
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	minss	520(%rsp,%r12), %xmm0
	mulss	.LCPI2_1(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movb	%al, 7(%rsp)
	movq	16(%rsp), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 32(%rsp,%rcx)
	je	.LBB2_11
# %bb.9:                                #   in Loop: Header=BB2_8 Depth=1
.Ltmp10:
	movl	$1, %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp11:
# %bb.10:                               #   in Loop: Header=BB2_8 Depth=1
	movq	%rax, %r15
	jmp	.LBB2_12
.LBB2_11:                               #   in Loop: Header=BB2_8 Depth=1
.Ltmp12:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp13:
	movq	%rbx, %r15
.LBB2_12:                               #   in Loop: Header=BB2_8 Depth=1
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	minss	524(%rsp,%r12), %xmm0
	mulss	.LCPI2_1(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movb	%al, 7(%rsp)
	movq	(%r15), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r15,%rcx)
	je	.LBB2_15
# %bb.13:                               #   in Loop: Header=BB2_8 Depth=1
.Ltmp15:
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp16:
# %bb.14:                               #   in Loop: Header=BB2_8 Depth=1
	movq	%rax, %r15
	jmp	.LBB2_16
.LBB2_15:                               #   in Loop: Header=BB2_8 Depth=1
.Ltmp17:
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp18:
.LBB2_16:                               #   in Loop: Header=BB2_8 Depth=1
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	minss	528(%rsp,%r12), %xmm0
	mulss	.LCPI2_1(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movb	%al, 7(%rsp)
	movq	(%r15), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r15,%rcx)
	je	.LBB2_18
# %bb.17:                               #   in Loop: Header=BB2_8 Depth=1
.Ltmp20:
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp21:
	jmp	.LBB2_19
.LBB2_18:                               #   in Loop: Header=BB2_8 Depth=1
.Ltmp22:
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp23:
.LBB2_19:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit22
                                        #   in Loop: Header=BB2_8 Depth=1
	addq	$12, %r12
	cmpq	$3145736, %r12                  # imm = 0x300008
	jne	.LBB2_8
# %bb.20:
.Ltmp25:
	leaq	16(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp26:
# %bb.21:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	24(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 16(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	264(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	xorl	%eax, %eax
	addq	$3146264, %rsp                  # imm = 0x300218
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB2_25:
	.cfi_def_cfa_offset 3146304
.Ltmp27:
	jmp	.LBB2_26
.LBB2_22:
.Ltmp14:
	jmp	.LBB2_26
.LBB2_23:
.Ltmp19:
	jmp	.LBB2_26
.LBB2_24:
.Ltmp24:
.LBB2_26:
	movq	%rax, %rbx
	leaq	16(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp9-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp9
	.uleb128 .Ltmp27-.Lfunc_begin0          #     jumps to .Ltmp27
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp13-.Ltmp10                #   Call between .Ltmp10 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp18-.Ltmp15                #   Call between .Ltmp15 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin0          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp23-.Ltmp20                #   Call between .Ltmp20 and .Ltmp23
	.uleb128 .Ltmp24-.Lfunc_begin0          #     jumps to .Ltmp24
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp25-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp26-.Ltmp25                #   Call between .Ltmp25 and .Ltmp26
	.uleb128 .Ltmp27-.Lfunc_begin0          #     jumps to .Ltmp27
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp26-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Lfunc_end2-.Ltmp26            #   Call between .Ltmp26 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	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	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13tracer_kernelP15HIP_vector_typeIfLj3EE, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$s, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$288, %r9d                      # imm = 0x120
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	s,@object                       # @s
	.local	s
	.comm	s,288,16
	.type	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE,@object # @_Z13tracer_kernelP15HIP_vector_typeIfLj3EE
	.section	.rodata,"a",@progbits
	.globl	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE
	.p2align	3, 0x0
_Z13tracer_kernelP15HIP_vector_typeIfLj3EE:
	.quad	_Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE
	.size	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"x,y,z: %f, %f, %f, radius: %f\n"
	.size	.L.str, 31

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"./yuxin.ppm"
	.size	.L.str.1, 12

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"\n255\n"
	.size	.L.str.4, 6

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"s"
	.size	.L__unnamed_2, 2

	.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 _Z28__device_stub__tracer_kernelP15HIP_vector_typeIfLj3EE
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym s
	.addrsig_sym _Z13tracer_kernelP15HIP_vector_typeIfLj3EE
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.p2align	2                               ; -- Begin function _Z5trace15HIP_vector_typeIfLj3EES0_i
	.type	_Z5trace15HIP_vector_typeIfLj3EES0_i,@function
_Z5trace15HIP_vector_typeIfLj3EES0_i:   ; @_Z5trace15HIP_vector_typeIfLj3EES0_i
; %bb.0:
	s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
	s_mov_b32 s0, s33
	s_mov_b32 s33, s32
	s_or_saveexec_b32 s1, -1
	scratch_store_b32 off, v77, s33 offset:84 ; 4-byte Folded Spill
	s_mov_b32 exec_lo, s1
	v_writelane_b32 v77, s0, 5
	s_addk_i32 s32, 0x60
	s_clause 0x14
	scratch_store_b32 off, v40, s33 offset:80
	; meta instruction
	scratch_store_b32 off, v41, s33 offset:76
	; meta instruction
	scratch_store_b32 off, v42, s33 offset:72
	; meta instruction
	scratch_store_b32 off, v43, s33 offset:68
	; meta instruction
	scratch_store_b32 off, v44, s33 offset:64
	; meta instruction
	scratch_store_b32 off, v45, s33 offset:60
	; meta instruction
	scratch_store_b32 off, v46, s33 offset:56
	; meta instruction
	scratch_store_b32 off, v47, s33 offset:52
	; meta instruction
	scratch_store_b32 off, v56, s33 offset:48
	; meta instruction
	scratch_store_b32 off, v57, s33 offset:44
	; meta instruction
	scratch_store_b32 off, v58, s33 offset:40
	; meta instruction
	scratch_store_b32 off, v59, s33 offset:36
	; meta instruction
	scratch_store_b32 off, v60, s33 offset:32
	; meta instruction
	scratch_store_b32 off, v61, s33 offset:28
	; meta instruction
	scratch_store_b32 off, v62, s33 offset:24
	; meta instruction
	scratch_store_b32 off, v63, s33 offset:20
	; meta instruction
	scratch_store_b32 off, v72, s33 offset:16
	; meta instruction
	scratch_store_b32 off, v73, s33 offset:12
	; meta instruction
	scratch_store_b32 off, v74, s33 offset:8
	; meta instruction
	scratch_store_b32 off, v75, s33 offset:4
	; meta instruction
	scratch_store_b32 off, v76, s33
	v_writelane_b32 v77, s34, 0
	v_writelane_b32 v77, s35, 1
	v_writelane_b32 v77, s36, 2
	v_writelane_b32 v77, s30, 3
	v_writelane_b32 v77, s31, 4
	v_dual_mov_b32 v43, v5 :: v_dual_mov_b32 v44, v3
	v_dual_mov_b32 v45, v4 :: v_dual_mov_b32 v40, v2
	v_dual_mov_b32 v41, v1 :: v_dual_mov_b32 v42, v0
	v_dual_mov_b32 v3, 0x7f800000 :: v_dual_mov_b32 v60, -1
	s_mov_b32 s1, 0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, s@rel32@lo+28
	s_addc_u32 s3, s3, s@rel32@hi+36
.LBB0_1:                                ; =>This Inner Loop Header: Depth=1
	s_add_u32 s4, s2, -8
	s_addc_u32 s5, s3, -1
	v_mov_b32_e32 v2, 0x7f800000
	s_load_b128 s[4:7], s[4:5], 0x0
	v_mov_b32_e32 v1, 0x7f800000
	s_waitcnt lgkmcnt(0)
	v_dual_sub_f32 v5, s5, v41 :: v_dual_sub_f32 v4, s4, v42
	v_sub_f32_e32 v7, s6, v40
	s_mov_b32 s5, 0
	s_mov_b32 s4, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v0, v45, v5
	v_fmac_f32_e32 v0, v44, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, v43, v7
	v_cmpx_ngt_f32_e32 0, v0
	s_cbranch_execz .LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	s_add_u32 s6, s2, -12
	s_addc_u32 s7, s3, -1
	v_dual_mul_f32 v1, v5, v5 :: v_dual_mov_b32 v2, 0x7f800000
	s_load_b32 s0, s[6:7], 0x0
	s_mov_b32 s6, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v1, v4, v4
	v_fmac_f32_e32 v1, v7, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_fma_f32 v4, -v0, v0, v1
	v_mov_b32_e32 v1, 0x7f800000
	s_waitcnt lgkmcnt(0)
	v_mul_f32_e64 v5, s0, s0
	v_cmpx_ngt_f32_e32 v4, v5
	s_cbranch_execz .LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	v_sub_f32_e32 v1, v5, v4
	s_mov_b32 s5, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v2, 0x4f800000, v1
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v1
	v_cndmask_b32_e32 v1, v1, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v2, v1
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v4, -1, v2
	v_add_nc_u32_e32 v5, 1, v2
	v_fma_f32 v7, -v4, v2, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v8, -v5, v2, v1
	v_cmp_ge_f32_e64 s0, 0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v2, v2, v4, s0
	v_cmp_lt_f32_e64 s0, 0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v2, v2, v5, s0
	v_mul_f32_e32 v4, 0x37800000, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v2, v2, v4, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v1, 0x260
	v_cndmask_b32_e32 v2, v2, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_sub_f32_e32 v1, v0, v2
	v_add_f32_e32 v2, v0, v2
.LBB0_4:                                ; %Flow22
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s5, s5, exec_lo
.LBB0_5:                                ; %_ZN6Sphere3hitE15HIP_vector_typeIfLj3EES1_PfS2_.exit
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	s_and_saveexec_b32 s0, s5
	s_cbranch_execz .LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	v_cmp_gt_f32_e32 vcc_lo, 0, v1
	s_mov_b32 s4, exec_lo
	v_cndmask_b32_e32 v0, v1, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_f32_e32 v0, v3
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	v_dual_mov_b32 v60, s1 :: v_dual_mov_b32 v3, v0
; %bb.8:                                ; %Flow21
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
.LBB0_9:                                ;   in Loop: Header=BB0_1 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s0
	s_add_i32 s1, s1, 1
	s_add_u32 s2, s2, 48
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s1, 6
	s_cbranch_scc0 .LBB0_1
; %bb.10:
	v_dual_mov_b32 v0, 2.0 :: v_dual_mov_b32 v1, 2.0
	v_mov_b32_e32 v2, 2.0
	s_mov_b32 s34, exec_lo
	v_cmpx_ne_u32_e32 -1, v60
	s_cbranch_execz .LBB0_35
; %bb.11:
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, s@rel32@lo+20
	s_addc_u32 s1, s1, s@rel32@hi+28
	s_mov_b32 s4, 0
	v_mad_i64_i32 v[0:1], null, v60, 48, s[0:1]
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, s@rel32@lo+44
	s_addc_u32 s1, s1, s@rel32@hi+52
	s_mov_b32 s6, 0
	v_mad_i64_i32 v[4:5], null, v60, 48, s[0:1]
	s_clause 0x1
	global_load_b96 v[0:2], v[0:1], off
	global_load_b32 v61, v[4:5], off
	v_fmac_f32_e32 v40, v43, v3
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_fmac_f32 v41, v45, v3 :: v_dual_sub_f32 v2, v40, v2
	v_dual_fmac_f32 v42, v44, v3 :: v_dual_sub_f32 v1, v41, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v3, v42, v0 :: v_dual_mul_f32 v0, v1, v1
	v_fmac_f32_e32 v0, v3, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, v2, v2
	v_mul_f32_e32 v4, 0x4f800000, v0
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v4, vcc_lo
	v_sqrt_f32_e32 v4, v0
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v5, -1, v4
	v_add_nc_u32_e32 v7, 1, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v8, -v5, v4, v0
	v_fma_f32 v9, -v7, v4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v8
	v_cndmask_b32_e64 v4, v4, v5, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v9
	v_cndmask_b32_e64 v4, v4, v7, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, 0x37800000, v4
	v_cndmask_b32_e32 v4, v4, v5, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v4, v4, v0, vcc_lo
	v_div_scale_f32 v0, null, v4, v4, v3
	v_div_scale_f32 v5, null, v4, v4, v1
	v_div_scale_f32 v8, null, v4, v4, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v7, v0
	v_rcp_f32_e32 v9, v5
	v_div_scale_f32 v14, s0, v1, v4, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(TRANS32_DEP_3)
	v_rcp_f32_e32 v10, v8
	v_fma_f32 v11, -v0, v7, 1.0
	s_waitcnt_depctr 0xfff
	v_fma_f32 v13, -v5, v9, 1.0
	v_fmac_f32_e32 v7, v11, v7
	v_fma_f32 v11, -v8, v10, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_fmac_f32 v9, v13, v9 :: v_dual_fmac_f32 v10, v11, v10
	v_mul_f32_e32 v11, v14, v9
	v_div_scale_f32 v12, vcc_lo, v3, v4, v3
	v_div_scale_f32 v13, s1, v2, v4, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v18, -v5, v11, v14
	v_mul_f32_e32 v15, v12, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v11, v18, v9
	v_fma_f32 v16, -v0, v15, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v5, -v5, v11, v14
	v_fmac_f32_e32 v15, v16, v7
	v_mul_f32_e32 v17, v13, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v0, -v0, v15, v12
	v_fma_f32 v16, -v8, v17, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v7, v0, v7, v15
	s_mov_b32 vcc_lo, s0
	v_fmac_f32_e32 v17, v16, v10
	v_div_fmas_f32 v0, v5, v9, v11
	s_mov_b32 vcc_lo, s1
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v5, -v8, v17, v13
	v_div_fixup_f32 v0, v0, v4, v1
	v_div_fixup_f32 v1, v7, v4, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v5, v5, v10, v17
	v_mul_f32_e32 v3, v45, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f32 v2, v5, v4, v2
	v_fmac_f32_e32 v3, v44, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v43, v2
	v_cmp_lt_f32_e64 s0, 0, v3
	s_waitcnt vmcnt(0)
	v_cmpx_nlt_f32_e32 0, v61
	s_xor_b32 s2, exec_lo, s1
	s_cbranch_execz .LBB0_13
; %bb.12:
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, s@rel32@lo+48
	s_addc_u32 s5, s5, s@rel32@hi+56
	v_cmp_lt_i32_e64 s1, 2, v6
	v_mad_i64_i32 v[3:4], null, v60, 48, s[4:5]
	s_mov_b32 s6, exec_lo
	global_load_b32 v3, v[3:4], off
	s_waitcnt vmcnt(0)
	v_cmp_nlt_f32_e32 vcc_lo, 0, v3
	s_or_b32 s1, s1, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s4, s1, exec_lo
.LBB0_13:                               ; %Flow16
	s_or_saveexec_b32 s5, s2
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, s@rel32@lo+4
	s_addc_u32 s3, s3, s@rel32@hi+12
	s_xor_b32 exec_lo, exec_lo, s5
; %bb.14:
	v_cmp_gt_i32_e32 vcc_lo, 3, v6
	v_cmp_lt_i32_e64 s1, 2, v6
	s_and_not1_b32 s6, s6, exec_lo
	s_and_not1_b32 s4, s4, exec_lo
	s_and_b32 s7, vcc_lo, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s1, s1, exec_lo
	s_or_b32 s6, s6, s7
	s_or_b32 s4, s4, s1
; %bb.15:                               ; %Flow17
	s_or_b32 exec_lo, exec_lo, s5
	v_mad_i64_i32 v[58:59], null, v60, 48, s[2:3]
	v_cndmask_b32_e64 v63, v1, -v1, s0
	v_cndmask_b32_e64 v72, v0, -v0, s0
	v_cndmask_b32_e64 v62, v2, -v2, s0
                                        ; implicit-def: $vgpr2
                                        ; implicit-def: $vgpr1
                                        ; implicit-def: $vgpr0
	s_and_saveexec_b32 s7, s4
	s_cbranch_execz .LBB0_30
; %bb.16:
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_fmamk_f32 v3, v63, 0x38d1b717, v42 :: v_dual_fmamk_f32 v4, v72, 0x38d1b717, v41
	v_dual_fmamk_f32 v5, v62, 0x38d1b717, v40 :: v_dual_mov_b32 v2, 0
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v0, 0
	s_mov_b32 s8, 0
.LBB0_17:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mul_i32 s2, s8, 48
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, s@rel32@lo+32
	s_addc_u32 s5, s5, s@rel32@hi+40
	s_mul_hi_u32 s1, s8, 48
	s_add_u32 s4, s2, s4
	s_addc_u32 s5, s1, s5
	s_load_b32 s9, s[4:5], 0x0
	s_waitcnt lgkmcnt(0)
	v_cmp_ngt_f32_e64 s3, s9, 0
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s3
	s_cbranch_vccnz .LBB0_28
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, s@rel32@lo+20
	s_addc_u32 s11, s11, s@rel32@hi+28
	s_add_u32 s2, s2, s10
	s_addc_u32 s3, s1, s11
	s_mov_b32 s10, 0
	s_load_b128 s[12:15], s[2:3], 0x0
	s_waitcnt lgkmcnt(0)
	v_dual_sub_f32 v7, s13, v41 :: v_dual_sub_f32 v8, s12, v42
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v10, s14, v40 :: v_dual_mul_f32 v9, v7, v7
	v_fmac_f32_e32 v9, v8, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v9, v10, v10
	v_mul_f32_e32 v11, 0x4f800000, v9
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v9, v9, v11, vcc_lo
	v_sqrt_f32_e32 v11, v9
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v12, -1, v11
	v_add_nc_u32_e32 v13, 1, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v14, -v12, v11, v9
	v_fma_f32 v15, -v13, v11, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s1, 0, v14
	v_cndmask_b32_e64 v11, v11, v12, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s1, 0, v15
	v_cndmask_b32_e64 v11, v11, v13, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v12, 0x37800000, v11
	v_cndmask_b32_e32 v11, v11, v12, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v9, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v11, v11, v9, vcc_lo
	v_div_scale_f32 v12, null, v11, v11, v7
	v_div_scale_f32 v18, s1, v7, v11, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v15, v12
	s_waitcnt_depctr 0xfff
	v_fma_f32 v20, -v12, v15, 1.0
	v_fmac_f32_e32 v15, v20, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v20, v18, v15
	v_fma_f32 v24, -v12, v20, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v20, v24, v15
	v_div_scale_f32 v9, null, v11, v11, v8
	v_div_scale_f32 v13, null, v11, v11, v10
	v_div_scale_f32 v17, vcc_lo, v8, v11, v8
	v_rcp_f32_e32 v14, v9
	s_delay_alu instid0(VALU_DEP_2)
	v_rcp_f32_e32 v16, v13
	v_div_scale_f32 v22, s2, v10, v11, v10
	v_fma_f32 v12, -v12, v20, v18
	s_waitcnt_depctr 0xfff
	v_fma_f32 v19, -v9, v14, 1.0
	v_fma_f32 v21, -v13, v16, 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v14, v19, v14
	v_fmac_f32_e32 v16, v21, v16
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v19, v17, v14
	v_mul_f32_e32 v21, v22, v16
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v23, -v9, v19, v17
	v_fma_f32 v25, -v13, v21, v22
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v19, v23, v14
	v_fmac_f32_e32 v21, v25, v16
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v9, -v9, v19, v17
	v_fma_f32 v13, -v13, v21, v22
	s_delay_alu instid0(VALU_DEP_2)
	v_div_fmas_f32 v9, v9, v14, v19
	s_mov_b32 vcc_lo, s1
	s_mov_b32 s1, 0
	v_div_fmas_f32 v12, v12, v15, v20
	s_mov_b32 vcc_lo, s2
	v_div_fixup_f32 v8, v9, v11, v8
	v_div_fmas_f32 v13, v13, v16, v21
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, s@rel32@lo+28
	s_addc_u32 s3, s3, s@rel32@hi+36
	v_div_fixup_f32 v9, v12, v11, v7
	v_div_fixup_f32 v7, v13, v11, v10
.LBB0_19:                               ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_cmp_eq_u32 s8, s10
	s_cselect_b32 s11, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 vcc_lo, exec_lo, s11
	s_cbranch_vccnz .LBB0_23
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	s_add_u32 s12, s2, -8
	s_addc_u32 s13, s3, -1
	s_mov_b32 s11, -1
	s_load_b128 s[12:15], s[12:13], 0x0
	s_waitcnt lgkmcnt(0)
	v_dual_sub_f32 v11, s13, v4 :: v_dual_sub_f32 v10, s12, v3
	s_mov_b32 s12, exec_lo
                                        ; implicit-def: $sgpr13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v13, s14, v5 :: v_dual_mul_f32 v12, v9, v11
	v_fmac_f32_e32 v12, v8, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, v7, v13
	v_cmpx_ngt_f32_e32 0, v12
	s_cbranch_execz .LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=2
	s_add_u32 s14, s2, -12
	s_addc_u32 s15, s3, -1
	v_mul_f32_e32 v11, v11, v11
	s_load_b32 s11, s[14:15], 0x0
	s_mov_b32 s13, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v11, v10, v10
	v_fmac_f32_e32 v11, v13, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_fma_f32 v10, -v12, v12, v11
	s_waitcnt lgkmcnt(0)
	v_mul_f32_e64 v11, s11, s11
	v_cmp_gt_f32_e32 vcc_lo, v10, v11
	s_or_not1_b32 s11, vcc_lo, exec_lo
.LBB0_22:                               ; %Flow12
                                        ;   in Loop: Header=BB0_19 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
	s_branch .LBB0_24
.LBB0_23:                               ;   in Loop: Header=BB0_19 Depth=2
                                        ; implicit-def: $sgpr13
.LBB0_24:                               ; %Flow
                                        ;   in Loop: Header=BB0_19 Depth=2
	v_mov_b32_e32 v10, s13
	s_mov_b32 s13, -1
	s_and_saveexec_b32 s12, s11
; %bb.25:                               ; %.critedge
                                        ;   in Loop: Header=BB0_19 Depth=2
	s_add_i32 s10, s10, 1
	s_add_u32 s2, s2, 48
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s10, 6
	v_mov_b32_e32 v10, 1.0
	s_cselect_b32 s11, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_not1_b32 s13, s11, exec_lo
; %bb.26:                               ; %Flow13
                                        ;   in Loop: Header=BB0_19 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s11, exec_lo, s13
	s_or_b32 s1, s11, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_19
; %bb.27:                               ; %_ZN6Sphere3hitE15HIP_vector_typeIfLj3EES1_PfS2_.exit337
                                        ;   in Loop: Header=BB0_17 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b96 v[11:13], v[58:59], off
	s_load_b64 s[2:3], s[4:5], 0x4
	v_mul_f32_e32 v9, v72, v9
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_fmac_f32 v9, v63, v8 :: v_dual_mul_f32 v8, v10, v11
	v_fmac_f32_e32 v9, v62, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_cmp_ngt_f32_e32 vcc_lo, 0, v9
	v_cndmask_b32_e32 v7, 0, v9, vcc_lo
	v_mul_f32_e32 v9, v10, v12
	v_mul_f32_e32 v10, v10, v13
	v_mul_f32_e32 v8, v7, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v0, s9, v8 :: v_dual_mul_f32 v9, v7, v9
	v_mul_f32_e32 v7, v7, v10
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_fmac_f32 v1, s2, v9 :: v_dual_fmac_f32 v2, s3, v7
.LBB0_28:                               ;   in Loop: Header=BB0_17 Depth=1
	s_add_i32 s8, s8, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s8, 6
	s_cbranch_scc1 .LBB0_17
; %bb.29:                               ; %Flow15
	s_and_not1_b32 s6, s6, exec_lo
.LBB0_30:                               ; %Flow18
	s_or_b32 exec_lo, exec_lo, s7
	s_and_saveexec_b32 s1, s6
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s35, exec_lo, s1
	s_cbranch_execz .LBB0_34
; %bb.31:
	v_dual_mul_f32 v76, v45, v72 :: v_dual_mul_f32 v75, 0x38d1b717, v63
	v_dual_mul_f32 v73, 0x38d1b717, v72 :: v_dual_mul_f32 v74, 0x38d1b717, v62
	v_dual_mov_b32 v57, 0 :: v_dual_add_nc_u32 v46, 1, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v76, v44, v63 :: v_dual_mov_b32 v47, 0
	v_mov_b32_e32 v56, 0
	s_mov_b32 s36, exec_lo
	v_fmac_f32_e32 v76, v43, v62
	v_cmpx_neq_f32_e32 0, v61
	s_cbranch_execz .LBB0_33
; %bb.32:
	v_mov_b32_e32 v0, 0x3f9ae148
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v1, -v76, v76, 1.0
	v_cndmask_b32_e64 v0, 0x3f5391fb, v0, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v0, -v0, v1, 1.0
	v_mul_f32_e32 v1, 0x4f800000, v0
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v1, vcc_lo
	v_sqrt_f32_e32 v1, v0
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v2, -1, v1
	v_add_nc_u32_e32 v3, 1, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v4, -v2, v1, v0
	v_fma_f32 v5, -v3, v1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s1, 0, v4
	v_cndmask_b32_e64 v1, v1, v2, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s1, 0, v5
	v_cndmask_b32_e64 v1, v1, v3, s1
	v_mov_b32_e32 v3, 0x3f8ccccd
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, 0x37800000, v1
	v_cndmask_b32_e32 v1, v1, v2, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x260
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v2, 0x3f68ba2e, v3, s0
	v_cndmask_b32_e32 v0, v1, v0, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v0, v2, -v76, -v0
	v_mul_f32_e32 v4, v72, v0
	v_mul_f32_e32 v3, v63, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_mul_f32 v5, v62, v0 :: v_dual_fmac_f32 v4, v45, v2
	v_fmac_f32_e32 v3, v44, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_fmac_f32 v5, v43, v2 :: v_dual_mul_f32 v0, v4, v4
	v_fmac_f32_e32 v0, v3, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, v5, v5
	v_mul_f32_e32 v1, 0x4f800000, v0
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v1, vcc_lo
	v_sqrt_f32_e32 v1, v0
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v2, -1, v1
	v_add_nc_u32_e32 v6, 1, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v7, -v2, v1, v0
	v_fma_f32 v8, -v6, v1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v7
	v_cndmask_b32_e64 v1, v1, v2, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v8
	v_cndmask_b32_e64 v1, v1, v6, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, 0x37800000, v1
	v_cndmask_b32_e32 v1, v1, v2, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v6, v1, v0, vcc_lo
	v_div_scale_f32 v7, null, v6, v6, v3
	v_div_scale_f32 v8, null, v6, v6, v4
	v_div_scale_f32 v9, null, v6, v6, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v10, v7
	v_rcp_f32_e32 v11, v8
	v_div_scale_f32 v13, vcc_lo, v3, v6, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(TRANS32_DEP_3)
	v_rcp_f32_e32 v12, v9
	v_div_scale_f32 v14, s0, v4, v6, v4
	v_div_scale_f32 v15, s1, v5, v6, v5
	v_fma_f32 v0, -v7, v10, 1.0
	s_waitcnt_depctr 0xfff
	v_fma_f32 v1, -v8, v11, 1.0
	v_fma_f32 v2, -v9, v12, 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v10, v0, v10 :: v_dual_fmac_f32 v11, v1, v11
	v_sub_f32_e32 v0, v42, v75
	v_fmac_f32_e32 v12, v2, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mul_f32 v16, v13, v10 :: v_dual_mul_f32 v17, v14, v11
	v_fma_f32 v1, -v7, v16, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v2, -v8, v17, v14
	v_fmac_f32_e32 v16, v1, v10
	v_dual_sub_f32 v1, v41, v73 :: v_dual_mul_f32 v18, v15, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v17, v2, v11 :: v_dual_sub_f32 v2, v40, v74
	v_fma_f32 v7, -v7, v16, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v19, -v9, v18, v15
	v_fma_f32 v8, -v8, v17, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v7, v7, v10, v16
	s_mov_b32 vcc_lo, s0
	v_fmac_f32_e32 v18, v19, v12
	s_delay_alu instid0(VALU_DEP_3)
	v_div_fmas_f32 v8, v8, v11, v17
	s_mov_b32 vcc_lo, s1
	v_div_fixup_f32 v3, v7, v6, v3
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, _Z5trace15HIP_vector_typeIfLj3EES0_i@rel32@lo+4
	s_addc_u32 s1, s1, _Z5trace15HIP_vector_typeIfLj3EES0_i@rel32@hi+12
	v_fma_f32 v9, -v9, v18, v15
	v_div_fixup_f32 v4, v8, v6, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f32 v9, v9, v12, v18
	v_div_fixup_f32 v5, v9, v6, v5
	v_mov_b32_e32 v6, v46
	s_swappc_b64 s[30:31], s[0:1]
	v_dual_mov_b32 v47, v0 :: v_dual_mov_b32 v56, v1
	v_mov_b32_e32 v57, v2
.LBB0_33:
	s_or_b32 exec_lo, exec_lo, s36
	s_delay_alu instid0(VALU_DEP_2)
	v_add_f32_e32 v3, 1.0, v76
	s_mov_b32 s0, 0x3e76c4e1
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, _Z5trace15HIP_vector_typeIfLj3EES0_i@rel32@lo+4
	s_addc_u32 s5, s5, _Z5trace15HIP_vector_typeIfLj3EES0_i@rel32@hi+12
	s_mov_b32 s6, 0x3f666666
	v_frexp_mant_f32_e64 v0, |v3|
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_f32_e32 vcc_lo, 0x3f2aaaab, v0
	v_cndmask_b32_e64 v1, 0, 1, vcc_lo
	v_ldexp_f32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v1, 1.0, v0
	v_add_f32_e32 v4, -1.0, v0
	v_add_f32_e32 v6, -1.0, v1
	v_cmp_class_f32_e64 s7, v3, 0x204
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v0, v0, v6
	v_rcp_f32_e32 v2, v1
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v5, v4, v2
	v_mul_f32_e32 v7, v1, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v1, v5, v1, -v7
	v_fmac_f32_e32 v1, v5, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v0, v7, v1
	v_sub_f32_e32 v7, v0, v7
	v_sub_f32_e32 v6, v4, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v4, v4, v6 :: v_dual_sub_f32 v1, v7, v1
	v_sub_f32_e32 v0, v4, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v0, v1, v0
	v_add_f32_e32 v0, v6, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v0, v2, v0
	v_add_f32_e32 v1, v5, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v2, v1, v5
	v_sub_f32_e32 v0, v0, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mul_f32 v4, v1, v1 :: v_dual_add_f32 v5, v0, v0
	v_fma_f32 v2, v1, v1, -v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v2, v1, v5
	v_add_f32_e32 v5, v4, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v9, v1, v5
	v_sub_f32_e32 v4, v5, v4
	v_fma_f32 v10, v5, v1, -v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v2, v2, v4
	v_fmac_f32_e32 v10, v5, v0
	v_ldexp_f32 v0, v0, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v10, v2, v1
	v_fmaak_f32 v6, s0, v5, 0x3e91f4c4
	v_ldexp_f32 v1, v1, 1
	v_fmaak_f32 v6, v5, v6, 0x3ecccdef
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v7, v5, v6
	v_fma_f32 v4, v5, v6, -v7
	v_add_f32_e32 v5, v9, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v2, v6
	v_add_f32_e32 v6, v7, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v7, v6, v7 :: v_dual_add_f32 v8, 0x3f2aaaaa, v6
	v_dual_sub_f32 v4, v4, v7 :: v_dual_add_f32 v7, 0xbf2aaaaa, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v4, 0x31739010, v4
	v_sub_f32_e32 v6, v6, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v4, v4, v6
	v_add_f32_e32 v2, v8, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v6, v8, v2
	v_mul_f32_e32 v7, v5, v2
	v_sub_f32_e32 v8, v5, v9
	v_add_f32_e32 v4, v4, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v6, v5, v2, -v7
	v_sub_f32_e32 v8, v10, v8
	v_add_f32_e32 v10, v76, v76
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v6, v5, v4
	v_frexp_exp_i32_f32_e32 v4, v3
	v_fmac_f32_e32 v6, v8, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_subrev_co_ci_u32_e32 v2, vcc_lo, 0, v4, vcc_lo
	v_add_f32_e32 v4, v7, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_i32_e32 v2, v2
	v_add_f32_e32 v5, v1, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v7, v4, v7 :: v_dual_mul_f32 v8, 0x3f317218, v2
	v_dual_sub_f32 v1, v5, v1 :: v_dual_sub_f32 v6, v6, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v7, 0x3f317218, v2, -v8
	v_sub_f32_e32 v1, v4, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f32_e32 v0, v0, v6
	v_fmamk_f32 v2, v2, 0xb102e308, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v0, v0, v1
	v_dual_add_f32 v1, v8, v2 :: v_dual_add_f32 v4, v5, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v8, v1, v8
	v_dual_add_f32 v6, v1, v4 :: v_dual_sub_f32 v5, v4, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v2, v2, v8
	v_sub_f32_e32 v7, v6, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v0, v0, v5
	v_fma_f32 v5, -v72, v10, v45
	v_sub_f32_e32 v9, v6, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_sub_f32 v4, v4, v7 :: v_dual_add_f32 v7, v2, v0
	v_mul_f32_e32 v8, v5, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v1, v1, v9
	v_sub_f32_e32 v9, v7, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_add_f32_e32 v1, v4, v1
	v_fma_f32 v4, -v63, v10, v44
	v_fma_f32 v10, -v62, v10, v43
	v_sub_f32_e32 v0, v0, v9
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_add_f32 v1, v7, v1 :: v_dual_fmac_f32 v8, v4, v4
	v_sub_f32_e32 v7, v7, v9
	v_add_f32_e32 v11, v6, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v8, v10, v10
	v_sub_f32_e32 v2, v2, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_dual_sub_f32 v6, v11, v6 :: v_dual_mul_f32 v7, 0x4f800000, v8
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v8
	v_add_f32_e32 v0, v0, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v1, v1, v6 :: v_dual_cndmask_b32 v6, v8, v7
	v_add_f32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sqrt_f32_e32 v1, v6
	v_add_f32_e32 v2, v11, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v7, v2, v11
	s_waitcnt_depctr 0xfff
	v_dual_mul_f32 v9, 0x40400000, v2 :: v_dual_add_nc_u32 v8, -1, v1
	v_dual_mul_f32 v11, 0, v2 :: v_dual_sub_f32 v0, v0, v7
	v_add_nc_u32_e32 v7, 1, v1
	v_fma_f32 v12, -v8, v1, v6
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f32 v2, 0x40400000, v2, -v9
	v_fmac_f32_e32 v11, 0x40400000, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f32 v0, -v7, v1, v6
	v_cmp_ge_f32_e64 s0, 0, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v1, v1, v8, s0
	v_add_f32_e32 v8, v2, v11
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_lt_f32_e64 s0, 0, v0
	v_add_f32_e32 v0, v42, v75
	v_cndmask_b32_e64 v1, v1, v7, s0
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_f32_e32 v7, v9, v8
	v_cmp_class_f32_e64 s0, v9, 0x204
	v_mul_f32_e32 v2, 0x37800000, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v11, v7, v9, s0
	v_sub_f32_e32 v7, v7, v9
	v_cmp_eq_f32_e64 s0, 0, v3
	v_cndmask_b32_e32 v12, v1, v2, vcc_lo
	v_add_f32_e32 v1, v41, v73
	v_cmp_eq_f32_e32 vcc_lo, 0x42b17218, v11
	v_sub_f32_e32 v7, v8, v7
	v_cmp_neq_f32_e64 s3, 0x7f800000, |v11|
	v_cndmask_b32_e64 v21, 0x7f800000, 0, s0
	v_add_f32_e32 v2, v40, v74
	v_cndmask_b32_e64 v13, 0, 0x37000000, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v6, 0x260
	v_cndmask_b32_e64 v7, 0, v7, s3
	v_cndmask_b32_e32 v6, v12, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_sub_f32 v12, v11, v13 :: v_dual_add_f32 v7, v13, v7
	v_div_scale_f32 v14, null, v6, v6, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v15, 0x3fb8aa3b, v12
	v_div_scale_f32 v16, null, v6, v6, v5
	v_div_scale_f32 v17, null, v6, v6, v10
	v_fma_f32 v19, 0x3fb8aa3b, v12, -v15
	v_rndne_f32_e32 v20, v15
	v_rcp_f32_e32 v18, v14
	v_rcp_f32_e32 v22, v16
	v_rcp_f32_e32 v23, v17
	v_fmamk_f32 v19, v12, 0x32a5705f, v19
	v_sub_f32_e32 v15, v15, v20
	v_cvt_i32_f32_e32 v9, v20
	v_div_scale_f32 v24, vcc_lo, v4, v6, v4
	v_div_scale_f32 v25, s1, v5, v6, v5
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(TRANS32_DEP_3)
	v_add_f32_e32 v15, v15, v19
	v_fma_f32 v26, -v14, v18, 1.0
	s_delay_alu instid0(TRANS32_DEP_2) | instskip(NEXT) | instid1(TRANS32_DEP_1)
	v_fma_f32 v19, -v16, v22, 1.0
	v_fma_f32 v28, -v17, v23, 1.0
	v_div_scale_f32 v27, s2, v10, v6, v10
	v_exp_f32_e32 v15, v15
	v_fmac_f32_e32 v18, v26, v18
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v22, v19, v22 :: v_dual_fmac_f32 v23, v28, v23
	v_cmp_ngt_f32_e64 s3, 0xc2ce8ed0, v12
	v_mul_f32_e32 v19, v24, v18
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_mul_f32_e32 v20, v25, v22
	v_mul_f32_e32 v8, v27, v23
	s_delay_alu instid0(TRANS32_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_ldexp_f32 v9, v15, v9
	v_fma_f32 v15, -v14, v19, v24
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f32 v11, -v16, v20, v25
	v_fma_f32 v26, -v17, v8, v27
	s_delay_alu instid0(VALU_DEP_4)
	v_cndmask_b32_e64 v9, 0, v9, s3
	v_cmp_nlt_f32_e64 s3, 0x42b17218, v12
	v_fmac_f32_e32 v19, v15, v18
	v_fmac_f32_e32 v20, v11, v22
	v_fmac_f32_e32 v8, v26, v23
	v_bfi_b32 v11, 0x7fffffff, v21, v3
	v_cndmask_b32_e64 v9, 0x7f800000, v9, s3
	v_fma_f32 v12, -v14, v19, v24
	v_fma_f32 v13, -v16, v20, v25
	v_fma_f32 v14, -v17, v8, v27
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v7, v9, v7, v9
	v_cmp_eq_f32_e64 s3, 0x7f800000, v9
	v_cndmask_b32_e64 v7, v7, v9, s3
	v_div_fmas_f32 v9, v12, v18, v19
	s_mov_b32 vcc_lo, s1
	v_div_fmas_f32 v12, v13, v22, v20
	s_mov_b32 vcc_lo, s2
	v_bfi_b32 v3, 0x7fffffff, v7, v3
	v_div_fmas_f32 v7, v14, v23, v8
	s_or_b32 vcc_lo, s0, s7
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e32 v8, v3, v11, vcc_lo
	v_div_fixup_f32 v3, v9, v6, v4
	v_div_fixup_f32 v4, v12, v6, v5
	v_div_fixup_f32 v5, v7, v6, v10
	v_mov_b32_e32 v6, v46
	v_fmaak_f32 v40, s6, v8, 0x3dcccccd
	s_swappc_b64 s[30:31], s[4:5]
	global_load_b96 v[3:5], v[58:59], off
	v_sub_f32_e32 v6, 1.0, v40
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v7, v6, v47
	v_dual_mul_f32 v7, v61, v7 :: v_dual_mul_f32 v8, v6, v56
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_mul_f32 v6, v6, v57 :: v_dual_fmac_f32 v7, v40, v0
	v_mul_f32_e32 v8, v61, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v8, v40, v1
	s_waitcnt vmcnt(0)
	v_dual_mul_f32 v6, v61, v6 :: v_dual_mul_f32 v1, v4, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v6, v40, v2
	v_mul_f32_e32 v0, v3, v7
	v_mul_f32_e32 v2, v5, v6
.LBB0_34:                               ; %Flow19
	s_or_b32 exec_lo, exec_lo, s35
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, s@rel32@lo+32
	s_addc_u32 s1, s1, s@rel32@hi+40
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_i64_i32 v[3:4], null, v60, 48, s[0:1]
	global_load_b96 v[3:5], v[3:4], off
	s_waitcnt vmcnt(0)
	v_dual_add_f32 v0, v0, v3 :: v_dual_add_f32 v1, v1, v4
	v_add_f32_e32 v2, v2, v5
.LBB0_35:                               ; %Flow20
	s_or_b32 exec_lo, exec_lo, s34
	s_clause 0x14
	scratch_load_b32 v76, off, s33
	scratch_load_b32 v75, off, s33 offset:4
	scratch_load_b32 v74, off, s33 offset:8
	scratch_load_b32 v73, off, s33 offset:12
	scratch_load_b32 v72, off, s33 offset:16
	scratch_load_b32 v63, off, s33 offset:20
	scratch_load_b32 v62, off, s33 offset:24
	scratch_load_b32 v61, off, s33 offset:28
	scratch_load_b32 v60, off, s33 offset:32
	scratch_load_b32 v59, off, s33 offset:36
	scratch_load_b32 v58, off, s33 offset:40
	scratch_load_b32 v57, off, s33 offset:44
	scratch_load_b32 v56, off, s33 offset:48
	scratch_load_b32 v47, off, s33 offset:52
	scratch_load_b32 v46, off, s33 offset:56
	scratch_load_b32 v45, off, s33 offset:60
	scratch_load_b32 v44, off, s33 offset:64
	scratch_load_b32 v43, off, s33 offset:68
	scratch_load_b32 v42, off, s33 offset:72
	scratch_load_b32 v41, off, s33 offset:76
	scratch_load_b32 v40, off, s33 offset:80
	v_readlane_b32 s30, v77, 3
	v_readlane_b32 s31, v77, 4
	v_readlane_b32 s36, v77, 2
	v_readlane_b32 s35, v77, 1
	v_readlane_b32 s34, v77, 0
	v_readlane_b32 s0, v77, 5
	s_or_saveexec_b32 s1, -1
	scratch_load_b32 v77, off, s33 offset:84 ; 4-byte Folded Reload
	s_mov_b32 exec_lo, s1
	s_addk_i32 s32, 0xffa0
	s_mov_b32 s33, s0
	s_waitcnt vmcnt(0)
	s_setpc_b64 s[30:31]
.Lfunc_end0:
	.size	_Z5trace15HIP_vector_typeIfLj3EES0_i, .Lfunc_end0-_Z5trace15HIP_vector_typeIfLj3EES0_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Function info:
; codeLenInByte = 5160
; NumSgprs: 39
; NumVgprs: 78
; ScratchSize: 96
; MemoryBound: 0
	.text
	.protected	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE ; -- Begin function _Z13tracer_kernelP15HIP_vector_typeIfLj3EE
	.globl	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE
	.p2align	8
	.type	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE,@function
_Z13tracer_kernelP15HIP_vector_typeIfLj3EE: ; @_Z13tracer_kernelP15HIP_vector_typeIfLj3EE
; %bb.0:
	s_load_b32 s2, s[0:1], 0x14
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_mov_b32 s32, 0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[40:41], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[41:42], null, s15, s3, v[0:1]
	s_mov_b32 s2, exec_lo
	v_or_b32_e32 v0, v41, v40
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 0x200, v0
	s_cbranch_execz .LBB1_2
; %bb.1:
	v_cvt_f64_i32_e32 v[0:1], v41
	v_cvt_f64_i32_e32 v[2:3], v40
	s_load_b64 s[38:39], s[0:1], 0x0
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, _Z5trace15HIP_vector_typeIfLj3EES0_i@rel32@lo+4
	s_addc_u32 s1, s1, _Z5trace15HIP_vector_typeIfLj3EES0_i@rel32@hi+12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[0:1], v[0:1], 0.5
	v_add_f64 v[2:3], v[2:3], 0.5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[0:1], v[0:1], v[0:1]
	v_add_f64 v[2:3], v[2:3], v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[0:1], 0xbf600000, v[0:1], 1.0
	v_fma_f64 v[2:3], 0x3f600000, v[2:3], -1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v0, v[0:1]
	v_cvt_f32_f64_e32 v1, v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, v0, v0
	v_fmac_f32_e32 v2, v1, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v2, 1.0, v2
	v_mul_f32_e32 v3, 0x4f800000, v2
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	v_sqrt_f32_e32 v3, v2
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v4, -1, v3
	v_add_nc_u32_e32 v5, 1, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, -v4, v3, v2
	v_fma_f32 v7, -v5, v3, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s2, 0, v6
	v_cndmask_b32_e64 v3, v3, v4, s2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s2, 0, v7
	v_cndmask_b32_e64 v3, v3, v5, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, 0x37800000, v3
	v_cndmask_b32_e32 v3, v3, v4, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v2, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v3, v2, vcc_lo
	v_div_scale_f32 v5, null, v2, v2, -1.0
	v_div_scale_f32 v14, s3, -1.0, v2, -1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v8, v5
	s_waitcnt_depctr 0xfff
	v_fma_f32 v13, -v5, v8, 1.0
	v_fmac_f32_e32 v8, v13, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v13, v14, v8
	v_fma_f32 v17, -v5, v13, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v13, v17, v8
	v_div_scale_f32 v3, null, v2, v2, v1
	v_div_scale_f32 v4, null, v2, v2, v0
	v_div_scale_f32 v9, vcc_lo, v1, v2, v1
	v_rcp_f32_e32 v6, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_rcp_f32_e32 v7, v4
	v_div_scale_f32 v10, s2, v0, v2, v0
	v_fma_f32 v5, -v5, v13, v14
	s_waitcnt_depctr 0xfff
	v_fma_f32 v11, -v3, v6, 1.0
	v_fma_f32 v12, -v4, v7, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_fmac_f32 v6, v11, v6 :: v_dual_fmac_f32 v7, v12, v7
	v_dual_mul_f32 v11, v9, v6 :: v_dual_mul_f32 v12, v10, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v15, -v3, v11, v9
	v_fma_f32 v16, -v4, v12, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_fmac_f32 v11, v15, v6 :: v_dual_fmac_f32 v12, v16, v7
	v_fma_f32 v3, -v3, v11, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v4, -v4, v12, v10
	v_div_fmas_f32 v3, v3, v6, v11
	s_mov_b32 vcc_lo, s2
	v_mov_b32_e32 v6, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_div_fmas_f32 v4, v4, v7, v12
	s_mov_b32 vcc_lo, s3
	v_div_fixup_f32 v3, v3, v2, v1
	v_mov_b32_e32 v1, 0
	v_div_fmas_f32 v5, v5, v8, v13
	v_div_fixup_f32 v4, v4, v2, v0
	v_mov_b32_e32 v0, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v5, v5, v2, -1.0
	v_mov_b32_e32 v2, 0
	s_swappc_b64 s[30:31], s[0:1]
	v_lshl_add_u32 v5, v41, 9, v40
	v_mad_u64_u32 v[3:4], null, v5, 12, s[38:39]
	global_store_b96 v[3:4], v[0:2], off
.LBB1_2:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13tracer_kernelP15HIP_vector_typeIfLj3EE
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 96
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_enable_private_segment 1
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 78
		.amdhsa_next_free_sgpr 40
		.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	_Z13tracer_kernelP15HIP_vector_typeIfLj3EE, .Lfunc_end1-_Z13tracer_kernelP15HIP_vector_typeIfLj3EE
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 680
; NumSgprs: 42
; NumVgprs: 78
; ScratchSize: 96
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 5
; VGPRBlocks: 9
; NumSGPRsForWavesPerEU: 42
; NumVGPRsForWavesPerEU: 78
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	s                       ; @s
	.type	s,@object
	.section	.bss,"aw",@nobits
	.globl	s
	.p2align	4, 0x0
s:
	.zero	288
	.size	s, 288

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 s
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13tracer_kernelP15HIP_vector_typeIfLj3EE
    .private_segment_fixed_size: 96
    .sgpr_count:     42
    .sgpr_spill_count: 0
    .symbol:         _Z13tracer_kernelP15HIP_vector_typeIfLj3EE.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: true
    .vgpr_count:     78
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
