#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <cstring>
#include <iostream>

#define checkCudaErrors(err) __checkCudaErrors (err, __FILE__, __LINE__)

inline void __checkCudaErrors(cudaError err, const char* file, const int line)
{
	if (cudaSuccess != err)
	{
		std::cerr << file << "(" << line << ") : CUDA Runtime API error " << err << ": " << cudaGetErrorString(err) << ".\n";
		exit(EXIT_FAILURE);
	}
}

__global__ void kernel(cudaTextureObject_t tex, int width, int height, unsigned char* outputData)
{
	unsigned int x = blockIdx.x * blockDim.x + threadIdx.x;
	unsigned int y = blockIdx.y * blockDim.y + threadIdx.y;

	if (x >= width || y >= height)
	{
		return;
	}

	outputData[y * width * 3 + 3 * x] = tex2D<unsigned char>(tex, 3 * x, y);
	outputData[y * width * 3 + 3 * x + 1] = tex2D<unsigned char>(tex, 3 * x + 1, y);
	outputData[y * width * 3 + 3 * x + 2] = tex2D<unsigned char>(tex, 3 * x + 2, y);
}

extern "C" void process(unsigned char* inBuffer, int width, int height, int channels, unsigned char** outBuffer, int &stride)
{
	size_t inputStride = sizeof(unsigned char) * width * channels;

	unsigned char* devImageIn = nullptr;
	size_t inPitch;
	cudaError_t err = cudaMallocPitch(&devImageIn, &inPitch, inputStride, height);
	err = cudaMemcpy2D(devImageIn, inPitch, inBuffer, inputStride, inputStride, height, cudaMemcpyHostToDevice);
	checkCudaErrors(err);

	unsigned char* devImageOut = nullptr;
	size_t outPitch;
	err = cudaMallocPitch(&devImageOut, &outPitch, inputStride, height);
	checkCudaErrors(err);

	cudaChannelFormatDesc desc = cudaCreateChannelDesc<unsigned char>();
	cudaResourceDesc texRes;
	memset(&texRes, 0, sizeof(cudaResourceDesc));

	texRes.resType = cudaResourceTypePitch2D;
	texRes.res.pitch2D.devPtr = devImageIn;
	texRes.res.pitch2D.desc = desc;
	texRes.res.pitch2D.width = static_cast<size_t>(width) * channels;
	texRes.res.pitch2D.height = height;
	texRes.res.pitch2D.pitchInBytes = inPitch;
	cudaTextureDesc texDescr;
	memset(&texDescr, 0, sizeof(cudaTextureDesc));

	texDescr.normalizedCoords = false;
	texDescr.filterMode = cudaFilterModePoint;
	texDescr.addressMode[0] = cudaAddressModeWrap;
	texDescr.addressMode[1] = cudaAddressModeWrap;
	texDescr.readMode = cudaReadModeElementType;

	cudaTextureObject_t texture;
	err = cudaCreateTextureObject(&texture, &texRes, &texDescr, NULL);
	checkCudaErrors(err);

	dim3 blockSize(16, 16);
	dim3 gridSize(width + blockSize.x / blockSize.x, height + blockSize.y/ blockSize.y);
	
	kernel<<<gridSize, blockSize>>>(texture, width, height, devImageOut);
	stride = static_cast<int>(outPitch);
	*outBuffer = new unsigned char[stride * height];
	for (int i = 0; i < stride * height; i += 3)
	{
		(*outBuffer)[i] = 255;
		(*outBuffer)[i+1] = 0;
		(*outBuffer)[i+2] = 0;
	}
	err = cudaMemcpy2D(*outBuffer, inPitch, devImageOut, inputStride, inputStride, height, cudaMemcpyDeviceToHost);
	checkCudaErrors(err);

	cudaDestroyTextureObject(texture);
	cudaFree(devImageIn);
	cudaFree(&inPitch);
	cudaFree(&outPitch);
}

	.file	"tmpxft_002612a7_00000000-6_ImProc.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3639:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3639:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata._Z17__checkCudaErrors9cudaErrorPKci.str1.1,"aMS",@progbits,1
.LC0:
	.string	"("
.LC1:
	.string	") : CUDA Runtime API error "
.LC2:
	.string	": "
.LC3:
	.string	".\n"
	.section	.text._Z17__checkCudaErrors9cudaErrorPKci,"axG",@progbits,_Z17__checkCudaErrors9cudaErrorPKci,comdat
	.weak	_Z17__checkCudaErrors9cudaErrorPKci
	.type	_Z17__checkCudaErrors9cudaErrorPKci, @function
_Z17__checkCudaErrors9cudaErrorPKci:
.LFB3635:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	leaq	_ZSt4cerr(%rip), %rdi
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE3635:
	.size	_Z17__checkCudaErrors9cudaErrorPKci, .-_Z17__checkCudaErrors9cudaErrorPKci
	.text
	.globl	_Z28__device_stub__Z6kernelyiiPhyiiPh
	.type	_Z28__device_stub__Z6kernelyiiPhyiiPh, @function
_Z28__device_stub__Z6kernelyiiPhyiiPh:
.LFB3661:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%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	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	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	.L8
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z6kernelyiiPh(%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
.L8:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3661:
	.size	_Z28__device_stub__Z6kernelyiiPhyiiPh, .-_Z28__device_stub__Z6kernelyiiPhyiiPh
	.globl	_Z6kernelyiiPh
	.type	_Z6kernelyiiPh, @function
_Z6kernelyiiPh:
.LFB3662:
	.cfi_startproc
	endbr64
	jmp	_Z28__device_stub__Z6kernelyiiPhyiiPh
	.cfi_endproc
.LFE3662:
	.size	_Z6kernelyiiPh, .-_Z6kernelyiiPh
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/shedding-reptile/ImProc/master/ImProc.cu"
	.text
	.globl	process
	.type	process, @function
process:
.LFB3636:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%ecx, %rcx
	movq	%r9, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r8, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%esi, %rbx
	xorl	%esi, %esi
	movq	%rbx, %r13
	imulq	%rcx, %rbx
	movslq	%edx, %rcx
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%fs:40, %rax
	movq	%rax, 264(%rsp)
	xorl	%eax, %eax
	movslq	%edx, %rax
	leaq	40(%rsp), %rdi
	movq	%rsi, 40(%rsp)
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movq	%rbx, %rdx
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMallocPitch@PLT
	movq	%rbx, %rcx
	movq	%r14, %rdx
	movslq	%ebp, %r9
	pushq	%rdi
	.cfi_def_cfa_offset 344
	movq	%rbx, %r8
	leaq	.LC4(%rip), %r14
	pushq	$1
	.cfi_def_cfa_offset 352
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	cudaMemcpy2D@PLT
	popq	%r8
	.cfi_def_cfa_offset 344
	movl	$40, %edx
	popq	%r9
	.cfi_def_cfa_offset 336
	movl	%eax, %edi
	movq	%r14, %rsi
	call	_Z17__checkCudaErrors9cudaErrorPKci
	leaq	64(%rsp), %rax
	xorl	%r10d, %r10d
	movslq	%ebp, %rcx
	leaq	56(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%rax, %rsi
	movq	%r10, 56(%rsp)
	movq	%rax, 16(%rsp)
	call	cudaMallocPitch@PLT
	movl	$45, %edx
	movq	%r14, %rsi
	movl	%eax, %edi
	call	_Z17__checkCudaErrors9cudaErrorPKci
	xorl	%r8d, %r8d
	movl	$1, %r9d
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	leaq	108(%rsp), %rdi
	movl	$8, %esi
	call	cudaCreateChannelDesc@PLT
	leaq	132(%rsp), %rdx
	xorl	%eax, %eax
	movl	$9, %ecx
	movq	%rdx, %rdi
	movq	40(%rsp), %rdx
	movups	108(%rsp), %xmm0
	leaq	128(%rsp), %rsi
	rep stosl
	movslq	%ebp, %rcx
	movl	$3, 128(%rsp)
	movq	%rdx, 136(%rsp)
	movl	124(%rsp), %edx
	movq	%rcx, 176(%rsp)
	movl	$18, %ecx
	movl	%edx, 160(%rsp)
	movq	48(%rsp), %rdx
	movups	%xmm0, 144(%rsp)
	movq	%rdx, 184(%rsp)
	leaq	192(%rsp), %rdx
	movq	%rdx, %rdi
	movq	%rbx, 168(%rsp)
	rep stosl
	leaq	72(%rsp), %rdi
	call	cudaCreateTextureObject@PLT
	movl	$68, %edx
	movq	%r14, %rsi
	movl	%eax, %edi
	call	_Z17__checkCudaErrors9cudaErrorPKci
	leal	1(%r13), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, 96(%rsp)
	leal	1(%rbp), %eax
	movl	$1, %ecx
	movabsq	$68719476752, %rdx
	movl	%eax, 100(%rsp)
	movq	96(%rsp), %rdi
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	movq	56(%rsp), %rcx
	movq	72(%rsp), %rdi
	movl	%ebp, %edx
	movl	%r13d, %esi
	call	_Z28__device_stub__Z6kernelyiiPhyiiPh
.L14:
	movq	64(%rsp), %rdi
	movl	%edi, (%r15)
	imull	%ebp, %edi
	movslq	%edi, %rdi
	call	_Znam@PLT
	movq	%rax, (%r12)
	xorl	%eax, %eax
.L15:
	movl	(%r15), %edx
	movq	(%r12), %rdi
	imull	%ebp, %edx
	cmpl	%eax, %edx
	jle	.L19
	movb	$-1, (%rdi,%rax)
	movq	(%r12), %rdx
	movb	$0, 1(%rdx,%rax)
	movq	(%r12), %rdx
	movb	$0, 2(%rdx,%rax)
	addq	$3, %rax
	jmp	.L15
.L19:
	pushq	%rax
	.cfi_def_cfa_offset 344
	movq	%rbx, %r8
	movq	%rbx, %rcx
	pushq	$2
	.cfi_def_cfa_offset 352
	movq	40(%rsp), %r9
	movq	64(%rsp), %rsi
	movq	72(%rsp), %rdx
	call	cudaMemcpy2D@PLT
	popq	%rdx
	.cfi_def_cfa_offset 344
	movq	%r14, %rsi
	popq	%rcx
	.cfi_def_cfa_offset 336
	movl	$83, %edx
	movl	%eax, %edi
	call	_Z17__checkCudaErrors9cudaErrorPKci
	movq	72(%rsp), %rdi
	call	cudaDestroyTextureObject@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	264(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$280, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	process, .-process
	.section	.rodata.str1.1
.LC5:
	.string	"_Z6kernelyiiPh"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3664:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC5(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z6kernelyiiPh(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3664:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include "hip/hip_runtime.h"

#include <cstring>
#include <iostream>

#define checkCudaErrors(err) __checkCudaErrors (err, __FILE__, __LINE__)

inline void __checkCudaErrors(hipError_t err, const char* file, const int line)
{
	if (hipSuccess != err)
	{
		std::cerr << file << "(" << line << ") : CUDA Runtime API error " << err << ": " << hipGetErrorString(err) << ".\n";
		exit(EXIT_FAILURE);
	}
}

__global__ void kernel(hipTextureObject_t tex, int width, int height, unsigned char* outputData)
{
	unsigned int x = blockIdx.x * blockDim.x + threadIdx.x;
	unsigned int y = blockIdx.y * blockDim.y + threadIdx.y;

	if (x >= width || y >= height)
	{
		return;
	}

	outputData[y * width * 3 + 3 * x] = tex2D<unsigned char>(tex, 3 * x, y);
	outputData[y * width * 3 + 3 * x + 1] = tex2D<unsigned char>(tex, 3 * x + 1, y);
	outputData[y * width * 3 + 3 * x + 2] = tex2D<unsigned char>(tex, 3 * x + 2, y);
}

extern "C" void process(unsigned char* inBuffer, int width, int height, int channels, unsigned char** outBuffer, int &stride)
{
	size_t inputStride = sizeof(unsigned char) * width * channels;

	unsigned char* devImageIn = nullptr;
	size_t inPitch;
	hipError_t err = hipMallocPitch(&devImageIn, &inPitch, inputStride, height);
	err = hipMemcpy2D(devImageIn, inPitch, inBuffer, inputStride, inputStride, height, hipMemcpyHostToDevice);
	checkCudaErrors(err);

	unsigned char* devImageOut = nullptr;
	size_t outPitch;
	err = hipMallocPitch(&devImageOut, &outPitch, inputStride, height);
	checkCudaErrors(err);

	hipChannelFormatDesc desc = hipCreateChannelDesc<unsigned char>();
	hipResourceDesc texRes;
	memset(&texRes, 0, sizeof(hipResourceDesc));

	texRes.resType = hipResourceTypePitch2D;
	texRes.res.pitch2D.devPtr = devImageIn;
	texRes.res.pitch2D.desc = desc;
	texRes.res.pitch2D.width = static_cast<size_t>(width) * channels;
	texRes.res.pitch2D.height = height;
	texRes.res.pitch2D.pitchInBytes = inPitch;
	hipTextureDesc texDescr;
	memset(&texDescr, 0, sizeof(hipTextureDesc));

	texDescr.normalizedCoords = false;
	texDescr.filterMode = hipFilterModePoint;
	texDescr.addressMode[0] = hipAddressModeWrap;
	texDescr.addressMode[1] = hipAddressModeWrap;
	texDescr.readMode = hipReadModeElementType;

	hipTextureObject_t texture;
	err = hipCreateTextureObject(&texture, &texRes, &texDescr, NULL);
	checkCudaErrors(err);

	dim3 blockSize(16, 16);
	dim3 gridSize(width + blockSize.x / blockSize.x, height + blockSize.y/ blockSize.y);
	
	kernel<<<gridSize, blockSize>>>(texture, width, height, devImageOut);
	stride = static_cast<int>(outPitch);
	*outBuffer = new unsigned char[stride * height];
	for (int i = 0; i < stride * height; i += 3)
	{
		(*outBuffer)[i] = 255;
		(*outBuffer)[i+1] = 0;
		(*outBuffer)[i+2] = 0;
	}
	err = hipMemcpy2D(*outBuffer, inPitch, devImageOut, inputStride, inputStride, height, hipMemcpyDeviceToHost);
	checkCudaErrors(err);

	hipDestroyTextureObject(texture);
	hipFree(devImageIn);
	hipFree(&inPitch);
	hipFree(&outPitch);
}

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

                                        # End of file scope inline assembly
	.globl	_Z21__device_stub__kernelP13__hip_textureiiPh # -- Begin function _Z21__device_stub__kernelP13__hip_textureiiPh
	.type	_Z21__device_stub__kernelP13__hip_textureiiPh,@function
_Z21__device_stub__kernelP13__hip_textureiiPh: # @_Z21__device_stub__kernelP13__hip_textureiiPh
	.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), %rdi
	movl	%esi, (%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	$_Z6kernelP13__hip_textureiiPh, %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_end0:
	.size	_Z21__device_stub__kernelP13__hip_textureiiPh, .Lfunc_end0-_Z21__device_stub__kernelP13__hip_textureiiPh
	.cfi_endproc
                                        # -- End function
	.globl	process                         # -- Begin function process
	.type	process,@function
process:                                # @process
	.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	$232, %rsp
	.cfi_def_cfa_offset 288
	.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	%r9, %r12
	movq	%r8, %r15
	movl	%edx, 12(%rsp)                  # 4-byte Spill
	movq	%rdi, 56(%rsp)                  # 8-byte Spill
	movl	%esi, 8(%rsp)                   # 4-byte Spill
	movslq	%esi, %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movslq	%ecx, %rbx
	imulq	%rax, %rbx
	xorl	%eax, %eax
	leaq	48(%rsp), %r13
	movq	%rax, (%r13)
	movslq	%edx, %r14
	leaq	40(%rsp), %rbp
	movq	%r13, %rdi
	movq	%rbp, %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	hipMallocPitch
	movq	(%r13), %rdi
	movq	(%rbp), %rsi
	movl	$1, (%rsp)
	movq	56(%rsp), %rdx                  # 8-byte Reload
	movq	%rbx, %rcx
	movq	%rbx, %r8
	movq	%r14, %r9
	callq	hipMemcpy2D
	movl	$.L.str, %esi
	movl	%eax, %edi
	movl	$40, %edx
	callq	_Z17__checkCudaErrors10hipError_tPKci
	leaq	32(%rsp), %rdi
	xorl	%eax, %eax
	movq	%rax, (%rdi)
	xorl	%ebp, %ebp
	leaq	24(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	hipMallocPitch
	movl	$.L.str, %esi
	movl	%eax, %edi
	movl	$45, %edx
	callq	_Z17__checkCudaErrors10hipError_tPKci
	leaq	76(%rsp), %r13
	movq	%r13, %rdi
	movl	$8, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	hipCreateChannelDesc
	xorps	%xmm0, %xmm0
	leaq	160(%rsp), %rsi
	movaps	%xmm0, (%rsi)
	movq	%rbp, 32(%rsi)
	movl	$3, (%rsi)
	leaq	48(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rsi)
	movups	(%r13), %xmm1
	movaps	%xmm1, 16(%rsi)
	movl	16(%r13), %eax
	movl	%eax, 32(%rsi)
	movq	%rbx, 40(%rsi)
	movq	%r14, 48(%rsi)
	leaq	40(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 56(%rsi)
	leaq	96(%rsp), %rdx
	movaps	%xmm0, 48(%rdx)
	movaps	%xmm0, 32(%rdx)
	movaps	%xmm0, 16(%rdx)
	movaps	%xmm0, (%rdx)
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	callq	hipCreateTextureObject
	movl	$.L.str, %esi
	movl	%eax, %edi
	movl	$68, %edx
	callq	_Z17__checkCudaErrors10hipError_tPKci
	movq	64(%rsp), %rax                  # 8-byte Reload
	incl	%eax
	leal	1(%r14), %edi
	shlq	$32, %rdi
	orq	%rax, %rdi
	movl	12(%rsp), %ebp                  # 4-byte Reload
	movabsq	$68719476752, %rdx              # imm = 0x1000000010
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_2
# %bb.1:
	movq	16(%rsp), %rdi
	movq	32(%rsp), %rcx
	movl	8(%rsp), %esi                   # 4-byte Reload
	movl	%ebp, %edx
	callq	_Z21__device_stub__kernelP13__hip_textureiiPh
.LBB1_2:
	movl	24(%rsp), %eax
	movl	%eax, (%r12)
	imull	%eax, %ebp
	movslq	%ebp, %r13
	movq	%r13, %rdi
	callq	_Znam
	movq	%rax, (%r15)
	testl	%r13d, %r13d
	jle	.LBB1_6
# %bb.3:                                # %.lr.ph.preheader
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB1_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdx
	movb	$-1, (%rdx,%rcx)
	movq	(%r15), %rdx
	movb	%al, 1(%rdx,%rcx)
	movq	(%r15), %rdx
	movb	%al, 2(%rdx,%rcx)
	addq	$3, %rcx
	movslq	(%r12), %rdx
	imulq	%r14, %rdx
	cmpq	%rdx, %rcx
	jl	.LBB1_4
# %bb.5:                                # %._crit_edge.loopexit
	movq	(%r15), %rax
.LBB1_6:                                # %._crit_edge
	leaq	40(%rsp), %r15
	movq	(%r15), %rsi
	movq	32(%rsp), %rdx
	movl	$2, (%rsp)
	movq	%rax, %rdi
	movq	%rbx, %rcx
	movq	%rbx, %r8
	movq	%r14, %r9
	callq	hipMemcpy2D
	movl	$.L.str, %esi
	movl	%eax, %edi
	movl	$83, %edx
	callq	_Z17__checkCudaErrors10hipError_tPKci
	movq	16(%rsp), %rdi
	callq	hipDestroyTextureObject
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	%r15, %rdi
	callq	hipFree
	leaq	24(%rsp), %rdi
	callq	hipFree
	addq	$232, %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	process, .Lfunc_end1-process
	.cfi_endproc
                                        # -- End function
	.section	.text._Z17__checkCudaErrors10hipError_tPKci,"axG",@progbits,_Z17__checkCudaErrors10hipError_tPKci,comdat
	.weak	_Z17__checkCudaErrors10hipError_tPKci # -- Begin function _Z17__checkCudaErrors10hipError_tPKci
	.type	_Z17__checkCudaErrors10hipError_tPKci,@function
_Z17__checkCudaErrors10hipError_tPKci:  # @_Z17__checkCudaErrors10hipError_tPKci
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB2_2
# %bb.1:
	retq
.LBB2_2:
	pushq	%rbp
	.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 %rbp, -16
	movl	%edx, %ebp
	movl	%edi, %ebx
	movl	$_ZSt4cerr, %edi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.1, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	hipGetErrorString
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$1, %edi
	callq	exit
.Lfunc_end2:
	.size	_Z17__checkCudaErrors10hipError_tPKci, .Lfunc_end2-_Z17__checkCudaErrors10hipError_tPKci
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z6kernelP13__hip_textureiiPh, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB4_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z6kernelP13__hip_textureiiPh,@object # @_Z6kernelP13__hip_textureiiPh
	.section	.rodata,"a",@progbits
	.globl	_Z6kernelP13__hip_textureiiPh
	.p2align	3, 0x0
_Z6kernelP13__hip_textureiiPh:
	.quad	_Z21__device_stub__kernelP13__hip_textureiiPh
	.size	_Z6kernelP13__hip_textureiiPh, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/shedding-reptile/ImProc/master/ImProc.hip"
	.size	.L.str, 104

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	") : CUDA Runtime API error "
	.size	.L.str.2, 28

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

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z6kernelP13__hip_textureiiPh"
	.size	.L__unnamed_1, 30

	.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 _Z21__device_stub__kernelP13__hip_textureiiPh
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z6kernelP13__hip_textureiiPh
	.addrsig_sym _ZSt4cerr
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z6kernelP13__hip_textureiiPh ; -- Begin function _Z6kernelP13__hip_textureiiPh
	.globl	_Z6kernelP13__hip_textureiiPh
	.p2align	8
	.type	_Z6kernelP13__hip_textureiiPh,@function
_Z6kernelP13__hip_textureiiPh:          ; @_Z6kernelP13__hip_textureiiPh
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[16:17], s[0:1], 0x8
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_u32_e32 vcc_lo, s16, v0
	v_cmp_gt_u32_e64 s2, s17, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_clause 0x1
	s_load_b64 s[2:3], s[0:1], 0x0
	s_load_b64 s[18:19], s[0:1], 0x10
	v_lshl_add_u32 v6, v0, 1, v0
	v_cvt_f32_u32_e32 v2, v1
	s_waitcnt lgkmcnt(0)
	s_clause 0x2
	s_load_b128 s[12:15], s[2:3], 0x30
	s_load_b256 s[4:11], s[2:3], 0x0
	s_load_b32 s1, s[2:3], 0x28
	s_waitcnt lgkmcnt(0)
	s_bitcmp0_b32 s14, 20
	s_cselect_b32 vcc_lo, -1, 0
	s_bitcmp0_b32 s12, 15
	v_cvt_f32_u32_e32 v4, s1
	s_cselect_b32 s0, -1, 0
	s_bfe_u32 s2, s6, 0xe000e
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_add_i32 s2, s2, 1
	v_cndmask_b32_e64 v7, 1.0, v4, s0
	v_cvt_f32_u32_e32 v3, s2
	v_cvt_f32_u32_e32 v4, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v8, v7
	v_cndmask_b32_e64 v3, 1.0, v3, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v9, v7, v4
	v_rcp_f32_e32 v5, v3
	v_mul_f32_e32 v3, v3, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_floor_f32_e32 v9, v9
	v_floor_f32_e32 v3, v3
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v3, v5, v3
	v_mul_f32_e32 v5, v8, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v3, v2, v3 :: v_dual_cndmask_b32 v2, v4, v5
	image_sample_lz v9, v[2:3], s[4:11], s[12:15] dmask:0x1 dim:SQ_RSRC_IMG_2D
	v_add_nc_u32_e32 v2, 1, v6
	v_cvt_f32_u32_e32 v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, v7, v2
	v_floor_f32_e32 v10, v4
	v_mad_u64_u32 v[4:5], null, v1, s16, v[0:1]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v0, v8, v10
	v_lshl_add_u32 v1, v4, 1, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_cndmask_b32 v2, v2, v0 :: v_dual_add_nc_u32 v5, 1, v1
	s_waitcnt vmcnt(0)
	global_store_b8 v1, v9, s[18:19]
	image_sample_lz v0, v[2:3], s[4:11], s[12:15] dmask:0x1 dim:SQ_RSRC_IMG_2D
	v_add_nc_u32_e32 v2, 2, v6
	v_add_nc_u32_e32 v1, 2, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_u32_e32 v2, v2
	v_mul_f32_e32 v4, v7, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_floor_f32_e32 v4, v4
	v_mul_f32_e32 v4, v8, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v2, v4, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b8 v5, v0, s[18:19]
	image_sample_lz v0, v[2:3], s[4:11], s[12:15] dmask:0x1 dim:SQ_RSRC_IMG_2D
	s_waitcnt vmcnt(0)
	global_store_b8 v1, v0, s[18:19]
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z6kernelP13__hip_textureiiPh
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 20
		.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	_Z6kernelP13__hip_textureiiPh, .Lfunc_end0-_Z6kernelP13__hip_textureiiPh
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 460
; NumSgprs: 22
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.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:         12
        .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:           _Z6kernelP13__hip_textureiiPh
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z6kernelP13__hip_textureiiPh.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
