#include <iostream>
#include <cmath>
#include <cstdlib>
#include <climits>

#include <cuda.h>
#include <cuda_runtime.h>
using namespace std;

#define SIZE 14*14
#define X_SIZE 14

#define NUM_EXAMPLES 3
#define BLOCK_SIZE 3

//Function prototype
//int SAT(int, int, int, int, int);

//Global variable
//Create big ass array for test char
	unsigned char image[3*SIZE] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 191, 127, 255, 255, 191, 127, 20 , 255, 255, 255,
					 		       255, 255, 255, 255, 127, 0  , 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 127, 0  , 40 , 40 , 230, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 175, 127, 127, 127, 235, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 245, 220, 245, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 127, 120, 180, 125, 120, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 245, 255, 255, 255, 100, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 110, 252, 252, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 120, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 128, 0  , 45 , 127, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 250, 20 , 240, 30 , 252, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 250, 15 , 15 , 235, 205, 135, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		 	   255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 150, 50 , 255, 255, 191, 127, 30 , 255, 255, 255,
					 		       255, 255, 255, 255, 120, 0  , 255, 235, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 113, 0  , 40 , 40 , 230, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 175, 150, 127, 127, 235, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 45 , 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};

//Define constant memory for device image
__constant__ unsigned char _image[3*SIZE];
__constant__ int _label[NUM_EXAMPLES];

//Function SAT
__device__ int SAT(int x1, int y1, int x2, int y2, int img)
{
	unsigned int area = 0;
	for(int j = y1; j <= y2; j++)
	{
		for(int i = x1; i <= x2; i++)
		{
			area += _image[img*SIZE + j*X_SIZE + i];
		}
	}
	return area;
}

__global__ void compute(int *error, int x, int y, int w, int h, int theta, int f, int comp)
{
	int i = blockDim.x*blockIdx.x + threadIdx.x;

	//Compute features and classify with them
	f = SAT(x, y, x+w-1, y+h-1, i) - SAT(x+w, y, x+2*w-1, y+h-1, i);
	comp = abs(f - 255*w*h);
	if(comp < theta)
	{
		if(_label[i] == 0)
		{
			//printf("label[%i] == 0\n", i);
			atomicAdd(error, 1);
		}
	}
	else
	{
		if(_label[i] == 1)
		{
			//printf("label[%i] == 1\n", i);
			atomicAdd(error, 1);
		}
	}

	__syncthreads();
	//printf("error: %i\n", error[0]);
}

int main(int argc, char*argv[])
{
	int label[3];
	label[0] = atoi(argv[1]);
	label[1] = atoi(argv[2]);
	label[2] = atoi(argv[3]);

	int hi = atoi(argv[4]);

	int i = 0;

	int theta = 0;
	int min_theta = 0;

	int e[1] = {0};
	int min_e = INT_MAX;

	int f = 0;
	int comp = 0;

	//CUDA stuffs
	dim3 dimGrid(ceil(NUM_EXAMPLES/BLOCK_SIZE), 1, 1);
	dim3 dimBlock(BLOCK_SIZE, 1, 1);
	unsigned char* dev_in;
	unsigned char* dev_out;
	int* dev_e = (int*)malloc(sizeof(int));

	int size = 3*SIZE*sizeof(unsigned char);

	cudaError_t error[3];
	error[0] = cudaMalloc((void**) &dev_in, size);
	error[1] = cudaMalloc((void**) &dev_out, size);
	error[2] = cudaMalloc((void**) &dev_e, sizeof(int));
	cout << "cudaMalloc dev_in error: " << cudaGetErrorString(error[0]) << endl;
	cout << "cudaMalloc dev_out error: " << cudaGetErrorString(error[1]) << endl;
	cout << "cudaMalloc dev_e error: " << cudaGetErrorString(error[2]) << endl;

	//error[0] = cudaMemcpy(dev_e, e, sizeof(int), cudaMemcpyHostToDevice);
	error[1] = cudaMemcpyToSymbol(_image, image, size);
	error[2] = cudaMemcpyToSymbol(_label, label, 3*sizeof(int));
	//cout << "cudaMemcpy error: " << cudaGetErrorString(error[0]) << endl;
	cout << "cudaMemcpyToSymbol image error: " << cudaGetErrorString(error[1]) << endl;
	cout << "cudaMemcpyToSymbol label error: " << cudaGetErrorString(error[2]) << endl;
	//END CUDA stuffs
		
	for(int x = 0; x < 14; x++)
	{
		for(int y = 0; y < 14; y++)
		{
			for(int h = 1; h <= 15 - y; h++)
			{
				for(int w = 1; w <= (15 - x)/2; w++)
				{
					theta = hi;
					i++;

					while(theta > 0)
					{
						e[0] = 0;
						error[0] = cudaMemcpy(dev_e, e, sizeof(int), cudaMemcpyHostToDevice);
						//cout << "cudaMemcpy error: " << cudaGetErrorString(error[0]) << endl;

						//Call the cuda kernel
						compute<<<dimGrid, dimBlock>>>(dev_e, x, y, w, h, theta, f, comp);
						cudaDeviceSynchronize();
						error[0] = cudaMemcpy(e, dev_e, sizeof(int), cudaMemcpyDeviceToHost);
						//cout << "cudaMemcpy error: " << cudaGetErrorString(error[0]) << endl;

						//Keep track of current best theta value
						if(e[0] <= min_e)
						{
							min_e = e[0];
							min_theta = theta;
						}
							
						//Compute new threshold bounds based on number of misclassifications
						theta--;

						/*//Display classification info
						cout << "\tNumber misclassified:" << endl;
						cout << "\t---------------------" << endl;
						cout << "\te: " << e[0] << endl;
				
						cout << "\tNew theta bounds:" << endl;
						cout << "\t-----------------" << endl;
						cout << "\ttheta: " << theta << endl << endl;*/
					}

					cout << "==========================" << endl;
					cout << "feature(" << x << ", " << y << ", " << w << ", " << h << ")" << endl;
					cout << "Best theta classifier: " << min_theta << endl;
					cout << "Number misclassified:  " << min_e << endl;
					cout << "==========================" << endl << endl;
				}
			}
		}
	}

	cout << "Total number of features: " << i << endl;
	cout << "Memory size for array to hold feature values: " << i*sizeof(int) << " B" << endl << endl;

	return 0;
}
	.file	"tmpxft_0024b21a_00000000-6_weak_classifier.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3640:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3640:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z3SATiiiii
	.type	_Z3SATiiiii, @function
_Z3SATiiiii:
.LFB3635:
	.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
.LFE3635:
	.size	_Z3SATiiiii, .-_Z3SATiiiii
	.globl	_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii
	.type	_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii, @function
_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii:
.LFB3662:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 12(%rsp)
	leaq	48(%rsp), %rcx
	movl	%r8d, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	200(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L4
	pushq	48(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z7computePiiiiiiii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 208
	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 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L4:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3662:
	.size	_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii, .-_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii
	.globl	_Z7computePiiiiiiii
	.type	_Z7computePiiiiiiii, @function
_Z7computePiiiiiiii:
.LFB3663:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii
	.cfi_endproc
.LFE3663:
	.size	_Z7computePiiiiiiii, .-_Z7computePiiiiiiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"cudaMalloc dev_in error: "
.LC1:
	.string	"cudaMalloc dev_out error: "
.LC2:
	.string	"cudaMalloc dev_e error: "
.LC3:
	.string	"cudaMemcpyToSymbol image error: "
.LC4:
	.string	"cudaMemcpyToSymbol label error: "
.LC5:
	.string	"=========================="
.LC6:
	.string	"feature("
.LC7:
	.string	", "
.LC8:
	.string	")"
.LC9:
	.string	"Best theta classifier: "
.LC10:
	.string	"Number misclassified:  "
.LC11:
	.string	"Total number of features: "
.LC12:
	.string	"Memory size for array to hold feature values: "
.LC13:
	.string	" B"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3636:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$2147483647, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	8(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, 92(%rsp)
	call	atoi@PLT
	movq	24(%rbx), %rdi
	movl	%eax, 96(%rsp)
	call	atoi@PLT
	movq	32(%rbx), %rdi
	leaq	_ZSt4cout(%rip), %rbx
	movl	%eax, 100(%rsp)
	call	atoi@PLT
	xorl	%esi, %esi
	movl	$4, %edi
	movl	$1, 72(%rsp)
	movl	%eax, 28(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	addq	$2, %rax
	movl	%esi, 88(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	malloc@PLT
	leaq	40(%rsp), %rdi
	movl	$588, %esi
	movq	%rax, 56(%rsp)
	call	cudaMalloc@PLT
	leaq	48(%rsp), %rdi
	movl	$588, %esi
	movl	%eax, %r14d
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$4, %esi
	movl	%eax, %r13d
	call	cudaMalloc@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %r12d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r14d, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$588, %edx
	leaq	image(%rip), %rsi
	leaq	_ZL6_image(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$12, %edx
	leaq	92(%rsp), %rsi
	leaq	_ZL6_label(%rip), %rdi
	movl	%eax, %r13d
	call	cudaMemcpyToSymbol@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %ebp
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%r12, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	xorl	%r12d, %r12d
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rbx, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	xorl	%edi, %edi
	movl	%edi, 24(%rsp)
	movl	%edi, 4(%rsp)
.L11:
	movl	$15, %ebx
	xorl	%ebp, %ebp
	subl	%r12d, %ebx
	sarl	%ebx
	imull	$14, %ebx, %eax
	movl	%eax, 12(%rsp)
.L21:
	movl	$1, %r13d
.L19:
	movl	$1, 8(%rsp)
.L16:
	leaq	88(%rsp), %rax
	movl	28(%rsp), %r14d
	movq	%rax, 16(%rsp)
.L12:
	testl	%r14d, %r14d
	jle	.L26
	xorl	%ecx, %ecx
	movq	16(%rsp), %rsi
	movq	56(%rsp), %rdi
	movl	$4, %edx
	movl	%ecx, 88(%rsp)
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	84(%rsp), %ecx
	movl	72(%rsp), %esi
	xorl	%r9d, %r9d
	movq	76(%rsp), %rdx
	movq	64(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L13
	pushq	$0
	.cfi_def_cfa_offset 184
	movl	%ebp, %edx
	movl	%r14d, %r9d
	movl	%r13d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 192
	movl	24(%rsp), %ecx
	movl	%r12d, %esi
	movq	72(%rsp), %rdi
	call	_Z33__device_stub__Z7computePiiiiiiiiPiiiiiiii
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L13:
	call	cudaDeviceSynchronize@PLT
	movq	56(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movl	88(%rsp), %eax
	cmpl	%r15d, %eax
	jle	.L23
	movl	%r15d, %eax
	jmp	.L14
.L23:
	movl	%r14d, 24(%rsp)
.L14:
	decl	%r14d
	movl	%eax, %r15d
	jmp	.L12
.L26:
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	.LC7(%rip), %r14
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	8(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC9(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	24(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC10(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r15d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	incl	8(%rsp)
	cmpl	%ebx, 8(%rsp)
	jle	.L16
	movl	$15, %eax
	incl	%r13d
	subl	%ebp, %eax
	cmpl	%r13d, %eax
	jge	.L19
	movl	4(%rsp), %eax
	movl	12(%rsp), %edx
	incl	%ebp
	subl	%ebx, 12(%rsp)
	addl	%edx, %eax
	addl	%ebx, %eax
	movl	%eax, 4(%rsp)
	cmpl	$14, %ebp
	jne	.L21
	incl	%r12d
	cmpl	$14, %r12d
	jne	.L11
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	4(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC12(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movslq	4(%rsp), %rsi
	movq	%rax, %rdi
	salq	$2, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC13(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$120, %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
.LFE3636:
	.size	main, .-main
	.section	.rodata.str1.1
.LC14:
	.string	"_Z7computePiiiiiiii"
.LC15:
	.string	"_image"
.LC16:
	.string	"_label"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3665:
	.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	.LC14(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z7computePiiiiiiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC15(%rip), %rdx
	movl	$588, %r9d
	leaq	_ZL6_image(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC16(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$12, %r9d
	leaq	_ZL6_label(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.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
.LFE3665:
	.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
	.local	_ZL6_label
	.comm	_ZL6_label,12,8
	.local	_ZL6_image
	.comm	_ZL6_image,588,32
	.globl	image
	.data
	.align 32
	.type	image, @object
	.size	image, 588
image:
	.string	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\277\177\377\377\277\177\024\377\377\377\377\377\377\377\177"
	.string	"\377\377\177"
	.string	"\353\377\377\377\377\377\377\377\177"
	.string	"((\346"
	.string	"\353\377\377\377\377\377\377\377\257\177\177\177\353"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\177"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\177"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\177"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\365\334\365\377\377\377\377\377\377\377\377\377\177x\264}x\377\377\377\377\377\377\377\377\377\365\377\377\377d\377\377\377\377\377\377\377\377\377\377\377\377\377n\374\374\377\377\377\377\377\377\377\377\377\377\377x\377\377\377\377\377\377\377\377\377\377\200"
	.string	"-\177\377\377\377\377\377\377\377\377\377\372\024\360\036\374\377\377\377\377\377\377\377\377\377\372\017\017\353\315\207\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\2262\377\377\277\177\036\377\377\377\377\377\377\377x"
	.string	"\377\353\177"
	.string	"\353\377\377\377\377\377\377\377q"
	.string	"((\346"
	.string	"\353\377\377\377\377\377\377\377\257\226\177\177\353"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\177"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\177"
	.string	"\353\377\377\377\377\377\377\377\377\377\377\377\177"
	.ascii	"\353\377\377\377\377\377\377\377\377\377\377\377\377-\377\377"
	.ascii	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
	.ascii	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
	.ascii	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
	.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 <iostream>
#include <cmath>
#include <cstdlib>
#include <climits>

#include <hip/hip_runtime.h>

using namespace std;

#define SIZE 14*14
#define X_SIZE 14

#define NUM_EXAMPLES 3
#define BLOCK_SIZE 3

//Function prototype
//int SAT(int, int, int, int, int);

//Global variable
//Create big ass array for test char
	unsigned char image[3*SIZE] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 191, 127, 255, 255, 191, 127, 20 , 255, 255, 255,
					 		       255, 255, 255, 255, 127, 0  , 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 127, 0  , 40 , 40 , 230, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 175, 127, 127, 127, 235, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 245, 220, 245, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 127, 120, 180, 125, 120, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 245, 255, 255, 255, 100, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 110, 252, 252, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 120, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 128, 0  , 45 , 127, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 250, 20 , 240, 30 , 252, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 250, 15 , 15 , 235, 205, 135, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		 	   255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 150, 50 , 255, 255, 191, 127, 30 , 255, 255, 255,
					 		       255, 255, 255, 255, 120, 0  , 255, 235, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 113, 0  , 40 , 40 , 230, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 175, 150, 127, 127, 235, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 127, 0  , 235, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 45 , 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
					 		       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};

//Define constant memory for device image
__constant__ unsigned char _image[3*SIZE];
__constant__ int _label[NUM_EXAMPLES];

//Function SAT
__device__ int SAT(int x1, int y1, int x2, int y2, int img)
{
	unsigned int area = 0;
	for(int j = y1; j <= y2; j++)
	{
		for(int i = x1; i <= x2; i++)
		{
			area += _image[img*SIZE + j*X_SIZE + i];
		}
	}
	return area;
}

__global__ void compute(int *error, int x, int y, int w, int h, int theta, int f, int comp)
{
	int i = blockDim.x*blockIdx.x + threadIdx.x;

	//Compute features and classify with them
	f = SAT(x, y, x+w-1, y+h-1, i) - SAT(x+w, y, x+2*w-1, y+h-1, i);
	comp = abs(f - 255*w*h);
	if(comp < theta)
	{
		if(_label[i] == 0)
		{
			//printf("label[%i] == 0\n", i);
			atomicAdd(error, 1);
		}
	}
	else
	{
		if(_label[i] == 1)
		{
			//printf("label[%i] == 1\n", i);
			atomicAdd(error, 1);
		}
	}

	__syncthreads();
	//printf("error: %i\n", error[0]);
}

int main(int argc, char*argv[])
{
	int label[3];
	label[0] = atoi(argv[1]);
	label[1] = atoi(argv[2]);
	label[2] = atoi(argv[3]);

	int hi = atoi(argv[4]);

	int i = 0;

	int theta = 0;
	int min_theta = 0;

	int e[1] = {0};
	int min_e = INT_MAX;

	int f = 0;
	int comp = 0;

	//CUDA stuffs
	dim3 dimGrid(ceil(NUM_EXAMPLES/BLOCK_SIZE), 1, 1);
	dim3 dimBlock(BLOCK_SIZE, 1, 1);
	unsigned char* dev_in;
	unsigned char* dev_out;
	int* dev_e = (int*)malloc(sizeof(int));

	int size = 3*SIZE*sizeof(unsigned char);

	hipError_t error[3];
	error[0] = hipMalloc((void**) &dev_in, size);
	error[1] = hipMalloc((void**) &dev_out, size);
	error[2] = hipMalloc((void**) &dev_e, sizeof(int));
	cout << "hipMalloc dev_in error: " << hipGetErrorString(error[0]) << endl;
	cout << "hipMalloc dev_out error: " << hipGetErrorString(error[1]) << endl;
	cout << "hipMalloc dev_e error: " << hipGetErrorString(error[2]) << endl;

	//error[0] = cudaMemcpy(dev_e, e, sizeof(int), cudaMemcpyHostToDevice);
	error[1] = hipMemcpyToSymbol(HIP_SYMBOL(_image), image, size);
	error[2] = hipMemcpyToSymbol(HIP_SYMBOL(_label), label, 3*sizeof(int));
	//cout << "cudaMemcpy error: " << cudaGetErrorString(error[0]) << endl;
	cout << "hipMemcpyToSymbol image error: " << hipGetErrorString(error[1]) << endl;
	cout << "hipMemcpyToSymbol label error: " << hipGetErrorString(error[2]) << endl;
	//END CUDA stuffs
		
	for(int x = 0; x < 14; x++)
	{
		for(int y = 0; y < 14; y++)
		{
			for(int h = 1; h <= 15 - y; h++)
			{
				for(int w = 1; w <= (15 - x)/2; w++)
				{
					theta = hi;
					i++;

					while(theta > 0)
					{
						e[0] = 0;
						error[0] = hipMemcpy(dev_e, e, sizeof(int), hipMemcpyHostToDevice);
						//cout << "cudaMemcpy error: " << cudaGetErrorString(error[0]) << endl;

						//Call the cuda kernel
						compute<<<dimGrid, dimBlock>>>(dev_e, x, y, w, h, theta, f, comp);
						hipDeviceSynchronize();
						error[0] = hipMemcpy(e, dev_e, sizeof(int), hipMemcpyDeviceToHost);
						//cout << "cudaMemcpy error: " << cudaGetErrorString(error[0]) << endl;

						//Keep track of current best theta value
						if(e[0] <= min_e)
						{
							min_e = e[0];
							min_theta = theta;
						}
							
						//Compute new threshold bounds based on number of misclassifications
						theta--;

						/*//Display classification info
						cout << "\tNumber misclassified:" << endl;
						cout << "\t---------------------" << endl;
						cout << "\te: " << e[0] << endl;
				
						cout << "\tNew theta bounds:" << endl;
						cout << "\t-----------------" << endl;
						cout << "\ttheta: " << theta << endl << endl;*/
					}

					cout << "==========================" << endl;
					cout << "feature(" << x << ", " << y << ", " << w << ", " << h << ")" << endl;
					cout << "Best theta classifier: " << min_theta << endl;
					cout << "Number misclassified:  " << min_e << endl;
					cout << "==========================" << endl << endl;
				}
			}
		}
	}

	cout << "Total number of features: " << i << endl;
	cout << "Memory size for array to hold feature values: " << i*sizeof(int) << " B" << endl << endl;

	return 0;
}
	.text
	.file	"weak_classifier.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z22__device_stub__computePiiiiiiii # -- Begin function _Z22__device_stub__computePiiiiiiii
	.type	_Z22__device_stub__computePiiiiiiii,@function
_Z22__device_stub__computePiiiiiiii:    # @_Z22__device_stub__computePiiiiiiii
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.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	20(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	16(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	12(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	8(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	4(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	192(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	200(%rsp), %rax
	movq	%rax, 56(%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	$_Z7computePiiiiiiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z22__device_stub__computePiiiiiiii, .Lfunc_end0-_Z22__device_stub__computePiiiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function 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	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, 60(%rsp)
	movq	16(%rbx), %rdi
	callq	atoi
	movl	%eax, 64(%rsp)
	movq	24(%rbx), %rdi
	callq	atoi
	movl	%eax, 68(%rsp)
	movq	32(%rbx), %rdi
	callq	atoi
	movl	%eax, 56(%rsp)                  # 4-byte Spill
	movl	$0, 20(%rsp)
	movl	$4, %edi
	callq	malloc
	leaq	32(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	80(%rsp), %rdi
	movl	$588, %esi                      # imm = 0x24C
	callq	hipMalloc
	movl	%eax, %r14d
	leaq	72(%rsp), %rdi
	movl	$588, %esi                      # imm = 0x24C
	callq	hipMalloc
	movl	%eax, %ebp
	movl	$4, %esi
	movq	%rbx, %rdi
	callq	hipMalloc
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%r14d, %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB1_1
# %bb.2:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB1_3
.LBB1_1:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB1_3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebp, %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB1_4
# %bb.5:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB1_6
.LBB1_4:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB1_6:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit68
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebx, %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB1_7
# %bb.8:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB1_9
.LBB1_7:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB1_9:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit70
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_image, %edi
	movl	$image, %esi
	movl	$588, %edx                      # imm = 0x24C
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	%eax, %ebp
	leaq	60(%rsp), %rsi
	movl	$_label, %edi
	movl	$12, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$31, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebp, %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB1_10
# %bb.11:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB1_12
.LBB1_10:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB1_12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit72
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$31, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebx, %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB1_13
# %bb.14:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB1_15
.LBB1_13:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB1_15:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit74
	movabsq	$4294967297, %r14               # imm = 0x100000001
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$2147483647, %r15d              # imm = 0x7FFFFFFF
	leaq	20(%rsp), %r12
	xorl	%ebp, %ebp
	xorl	%r13d, %r13d
	xorl	%eax, %eax
.LBB1_16:                               # %.preheader78
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_17 Depth 2
                                        #       Child Loop BB1_19 Depth 3
                                        #         Child Loop BB1_21 Depth 4
                                        #           Child Loop BB1_23 Depth 5
	movl	%eax, %ecx
	shrl	%ecx
	xorl	$7, %ecx
	movl	%ecx, 8(%rsp)                   # 4-byte Spill
	xorl	%ecx, %ecx
	movl	%eax, 12(%rsp)                  # 4-byte Spill
.LBB1_17:                               # %.preheader77
                                        #   Parent Loop BB1_16 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB1_19 Depth 3
                                        #         Child Loop BB1_21 Depth 4
                                        #           Child Loop BB1_23 Depth 5
	movl	%ecx, %edx
	xorl	$15, %edx
	je	.LBB1_29
# %bb.18:                               # %.preheader.preheader
                                        #   in Loop: Header=BB1_17 Depth=2
	movl	%ecx, 16(%rsp)                  # 4-byte Spill
	movl	%ebp, 48(%rsp)                  # 4-byte Spill
	movl	8(%rsp), %eax                   # 4-byte Reload
	imull	%edx, %eax
	movl	%eax, 44(%rsp)                  # 4-byte Spill
	movl	$1, %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movl	%edx, 52(%rsp)                  # 4-byte Spill
.LBB1_19:                               # %.preheader
                                        #   Parent Loop BB1_16 Depth=1
                                        #     Parent Loop BB1_17 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB1_21 Depth 4
                                        #           Child Loop BB1_23 Depth 5
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	je	.LBB1_27
# %bb.20:                               # %.lr.ph88.preheader
                                        #   in Loop: Header=BB1_19 Depth=3
	movl	$1, %ebx
.LBB1_21:                               # %.lr.ph88
                                        #   Parent Loop BB1_16 Depth=1
                                        #     Parent Loop BB1_17 Depth=2
                                        #       Parent Loop BB1_19 Depth=3
                                        # =>      This Loop Header: Depth=4
                                        #           Child Loop BB1_23 Depth 5
	movl	56(%rsp), %eax                  # 4-byte Reload
	testl	%eax, %eax
	jle	.LBB1_26
# %bb.22:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_21 Depth=4
	movl	%eax, %ebp
.LBB1_23:                               # %.lr.ph
                                        #   Parent Loop BB1_16 Depth=1
                                        #     Parent Loop BB1_17 Depth=2
                                        #       Parent Loop BB1_19 Depth=3
                                        #         Parent Loop BB1_21 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movl	$0, 20(%rsp)
	movq	32(%rsp), %rdi
	movl	$4, %edx
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	2(%r14), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_25
# %bb.24:                               #   in Loop: Header=BB1_23 Depth=5
	movq	32(%rsp), %rdi
	movl	12(%rsp), %esi                  # 4-byte Reload
	movl	16(%rsp), %edx                  # 4-byte Reload
	movl	%ebx, %ecx
	movq	24(%rsp), %r8                   # 8-byte Reload
                                        # kill: def $r8d killed $r8d killed $r8
	movl	%ebp, %r9d
	xorl	%eax, %eax
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	callq	_Z22__device_stub__computePiiiiiiii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB1_25:                               #   in Loop: Header=BB1_23 Depth=5
	callq	hipDeviceSynchronize
	movq	32(%rsp), %rsi
	movl	$4, %edx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	20(%rsp), %eax
	cmpl	%r15d, %eax
	cmovll	%eax, %r15d
	cmovlel	%ebp, %r13d
	leal	-1(%rbp), %eax
	cmpl	$1, %ebp
	movl	%eax, %ebp
	jg	.LBB1_23
.LBB1_26:                               # %._crit_edge
                                        #   in Loop: Header=BB1_21 Depth=4
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	12(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
	movq	%rax, %rbp
	movl	$.L.str.7, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbp, %rdi
	movl	16(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
	movq	%rax, %rbp
	movl	$.L.str.7, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbp, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbp
	movl	$.L.str.7, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbp, %rdi
	movq	24(%rsp), %rsi                  # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	callq	_ZNSolsEi
	movq	%rax, %rbp
	movl	$.L.str.8, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbp), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r13d, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbp
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbp
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rax, %rbp
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leal	1(%rbx), %eax
	cmpl	8(%rsp), %ebx                   # 4-byte Folded Reload
	movl	%eax, %ebx
	jne	.LBB1_21
.LBB1_27:                               # %._crit_edge89
                                        #   in Loop: Header=BB1_19 Depth=3
	movq	24(%rsp), %rcx                  # 8-byte Reload
	leal	1(%rcx), %eax
	movl	52(%rsp), %edx                  # 4-byte Reload
	cmpl	%edx, %ecx
                                        # kill: def $eax killed $eax def $rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	jne	.LBB1_19
# %bb.28:                               # %._crit_edge98.loopexit
                                        #   in Loop: Header=BB1_17 Depth=2
	movl	48(%rsp), %ebp                  # 4-byte Reload
	addl	44(%rsp), %ebp                  # 4-byte Folded Reload
	movl	12(%rsp), %eax                  # 4-byte Reload
	movl	16(%rsp), %ecx                  # 4-byte Reload
.LBB1_29:                               # %._crit_edge98
                                        #   in Loop: Header=BB1_17 Depth=2
	incl	%ecx
	cmpl	$14, %ecx
	jne	.LBB1_17
# %bb.30:                               #   in Loop: Header=BB1_16 Depth=1
	incl	%eax
	cmpl	$14, %eax
	jne	.LBB1_16
# %bb.31:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$46, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movslq	%ebp, %rsi
	shlq	$2, %rsi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.13, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%eax, %eax
	addq	$88, %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_end1:
	.size	main, .Lfunc_end1-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
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB2_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB2_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7computePiiiiiiii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$_image, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$588, %r9d                      # imm = 0x24C
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$_label, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$12, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end2:
	.size	__hip_module_ctor, .Lfunc_end2-__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	.LBB3_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
.LBB3_2:
	retq
.Lfunc_end3:
	.size	__hip_module_dtor, .Lfunc_end3-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	image,@object                   # @image
	.data
	.globl	image
	.p2align	4, 0x0
image:
	.ascii	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\277\177\377\377\277\177\024\377\377\377\377\377\377\377\177\000\377\377\177\000\353\377\377\377\377\377\377\377\177\000((\346\000\353\377\377\377\377\377\377\377\257\177\177\177\353\000\353\377\377\377\377\377\377\377\377\377\377\377\177\000\353\377\377\377\377\377\377\377\377\377\377\377\177\000\353\377\377\377\377\377\377\377\377\377\377\377\177\000\353\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\365\334\365\377\377\377\377\377\377\377\377\377\177x\264}x\377\377\377\377\377\377\377\377\377\365\377\377\377d\377\377\377\377\377\377\377\377\377\377\377\377\377n\374\374\377\377\377\377\377\377\377\377\377\377\377x\377\377\377\377\377\377\377\377\377\377\200\000-\177\377\377\377\377\377\377\377\377\377\372\024\360\036\374\377\377\377\377\377\377\377\377\377\372\017\017\353\315\207\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\2262\377\377\277\177\036\377\377\377\377\377\377\377x\000\377\353\177\000\353\377\377\377\377\377\377\377q\000((\346\000\353\377\377\377\377\377\377\377\257\226\177\177\353\000\353\377\377\377\377\377\377\377\377\377\377\377\177\000\353\377\377\377\377\377\377\377\377\377\377\377\177\000\353\377\377\377\377\377\377\377\377\377\377\377\177\000\353\377\377\377\377\377\377\377\377\377\377\377\377-\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
	.size	image, 588

	.type	_image,@object                  # @_image
	.local	_image
	.comm	_image,588,16
	.type	_label,@object                  # @_label
	.local	_label
	.comm	_label,12,4
	.type	_Z7computePiiiiiiii,@object     # @_Z7computePiiiiiiii
	.section	.rodata,"a",@progbits
	.globl	_Z7computePiiiiiiii
	.p2align	3, 0x0
_Z7computePiiiiiiii:
	.quad	_Z22__device_stub__computePiiiiiiii
	.size	_Z7computePiiiiiiii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"hipMalloc dev_in error: "
	.size	.L.str, 25

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"hipMalloc dev_out error: "
	.size	.L.str.1, 26

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"hipMalloc dev_e error: "
	.size	.L.str.2, 24

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"hipMemcpyToSymbol image error: "
	.size	.L.str.3, 32

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"hipMemcpyToSymbol label error: "
	.size	.L.str.4, 32

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"=========================="
	.size	.L.str.5, 27

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"feature("
	.size	.L.str.6, 9

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

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

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Best theta classifier: "
	.size	.L.str.9, 24

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Number misclassified:  "
	.size	.L.str.10, 24

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Total number of features: "
	.size	.L.str.11, 27

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Memory size for array to hold feature values: "
	.size	.L.str.12, 47

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7computePiiiiiiii"
	.size	.L__unnamed_1, 20

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_image"
	.size	.L__unnamed_2, 7

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_label"
	.size	.L__unnamed_3, 7

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z22__device_stub__computePiiiiiiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym image
	.addrsig_sym _image
	.addrsig_sym _label
	.addrsig_sym _Z7computePiiiiiiii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7computePiiiiiiii     ; -- Begin function _Z7computePiiiiiiii
	.globl	_Z7computePiiiiiiii
	.p2align	8
	.type	_Z7computePiiiiiiii,@function
_Z7computePiiiiiiii:                    ; @_Z7computePiiiiiiii
; %bb.0:
	s_clause 0x2
	s_load_b32 s3, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x8
	s_load_b32 s2, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_add_i32 s9, s6, s4
	v_mad_u64_u32 v[1:2], null, s15, s3, v[0:1]
	s_add_i32 s8, s5, s7
	s_add_i32 s3, s9, -1
	s_add_i32 s8, s8, -1
	v_mov_b32_e32 v0, 0
	s_cmp_gt_i32 s7, 0
	s_mul_i32 s10, s5, 14
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_lo_u32 v4, 0xc4, v1
	s_cselect_b32 s11, -1, 0
	s_cmp_lt_i32 s7, 1
	s_cbranch_scc1 .LBB0_7
; %bb.1:                                ; %.preheader.lr.ph.i
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v5, s10, s4, v4
	v_mov_b32_e32 v0, 0
	s_cmp_gt_i32 s6, 0
	s_mov_b32 s14, s5
	s_cselect_b32 s12, -1, 0
	s_add_i32 s13, s4, -1
	s_getpc_b64 s[16:17]
	s_add_u32 s16, s16, _image@rel32@lo+4
	s_addc_u32 s17, s17, _image@rel32@hi+12
.LBB0_2:                                ; %.preheader.i
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	s_and_not1_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccnz .LBB0_5
; %bb.3:                                ; %.lr.ph.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_ashrrev_i32_e32 v3, 31, v5
	v_add_co_u32 v2, vcc_lo, v5, s16
	s_mov_b32 s15, s13
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s17, v3, vcc_lo
.LBB0_4:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_u8 v6, v[2:3], off
	v_add_co_u32 v2, vcc_lo, v2, 1
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_add_i32 s15, s15, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_ge_i32 s15, s3
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v0, v0, v6
	s_cbranch_scc0 .LBB0_4
.LBB0_5:                                ; %._crit_edge.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v5, 14, v5
	s_add_i32 s15, s14, 1
	s_cmp_ge_i32 s14, s8
	s_cbranch_scc1 .LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s14, s15
	s_branch .LBB0_2
.LBB0_7:                                ; %_Z3SATiiiii.exit
	s_and_not1_b32 vcc_lo, exec_lo, s11
	s_cbranch_vccnz .LBB0_14
; %bb.8:                                ; %.preheader.lr.ph.i26
	s_lshl_b32 s11, s6, 1
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v5, s10, s9, v4
	s_add_i32 s4, s4, s11
	v_mov_b32_e32 v4, 0
	s_add_i32 s4, s4, -1
	s_cmp_gt_i32 s11, s6
	s_cselect_b32 s9, -1, 0
.LBB0_9:                                ; %.preheader.i28
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccnz .LBB0_12
; %bb.10:                               ; %.lr.ph.i31
                                        ;   in Loop: Header=BB0_9 Depth=1
	v_ashrrev_i32_e32 v3, 31, v5
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, _image@rel32@lo+4
	s_addc_u32 s11, s11, _image@rel32@hi+12
	v_add_co_u32 v2, vcc_lo, v5, s10
	s_mov_b32 s10, s3
	v_add_co_ci_u32_e32 v3, vcc_lo, s11, v3, vcc_lo
.LBB0_11:                               ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_u8 v6, v[2:3], off
	v_add_co_u32 v2, vcc_lo, v2, 1
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_add_i32 s10, s10, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_ge_i32 s10, s4
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v4, v4, v6
	s_cbranch_scc0 .LBB0_11
.LBB0_12:                               ; %._crit_edge.i35
                                        ;   in Loop: Header=BB0_9 Depth=1
	v_add_nc_u32_e32 v5, 14, v5
	s_add_i32 s10, s5, 1
	s_cmp_ge_i32 s5, s8
	s_cbranch_scc1 .LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	s_mov_b32 s5, s10
	s_branch .LBB0_9
.LBB0_14:
	v_mov_b32_e32 v4, 0
.LBB0_15:                               ; %_Z3SATiiiii.exit39
	v_ashrrev_i32_e32 v2, 31, v1
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, _label@rel32@lo+4
	s_addc_u32 s5, s5, _label@rel32@hi+12
	s_mul_i32 s3, s6, s7
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, v1, s4
	v_add_co_ci_u32_e32 v2, vcc_lo, s5, v2, vcc_lo
	global_load_b32 v1, v[1:2], off
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[2:3], null, 0xffffff01, s3, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v2, v4
	v_sub_nc_u32_e32 v2, 0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_i32_e32 v0, v0, v2
	v_cmp_le_i32_e32 vcc_lo, s2, v0
	s_mov_b32 s2, 0
	s_and_saveexec_b32 s3, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s3, exec_lo, s3
; %bb.16:
	v_cmp_eq_u32_e32 vcc_lo, 1, v1
                                        ; implicit-def: $vgpr1
	s_and_b32 s2, vcc_lo, exec_lo
; %bb.17:                               ; %Flow74
	s_and_not1_saveexec_b32 s3, s3
; %bb.18:
	v_cmp_eq_u32_e32 vcc_lo, 0, 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.19:                               ; %Flow75
	s_or_b32 exec_lo, exec_lo, s3
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_22
; %bb.20:                               ; %.sink.split
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v0, s2, 0
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_and_b32 s4, exec_lo, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mov_b32 exec_lo, s4
	s_cbranch_execz .LBB0_22
; %bb.21:
	s_load_b64 s[0:1], s[0:1], 0x0
	s_bcnt1_i32_b32 s2, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s2
	s_waitcnt lgkmcnt(0)
	global_atomic_add_u32 v0, v1, s[0:1]
.LBB0_22:
	s_or_b32 exec_lo, exec_lo, s3
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7computePiiiiiiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 18
		.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	_Z7computePiiiiiiii, .Lfunc_end0-_Z7computePiiiiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 680
; NumSgprs: 20
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 20
; 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	_image                  ; @_image
	.type	_image,@object
	.section	.bss,"aw",@nobits
	.globl	_image
	.p2align	4, 0x0
_image:
	.zero	588
	.size	_image, 588

	.protected	_label                  ; @_label
	.type	_label,@object
	.globl	_label
	.p2align	2, 0x0
_label:
	.zero	12
	.size	_label, 12

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _image
	.addrsig_sym _label
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7computePiiiiiiii
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z7computePiiiiiiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
