#include <emmintrin.h>
#include <sys/time.h>
#include <stdio.h>
//#include <>

int N = 64000000;
int nTrapsPow2 = 2046;
int nSumsPow2 = 10;
int nTraps;
int nSums;                                                                                                                                         
int doPrint = 0; 

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// HELPER CODE TO INITIALIZE, PRINT AND TIME
struct timeval start, end;
void initialize(float *a, int N) {
  int i;
  for (i = 0; i < N; ++i) { 
    a[i] = pow(rand() % 10, 2); 
  }                                                                                                                                                                                       
}

void print(float* a, int N) {
   if (doPrint) {
   int i;
   for (i = 0; i < N; ++i)
      printf("%f ", a[i]);
   printf("\n");
   }
}  

void starttime() {
  gettimeofday( &start, 0 );
}

void endtime(const char* c) {
   gettimeofday( &end, 0 );
   double elapsed = ( end.tv_sec - start.tv_sec ) * 1000.0 + ( end.tv_usec - start.tv_usec ) / 1000.0;
   printf("%s: %f ms\n", c, elapsed); 
}

void init(const char* c) {
  printf("***************** %s **********************\n", c);
  //initialize(a, N); 
  //print(a, N);
  starttime();
}

void finish(const char* c) {
  endtime(c);
  //print(a, N);
  printf("***************************************************\n");
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////



// Normal C function to square root values
void normal(float* a, int N)                                                                                                                                                                                     
{
  int i;                                                                                                                                                                                                                
  for (i = 0; i < N; ++i)                                                                                                                                                                                    
    a[i] = sqrt(a[i]);                                                                                                                                                                                           
}                 

// GPU function to square root values
__global__ void gpu_sqrt(float* a, int N) {
   int element = blockIdx.x*blockDim.x + threadIdx.x;
   if (element < N) a[element] = sqrt(a[element]);
}

void gpu(float* a, int N) {
   int numThreads = 1024; // This can vary, up to 1024
   int numCores = N / 1024 + 1;

   float* gpuA;
   cudaMalloc(&gpuA, N*sizeof(float)); // Allocate enough memory on the GPU
   cudaMemcpy(gpuA, a, N*sizeof(float), cudaMemcpyHostToDevice); // Copy array from CPU to GPU
   gpu_sqrt<<<numCores, numThreads>>>(gpuA, N);  // Call GPU Sqrt
   cudaMemcpy(a, gpuA, N*sizeof(float), cudaMemcpyDeviceToHost); // Copy array from GPU to CPU
   cudaFree(&gpuA); // Free the memory on the GPU
}

//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////

__device__ double myCurve(double x)
{
	return x * x;
}

__device__ double Sum(int trapStart, int trapEnd, double* area)
{	
	int i;
	double total = 0;
        if(((trapEnd+1) - trapStart) <= 0)
                return -1;
	else
	{
		for(i = trapStart; i <= trapEnd; i++)
		{
			total += area[i];
		}
	}
	return total;
}

                                                   
__global__ void trapAreaPow2(int x1, int x2, double* area, int numTraps)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numTraps)
	{
		int n, t;
		double d, x;
		n = index + 2;
		n = log2((double) n);
		if(index == 6 || index == 62)
		{
//			printf("%d) log2(%f) = %d\n", index,(double) (index+2), n);
			n++;
		}
		n = exp2((double) n);
		d = (x2 - x1) / (double)n;
		t = index - n + 3;
		x = ((t - 1) * d) + x1;
		area[index] = ((myCurve(x) + myCurve(x+d)) / 2) * d;
		if(index >= 1022 && index <= 2045)
		{
			//printf("index = %d:\nn = %d\nd = %f\nt = %d\nx = %f\n", index, n, d, t, x);
			//printf("area[%d] = %f\n", index, area[index]);
			//printf("index = %d, n = %d\n", index, n);
		}
	}
}
__global__ void trapSumPow2(double* sum, int numSums, double* area)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numSums)
	{
		int n, trapStart, trapEnd;	
		n = exp2((double) (index+1));
		trapStart = n - 2;
		trapEnd = (n * 2) - 3;
		sum[index] = Sum(trapStart, trapEnd, area);
	}
}


__global__ void trapArea(int x1, int x2, int S, double* area, int numTraps)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numTraps)
	{
		int a, b, t, n, i=0;
		double d, c;
		t = index;
		while(t >= 0)
		{
			t = t - S - i;
			i++;
		}
		a = i - 1;
		n = S + a;
		d = (x2 - x1) / (double) n;
		b = ((a * a) - a) / 2;
		c = index - ((a * S) + b);
		c = x1 + (c * d);
		area[index] =  ((myCurve(c) + myCurve(c+d)) / 2) * d;
	//	printf("index: %d\na: %d\nn: %d\nd: %f\nc: %f\narea[%d] = %f\n", index, a, n, d, c, index, area[index]);
	}
}

__global__ void trapSum(int S, double* sum, int numSums, double* area)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numSums)
	{
		int trapStart, trapEnd;
		trapStart = (index * S) + (((index*index) - index) / 2);
		trapEnd = trapStart + S + index - 1;
		sum[index] = Sum(trapStart, trapEnd, area);
	}
}


int main()
{
	init("Trapezoidal Sum");
	
	int S = 0, x1 = 1, x2 = 4;
	int i, x = 0;
	double epsilon = 0.000001;
	double answer = 21;
 	double* areaPow2;
	double* sumPow2;
	double* answersPow2;
	double* areaLinear;
	double* sumLinear;
	int numThreads = 1024;
	int numCores = nTrapsPow2 / numThreads + 1;
	double* answersLinear;
	
//	printf("no fault here\n");

	answersPow2 = (double*)malloc(nSumsPow2*sizeof(double));
	cudaMalloc(&areaPow2, nTrapsPow2*sizeof(double));
	cudaMalloc(&sumPow2, nSumsPow2*sizeof(double));
	
//	printf("so far so good\n");

	trapAreaPow2<<<numCores, numThreads>>>(x1, x2, areaPow2, nTrapsPow2);

//	printf("got past trapAreaPow2\n");
		
	numCores = nSumsPow2 / numThreads + 1;
	trapSumPow2<<<numCores, numThreads>>>(sumPow2, nSumsPow2, areaPow2);

//	printf("made it past trapSumPow2\n");
	
	cudaMemcpy(answersPow2, sumPow2, nSumsPow2*sizeof(double), cudaMemcpyDeviceToHost);
	
//	printf("cudaMemcpy was sucessful\n");

	
//	printf("nSumsPow2 = %d\n", nSumsPow2); 
	for(i = nSumsPow2 - 1; i >= 0; i--)
	{
		printf("answersPow2[%d] = %f\n", i, answersPow2[i]);
		if((answer - answersPow2[i]) >= -epsilon && (answer - answersPow2[i]) <= epsilon)
		{
			x = i + 1;
		}
	}
	printf("loop sucessful\n");	
	S = exp2((double) x) / 2;
	printf("x = %d and S = %d\n", x, S);
	printf("S = %d, the sum with %d trapazoids was %f\n", S, S*2, answersPow2[x-1]);
	
	if(S == 1)
		printf("done\n");
	else if(S == 0)
		printf("1024 trapazoids is too few to get an answer within epsilon.\n");
	else
	{
		nTraps = ((S + 1) * S) + (((S * S) + S) / 2);
		nSums = S + 1;
		printf("nSums = %d\n", nSums);
		cudaMalloc(&sumLinear, nSums * sizeof(double));
		cudaMalloc(&areaLinear, nTraps * sizeof(double));
		numCores = (nTraps/numThreads) + 1;
		trapArea<<<numCores, numThreads>>>(x1, x2, S, areaLinear, nTraps);
		printf("this works\n");
		numCores = (nSums/numThreads) + 1;
		trapSum<<<numCores, numThreads>>>(S, sumLinear, nSums, areaLinear);
		answersLinear = (double*) malloc(nSums * sizeof(double));
		cudaMemcpy(answersLinear, sumLinear, nSums*sizeof(double), cudaMemcpyDeviceToHost);
		for(i=nSums-1; i >= 0; i--)
		{
			printf("answersLinear[%d] = %f\n", i, answersLinear[i]);
			if((answer - answersLinear[i]) >= -epsilon && (answer - answersLinear[i]) <= epsilon)
				x = i;
		}
		x = S + x;
		printf("This is the minimunm number of trapezoids needed to compute a trapezoidal sum that is within our epsilon of the actual answer: %d\n", x);
	}

	finish("Trapezoidal Sum");
	
  //////////////////////////////////////////////////////////////////////////
  // Necessary if you are doing SSE.  Align on a 128-bit boundary (16 bytes)
  float* a;                                                                                                                                                                                                      
  posix_memalign((void**)&a, 16,  N * sizeof(float));                                                                                                                                                            
  /////////////////////////////////////////////////////////////////////////

  // Test 1: Sequential For Loop
//  init(a, N, "Normal");
//  normal(a, N); 
//  finish(a, N, "Normal"); 

  // Test 2: Vectorization
//  init(a, N, "GPU");
//  gpu(a, N);  
//  finish(a, N, "GPU");

  return 0;
}



	.file	"tmpxft_00316b63_00000000-6_final.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2561:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2561:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10initializePfi
	.type	_Z10initializePfi, @function
_Z10initializePfi:
.LFB2548:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$10, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L3:
	cmpl	%ebx, %ebp
	jle	.L7
	call	rand@PLT
	cltd
	idivl	%r13d
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm0, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r12,%rbx,4)
	incq	%rbx
	jmp	.L3
.L7:
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2548:
	.size	_Z10initializePfi, .-_Z10initializePfi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%f "
.LC1:
	.string	"\n"
	.text
	.globl	_Z5printPfi
	.type	_Z5printPfi, @function
_Z5printPfi:
.LFB2549:
	.cfi_startproc
	endbr64
	cmpl	$0, doPrint(%rip)
	jne	.L12
	ret
.L12:
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L9:
	cmpl	%ebx, %ebp
	jle	.L16
	movq	%r13, %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r12,%rbx,4), %xmm0
	call	__printf_chk@PLT
	incq	%rbx
	jmp	.L9
.L16:
	popq	%rdx
	.cfi_def_cfa_offset 40
	leaq	.LC1(%rip), %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_restore 13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2549:
	.size	_Z5printPfi, .-_Z5printPfi
	.globl	_Z9starttimev
	.type	_Z9starttimev, @function
_Z9starttimev:
.LFB2550:
	.cfi_startproc
	endbr64
	xorl	%esi, %esi
	leaq	start(%rip), %rdi
	jmp	gettimeofday@PLT
	.cfi_endproc
.LFE2550:
	.size	_Z9starttimev, .-_Z9starttimev
	.section	.rodata.str1.1
.LC3:
	.string	"%s: %f ms\n"
	.text
	.globl	_Z7endtimePKc
	.type	_Z7endtimePKc, @function
_Z7endtimePKc:
.LFB2551:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%esi, %esi
	movq	%rdi, %rbx
	leaq	end(%rip), %rdi
	call	gettimeofday@PLT
	movq	end(%rip), %rax
	movq	%rbx, %rdx
	popq	%rbx
	.cfi_def_cfa_offset 8
	subq	start(%rip), %rax
	movsd	.LC2(%rip), %xmm2
	movl	$2, %edi
	leaq	.LC3(%rip), %rsi
	cvtsi2sdq	%rax, %xmm0
	movq	8+end(%rip), %rax
	subq	8+start(%rip), %rax
	cvtsi2sdq	%rax, %xmm1
	movb	$1, %al
	mulsd	%xmm2, %xmm0
	divsd	%xmm2, %xmm1
	addsd	%xmm1, %xmm0
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2551:
	.size	_Z7endtimePKc, .-_Z7endtimePKc
	.section	.rodata.str1.1
.LC4:
	.string	"***************** %s **********************\n"
	.text
	.globl	_Z4initPKc
	.type	_Z4initPKc, @function
_Z4initPKc:
.LFB2552:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	_Z9starttimev
	.cfi_endproc
.LFE2552:
	.size	_Z4initPKc, .-_Z4initPKc
	.section	.rodata.str1.1
.LC5:
	.string	"***************************************************\n"
	.text
	.globl	_Z6finishPKc
	.type	_Z6finishPKc, @function
_Z6finishPKc:
.LFB2553:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z7endtimePKc
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	popq	%rdx
	.cfi_def_cfa_offset 8
	movl	$2, %edi
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2553:
	.size	_Z6finishPKc, .-_Z6finishPKc
	.globl	_Z6normalPfi
	.type	_Z6normalPfi, @function
_Z6normalPfi:
.LFB2554:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
.L25:
	cmpl	%ebx, %r12d
	jle	.L28
	movss	0(%rbp,%rbx,4), %xmm0
	call	sqrtf@PLT
	movss	%xmm0, 0(%rbp,%rbx,4)
	incq	%rbx
	jmp	.L25
.L28:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2554:
	.size	_Z6normalPfi, .-_Z6normalPfi
	.globl	_Z7myCurved
	.type	_Z7myCurved, @function
_Z7myCurved:
.LFB2556:
	.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
.LFE2556:
	.size	_Z7myCurved, .-_Z7myCurved
	.globl	_Z3SumiiPd
	.type	_Z3SumiiPd, @function
_Z3SumiiPd:
.LFB2557:
	.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
.LFE2557:
	.size	_Z3SumiiPd, .-_Z3SumiiPd
	.globl	_Z28__device_stub__Z8gpu_sqrtPfiPfi
	.type	_Z28__device_stub__Z8gpu_sqrtPfiPfi, @function
_Z28__device_stub__Z8gpu_sqrtPfiPfi:
.LFB2583:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z8gpu_sqrtPfi(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L33:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2583:
	.size	_Z28__device_stub__Z8gpu_sqrtPfiPfi, .-_Z28__device_stub__Z8gpu_sqrtPfiPfi
	.globl	_Z8gpu_sqrtPfi
	.type	_Z8gpu_sqrtPfi, @function
_Z8gpu_sqrtPfi:
.LFB2584:
	.cfi_startproc
	endbr64
	jmp	_Z28__device_stub__Z8gpu_sqrtPfiPfi
	.cfi_endproc
.LFE2584:
	.size	_Z8gpu_sqrtPfi, .-_Z8gpu_sqrtPfi
	.globl	_Z3gpuPfi
	.type	_Z3gpuPfi, @function
_Z3gpuPfi:
.LFB2555:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rbx
	salq	$2, %rbp
	movq	%rbp, %rsi
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r13
	movq	%r13, %rdi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	%ebx, %eax
	movl	$1024, %ecx
	xorl	%r9d, %r9d
	cltd
	xorl	%r8d, %r8d
	idivl	%ecx
	movl	$4194305, %edx
	movl	$1, %ecx
	salq	$10, %rdx
	incl	%eax
	movl	%eax, 16(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 20(%rsp)
	movq	16(%rsp), %rdi
	movl	24(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L39
	movq	8(%rsp), %rdi
	movl	%ebx, %esi
	call	_Z28__device_stub__Z8gpu_sqrtPfiPfi
.L39:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	movl	$2, %ecx
	movq	%rbp, %rdx
	call	cudaMemcpy@PLT
	movq	%r13, %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2555:
	.size	_Z3gpuPfi, .-_Z3gpuPfi
	.globl	_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi
	.type	_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi, @function
_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi:
.LFB2585:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 24(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 12(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L42
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z12trapAreaPow2iiPdi(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L42:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2585:
	.size	_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi, .-_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi
	.globl	_Z12trapAreaPow2iiPdi
	.type	_Z12trapAreaPow2iiPdi, @function
_Z12trapAreaPow2iiPdi:
.LFB2586:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi
	.cfi_endproc
.LFE2586:
	.size	_Z12trapAreaPow2iiPdi, .-_Z12trapAreaPow2iiPdi
	.globl	_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_
	.type	_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_, @function
_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_:
.LFB2587:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11trapSumPow2PdiS_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L47:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2587:
	.size	_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_, .-_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_
	.globl	_Z11trapSumPow2PdiS_
	.type	_Z11trapSumPow2PdiS_, @function
_Z11trapSumPow2PdiS_:
.LFB2588:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_
	.cfi_endproc
.LFE2588:
	.size	_Z11trapSumPow2PdiS_, .-_Z11trapSumPow2PdiS_
	.globl	_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi
	.type	_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi, @function
_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi:
.LFB2589:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rdi
	movl	%esi, 24(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 20(%rsp)
	leaq	32(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L52
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z8trapAreaiiiPdi(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L52:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2589:
	.size	_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi, .-_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi
	.globl	_Z8trapAreaiiiPdi
	.type	_Z8trapAreaiiiPdi, @function
_Z8trapAreaiiiPdi:
.LFB2590:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi
	.cfi_endproc
.LFE2590:
	.size	_Z8trapAreaiiiPdi, .-_Z8trapAreaiiiPdi
	.globl	_Z30__device_stub__Z7trapSumiPdiS_iPdiS_
	.type	_Z30__device_stub__Z7trapSumiPdiS_iPdiS_, @function
_Z30__device_stub__Z7trapSumiPdiS_iPdiS_:
.LFB2591:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 24(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L57
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7trapSumiPdiS_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L57:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L59
	call	__stack_chk_fail@PLT
.L59:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2591:
	.size	_Z30__device_stub__Z7trapSumiPdiS_iPdiS_, .-_Z30__device_stub__Z7trapSumiPdiS_iPdiS_
	.globl	_Z7trapSumiPdiS_
	.type	_Z7trapSumiPdiS_, @function
_Z7trapSumiPdiS_:
.LFB2592:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z7trapSumiPdiS_iPdiS_
	.cfi_endproc
.LFE2592:
	.size	_Z7trapSumiPdiS_, .-_Z7trapSumiPdiS_
	.section	.rodata.str1.1
.LC6:
	.string	"Trapezoidal Sum"
.LC7:
	.string	"answersPow2[%d] = %f\n"
.LC11:
	.string	"loop sucessful\n"
.LC13:
	.string	"x = %d and S = %d\n"
.LC14:
	.string	"S = %d, the sum with %d trapazoids was %f\n"
.LC15:
	.string	"done\n"
.LC16:
	.string	"1024 trapazoids is too few to get an answer within epsilon.\n"
.LC17:
	.string	"nSums = %d\n"
.LC18:
	.string	"this works\n"
.LC19:
	.string	"answersLinear[%d] = %f\n"
.LC20:
	.string	"This is the minimunm number of trapezoids needed to compute a trapezoidal sum that is within our epsilon of the actual answer: %d\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2558:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC6(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	_Z4initPKc
	movslq	nSumsPow2(%rip), %rdi
	movl	nTrapsPow2(%rip), %ebx
	salq	$3, %rdi
	call	malloc@PLT
	movslq	%ebx, %rsi
	leaq	8(%rsp), %rdi
	salq	$3, %rsi
	movq	%rax, %rbp
	call	cudaMalloc@PLT
	movslq	nSumsPow2(%rip), %rsi
	leaq	16(%rsp), %rdi
	salq	$3, %rsi
	call	cudaMalloc@PLT
	movl	%ebx, %eax
	movl	$1024, %esi
	xorl	%r9d, %r9d
	cltd
	movl	$4194305, %ecx
	xorl	%r8d, %r8d
	movl	$1, 64(%rsp)
	idivl	%esi
	salq	$10, %rcx
	movq	%rcx, 56(%rsp)
	movq	%rcx, %rdx
	movl	$1, %ecx
	incl	%eax
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	44(%rsp), %rdi
	movl	52(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L63
	movl	nTrapsPow2(%rip), %ecx
	movq	8(%rsp), %rdx
	movl	$4, %esi
	movl	$1, %edi
	call	_Z35__device_stub__Z12trapAreaPow2iiPdiiiPdi
.L63:
	movl	nSumsPow2(%rip), %eax
	movl	$1024, %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, 64(%rsp)
	cltd
	idivl	%ecx
	movl	$4194305, %edx
	movl	$1, %ecx
	salq	$10, %rdx
	movq	%rdx, 56(%rsp)
	incl	%eax
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	44(%rsp), %rdi
	movl	52(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L64
	movq	8(%rsp), %rdx
	movl	nSumsPow2(%rip), %esi
	movq	16(%rsp), %rdi
	call	_Z34__device_stub__Z11trapSumPow2PdiS_PdiS_
.L64:
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdi
	xorl	%r13d, %r13d
	movslq	nSumsPow2(%rip), %rdx
	leaq	.LC7(%rip), %r14
	salq	$3, %rdx
	call	cudaMemcpy@PLT
	movl	nSumsPow2(%rip), %eax
	leal	-1(%rax), %ebx
	movslq	%ebx, %rbx
.L65:
	movl	%ebx, %edx
	testl	%ebx, %ebx
	js	.L86
	movsd	0(%rbp,%rbx,8), %xmm0
	movq	%r14, %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movsd	.LC8(%rip), %xmm0
	subsd	0(%rbp,%rbx,8), %xmm0
	comisd	.LC9(%rip), %xmm0
	jb	.L66
	movsd	.LC10(%rip), %xmm1
	comisd	%xmm0, %xmm1
	jb	.L66
	leal	1(%rbx), %r13d
.L66:
	decq	%rbx
	jmp	.L65
.L86:
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cvtsi2sdl	%r13d, %xmm0
	call	exp2@PLT
	movl	%r13d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	mulsd	.LC12(%rip), %xmm0
	leaq	.LC13(%rip), %rsi
	cvttsd2sil	%xmm0, %ebx
	movl	%ebx, %ecx
	call	__printf_chk@PLT
	movslq	%r13d, %rax
	leal	(%rbx,%rbx), %ecx
	movl	%ebx, %edx
	movsd	-8(%rbp,%rax,8), %xmm0
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	leaq	.LC15(%rip), %rsi
	cmpl	$1, %ebx
	je	.L85
	testl	%ebx, %ebx
	jne	.L72
	leaq	.LC16(%rip), %rsi
.L85:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L71
.L72:
	movl	%ebx, %eax
	movl	$2, %esi
	leal	1(%rbx), %ecx
	movl	$2, %edi
	imull	%ebx, %eax
	movl	%ecx, nSums(%rip)
	addl	%ebx, %eax
	cltd
	idivl	%esi
	movl	%ecx, %edx
	leaq	.LC17(%rip), %rsi
	imull	%ebx, %edx
	addl	%edx, %eax
	movl	%ecx, %edx
	movl	%eax, nTraps(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	nSums(%rip), %rsi
	leaq	32(%rsp), %rdi
	salq	$3, %rsi
	call	cudaMalloc@PLT
	movslq	nTraps(%rip), %rsi
	leaq	24(%rsp), %rdi
	salq	$3, %rsi
	call	cudaMalloc@PLT
	movl	$1024, %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	nTraps(%rip), %eax
	movl	$1, 64(%rsp)
	cltd
	idivl	%ecx
	movl	$4194305, %edx
	movl	$1, %ecx
	salq	$10, %rdx
	movq	%rdx, 56(%rsp)
	incl	%eax
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	44(%rsp), %rdi
	movl	52(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L73
	movl	nTraps(%rip), %r8d
	movq	24(%rsp), %rcx
	movl	%ebx, %edx
	movl	$4, %esi
	movl	$1, %edi
	call	_Z31__device_stub__Z8trapAreaiiiPdiiiiPdi
.L73:
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1024, %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	nSums(%rip), %eax
	movl	$1, 64(%rsp)
	cltd
	idivl	%ecx
	movl	$4194305, %edx
	movl	$1, %ecx
	salq	$10, %rdx
	movq	%rdx, 56(%rsp)
	incl	%eax
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	44(%rsp), %rdi
	movl	52(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L74
	movq	24(%rsp), %rcx
	movl	nSums(%rip), %edx
	movl	%ebx, %edi
	movq	32(%rsp), %rsi
	call	_Z30__device_stub__Z7trapSumiPdiS_iPdiS_
.L74:
	movslq	nSums(%rip), %rbp
	leaq	.LC19(%rip), %r15
	salq	$3, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	32(%rsp), %rsi
	movq	%rbp, %rdx
	movl	$2, %ecx
	movq	%rax, %rdi
	movq	%rax, %r14
	call	cudaMemcpy@PLT
	movl	nSums(%rip), %eax
	leal	-1(%rax), %ebp
	movslq	%ebp, %rbp
.L75:
	movl	%ebp, %edx
	testl	%ebp, %ebp
	js	.L87
	movsd	(%r14,%rbp,8), %xmm0
	movq	%r15, %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movsd	.LC8(%rip), %xmm0
	subsd	(%r14,%rbp,8), %xmm0
	comisd	.LC9(%rip), %xmm0
	jb	.L76
	movsd	.LC10(%rip), %xmm1
	ucomisd	%xmm0, %xmm1
	cmovnb	%ebp, %r13d
.L76:
	decq	%rbp
	jmp	.L75
.L87:
	leal	0(%r13,%rbx), %edx
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L71:
	movq	%r12, %rdi
	call	_Z6finishPKc
	leaq	56(%rsp), %rdi
	movl	$16, %esi
	movslq	N(%rip), %rdx
	salq	$2, %rdx
	call	posix_memalign@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L79
	call	__stack_chk_fail@PLT
.L79:
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2558:
	.size	main, .-main
	.section	.rodata.str1.1
.LC21:
	.string	"_Z7trapSumiPdiS_"
.LC22:
	.string	"_Z8trapAreaiiiPdi"
.LC23:
	.string	"_Z11trapSumPow2PdiS_"
.LC24:
	.string	"_Z12trapAreaPow2iiPdi"
.LC25:
	.string	"_Z8gpu_sqrtPfi"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2594:
	.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	.LC21(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z7trapSumiPdiS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC22(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8trapAreaiiiPdi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC23(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11trapSumPow2PdiS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC24(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z12trapAreaPow2iiPdi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC25(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8gpu_sqrtPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2594:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	end
	.bss
	.align 16
	.type	end, @object
	.size	end, 16
end:
	.zero	16
	.globl	start
	.align 16
	.type	start, @object
	.size	start, 16
start:
	.zero	16
	.globl	doPrint
	.align 4
	.type	doPrint, @object
	.size	doPrint, 4
doPrint:
	.zero	4
	.globl	nSums
	.align 4
	.type	nSums, @object
	.size	nSums, 4
nSums:
	.zero	4
	.globl	nTraps
	.align 4
	.type	nTraps, @object
	.size	nTraps, 4
nTraps:
	.zero	4
	.globl	nSumsPow2
	.data
	.align 4
	.type	nSumsPow2, @object
	.size	nSumsPow2, 4
nSumsPow2:
	.long	10
	.globl	nTrapsPow2
	.align 4
	.type	nTrapsPow2, @object
	.size	nTrapsPow2, 4
nTrapsPow2:
	.long	2046
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.long	64000000
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1083129856
	.align 8
.LC8:
	.long	0
	.long	1077215232
	.align 8
.LC9:
	.long	-1598689907
	.long	-1095710985
	.align 8
.LC10:
	.long	-1598689907
	.long	1051772663
	.align 8
.LC12:
	.long	0
	.long	1071644672
	.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 <emmintrin.h>
#include <sys/time.h>
#include <stdio.h>
//#include <>

int N = 64000000;
int nTrapsPow2 = 2046;
int nSumsPow2 = 10;
int nTraps;
int nSums;                                                                                                                                         
int doPrint = 0; 

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// HELPER CODE TO INITIALIZE, PRINT AND TIME
struct timeval start, end;
void initialize(float *a, int N) {
  int i;
  for (i = 0; i < N; ++i) { 
    a[i] = pow(rand() % 10, 2); 
  }                                                                                                                                                                                       
}

void print(float* a, int N) {
   if (doPrint) {
   int i;
   for (i = 0; i < N; ++i)
      printf("%f ", a[i]);
   printf("\n");
   }
}  

void starttime() {
  gettimeofday( &start, 0 );
}

void endtime(const char* c) {
   gettimeofday( &end, 0 );
   double elapsed = ( end.tv_sec - start.tv_sec ) * 1000.0 + ( end.tv_usec - start.tv_usec ) / 1000.0;
   printf("%s: %f ms\n", c, elapsed); 
}

void init(const char* c) {
  printf("***************** %s **********************\n", c);
  //initialize(a, N); 
  //print(a, N);
  starttime();
}

void finish(const char* c) {
  endtime(c);
  //print(a, N);
  printf("***************************************************\n");
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////



// Normal C function to square root values
void normal(float* a, int N)                                                                                                                                                                                     
{
  int i;                                                                                                                                                                                                                
  for (i = 0; i < N; ++i)                                                                                                                                                                                    
    a[i] = sqrt(a[i]);                                                                                                                                                                                           
}                 

// GPU function to square root values
__global__ void gpu_sqrt(float* a, int N) {
   int element = blockIdx.x*blockDim.x + threadIdx.x;
   if (element < N) a[element] = sqrt(a[element]);
}

void gpu(float* a, int N) {
   int numThreads = 1024; // This can vary, up to 1024
   int numCores = N / 1024 + 1;

   float* gpuA;
   hipMalloc(&gpuA, N*sizeof(float)); // Allocate enough memory on the GPU
   hipMemcpy(gpuA, a, N*sizeof(float), hipMemcpyHostToDevice); // Copy array from CPU to GPU
   gpu_sqrt<<<numCores, numThreads>>>(gpuA, N);  // Call GPU Sqrt
   hipMemcpy(a, gpuA, N*sizeof(float), hipMemcpyDeviceToHost); // Copy array from GPU to CPU
   hipFree(&gpuA); // Free the memory on the GPU
}

//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////

__device__ double myCurve(double x)
{
	return x * x;
}

__device__ double Sum(int trapStart, int trapEnd, double* area)
{	
	int i;
	double total = 0;
        if(((trapEnd+1) - trapStart) <= 0)
                return -1;
	else
	{
		for(i = trapStart; i <= trapEnd; i++)
		{
			total += area[i];
		}
	}
	return total;
}

                                                   
__global__ void trapAreaPow2(int x1, int x2, double* area, int numTraps)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numTraps)
	{
		int n, t;
		double d, x;
		n = index + 2;
		n = log2((double) n);
		if(index == 6 || index == 62)
		{
//			printf("%d) log2(%f) = %d\n", index,(double) (index+2), n);
			n++;
		}
		n = exp2((double) n);
		d = (x2 - x1) / (double)n;
		t = index - n + 3;
		x = ((t - 1) * d) + x1;
		area[index] = ((myCurve(x) + myCurve(x+d)) / 2) * d;
		if(index >= 1022 && index <= 2045)
		{
			//printf("index = %d:\nn = %d\nd = %f\nt = %d\nx = %f\n", index, n, d, t, x);
			//printf("area[%d] = %f\n", index, area[index]);
			//printf("index = %d, n = %d\n", index, n);
		}
	}
}
__global__ void trapSumPow2(double* sum, int numSums, double* area)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numSums)
	{
		int n, trapStart, trapEnd;	
		n = exp2((double) (index+1));
		trapStart = n - 2;
		trapEnd = (n * 2) - 3;
		sum[index] = Sum(trapStart, trapEnd, area);
	}
}


__global__ void trapArea(int x1, int x2, int S, double* area, int numTraps)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numTraps)
	{
		int a, b, t, n, i=0;
		double d, c;
		t = index;
		while(t >= 0)
		{
			t = t - S - i;
			i++;
		}
		a = i - 1;
		n = S + a;
		d = (x2 - x1) / (double) n;
		b = ((a * a) - a) / 2;
		c = index - ((a * S) + b);
		c = x1 + (c * d);
		area[index] =  ((myCurve(c) + myCurve(c+d)) / 2) * d;
	//	printf("index: %d\na: %d\nn: %d\nd: %f\nc: %f\narea[%d] = %f\n", index, a, n, d, c, index, area[index]);
	}
}

__global__ void trapSum(int S, double* sum, int numSums, double* area)
{
	int index = blockIdx.x*blockDim.x + threadIdx.x;
	if(index < numSums)
	{
		int trapStart, trapEnd;
		trapStart = (index * S) + (((index*index) - index) / 2);
		trapEnd = trapStart + S + index - 1;
		sum[index] = Sum(trapStart, trapEnd, area);
	}
}


int main()
{
	init("Trapezoidal Sum");
	
	int S = 0, x1 = 1, x2 = 4;
	int i, x = 0;
	double epsilon = 0.000001;
	double answer = 21;
 	double* areaPow2;
	double* sumPow2;
	double* answersPow2;
	double* areaLinear;
	double* sumLinear;
	int numThreads = 1024;
	int numCores = nTrapsPow2 / numThreads + 1;
	double* answersLinear;
	
//	printf("no fault here\n");

	answersPow2 = (double*)malloc(nSumsPow2*sizeof(double));
	hipMalloc(&areaPow2, nTrapsPow2*sizeof(double));
	hipMalloc(&sumPow2, nSumsPow2*sizeof(double));
	
//	printf("so far so good\n");

	trapAreaPow2<<<numCores, numThreads>>>(x1, x2, areaPow2, nTrapsPow2);

//	printf("got past trapAreaPow2\n");
		
	numCores = nSumsPow2 / numThreads + 1;
	trapSumPow2<<<numCores, numThreads>>>(sumPow2, nSumsPow2, areaPow2);

//	printf("made it past trapSumPow2\n");
	
	hipMemcpy(answersPow2, sumPow2, nSumsPow2*sizeof(double), hipMemcpyDeviceToHost);
	
//	printf("cudaMemcpy was sucessful\n");

	
//	printf("nSumsPow2 = %d\n", nSumsPow2); 
	for(i = nSumsPow2 - 1; i >= 0; i--)
	{
		printf("answersPow2[%d] = %f\n", i, answersPow2[i]);
		if((answer - answersPow2[i]) >= -epsilon && (answer - answersPow2[i]) <= epsilon)
		{
			x = i + 1;
		}
	}
	printf("loop sucessful\n");	
	S = exp2((double) x) / 2;
	printf("x = %d and S = %d\n", x, S);
	printf("S = %d, the sum with %d trapazoids was %f\n", S, S*2, answersPow2[x-1]);
	
	if(S == 1)
		printf("done\n");
	else if(S == 0)
		printf("1024 trapazoids is too few to get an answer within epsilon.\n");
	else
	{
		nTraps = ((S + 1) * S) + (((S * S) + S) / 2);
		nSums = S + 1;
		printf("nSums = %d\n", nSums);
		hipMalloc(&sumLinear, nSums * sizeof(double));
		hipMalloc(&areaLinear, nTraps * sizeof(double));
		numCores = (nTraps/numThreads) + 1;
		trapArea<<<numCores, numThreads>>>(x1, x2, S, areaLinear, nTraps);
		printf("this works\n");
		numCores = (nSums/numThreads) + 1;
		trapSum<<<numCores, numThreads>>>(S, sumLinear, nSums, areaLinear);
		answersLinear = (double*) malloc(nSums * sizeof(double));
		hipMemcpy(answersLinear, sumLinear, nSums*sizeof(double), hipMemcpyDeviceToHost);
		for(i=nSums-1; i >= 0; i--)
		{
			printf("answersLinear[%d] = %f\n", i, answersLinear[i]);
			if((answer - answersLinear[i]) >= -epsilon && (answer - answersLinear[i]) <= epsilon)
				x = i;
		}
		x = S + x;
		printf("This is the minimunm number of trapezoids needed to compute a trapezoidal sum that is within our epsilon of the actual answer: %d\n", x);
	}

	finish("Trapezoidal Sum");
	
  //////////////////////////////////////////////////////////////////////////
  // Necessary if you are doing SSE.  Align on a 128-bit boundary (16 bytes)
  float* a;                                                                                                                                                                                                      
  posix_memalign((void**)&a, 16,  N * sizeof(float));                                                                                                                                                            
  /////////////////////////////////////////////////////////////////////////

  // Test 1: Sequential For Loop
//  init(a, N, "Normal");
//  normal(a, N); 
//  finish(a, N, "Normal"); 

  // Test 2: Vectorization
//  init(a, N, "GPU");
//  gpu(a, N);  
//  finish(a, N, "GPU");

  return 0;
}



	.text
	.file	"final.hip"
	.globl	_Z10initializePfi               # -- Begin function _Z10initializePfi
	.type	_Z10initializePfi,@function
_Z10initializePfi:                      # @_Z10initializePfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB0_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	%xmm0, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rbx,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB0_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB0_4:                                # %._crit_edge
	retq
.Lfunc_end0:
	.size	_Z10initializePfi, .Lfunc_end0-_Z10initializePfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z5printPfi                     # -- Begin function _Z5printPfi
	.type	_Z5printPfi,@function
_Z5printPfi:                            # @_Z5printPfi
	.cfi_startproc
# %bb.0:
	cmpl	$0, doPrint(%rip)
	je	.LBB1_6
# %bb.1:                                # %.preheader
	testl	%esi, %esi
	jle	.LBB1_5
# %bb.2:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB1_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r15,4), %xmm0
	movl	$.L.str, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB1_3
# %bb.4:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB1_5:                                # %._crit_edge
	movl	$10, %edi
	jmp	putchar@PLT                     # TAILCALL
.LBB1_6:
	retq
.Lfunc_end1:
	.size	_Z5printPfi, .Lfunc_end1-_Z5printPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z9starttimev                   # -- Begin function _Z9starttimev
	.type	_Z9starttimev,@function
_Z9starttimev:                          # @_Z9starttimev
	.cfi_startproc
# %bb.0:
	movl	$start, %edi
	xorl	%esi, %esi
	jmp	gettimeofday                    # TAILCALL
.Lfunc_end2:
	.size	_Z9starttimev, .Lfunc_end2-_Z9starttimev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7endtimePKc
.LCPI3_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	_Z7endtimePKc
	.type	_Z7endtimePKc,@function
_Z7endtimePKc:                          # @_Z7endtimePKc
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movl	$end, %edi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	end(%rip), %rax
	subq	start(%rip), %rax
	cvtsi2sd	%rax, %xmm1
	movsd	.LCPI3_0(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	movq	end+8(%rip), %rax
	subq	start+8(%rip), %rax
	cvtsi2sd	%rax, %xmm0
	divsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movl	$.L.str.2, %edi
	movq	%rbx, %rsi
	movb	$1, %al
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end3:
	.size	_Z7endtimePKc, .Lfunc_end3-_Z7endtimePKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z4initPKc                      # -- Begin function _Z4initPKc
	.type	_Z4initPKc,@function
_Z4initPKc:                             # @_Z4initPKc
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdi, %rsi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$start, %edi
	xorl	%esi, %esi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	gettimeofday                    # TAILCALL
.Lfunc_end4:
	.size	_Z4initPKc, .Lfunc_end4-_Z4initPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z6finishPKc                    # -- Begin function _Z6finishPKc
	.type	_Z6finishPKc,@function
_Z6finishPKc:                           # @_Z6finishPKc
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	_Z7endtimePKc
	movl	$.Lstr, %edi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end5:
	.size	_Z6finishPKc, .Lfunc_end5-_Z6finishPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z6normalPfi                    # -- Begin function _Z6normalPfi
	.type	_Z6normalPfi,@function
_Z6normalPfi:                           # @_Z6normalPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB6_7
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
	xorps	%xmm1, %xmm1
.LBB6_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rbx,%r15,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jb	.LBB6_4
# %bb.3:                                #   in Loop: Header=BB6_2 Depth=1
	sqrtss	%xmm0, %xmm0
	jmp	.LBB6_5
.LBB6_4:                                # %call.sqrt
                                        #   in Loop: Header=BB6_2 Depth=1
	callq	sqrtf@PLT
	xorps	%xmm1, %xmm1
.LBB6_5:                                # %.lr.ph.split
                                        #   in Loop: Header=BB6_2 Depth=1
	movss	%xmm0, (%rbx,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB6_2
# %bb.6:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB6_7:                                # %._crit_edge
	retq
.Lfunc_end6:
	.size	_Z6normalPfi, .Lfunc_end6-_Z6normalPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__gpu_sqrtPfi  # -- Begin function _Z23__device_stub__gpu_sqrtPfi
	.type	_Z23__device_stub__gpu_sqrtPfi,@function
_Z23__device_stub__gpu_sqrtPfi:         # @_Z23__device_stub__gpu_sqrtPfi
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%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	$_Z8gpu_sqrtPfi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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_end7:
	.size	_Z23__device_stub__gpu_sqrtPfi, .Lfunc_end7-_Z23__device_stub__gpu_sqrtPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z3gpuPfi                       # -- Begin function _Z3gpuPfi
	.type	_Z3gpuPfi,@function
_Z3gpuPfi:                              # @_Z3gpuPfi
	.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	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%esi, %r14d
	movq	%rdi, %rbx
	leal	1023(%r14), %r12d
	testl	%esi, %esi
	cmovnsl	%esi, %r12d
	sarl	$10, %r12d
	incl	%r12d
	movslq	%esi, %r15
	shlq	$2, %r15
	leaq	8(%rsp), %r13
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movq	(%r13), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	btsq	$32, %r12
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$1024, %rdx                     # imm = 0x400
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB8_2
# %bb.1:
	movq	8(%rsp), %rdi
	movl	%r14d, %esi
	callq	_Z23__device_stub__gpu_sqrtPfi
.LBB8_2:
	leaq	8(%rsp), %r14
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	%r14, %rdi
	callq	hipFree
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	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_end8:
	.size	_Z3gpuPfi, .Lfunc_end8-_Z3gpuPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__trapAreaPow2iiPdi # -- Begin function _Z27__device_stub__trapAreaPow2iiPdi
	.type	_Z27__device_stub__trapAreaPow2iiPdi,@function
_Z27__device_stub__trapAreaPow2iiPdi:   # @_Z27__device_stub__trapAreaPow2iiPdi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	20(%rsp), %rax
	movl	%edi, (%rax)
	leaq	16(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	12(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z12trapAreaPow2iiPdi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z27__device_stub__trapAreaPow2iiPdi, .Lfunc_end9-_Z27__device_stub__trapAreaPow2iiPdi
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__trapSumPow2PdiS_ # -- Begin function _Z26__device_stub__trapSumPow2PdiS_
	.type	_Z26__device_stub__trapSumPow2PdiS_,@function
_Z26__device_stub__trapSumPow2PdiS_:    # @_Z26__device_stub__trapSumPow2PdiS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	12(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11trapSumPow2PdiS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_Z26__device_stub__trapSumPow2PdiS_, .Lfunc_end10-_Z26__device_stub__trapSumPow2PdiS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__trapAreaiiiPdi # -- Begin function _Z23__device_stub__trapAreaiiiPdi
	.type	_Z23__device_stub__trapAreaiiiPdi,@function
_Z23__device_stub__trapAreaiiiPdi:      # @_Z23__device_stub__trapAreaiiiPdi
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	20(%rsp), %rax
	movl	%edi, (%rax)
	leaq	16(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	8(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z8trapAreaiiiPdi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end11:
	.size	_Z23__device_stub__trapAreaiiiPdi, .Lfunc_end11-_Z23__device_stub__trapAreaiiiPdi
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__trapSumiPdiS_ # -- Begin function _Z22__device_stub__trapSumiPdiS_
	.type	_Z22__device_stub__trapSumiPdiS_,@function
_Z22__device_stub__trapSumiPdiS_:       # @_Z22__device_stub__trapSumiPdiS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	8(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7trapSumiPdiS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z22__device_stub__trapSumiPdiS_, .Lfunc_end12-_Z22__device_stub__trapSumiPdiS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI13_0:
	.quad	0x4035000000000000              # double 21
.LCPI13_1:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
.LCPI13_2:
	.quad	0xbeb0c6f7a0b5ed8d              # double -9.9999999999999995E-7
.LCPI13_3:
	.quad	0x3ff0000000000000              # double 1
.LCPI13_4:
	.quad	0x3fe0000000000000              # double 0.5
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967296, %r13               # imm = 0x100000000
	movl	$.L.str.3, %edi
	movl	$.L.str.5, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$start, %edi
	xorl	%esi, %esi
	callq	gettimeofday
	movslq	nTrapsPow2(%rip), %r14
	leal	1023(%r14), %ebx
	testl	%r14d, %r14d
	cmovnsl	%r14d, %ebx
	sarl	$10, %ebx
	incl	%ebx
	movslq	nSumsPow2(%rip), %rdi
	shlq	$3, %rdi
	callq	malloc
	movq	%rax, %r12
	shlq	$3, %r14
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movslq	nSumsPow2(%rip), %rsi
	shlq	$3, %rsi
	leaq	16(%rsp), %rdi
	callq	hipMalloc
	btsq	$32, %rbx
	leaq	1024(%r13), %rdx
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB13_2
# %bb.1:
	movq	24(%rsp), %rdx
	movl	nTrapsPow2(%rip), %ecx
	movl	$1, %edi
	movl	$4, %esi
	callq	_Z27__device_stub__trapAreaPow2iiPdi
.LBB13_2:
	movl	nSumsPow2(%rip), %eax
	leal	1023(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$10, %edi
	incl	%edi
	orq	%r13, %rdi
	leaq	1024(%r13), %r14
	xorl	%ebx, %ebx
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB13_4
# %bb.3:
	movq	16(%rsp), %rdi
	movl	nSumsPow2(%rip), %esi
	movq	24(%rsp), %rdx
	callq	_Z26__device_stub__trapSumPow2PdiS_
.LBB13_4:
	movq	16(%rsp), %rsi
	movslq	nSumsPow2(%rip), %rdx
	shlq	$3, %rdx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	nSumsPow2(%rip), %ebp
	testl	%ebp, %ebp
	jle	.LBB13_7
# %bb.5:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
.LBB13_6:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	leaq	-1(%rbp), %r15
	movsd	-8(%r12,%rbp,8), %xmm0          # xmm0 = mem[0],zero
	movl	$.L.str.6, %edi
	movl	%r15d, %esi
	movb	$1, %al
	callq	printf
	movsd	.LCPI13_0(%rip), %xmm0          # xmm0 = mem[0],zero
	subsd	-8(%r12,%rbp,8), %xmm0
	movsd	.LCPI13_1(%rip), %xmm1          # xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	movl	%ebp, %eax
	cmovbl	%ebx, %eax
	ucomisd	.LCPI13_2(%rip), %xmm0
	cmovael	%eax, %ebx
	cmpq	$1, %rbp
	movq	%r15, %rbp
	ja	.LBB13_6
.LBB13_7:                               # %._crit_edge
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movsd	.LCPI13_3(%rip), %xmm0          # xmm0 = mem[0],zero
	movl	%ebx, %edi
	callq	ldexp@PLT
	mulsd	.LCPI13_4(%rip), %xmm0
	cvttsd2si	%xmm0, %r15d
	movl	$.L.str.8, %edi
	movl	%ebx, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	printf
	leal	(%r15,%r15), %edx
	movslq	%ebx, %rax
	movsd	-8(%r12,%rax,8), %xmm0          # xmm0 = mem[0],zero
	movl	$.L.str.9, %edi
	movl	%r15d, %esi
	movb	$1, %al
	callq	printf
	testl	%r15d, %r15d
	je	.LBB13_11
# %bb.8:                                # %._crit_edge
	cmpl	$1, %r15d
	jne	.LBB13_12
# %bb.9:
	movl	$.Lstr.4, %edi
	jmp	.LBB13_10
.LBB13_11:
	movl	$.Lstr.3, %edi
.LBB13_10:
	callq	puts@PLT
	jmp	.LBB13_19
.LBB13_12:
	leal	1(%r15), %esi
	movl	%esi, %eax
	imull	%r15d, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%eax, %ecx
	movl	%ecx, nTraps(%rip)
	movl	%esi, nSums(%rip)
	movl	$.L.str.12, %edi
	xorl	%eax, %eax
	callq	printf
	movslq	nSums(%rip), %rsi
	shlq	$3, %rsi
	movq	%rsp, %rdi
	callq	hipMalloc
	movslq	nTraps(%rip), %rsi
	shlq	$3, %rsi
	leaq	8(%rsp), %rdi
	callq	hipMalloc
	movl	nTraps(%rip), %eax
	leal	1023(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$10, %edi
	incl	%edi
	orq	%r13, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB13_14
# %bb.13:
	movq	8(%rsp), %rcx
	movl	nTraps(%rip), %r8d
	movl	$1, %edi
	movl	$4, %esi
	movl	%r15d, %edx
	callq	_Z23__device_stub__trapAreaiiiPdi
.LBB13_14:
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	nSums(%rip), %eax
	leal	1023(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$10, %edi
	incl	%edi
	orq	%r13, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB13_16
# %bb.15:
	movq	(%rsp), %rsi
	movl	nSums(%rip), %edx
	movq	8(%rsp), %rcx
	movl	%r15d, %edi
	callq	_Z22__device_stub__trapSumiPdiS_
.LBB13_16:
	movslq	nSums(%rip), %r12
	shlq	$3, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r14
	movq	(%rsp), %rsi
	movq	%rax, %rdi
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	nSums(%rip), %r13d
	testl	%r13d, %r13d
	jle	.LBB13_18
.LBB13_17:                              # %.lr.ph117
                                        # =>This Inner Loop Header: Depth=1
	leaq	-1(%r13), %r12
	movsd	-8(%r14,%r13,8), %xmm0          # xmm0 = mem[0],zero
	movl	$.L.str.14, %edi
	movl	%r12d, %esi
	movb	$1, %al
	callq	printf
	movsd	.LCPI13_0(%rip), %xmm0          # xmm0 = mem[0],zero
	subsd	-8(%r14,%r13,8), %xmm0
	movsd	.LCPI13_1(%rip), %xmm1          # xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	movl	%r12d, %eax
	cmovbl	%ebx, %eax
	ucomisd	.LCPI13_2(%rip), %xmm0
	cmovael	%eax, %ebx
	cmpq	$1, %r13
	movq	%r12, %r13
	ja	.LBB13_17
.LBB13_18:                              # %._crit_edge118
	addl	%r15d, %ebx
	movl	$.L.str.15, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
.LBB13_19:
	movl	$.L.str.5, %edi
	callq	_Z7endtimePKc
	movl	$.Lstr, %edi
	callq	puts@PLT
	movslq	N(%rip), %rdx
	shlq	$2, %rdx
	leaq	32(%rsp), %rdi
	movl	$16, %esi
	callq	posix_memalign
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	main, .Lfunc_end13-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	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	.LBB14_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB14_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8gpu_sqrtPfi, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12trapAreaPow2iiPdi, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11trapSumPow2PdiS_, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8trapAreaiiiPdi, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7trapSumiPdiS_, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end14:
	.size	__hip_module_ctor, .Lfunc_end14-__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	.LBB15_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
.LBB15_2:
	retq
.Lfunc_end15:
	.size	__hip_module_dtor, .Lfunc_end15-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	N,@object                       # @N
	.data
	.globl	N
	.p2align	2, 0x0
N:
	.long	64000000                        # 0x3d09000
	.size	N, 4

	.type	nTrapsPow2,@object              # @nTrapsPow2
	.globl	nTrapsPow2
	.p2align	2, 0x0
nTrapsPow2:
	.long	2046                            # 0x7fe
	.size	nTrapsPow2, 4

	.type	nSumsPow2,@object               # @nSumsPow2
	.globl	nSumsPow2
	.p2align	2, 0x0
nSumsPow2:
	.long	10                              # 0xa
	.size	nSumsPow2, 4

	.type	nTraps,@object                  # @nTraps
	.bss
	.globl	nTraps
	.p2align	2, 0x0
nTraps:
	.long	0                               # 0x0
	.size	nTraps, 4

	.type	nSums,@object                   # @nSums
	.globl	nSums
	.p2align	2, 0x0
nSums:
	.long	0                               # 0x0
	.size	nSums, 4

	.type	doPrint,@object                 # @doPrint
	.globl	doPrint
	.p2align	2, 0x0
doPrint:
	.long	0                               # 0x0
	.size	doPrint, 4

	.type	start,@object                   # @start
	.globl	start
	.p2align	3, 0x0
start:
	.zero	16
	.size	start, 16

	.type	end,@object                     # @end
	.globl	end
	.p2align	3, 0x0
end:
	.zero	16
	.size	end, 16

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

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"***************** %s **********************\n"
	.size	.L.str.3, 45

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

	.type	_Z12trapAreaPow2iiPdi,@object   # @_Z12trapAreaPow2iiPdi
	.globl	_Z12trapAreaPow2iiPdi
	.p2align	3, 0x0
_Z12trapAreaPow2iiPdi:
	.quad	_Z27__device_stub__trapAreaPow2iiPdi
	.size	_Z12trapAreaPow2iiPdi, 8

	.type	_Z11trapSumPow2PdiS_,@object    # @_Z11trapSumPow2PdiS_
	.globl	_Z11trapSumPow2PdiS_
	.p2align	3, 0x0
_Z11trapSumPow2PdiS_:
	.quad	_Z26__device_stub__trapSumPow2PdiS_
	.size	_Z11trapSumPow2PdiS_, 8

	.type	_Z8trapAreaiiiPdi,@object       # @_Z8trapAreaiiiPdi
	.globl	_Z8trapAreaiiiPdi
	.p2align	3, 0x0
_Z8trapAreaiiiPdi:
	.quad	_Z23__device_stub__trapAreaiiiPdi
	.size	_Z8trapAreaiiiPdi, 8

	.type	_Z7trapSumiPdiS_,@object        # @_Z7trapSumiPdiS_
	.globl	_Z7trapSumiPdiS_
	.p2align	3, 0x0
_Z7trapSumiPdiS_:
	.quad	_Z22__device_stub__trapSumiPdiS_
	.size	_Z7trapSumiPdiS_, 8

	.type	.L.str.5,@object                # @.str.5
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.5:
	.asciz	"Trapezoidal Sum"
	.size	.L.str.5, 16

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"answersPow2[%d] = %f\n"
	.size	.L.str.6, 22

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"x = %d and S = %d\n"
	.size	.L.str.8, 19

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"S = %d, the sum with %d trapazoids was %f\n"
	.size	.L.str.9, 43

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"nSums = %d\n"
	.size	.L.str.12, 12

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"answersLinear[%d] = %f\n"
	.size	.L.str.14, 24

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"This is the minimunm number of trapezoids needed to compute a trapezoidal sum that is within our epsilon of the actual answer: %d\n"
	.size	.L.str.15, 131

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8gpu_sqrtPfi"
	.size	.L__unnamed_1, 15

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z12trapAreaPow2iiPdi"
	.size	.L__unnamed_2, 22

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z11trapSumPow2PdiS_"
	.size	.L__unnamed_3, 21

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z8trapAreaiiiPdi"
	.size	.L__unnamed_4, 18

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z7trapSumiPdiS_"
	.size	.L__unnamed_5, 17

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"***************************************************"
	.size	.Lstr, 52

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"loop sucessful"
	.size	.Lstr.1, 15

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"this works"
	.size	.Lstr.2, 11

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"1024 trapazoids is too few to get an answer within epsilon."
	.size	.Lstr.3, 60

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"done"
	.size	.Lstr.4, 5

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z23__device_stub__gpu_sqrtPfi
	.addrsig_sym _Z27__device_stub__trapAreaPow2iiPdi
	.addrsig_sym _Z26__device_stub__trapSumPow2PdiS_
	.addrsig_sym _Z23__device_stub__trapAreaiiiPdi
	.addrsig_sym _Z22__device_stub__trapSumiPdiS_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym start
	.addrsig_sym end
	.addrsig_sym _Z8gpu_sqrtPfi
	.addrsig_sym _Z12trapAreaPow2iiPdi
	.addrsig_sym _Z11trapSumPow2PdiS_
	.addrsig_sym _Z8trapAreaiiiPdi
	.addrsig_sym _Z7trapSumiPdiS_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8gpu_sqrtPfi          ; -- Begin function _Z8gpu_sqrtPfi
	.globl	_Z8gpu_sqrtPfi
	.p2align	8
	.type	_Z8gpu_sqrtPfi,@function
_Z8gpu_sqrtPfi:                         ; @_Z8gpu_sqrtPfi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x1c
	s_load_b32 s3, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b32 v2, v[0:1], off
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v3, 0x4f800000, v2
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v2
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	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
	v_fma_f32 v6, -v4, v3, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v7, -v5, v3, v2
	v_cmp_ge_f32_e64 s0, 0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v3, v3, v4, s0
	v_cmp_lt_f32_e64 s0, 0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v3, v3, v5, s0
	v_mul_f32_e32 v4, 0x37800000, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v3, v3, v4, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v2, 0x260
	v_cndmask_b32_e32 v2, v3, v2, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8gpu_sqrtPfi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z8gpu_sqrtPfi, .Lfunc_end0-_Z8gpu_sqrtPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 268
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z12trapAreaPow2iiPdi   ; -- Begin function _Z12trapAreaPow2iiPdi
	.globl	_Z12trapAreaPow2iiPdi
	.p2align	8
	.type	_Z12trapAreaPow2iiPdi,@function
_Z12trapAreaPow2iiPdi:                  ; @_Z12trapAreaPow2iiPdi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB1_8
; %bb.1:                                ; %NodeBlock
	v_add_nc_u32_e32 v0, 2, v1
	s_mov_b32 s3, 0x3fe55555
	s_mov_b32 s2, 0x55555555
	s_mov_b32 s4, 0x6b47b09a
	s_mov_b32 s6, 0xbf559e2b
	v_cvt_f64_i32_e32 v[2:3], v0
	s_mov_b32 s5, 0x3fc38538
	s_mov_b32 s7, 0x3fc3ab76
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_frexp_mant_f64_e32 v[4:5], v[2:3]
	v_cmp_gt_f64_e32 vcc_lo, s[2:3], v[4:5]
	s_mov_b32 s2, 0x55555780
	v_cndmask_b32_e64 v6, 0, 1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[4:5], v[4:5], v6
	v_add_f64 v[6:7], v[4:5], 1.0
	v_add_f64 v[12:13], v[4:5], -1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[8:9], v[6:7]
	v_add_f64 v[14:15], v[6:7], -1.0
	v_add_f64 v[4:5], v[4:5], -v[14:15]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[10:11], v[8:9], v[8:9]
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[10:11], v[8:9], v[8:9]
	v_mul_f64 v[10:11], v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[16:17], v[6:7], v[10:11]
	v_fma_f64 v[6:7], v[10:11], v[6:7], -v[16:17]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[4:5], v[10:11], v[4:5], v[6:7]
	v_add_f64 v[6:7], v[16:17], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f64 v[14:15], v[12:13], -v[6:7]
	v_add_f64 v[16:17], v[6:7], -v[16:17]
	v_add_f64 v[12:13], v[12:13], -v[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[4:5], v[16:17], -v[4:5]
	v_add_f64 v[6:7], v[12:13], -v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[4:5], v[4:5], v[6:7]
	v_add_f64 v[4:5], v[14:15], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[4:5], v[8:9], v[4:5]
	v_add_f64 v[6:7], v[10:11], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[8:9], v[6:7], v[6:7]
	v_fma_f64 v[12:13], v[8:9], s[6:7], s[4:5]
	s_mov_b32 s4, 0xd7f4df2e
	s_mov_b32 s5, 0x3fc7474d
	v_mul_f64 v[14:15], v[6:7], v[8:9]
	s_delay_alu instid0(VALU_DEP_2)
	v_fma_f64 v[12:13], v[8:9], v[12:13], s[4:5]
	s_mov_b32 s4, 0x16291751
	s_mov_b32 s5, 0x3fcc71c0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[12:13], v[8:9], v[12:13], s[4:5]
	s_mov_b32 s4, 0x9b27acf1
	s_mov_b32 s5, 0x3fd24924
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[12:13], v[8:9], v[12:13], s[4:5]
	s_mov_b32 s4, 0x998ef7b6
	s_mov_b32 s5, 0x3fd99999
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[12:13], v[8:9], v[12:13], s[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	v_fma_f64 v[8:9], v[8:9], v[12:13], s[2:3]
	v_ldexp_f64 v[12:13], v[6:7], 1
	v_add_f64 v[6:7], v[6:7], -v[10:11]
	s_mov_b32 s2, 0x652b82fe
	s_mov_b32 s3, 0x3ff71547
	v_mul_f64 v[8:9], v[14:15], v[8:9]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[4:5], v[4:5], -v[6:7]
	v_add_f64 v[10:11], v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ldexp_f64 v[4:5], v[4:5], 1
	v_add_f64 v[6:7], v[10:11], -v[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[6:7], v[8:9], -v[6:7]
	v_add_f64 v[4:5], v[4:5], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[6:7], v[10:11], v[4:5]
	v_add_f64 v[8:9], v[6:7], -v[10:11]
	v_mul_f64 v[10:11], v[6:7], s[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[4:5], v[4:5], -v[8:9]
	v_fma_f64 v[8:9], v[6:7], s[2:3], -v[10:11]
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[4:5], v[4:5], s[2:3], v[8:9]
	v_frexp_exp_i32_f64_e32 v8, v[2:3]
	s_mov_b32 s2, 0xffda0d24
	s_mov_b32 s3, 0x3c7777d0
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[2:3], v[6:7], s[2:3], v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_subrev_co_ci_u32_e32 v4, vcc_lo, 0, v8, vcc_lo
	s_mov_b32 s2, 0
	s_mov_b32 s3, exec_lo
	v_cvt_f64_i32_e32 v[4:5], v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[6:7], v[10:11], v[2:3]
	v_add_f64 v[8:9], v[6:7], v[4:5]
	v_add_f64 v[10:11], v[6:7], -v[10:11]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[12:13], v[8:9], -v[4:5]
	v_add_f64 v[2:3], v[2:3], -v[10:11]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f64 v[14:15], v[12:13], -v[8:9]
	v_add_f64 v[6:7], v[6:7], -v[12:13]
	v_add_f64 v[4:5], v[14:15], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[4:5], v[6:7], v[4:5]
	v_add_f64 v[2:3], v[2:3], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[2:3], v[8:9], v[2:3]
	v_cvt_i32_f64_e32 v2, v[2:3]
	v_cmpx_lt_i32_e32 61, v1
	s_xor_b32 s3, exec_lo, s3
; %bb.2:                                ; %LeafBlock37
	v_cmp_eq_u32_e32 vcc_lo, 62, v1
	s_and_b32 s2, vcc_lo, exec_lo
; %bb.3:                                ; %Flow
	s_and_not1_saveexec_b32 s3, s3
; %bb.4:                                ; %LeafBlock
	v_cmp_eq_u32_e32 vcc_lo, 6, v1
	s_and_not1_b32 s2, s2, exec_lo
	s_and_b32 s4, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s2, s2, s4
; %bb.5:                                ; %Flow39
	s_or_b32 exec_lo, exec_lo, s3
	s_and_saveexec_b32 s3, s2
; %bb.6:
	s_delay_alu instid0(VALU_DEP_4)
	v_add_nc_u32_e32 v2, 1, v2
; %bb.7:
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f64_i32_e32 v[3:4], v2
	s_mov_b32 s2, 0x3b39803f
	s_mov_b32 s3, 0x3c7abc9e
	s_mov_b32 s4, 0x6a5dcb37
	s_mov_b32 s5, 0x3e5ade15
	v_cmp_lt_i32_e32 vcc_lo, 0xfffffbcc, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[3:4], v[3:4], -v[3:4]
	v_mul_f64 v[5:6], v[3:4], s[2:3]
	s_mov_b32 s2, 0xfefa39ef
	s_mov_b32 s3, 0x3fe62e42
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[3:4], v[3:4], s[2:3], v[5:6]
	s_mov_b32 s2, 0xfca7ab0c
	s_mov_b32 s3, 0x3e928af3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], s[4:5], s[2:3]
	s_mov_b32 s2, 0x623fde64
	s_mov_b32 s3, 0x3ec71dee
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 0x7c89e6b0
	s_mov_b32 s3, 0x3efa0199
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 0x14761f6e
	s_mov_b32 s3, 0x3f2a01a0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 0x1852b7b0
	s_mov_b32 s3, 0x3f56c16c
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 0x11122322
	s_mov_b32 s3, 0x3f811111
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 0x555502a1
	s_mov_b32 s3, 0x3fa55555
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 0x55555511
	s_mov_b32 s3, 0x3fc55555
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_mov_b32 s2, 11
	s_mov_b32 s3, 0x3fe00000
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], s[2:3]
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_sub_i32 s1, s1, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[5:6], v[3:4], v[5:6], 1.0
	v_fma_f64 v[3:4], v[3:4], v[5:6], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[3:4], v[3:4], v2
	v_cvt_i32_f64_e32 v3, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v14, 0, v3, vcc_lo
	v_cvt_f64_i32_e32 v[2:3], s1
	v_cvt_f64_i32_e32 v[4:5], v14
	v_sub_nc_u32_e32 v0, v0, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[6:7], null, v[4:5], v[4:5], v[2:3]
	v_div_scale_f64 v[12:13], vcc_lo, v[2:3], v[4:5], v[2:3]
	v_rcp_f64_e32 v[8:9], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_mul_f64 v[10:11], v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[6:7], -v[6:7], v[10:11], v[12:13]
	v_div_fmas_f64 v[6:7], v[6:7], v[8:9], v[10:11]
	v_cvt_f64_i32_e32 v[8:9], v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[2:3], v[6:7], v[4:5], v[2:3]
	v_cvt_f64_i32_e32 v[4:5], s0
	v_fma_f64 v[4:5], v[2:3], v[8:9], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[6:7], v[2:3], v[4:5]
	v_mul_f64 v[6:7], v[6:7], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[4:5], v[4:5], v[4:5], v[6:7]
	v_mul_f64 v[4:5], v[4:5], 0.5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_f64 v[3:4], v[2:3], v[4:5]
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	global_store_b64 v[0:1], v[3:4], off
.LBB1_8:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12trapAreaPow2iiPdi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 18
		.amdhsa_next_free_sgpr 16
		.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	_Z12trapAreaPow2iiPdi, .Lfunc_end1-_Z12trapAreaPow2iiPdi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1552
; NumSgprs: 18
; NumVgprs: 18
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 18
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z11trapSumPow2PdiS_    ; -- Begin function _Z11trapSumPow2PdiS_
	.globl	_Z11trapSumPow2PdiS_
	.p2align	8
	.type	_Z11trapSumPow2PdiS_,@function
_Z11trapSumPow2PdiS_:                   ; @_Z11trapSumPow2PdiS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB2_6
; %bb.1:
	v_add_nc_u32_e32 v0, 1, v1
	s_mov_b32 s2, 0x3b39803f
	s_mov_b32 s3, 0x3c7abc9e
	s_mov_b32 s4, 0x6a5dcb37
	s_mov_b32 s5, 0x3e5ade15
	v_cvt_f64_i32_e32 v[2:3], v0
	v_cmp_lt_i32_e32 vcc_lo, 0xfffffbcb, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[2:3], v[2:3], -v[2:3]
	v_mul_f64 v[4:5], v[2:3], s[2:3]
	s_mov_b32 s2, 0xfefa39ef
	s_mov_b32 s3, 0x3fe62e42
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[2:3], v[2:3], s[2:3], v[4:5]
	s_mov_b32 s2, 0xfca7ab0c
	s_mov_b32 s3, 0x3e928af3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], s[4:5], s[2:3]
	s_mov_b32 s2, 0x623fde64
	s_mov_b32 s3, 0x3ec71dee
	s_mov_b32 s5, 0
	s_mov_b32 s4, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 0x7c89e6b0
	s_mov_b32 s3, 0x3efa0199
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 0x14761f6e
	s_mov_b32 s3, 0x3f2a01a0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 0x1852b7b0
	s_mov_b32 s3, 0x3f56c16c
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 0x11122322
	s_mov_b32 s3, 0x3f811111
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 0x555502a1
	s_mov_b32 s3, 0x3fa55555
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 0x55555511
	s_mov_b32 s3, 0x3fc55555
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_mov_b32 s2, 11
	s_mov_b32 s3, 0x3fe00000
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], s[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[4:5], v[2:3], v[4:5], 1.0
	v_fma_f64 v[2:3], v[2:3], v[4:5], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[2:3], v[2:3], v0
	v_cvt_i32_f64_e32 v0, v[2:3]
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0xbff00000
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, 0, v0, vcc_lo
	v_lshlrev_b32_e32 v2, 1, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 v2, v0
	s_cbranch_execz .LBB2_5
; %bb.2:                                ; %.preheader.i.preheader
	s_load_b64 s[2:3], s[0:1], 0x10
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	s_mov_b32 s6, 0
.LBB2_3:                                ; %.preheader.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add3_u32 v5, v0, s6, -2
	s_add_i32 s6, s6, 1
	v_ashrrev_i32_e32 v6, 31, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v5, vcc_lo, s2, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s3, v6, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, s6, v0
	global_load_b64 v[5:6], v[5:6], off
	s_or_b32 s5, vcc_lo, s5
	s_waitcnt vmcnt(0)
	v_add_f64 v[3:4], v[3:4], v[5:6]
	s_and_not1_b32 exec_lo, exec_lo, s5
	s_cbranch_execnz .LBB2_3
; %bb.4:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s5
.LBB2_5:                                ; %Flow16
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s4
	s_load_b64 s[0:1], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b64 v[0:1], v[3:4], off
.LBB2_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11trapSumPow2PdiS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 7
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z11trapSumPow2PdiS_, .Lfunc_end2-_Z11trapSumPow2PdiS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 668
; NumSgprs: 18
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 7
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z8trapAreaiiiPdi       ; -- Begin function _Z8trapAreaiiiPdi
	.globl	_Z8trapAreaiiiPdi
	.p2align	8
	.type	_Z8trapAreaiiiPdi,@function
_Z8trapAreaiiiPdi:                      ; @_Z8trapAreaiiiPdi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB3_6
; %bb.1:                                ; %.preheader
	s_load_b128 s[4:7], s[0:1], 0x0
	v_mov_b32_e32 v0, 0
	s_mov_b32 s2, exec_lo
	v_cmpx_lt_i32_e32 -1, v1
	s_cbranch_execz .LBB3_5
; %bb.2:                                ; %.lr.ph.preheader
	v_mov_b32_e32 v2, v1
	s_mov_b32 s3, 0
	s_waitcnt lgkmcnt(0)
	s_mov_b32 s7, 0
.LBB3_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	s_add_i32 s8, s6, s7
	s_add_i32 s7, s7, 1
	v_subrev_nc_u32_e32 v2, s8, v2
	v_mov_b32_e32 v0, s7
	v_cmp_gt_i32_e32 vcc_lo, 0, v2
	s_or_b32 s3, vcc_lo, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB3_3
; %bb.4:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB3_5:                                ; %Flow51
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s2
	v_add_nc_u32_e32 v14, -1, v0
	s_waitcnt lgkmcnt(0)
	s_sub_i32 s2, s5, s4
	v_add_nc_u32_e32 v0, -2, v0
	v_cvt_f64_i32_e32 v[2:3], s2
	s_load_b64 s[0:1], s[0:1], 0x10
	v_add_nc_u32_e32 v4, s6, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v0, v14, v0
	v_cvt_f64_i32_e32 v[4:5], v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[6:7], null, v[4:5], v[4:5], v[2:3]
	v_div_scale_f64 v[12:13], vcc_lo, v[2:3], v[4:5], v[2:3]
	v_rcp_f64_e32 v[8:9], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_mul_f64 v[10:11], v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[6:7], -v[6:7], v[10:11], v[12:13]
	v_div_fmas_f64 v[6:7], v[6:7], v[8:9], v[10:11]
	v_lshrrev_b32_e32 v8, 31, v0
	v_mul_lo_u32 v9, v14, s6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v0, v0, v8
	v_sub_nc_u32_e32 v8, v1, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v0, 1, v0
	v_sub_nc_u32_e32 v0, v8, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cvt_f64_i32_e32 v[8:9], v0
	v_div_fixup_f64 v[2:3], v[6:7], v[4:5], v[2:3]
	v_cvt_f64_i32_e32 v[4:5], s4
	v_fma_f64 v[4:5], v[2:3], v[8:9], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[6:7], v[2:3], v[4:5]
	v_mul_f64 v[6:7], v[6:7], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[4:5], v[4:5], v[4:5], v[6:7]
	v_mul_f64 v[4:5], v[4:5], 0.5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_f64 v[3:4], v[2:3], v[4:5]
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b64 v[0:1], v[3:4], off
.LBB3_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8trapAreaiiiPdi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 15
		.amdhsa_next_free_sgpr 16
		.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_end3:
	.size	_Z8trapAreaiiiPdi, .Lfunc_end3-_Z8trapAreaiiiPdi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 464
; NumSgprs: 18
; NumVgprs: 15
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 15
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z7trapSumiPdiS_        ; -- Begin function _Z7trapSumiPdiS_
	.globl	_Z7trapSumiPdiS_
	.p2align	8
	.type	_Z7trapSumiPdiS_,@function
_Z7trapSumiPdiS_:                       ; @_Z7trapSumiPdiS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB4_6
; %bb.1:
	s_load_b32 s2, s[0:1], 0x0
	v_dual_mov_b32 v3, 0 :: v_dual_add_nc_u32 v0, -1, v1
	v_mov_b32_e32 v4, 0xbff00000
	s_mov_b32 s3, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v0, v0, v1
	v_lshrrev_b32_e32 v2, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v0, v0, v2
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v5, v1, s2
	v_ashrrev_i32_e32 v6, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v2, v6, v5
	v_add3_u32 v0, v1, s2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 v0, v2
	s_cbranch_execz .LBB4_5
; %bb.2:                                ; %.preheader.i.preheader
	s_load_b64 s[4:5], s[0:1], 0x18
	v_ashrrev_i32_e32 v4, 31, v6
	v_ashrrev_i32_e32 v7, 31, v5
	v_add_co_u32 v3, vcc_lo, v6, v5
	v_add_nc_u32_e32 v0, -1, v0
	v_add_nc_u32_e32 v2, -1, v2
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v4, vcc_lo, v4, v7, vcc_lo
	v_lshlrev_b64 v[5:6], 3, v[3:4]
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v5, vcc_lo, s4, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v6, vcc_lo
	s_mov_b32 s4, 0
.LBB4_3:                                ; %.preheader.i
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[7:8], v[5:6], off
	v_add_nc_u32_e32 v2, 1, v2
	v_add_co_u32 v5, s2, v5, 8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v6, s2, 0, v6, s2
	v_cmp_ge_i32_e32 vcc_lo, v2, v0
	s_or_b32 s4, vcc_lo, s4
	s_waitcnt vmcnt(0)
	v_add_f64 v[3:4], v[3:4], v[7:8]
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB4_3
; %bb.4:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s4
.LBB4_5:                                ; %Flow25
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s3
	s_load_b64 s[0:1], s[0:1], 0x8
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b64 v[0:1], v[3:4], off
.LBB4_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7trapSumiPdiS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.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_end4:
	.size	_Z7trapSumiPdiS_, .Lfunc_end4-_Z7trapSumiPdiS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 372
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8gpu_sqrtPfi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8gpu_sqrtPfi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12trapAreaPow2iiPdi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z12trapAreaPow2iiPdi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     18
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11trapSumPow2PdiS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11trapSumPow2PdiS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8trapAreaiiiPdi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8trapAreaiiiPdi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     15
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7trapSumiPdiS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7trapSumiPdiS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
