#include <iostream>
#include <cuda_runtime.h>
#include <cooperative_groups.h>
#include <vector>

namespace cg = cooperative_groups;

#define CHECK(call)                                                            \
{                                                                              \
    const cudaError_t error = call;                                            \
    if (error != cudaSuccess)                                                  \
    {                                                                          \
        std::cerr << "Error: " << cudaGetErrorString(error) << " (" << error << ") at " \
                  << __FILE__ << ":" << __LINE__ << std::endl;                   \
        exit(EXIT_FAILURE);                                                    \
    }                                                                          \
}

// Prewitt filter kernels
__constant__ float h_PrewittX[9] = {1, 0, -1, 1, 0, -1, 1, 0, -1};
__constant__ float h_PrewittY[9] = {1, 1, 1, 0, 0, 0, -1, -1, -1};

__global__ void prewittFilterKernel(const float* d_input, float* d_output, int width, int height) {
    cg::thread_block cta = cg::this_thread_block();
    cg::grid_group grid = cg::this_grid();

    // Allocate shared memory
    extern __shared__ float s_input[];

    // Calculate thread index
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    // Calculate shared memory indices
    int s_x = threadIdx.x + 1;
    int s_y = threadIdx.y + 1;

    // Load data into shared memory with halo
    if (x < width && y < height) {
        s_input[s_y * (blockDim.x + 2) + s_x] = d_input[y * width + x];
    } else {
        s_input[s_y * (blockDim.x + 2) + s_x] = 0.0f;
    }

    // Load halo data
    if (threadIdx.y == 0 && y > 0) {
        s_input[s_x] = d_input[(y - 1) * width + x];
    }
    if (threadIdx.y == blockDim.y - 1 && y < height - 1) {
        s_input[(blockDim.y + 1) * (blockDim.x + 2) + s_x] = d_input[(y + 1) * width + x];
    }
    if (threadIdx.x == 0 && x > 0) {
        s_input[s_y * (blockDim.x + 2)] = d_input[y * width + x - 1];
    }
    if (threadIdx.x == blockDim.x - 1 && x < width - 1) {
        s_input[s_y * (blockDim.x + 2) + blockDim.x + 1] = d_input[y * width + x + 1];
    }
    if (threadIdx.x == 0 && threadIdx.y == 0 && x > 0 && y > 0) {
        s_input[0] = d_input[(y - 1) * width + x - 1];
    }
    if (threadIdx.x == blockDim.x - 1 && threadIdx.y == 0 && x < width - 1 && y > 0) {
        s_input[blockDim.x + 1] = d_input[(y - 1) * width + x + 1];
    }
    if (threadIdx.x == 0 && threadIdx.y == blockDim.y - 1 && x > 0 && y < height - 1) {
        s_input[(blockDim.y + 1) * (blockDim.x + 2)] = d_input[(y + 1) * width + x - 1];
    }
    if (threadIdx.x == blockDim.x - 1 && threadIdx.y == blockDim.y - 1 && x < width - 1 && y < height - 1) {
        s_input[(blockDim.y + 2) * (blockDim.x + 2) - 1] = d_input[(y + 1) * width + x + 1];
    }

    // Synchronize to ensure all data is loaded
    cg::sync(cta);

    // Apply Prewitt filter
    float sumX = 0.0f, sumY = 0.0f;
    if (x > 0 && x < width - 1 && y > 0 && y < height - 1) {
        for (int i = -1; i <= 1; ++i) {
            for (int j = -1; j <= 1; ++j) {
                sumX += s_input[(s_y + i) * (blockDim.x + 2) + s_x + j] * h_PrewittX[(i + 1) * 3 + j + 1];
                sumY += s_input[(s_y + i) * (blockDim.x + 2) + s_x + j] * h_PrewittY[(i + 1) * 3 + j + 1];
            }
        }
        d_output[y * width + x] = sqrtf(sumX * sumX + sumY * sumY);
    }

    // Synchronize grid to ensure all threads are done
    cg::sync(grid);
}

int main() {
    int width = 1024, height = 1024;
    size_t size = width * height * sizeof(float);

    // Allocate host memory
    std::vector<float> h_input(width * height, 1.0f);
    std::vector<float> h_output(width * height, 0.0f);

    // Allocate device memory
    float* d_input, *d_output;
    CHECK(cudaMalloc(&d_input, size));
    CHECK(cudaMalloc(&d_output, size));

    // Copy data from host to device
    CHECK(cudaMemcpy(d_input, h_input.data(), size, cudaMemcpyHostToDevice));

    // Set up execution configuration
    dim3 blockSize(16, 16);
    dim3 gridSize((width + blockSize.x - 1) / blockSize.x, (height + blockSize.y - 1) / blockSize.y);

    // Launch kernel
    prewittFilterKernel<<<gridSize, blockSize, (blockSize.x + 2) * (blockSize.y + 2) * sizeof(float)>>>(d_input, d_output, width, height);
    CHECK(cudaGetLastError());

    // Copy result back to host
    CHECK(cudaMemcpy(h_output.data(), d_output, size, cudaMemcpyDeviceToHost));

    // Free device memory
    CHECK(cudaFree(d_input));
    CHECK(cudaFree(d_output));

    std::cout << "Prewitt filter applied successfully." << std::endl;

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB7198:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE7198:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB8153:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE8153:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii
	.type	_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii, @function
_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii:
.LFB7220:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 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	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%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	.L3
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z19prewittFilterKernelPKfPfii(%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
.L3:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE7220:
	.size	_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii, .-_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii
	.globl	_Z19prewittFilterKernelPKfPfii
	.type	_Z19prewittFilterKernelPKfPfii, @function
_Z19prewittFilterKernelPKfPfii:
.LFB7221:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii
	.cfi_endproc
.LFE7221:
	.size	_Z19prewittFilterKernelPKfPfii, .-_Z19prewittFilterKernelPKfPfii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z19prewittFilterKernelPKfPfii"
.LC1:
	.string	"h_PrewittX"
.LC2:
	.string	"h_PrewittY"
.LC3:
	.string	"_ZN50_INTERNAL_3783e4b0_19_cuda_code_017954_cu_8a7e2f964cuda3std3__419piecewise_constructE"
.LC4:
	.string	"_ZN50_INTERNAL_3783e4b0_19_cuda_code_017954_cu_8a7e2f964cuda3std6ranges3__45__cpo4swapE"
.LC5:
	.string	"_ZN50_INTERNAL_3783e4b0_19_cuda_code_017954_cu_8a7e2f964cuda3std6ranges3__45__cpo9iter_moveE"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB7223:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z19prewittFilterKernelPKfPfii(%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	.LC1(%rip), %rdx
	movl	$36, %r9d
	leaq	_ZL10h_PrewittX(%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	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$36, %r9d
	leaq	_ZL10h_PrewittY(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$1, %r9d
	leaq	_ZN4cuda3std3__419piecewise_constructE(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC4(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$1, %r9d
	leaq	_ZN4cuda3std6ranges3__45__cpo4swapE(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$1, %r9d
	movq	%rdx, %rcx
	leaq	_ZN4cuda3std6ranges3__45__cpo9iter_moveE(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rbx
	.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
.LFE7223:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB7672:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L11
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L11:
	ret
	.cfi_endproc
.LFE7672:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.rodata.str1.1
.LC8:
	.string	"Error: "
.LC9:
	.string	" ("
.LC10:
	.string	") at "
.LC11:
	.string	"/home/ubuntu/Datasets/cuda-codes-80k-from-llm-dedup/cuda_code_017954.cu"
.LC12:
	.string	":"
.LC13:
	.string	"Prewitt filter applied successfully."
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB7195:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA7195
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$4194304, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$104, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
.LEHB0:
	call	_Znwm@PLT
.LEHE0:
	movss	.LC6(%rip), %xmm0
	leaq	4194304(%rax), %rdx
	movq	%rax, 40(%rsp)
	movq	%rax, %rbp
	xorl	%eax, %eax
	movq	%rdx, 56(%rsp)
.L14:
	movss	%xmm0, 0(%rbp,%rax)
	addq	$4, %rax
	cmpq	$4194304, %rax
	jne	.L14
	xorl	%eax, %eax
	movl	$4194304, %edi
	movq	%rdx, 48(%rsp)
	movq	%rax, 72(%rsp)
	movq	%rax, 80(%rsp)
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	leaq	4194304(%rax), %rdx
	movq	%rax, 64(%rsp)
	movq	%rax, %rbx
	xorl	%eax, %eax
	movq	%rdx, 80(%rsp)
.L15:
	movl	$0x00000000, (%rbx,%rax)
	addq	$4, %rax
	cmpq	$4194304, %rax
	jne	.L15
	movq	%rsp, %rdi
	movl	$4194304, %esi
	movq	%rdx, 72(%rsp)
	leaq	64(%rsp), %r12
.LEHB2:
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L16
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r13d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$100, %esi
.L46:
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$1, %edi
	call	exit@PLT
.L16:
	leaq	8(%rsp), %rdi
	movl	$4194304, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L17
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r13d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$101, %esi
	jmp	.L46
.L17:
	movq	(%rsp), %rdi
	movl	$1, %ecx
	movl	$4194304, %edx
	movq	%rbp, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L19
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebp, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$104, %esi
	jmp	.L46
.L19:
	xorl	%r9d, %r9d
	movl	$1296, %r8d
	movl	$1, %ecx
	movabsq	$68719476752, %rdx
	movabsq	$274877907008, %rdi
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L20
.L22:
	call	cudaGetLastError@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L23
	jmp	.L52
.L20:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1024, %ecx
	movl	$1024, %edx
	call	_Z44__device_stub__Z19prewittFilterKernelPKfPfiiPKfPfii
	jmp	.L22
.L52:
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebp, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$112, %esi
	jmp	.L46
.L23:
	movq	8(%rsp), %rsi
	movl	$2, %ecx
	movl	$4194304, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L24
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$115, %esi
	jmp	.L46
.L24:
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L25
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$118, %esi
	jmp	.L46
.L25:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L26
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$119, %esi
	jmp	.L46
.L26:
	leaq	.LC13(%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.isra.0
.LEHE2:
	movq	%r12, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	40(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
	jmp	.L36
.L32:
	endbr64
	movq	%rax, %rbx
.L27:
	movq	%r12, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L28
.L31:
	endbr64
	movq	%rax, %rbx
.L28:
	leaq	40(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L36:
	call	__stack_chk_fail@PLT
.L30:
	addq	$104, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE7195:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA7195:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE7195-.LLSDACSB7195
.LLSDACSB7195:
	.uleb128 .LEHB0-.LFB7195
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB7195
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L31-.LFB7195
	.uleb128 0
	.uleb128 .LEHB2-.LFB7195
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L32-.LFB7195
	.uleb128 0
	.uleb128 .LEHB3-.LFB7195
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE7195:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.local	_ZL10h_PrewittY
	.comm	_ZL10h_PrewittY,36,32
	.local	_ZL10h_PrewittX
	.comm	_ZL10h_PrewittX,36,32
	.weak	_ZN4cuda3std3__419piecewise_constructE
	.section	.rodata._ZN4cuda3std3__419piecewise_constructE,"aG",@progbits,_ZN4cuda3std3__419piecewise_constructE,comdat
	.type	_ZN4cuda3std3__419piecewise_constructE, @gnu_unique_object
	.size	_ZN4cuda3std3__419piecewise_constructE, 1
_ZN4cuda3std3__419piecewise_constructE:
	.zero	1
	.weak	_ZN4cuda3std6ranges3__45__cpo9iter_moveE
	.section	.rodata._ZN4cuda3std6ranges3__45__cpo9iter_moveE,"aG",@progbits,_ZN4cuda3std6ranges3__45__cpo9iter_moveE,comdat
	.type	_ZN4cuda3std6ranges3__45__cpo9iter_moveE, @gnu_unique_object
	.size	_ZN4cuda3std6ranges3__45__cpo9iter_moveE, 1
_ZN4cuda3std6ranges3__45__cpo9iter_moveE:
	.zero	1
	.weak	_ZN4cuda3std6ranges3__45__cpo4swapE
	.section	.rodata._ZN4cuda3std6ranges3__45__cpo4swapE,"aG",@progbits,_ZN4cuda3std6ranges3__45__cpo4swapE,comdat
	.type	_ZN4cuda3std6ranges3__45__cpo4swapE, @gnu_unique_object
	.size	_ZN4cuda3std6ranges3__45__cpo4swapE, 1
_ZN4cuda3std6ranges3__45__cpo4swapE:
	.zero	1
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC6:
	.long	1065353216
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <iostream>
#include <hip/hip_runtime.h>
#include <hip/hip_cooperative_groups.h>
#include <vector>

namespace cg = cooperative_groups;

#define CHECK(call)                                                            \
{                                                                              \
    const hipError_t error = call;                                            \
    if (error != hipSuccess)                                                  \
    {                                                                          \
        std::cerr << "Error: " << hipGetErrorString(error) << " (" << error << ") at " \
                  << __FILE__ << ":" << __LINE__ << std::endl;                   \
        exit(EXIT_FAILURE);                                                    \
    }                                                                          \
}

// Prewitt filter kernels
__constant__ float h_PrewittX[9] = {1, 0, -1, 1, 0, -1, 1, 0, -1};
__constant__ float h_PrewittY[9] = {1, 1, 1, 0, 0, 0, -1, -1, -1};

__global__ void prewittFilterKernel(const float* d_input, float* d_output, int width, int height) {
    cg::thread_block cta = cg::this_thread_block();
    cg::grid_group grid = cg::this_grid();

    // Allocate shared memory
    extern __shared__ float s_input[];

    // Calculate thread index
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    // Calculate shared memory indices
    int s_x = threadIdx.x + 1;
    int s_y = threadIdx.y + 1;

    // Load data into shared memory with halo
    if (x < width && y < height) {
        s_input[s_y * (blockDim.x + 2) + s_x] = d_input[y * width + x];
    } else {
        s_input[s_y * (blockDim.x + 2) + s_x] = 0.0f;
    }

    // Load halo data
    if (threadIdx.y == 0 && y > 0) {
        s_input[s_x] = d_input[(y - 1) * width + x];
    }
    if (threadIdx.y == blockDim.y - 1 && y < height - 1) {
        s_input[(blockDim.y + 1) * (blockDim.x + 2) + s_x] = d_input[(y + 1) * width + x];
    }
    if (threadIdx.x == 0 && x > 0) {
        s_input[s_y * (blockDim.x + 2)] = d_input[y * width + x - 1];
    }
    if (threadIdx.x == blockDim.x - 1 && x < width - 1) {
        s_input[s_y * (blockDim.x + 2) + blockDim.x + 1] = d_input[y * width + x + 1];
    }
    if (threadIdx.x == 0 && threadIdx.y == 0 && x > 0 && y > 0) {
        s_input[0] = d_input[(y - 1) * width + x - 1];
    }
    if (threadIdx.x == blockDim.x - 1 && threadIdx.y == 0 && x < width - 1 && y > 0) {
        s_input[blockDim.x + 1] = d_input[(y - 1) * width + x + 1];
    }
    if (threadIdx.x == 0 && threadIdx.y == blockDim.y - 1 && x > 0 && y < height - 1) {
        s_input[(blockDim.y + 1) * (blockDim.x + 2)] = d_input[(y + 1) * width + x - 1];
    }
    if (threadIdx.x == blockDim.x - 1 && threadIdx.y == blockDim.y - 1 && x < width - 1 && y < height - 1) {
        s_input[(blockDim.y + 2) * (blockDim.x + 2) - 1] = d_input[(y + 1) * width + x + 1];
    }

    // Synchronize to ensure all data is loaded
    cg::sync(cta);

    // Apply Prewitt filter
    float sumX = 0.0f, sumY = 0.0f;
    if (x > 0 && x < width - 1 && y > 0 && y < height - 1) {
        for (int i = -1; i <= 1; ++i) {
            for (int j = -1; j <= 1; ++j) {
                sumX += s_input[(s_y + i) * (blockDim.x + 2) + s_x + j] * h_PrewittX[(i + 1) * 3 + j + 1];
                sumY += s_input[(s_y + i) * (blockDim.x + 2) + s_x + j] * h_PrewittY[(i + 1) * 3 + j + 1];
            }
        }
        d_output[y * width + x] = sqrtf(sumX * sumX + sumY * sumY);
    }

    // Synchronize grid to ensure all threads are done
    cg::sync(grid);
}

int main() {
    int width = 1024, height = 1024;
    size_t size = width * height * sizeof(float);

    // Allocate host memory
    std::vector<float> h_input(width * height, 1.0f);
    std::vector<float> h_output(width * height, 0.0f);

    // Allocate device memory
    float* d_input, *d_output;
    CHECK(hipMalloc(&d_input, size));
    CHECK(hipMalloc(&d_output, size));

    // Copy data from host to device
    CHECK(hipMemcpy(d_input, h_input.data(), size, hipMemcpyHostToDevice));

    // Set up execution configuration
    dim3 blockSize(16, 16);
    dim3 gridSize((width + blockSize.x - 1) / blockSize.x, (height + blockSize.y - 1) / blockSize.y);

    // Launch kernel
    prewittFilterKernel<<<gridSize, blockSize, (blockSize.x + 2) * (blockSize.y + 2) * sizeof(float)>>>(d_input, d_output, width, height);
    CHECK(hipGetLastError());

    // Copy result back to host
    CHECK(hipMemcpy(h_output.data(), d_output, size, hipMemcpyDeviceToHost));

    // Free device memory
    CHECK(hipFree(d_input));
    CHECK(hipFree(d_output));

    std::cout << "Prewitt filter applied successfully." << std::endl;

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

                                        # End of file scope inline assembly
	.globl	_Z34__device_stub__prewittFilterKernelPKfPfii # -- Begin function _Z34__device_stub__prewittFilterKernelPKfPfii
	.type	_Z34__device_stub__prewittFilterKernelPKfPfii,@function
_Z34__device_stub__prewittFilterKernelPKfPfii: # @_Z34__device_stub__prewittFilterKernelPKfPfii
	.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	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z19prewittFilterKernelPKfPfii, %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	_Z34__device_stub__prewittFilterKernelPKfPfii, .Lfunc_end0-_Z34__device_stub__prewittFilterKernelPKfPfii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:                                # %.noexc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$4194304, %edi                  # imm = 0x400000
	callq	_Znwm
	movq	%rax, %rbx
	xorl	%eax, %eax
.LBB1_1:                                # %.lr.ph.i.i.i.i.i.i.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movl	$1065353216, (%rbx,%rax)        # imm = 0x3F800000
	addq	$4, %rax
	cmpq	$4194304, %rax                  # imm = 0x400000
	jne	.LBB1_1
# %bb.2:                                # %_ZNSt6vectorIfSaIfEEC2EmRKfRKS0_.exit
.Ltmp0:
	movl	$4194304, %edi                  # imm = 0x400000
	callq	_Znwm
.Ltmp1:
# %bb.3:                                # %.lr.ph.i.i.i.i.i.i.i.i.i66.preheader
	movq	%rax, %r14
	movl	$4194304, %edx                  # imm = 0x400000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp3:
	leaq	16(%rsp), %rdi
	movl	$4194304, %esi                  # imm = 0x400000
	callq	hipMalloc
.Ltmp4:
# %bb.4:                                # %_ZL9hipMallocIfE10hipError_tPPT_m.exit
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_5
# %bb.17:
.Ltmp26:
	leaq	8(%rsp), %rdi
	movl	$4194304, %esi                  # imm = 0x400000
	callq	hipMalloc
.Ltmp27:
# %bb.18:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit83
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_19
# %bb.30:
	movq	16(%rsp), %rdi
.Ltmp49:
	movl	$4194304, %edx                  # imm = 0x400000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp50:
# %bb.31:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_32
# %bb.43:
.Ltmp72:
	movabsq	$274877907008, %rdi             # imm = 0x4000000040
	movabsq	$68719476752, %rdx              # imm = 0x1000000010
	movl	$1296, %r8d                     # imm = 0x510
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp73:
# %bb.44:
	testl	%eax, %eax
	jne	.LBB1_46
# %bb.45:
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
.Ltmp74:
	movl	$1024, %edx                     # imm = 0x400
	movl	$1024, %ecx                     # imm = 0x400
	callq	_Z34__device_stub__prewittFilterKernelPKfPfii
.Ltmp75:
.LBB1_46:
.Ltmp76:
	callq	hipGetLastError
.Ltmp77:
# %bb.47:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_48
# %bb.59:
	movq	8(%rsp), %rsi
.Ltmp99:
	movl	$4194304, %edx                  # imm = 0x400000
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp100:
# %bb.60:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_61
# %bb.72:
	movq	16(%rsp), %rdi
.Ltmp122:
	callq	hipFree
.Ltmp123:
# %bb.73:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_74
# %bb.85:
	movq	8(%rsp), %rdi
.Ltmp145:
	callq	hipFree
.Ltmp146:
# %bb.86:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_87
# %bb.98:
.Ltmp168:
	movl	$_ZSt4cout, %r15d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$36, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp169:
# %bb.99:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit157
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r15
.Ltmp170:
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp171:
# %bb.100:                              # %.noexc169
.Ltmp172:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp173:
# %bb.101:                              # %.noexc170
.Ltmp174:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp175:
# %bb.102:                              # %_ZNSt6vectorIfSaIfEED2Ev.exit161
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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
.LBB1_5:
	.cfi_def_cfa_offset 64
.Ltmp5:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp6:
# %bb.6:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp7:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp8:
# %bb.7:
.Ltmp9:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp10:
# %bb.8:
.Ltmp11:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp12:
# %bb.9:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit74
.Ltmp13:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp14:
# %bb.10:
.Ltmp15:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp16:
# %bb.11:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit76
.Ltmp17:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp18:
# %bb.12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit78
.Ltmp19:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp20:
# %bb.13:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit80
.Ltmp21:
	movq	%r15, %rdi
	movl	$100, %esi
	callq	_ZNSolsEi
.Ltmp22:
# %bb.14:
.Ltmp23:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp24:
	jmp	.LBB1_15
.LBB1_19:
.Ltmp28:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp29:
# %bb.20:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit85
.Ltmp30:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp31:
# %bb.21:
.Ltmp32:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp33:
# %bb.22:
.Ltmp34:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp35:
# %bb.23:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit87
.Ltmp36:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp37:
# %bb.24:
.Ltmp38:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp39:
# %bb.25:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit89
.Ltmp40:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp41:
# %bb.26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit91
.Ltmp42:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp43:
# %bb.27:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit93
.Ltmp44:
	movq	%r15, %rdi
	movl	$101, %esi
	callq	_ZNSolsEi
.Ltmp45:
# %bb.28:
.Ltmp46:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp47:
	jmp	.LBB1_15
.LBB1_32:
.Ltmp51:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp52:
# %bb.33:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit97
.Ltmp53:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp54:
# %bb.34:
.Ltmp55:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp56:
# %bb.35:
.Ltmp57:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp58:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit99
.Ltmp59:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp60:
# %bb.37:
.Ltmp61:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp62:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit101
.Ltmp63:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp64:
# %bb.39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit103
.Ltmp65:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp66:
# %bb.40:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit105
.Ltmp67:
	movq	%r15, %rdi
	movl	$104, %esi
	callq	_ZNSolsEi
.Ltmp68:
# %bb.41:
.Ltmp69:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp70:
	jmp	.LBB1_15
.LBB1_48:
.Ltmp78:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp79:
# %bb.49:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit109
.Ltmp80:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp81:
# %bb.50:
.Ltmp82:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp83:
# %bb.51:
.Ltmp84:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp85:
# %bb.52:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit111
.Ltmp86:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp87:
# %bb.53:
.Ltmp88:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp89:
# %bb.54:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit113
.Ltmp90:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp91:
# %bb.55:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit115
.Ltmp92:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp93:
# %bb.56:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit117
.Ltmp94:
	movq	%r15, %rdi
	movl	$112, %esi
	callq	_ZNSolsEi
.Ltmp95:
# %bb.57:
.Ltmp96:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp97:
	jmp	.LBB1_15
.LBB1_61:
.Ltmp101:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp102:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit121
.Ltmp103:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp104:
# %bb.63:
.Ltmp105:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp106:
# %bb.64:
.Ltmp107:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp108:
# %bb.65:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit123
.Ltmp109:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp110:
# %bb.66:
.Ltmp111:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp112:
# %bb.67:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit125
.Ltmp113:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp114:
# %bb.68:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit127
.Ltmp115:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp116:
# %bb.69:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit129
.Ltmp117:
	movq	%r15, %rdi
	movl	$115, %esi
	callq	_ZNSolsEi
.Ltmp118:
# %bb.70:
.Ltmp119:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp120:
	jmp	.LBB1_15
.LBB1_74:
.Ltmp124:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp125:
# %bb.75:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit133
.Ltmp126:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp127:
# %bb.76:
.Ltmp128:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp129:
# %bb.77:
.Ltmp130:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp131:
# %bb.78:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit135
.Ltmp132:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp133:
# %bb.79:
.Ltmp134:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp135:
# %bb.80:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit137
.Ltmp136:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp137:
# %bb.81:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit139
.Ltmp138:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp139:
# %bb.82:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit141
.Ltmp140:
	movq	%r15, %rdi
	movl	$118, %esi
	callq	_ZNSolsEi
.Ltmp141:
# %bb.83:
.Ltmp142:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp143:
	jmp	.LBB1_15
.LBB1_87:
.Ltmp147:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp148:
# %bb.88:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit145
.Ltmp149:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp150:
# %bb.89:
.Ltmp151:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp152:
# %bb.90:
.Ltmp153:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp154:
# %bb.91:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit147
.Ltmp155:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp156:
# %bb.92:
.Ltmp157:
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp158:
# %bb.93:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit149
.Ltmp159:
	movl	$.L.str.3, %esi
	movl	$88, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp160:
# %bb.94:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit151
.Ltmp161:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp162:
# %bb.95:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit153
.Ltmp163:
	movq	%r15, %rdi
	movl	$119, %esi
	callq	_ZNSolsEi
.Ltmp164:
# %bb.96:
.Ltmp165:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp166:
.LBB1_15:                               # %_ZNSolsEPFRSoS_E.exit
	movl	$1, %edi
	callq	exit
.LBB1_16:
.Ltmp2:
	movq	%rax, %r15
	jmp	.LBB1_105
.LBB1_97:
.Ltmp167:
	jmp	.LBB1_104
.LBB1_84:
.Ltmp144:
	jmp	.LBB1_104
.LBB1_71:
.Ltmp121:
	jmp	.LBB1_104
.LBB1_58:
.Ltmp98:
	jmp	.LBB1_104
.LBB1_42:
.Ltmp71:
	jmp	.LBB1_104
.LBB1_29:
.Ltmp48:
	jmp	.LBB1_104
.LBB1_103:
.Ltmp25:
	jmp	.LBB1_104
.LBB1_106:
.Ltmp176:
.LBB1_104:                              # %_ZNSt6vectorIfSaIfEED2Ev.exit163
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB1_105:                              # %_ZNSt6vectorIfSaIfEED2Ev.exit165
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r15, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp3-.Ltmp1                  #   Call between .Ltmp1 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp25-.Lfunc_begin0          #     jumps to .Ltmp25
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp26-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp27-.Ltmp26                #   Call between .Ltmp26 and .Ltmp27
	.uleb128 .Ltmp48-.Lfunc_begin0          #     jumps to .Ltmp48
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp50-.Ltmp49                #   Call between .Ltmp49 and .Ltmp50
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp75-.Ltmp72                #   Call between .Ltmp72 and .Ltmp75
	.uleb128 .Ltmp176-.Lfunc_begin0         #     jumps to .Ltmp176
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp76-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp77-.Ltmp76                #   Call between .Ltmp76 and .Ltmp77
	.uleb128 .Ltmp98-.Lfunc_begin0          #     jumps to .Ltmp98
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp99-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp100-.Ltmp99               #   Call between .Ltmp99 and .Ltmp100
	.uleb128 .Ltmp121-.Lfunc_begin0         #     jumps to .Ltmp121
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp122-.Lfunc_begin0         # >> Call Site 10 <<
	.uleb128 .Ltmp123-.Ltmp122              #   Call between .Ltmp122 and .Ltmp123
	.uleb128 .Ltmp144-.Lfunc_begin0         #     jumps to .Ltmp144
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp145-.Lfunc_begin0         # >> Call Site 11 <<
	.uleb128 .Ltmp146-.Ltmp145              #   Call between .Ltmp145 and .Ltmp146
	.uleb128 .Ltmp167-.Lfunc_begin0         #     jumps to .Ltmp167
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp168-.Lfunc_begin0         # >> Call Site 12 <<
	.uleb128 .Ltmp175-.Ltmp168              #   Call between .Ltmp168 and .Ltmp175
	.uleb128 .Ltmp176-.Lfunc_begin0         #     jumps to .Ltmp176
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 13 <<
	.uleb128 .Ltmp24-.Ltmp5                 #   Call between .Ltmp5 and .Ltmp24
	.uleb128 .Ltmp25-.Lfunc_begin0          #     jumps to .Ltmp25
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp28-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp47-.Ltmp28                #   Call between .Ltmp28 and .Ltmp47
	.uleb128 .Ltmp48-.Lfunc_begin0          #     jumps to .Ltmp48
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp70-.Ltmp51                #   Call between .Ltmp51 and .Ltmp70
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp78-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp97-.Ltmp78                #   Call between .Ltmp78 and .Ltmp97
	.uleb128 .Ltmp98-.Lfunc_begin0          #     jumps to .Ltmp98
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp101-.Lfunc_begin0         # >> Call Site 17 <<
	.uleb128 .Ltmp120-.Ltmp101              #   Call between .Ltmp101 and .Ltmp120
	.uleb128 .Ltmp121-.Lfunc_begin0         #     jumps to .Ltmp121
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp124-.Lfunc_begin0         # >> Call Site 18 <<
	.uleb128 .Ltmp143-.Ltmp124              #   Call between .Ltmp124 and .Ltmp143
	.uleb128 .Ltmp144-.Lfunc_begin0         #     jumps to .Ltmp144
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp147-.Lfunc_begin0         # >> Call Site 19 <<
	.uleb128 .Ltmp166-.Ltmp147              #   Call between .Ltmp147 and .Ltmp166
	.uleb128 .Ltmp167-.Lfunc_begin0         #     jumps to .Ltmp167
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp166-.Lfunc_begin0         # >> Call Site 20 <<
	.uleb128 .Lfunc_end1-.Ltmp166           #   Call between .Ltmp166 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.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	$_Z19prewittFilterKernelPKfPfii, %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	$h_PrewittX, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$36, %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	$h_PrewittY, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$36, %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	h_PrewittX,@object              # @h_PrewittX
	.local	h_PrewittX
	.comm	h_PrewittX,36,16
	.type	h_PrewittY,@object              # @h_PrewittY
	.local	h_PrewittY
	.comm	h_PrewittY,36,16
	.type	_Z19prewittFilterKernelPKfPfii,@object # @_Z19prewittFilterKernelPKfPfii
	.section	.rodata,"a",@progbits
	.globl	_Z19prewittFilterKernelPKfPfii
	.p2align	3, 0x0
_Z19prewittFilterKernelPKfPfii:
	.quad	_Z34__device_stub__prewittFilterKernelPKfPfii
	.size	_Z19prewittFilterKernelPKfPfii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error: "
	.size	.L.str, 8

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

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"/home/ubuntu/Datasets/hip-codes-80k-from-llm-dedup-disassemble-sm89/cuda_code_017954.hip"
	.size	.L.str.3, 89

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Prewitt filter applied successfully."
	.size	.L.str.5, 37

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z19prewittFilterKernelPKfPfii"
	.size	.L__unnamed_1, 31

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"h_PrewittX"
	.size	.L__unnamed_2, 11

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"h_PrewittY"
	.size	.L__unnamed_3, 11

	.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 _Z34__device_stub__prewittFilterKernelPKfPfii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym h_PrewittX
	.addrsig_sym h_PrewittY
	.addrsig_sym _Z19prewittFilterKernelPKfPfii
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19prewittFilterKernelPKfPfii ; -- Begin function _Z19prewittFilterKernelPKfPfii
	.globl	_Z19prewittFilterKernelPKfPfii
	.p2align	8
	.type	_Z19prewittFilterKernelPKfPfii,@function
_Z19prewittFilterKernelPKfPfii:         ; @_Z19prewittFilterKernelPKfPfii
; %bb.0:
	s_clause 0x2
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[16:17], s[0:1], 0x10
	s_load_b128 s[8:11], s[0:1], 0x0
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v2, v0, 10, 10
	s_add_u32 s12, s0, 24
	s_addc_u32 s13, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s18, s2, 0xffff
	s_lshr_b32 s19, s2, 16
	v_mad_u64_u32 v[3:4], null, s14, s18, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[4:5], null, s15, s19, v[2:3]
	v_cmp_gt_i32_e32 vcc_lo, s16, v3
	v_mov_b32_e32 v5, 0
	v_cmp_gt_i32_e64 s0, s17, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, vcc_lo, s0
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_mad_u64_u32 v[5:6], null, v4, s16, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s8, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s9, v6, vcc_lo
	global_load_b32 v5, v[5:6], off
.LBB0_2:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_nc_u32_e32 v8, 1, v2
	s_add_i32 s14, s18, 2
	v_cmp_eq_u32_e64 s2, 0, v2
	v_cmp_lt_i32_e64 s3, 0, v4
	v_add_nc_u32_e32 v7, -1, v4
	v_mad_u32_u24 v6, s14, v8, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_and_b32 s1, s2, s3
	v_lshl_add_u32 v6, v6, 2, 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v5 offset:4
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB0_4
; %bb.3:
	v_mad_u64_u32 v[5:6], null, v7, s16, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s8, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s9, v6, vcc_lo
	global_load_b32 v5, v[5:6], off
	v_lshl_add_u32 v6, v1, 2, 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v5 offset:4
.LBB0_4:
	s_or_b32 exec_lo, exec_lo, s0
	v_mul_lo_u32 v5, s16, v4
	s_add_i32 s0, s19, -1
	s_add_i32 s4, s17, -1
	v_cmp_eq_u32_e64 s1, s0, v2
	v_cmp_gt_i32_e32 vcc_lo, s4, v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add3_u32 v5, v5, s16, v3
	s_and_b32 s0, s1, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s0
	s_cbranch_execz .LBB0_6
; %bb.5:
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[9:10], 2, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v9, s0, s8, v9
	v_add_co_ci_u32_e64 v10, s0, s9, v10, s0
	s_add_i32 s0, s19, 1
	global_load_b32 v6, v[9:10], off
	v_mad_u64_u32 v[9:10], null, s0, s14, v[1:2]
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v9, v9, 2, 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v9, v6 offset:4
.LBB0_6:
	s_or_b32 exec_lo, exec_lo, s4
	v_cmp_eq_u32_e64 s4, 0, v1
	v_cmp_lt_i32_e64 s0, 0, v3
	v_mul_u32_u24_e32 v6, s14, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s5, s4, s0
	s_and_saveexec_b32 s6, s5
	s_cbranch_execz .LBB0_8
; %bb.7:
	v_mad_u64_u32 v[8:9], null, v4, s16, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v9, 31, v8
	v_lshlrev_b64 v[8:9], 2, v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v8, s5, s8, v8
	v_add_co_ci_u32_e64 v9, s5, s9, v9, s5
	global_load_b32 v8, v[8:9], off offset:-4
	v_lshl_add_u32 v9, v6, 2, 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v9, v8
.LBB0_8:
	s_or_b32 exec_lo, exec_lo, s6
	s_add_i32 s5, s18, -1
	s_add_i32 s6, s16, -1
	v_cmp_eq_u32_e64 s5, s5, v1
	v_cmp_gt_i32_e64 s6, s6, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s7, s5, s6
	s_and_saveexec_b32 s15, s7
	s_cbranch_execz .LBB0_10
; %bb.9:
	v_mad_u64_u32 v[8:9], null, v4, s16, v[3:4]
	v_add_nc_u32_e32 v6, s18, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshl_add_u32 v6, v6, 2, 0
	v_ashrrev_i32_e32 v9, 31, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[8:9], 2, v[8:9]
	v_add_co_u32 v8, s7, s8, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v9, s7, s9, v9, s7
	global_load_b32 v8, v[8:9], off offset:4
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v8 offset:4
.LBB0_10:
	s_or_b32 exec_lo, exec_lo, s15
	s_and_b32 s7, s2, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s7, s7, s3
	s_and_b32 s7, s4, s7
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s15, s7
	s_cbranch_execz .LBB0_12
; %bb.11:
	v_mad_u64_u32 v[8:9], null, v7, s16, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v9, 31, v8
	v_lshlrev_b64 v[8:9], 2, v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v8, s7, s8, v8
	v_add_co_ci_u32_e64 v9, s7, s9, v9, s7
	global_load_b32 v6, v[8:9], off offset:-4
	v_mov_b32_e32 v8, 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v8, v6
.LBB0_12:
	s_or_b32 exec_lo, exec_lo, s15
	s_and_b32 s2, s2, s5
	s_and_b32 s3, s6, s3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, s3
	s_and_saveexec_b32 s7, s2
	s_cbranch_execz .LBB0_14
; %bb.13:
	v_mad_u64_u32 v[8:9], null, v7, s16, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v9, 31, v8
	v_lshlrev_b64 v[6:7], 2, v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v6, s2, s8, v6
	v_add_co_ci_u32_e64 v7, s2, s9, v7, s2
	s_lshl_b32 s2, s18, 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_i32 s2, s2, 0
	global_load_b32 v6, v[6:7], off offset:4
	v_mov_b32_e32 v7, s2
	s_waitcnt vmcnt(0)
	ds_store_b32 v7, v6 offset:4
.LBB0_14:
	s_or_b32 exec_lo, exec_lo, s7
	s_and_b32 s2, s1, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s4, s2
	s_and_b32 s2, s2, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s2
	s_cbranch_execz .LBB0_16
; %bb.15:
	v_ashrrev_i32_e32 v6, 31, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[5:6]
	v_add_co_u32 v6, s2, s8, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_add_co_ci_u32_e64 v7, s2, s9, v7, s2
	s_add_i32 s2, s19, 1
	s_mul_i32 s2, s2, s14
	global_load_b32 v6, v[6:7], off offset:-4
	s_lshl_b32 s2, s2, 2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s2, s2, 0
	v_mov_b32_e32 v7, s2
	s_waitcnt vmcnt(0)
	ds_store_b32 v7, v6
.LBB0_16:
	s_or_b32 exec_lo, exec_lo, s4
	s_and_b32 s1, s5, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s1, s6
	s_and_b32 s1, s1, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB0_18
; %bb.17:
	v_ashrrev_i32_e32 v6, 31, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	v_add_co_u32 v5, s1, s8, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_add_co_ci_u32_e64 v6, s1, s9, v6, s1
	s_add_i32 s1, s19, 2
	s_mul_i32 s1, s1, s14
	global_load_b32 v5, v[5:6], off offset:4
	s_lshl_b32 s1, s1, 2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s1, s1, 0
	s_add_i32 s1, s1, -4
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v6, s1
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v5
.LBB0_18:
	s_or_b32 exec_lo, exec_lo, s2
	s_and_b32 s0, s0, s3
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, s0, vcc_lo
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s6, s0
	s_cbranch_execz .LBB0_24
; %bb.19:                               ; %.preheader206
	v_mul_u32_u24_e32 v5, s14, v2
	v_lshlrev_b32_e32 v6, 2, v1
	s_lshl_b32 s7, s18, 2
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, h_PrewittY@rel32@lo+4
	s_addc_u32 s1, s1, h_PrewittY@rel32@hi+12
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, h_PrewittX@rel32@lo+4
	s_addc_u32 s3, s3, h_PrewittX@rel32@hi+12
	v_lshlrev_b32_e32 v7, 2, v5
	v_mov_b32_e32 v5, 0
	s_add_i32 s7, s7, 8
	s_mov_b32 s8, -1
	s_delay_alu instid0(VALU_DEP_2)
	v_add3_u32 v6, v7, v6, 0
	v_mov_b32_e32 v7, 0
.LBB0_20:                               ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_21 Depth 2
	s_delay_alu instid0(VALU_DEP_2)
	v_mov_b32_e32 v8, v6
	s_mov_b64 s[4:5], 0
.LBB0_21:                               ;   Parent Loop BB0_20 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s14, s2, s4
	s_addc_u32 s15, s3, s5
	s_add_u32 s18, s0, s4
	s_addc_u32 s19, s1, s5
	ds_load_b32 v9, v8
	s_load_b32 s9, s[14:15], 0x0
	s_load_b32 s14, s[18:19], 0x0
	v_add_nc_u32_e32 v8, 4, v8
	s_add_u32 s4, s4, 4
	s_addc_u32 s5, s5, 0
	s_cmp_eq_u32 s4, 12
	s_waitcnt lgkmcnt(0)
	v_fmac_f32_e32 v7, s9, v9
	v_fmac_f32_e32 v5, s14, v9
	s_cbranch_scc0 .LBB0_21
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=1
	s_add_i32 s8, s8, 1
	s_add_u32 s0, s0, 12
	s_addc_u32 s1, s1, 0
	v_add_nc_u32_e32 v6, s7, v6
	s_add_u32 s2, s2, 12
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s8, 2
	s_cbranch_scc0 .LBB0_20
; %bb.23:
	v_mul_f32_e32 v5, v5, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v5, v7, v7
	v_mul_f32_e32 v6, 0x4f800000, v5
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v7, v5, v6, vcc_lo
	v_sqrt_f32_e32 v5, v7
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v6, -1, v5
	v_add_nc_u32_e32 v8, 1, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v9, -v6, v5, v7
	v_fma_f32 v10, -v8, v5, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v9
	v_cndmask_b32_e64 v9, v5, v6, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_lt_f32_e64 s0, 0, v10
	v_mad_u64_u32 v[5:6], null, v4, s16, v[3:4]
	v_cndmask_b32_e64 v3, v9, v8, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v6, 31, v5
	v_mul_f32_e32 v4, 0x37800000, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v8, v3, v4, vcc_lo
	v_lshlrev_b64 v[3:4], 2, v[5:6]
	v_cmp_class_f32_e64 vcc_lo, v7, 0x260
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v5, v8, v7, vcc_lo
	v_add_co_u32 v3, vcc_lo, s10, v3
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v4, vcc_lo, s11, v4, vcc_lo
	global_store_b32 v[3:4], v5, off
.LBB0_24:                               ; %Flow258
	s_or_b32 exec_lo, exec_lo, s6
	v_bfe_u32 v0, v0, 20, 10
	s_mov_b32 s2, exec_lo
	s_waitcnt_vscnt null, 0x0
	buffer_gl1_inv
	buffer_gl0_inv
	s_barrier
	v_or3_b32 v0, v2, v0, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_34
; %bb.25:
	s_load_b64 s[0:1], s[12:13], 0x58
	v_mov_b32_e32 v2, 0
	s_mov_b32 s3, exec_lo
	s_mov_b32 s4, exec_lo
	v_mbcnt_lo_u32_b32 v1, s3, 0
                                        ; implicit-def: $vgpr3
	s_waitcnt lgkmcnt(0)
	global_load_b32 v0, v2, s[0:1] offset:40
	v_cmpx_eq_u32_e32 0, v1
	s_cbranch_execz .LBB0_27
; %bb.26:
	s_bcnt1_i32_b32 s3, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v3, s3
	global_atomic_add_u32 v3, v2, v3, s[0:1] offset:32 glc
.LBB0_27:
	s_or_b32 exec_lo, exec_lo, s4
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s3, v3
	v_add_nc_u32_e32 v3, -1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v1, s3, v1
	s_mov_b32 s3, exec_lo
	v_and_b32_e32 v2, 0xffff, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_ne_u32_e64 v2, v3
	s_xor_b32 s3, exec_lo, s3
	s_cbranch_execz .LBB0_31
; %bb.28:                               ; %.preheader.i.i.i.i.preheader
	v_mov_b32_e32 v0, 0
	s_mov_b32 s4, 0
.LBB0_29:                               ; %.preheader.i.i.i.i
                                        ; =>This Inner Loop Header: Depth=1
	s_sleep 1
	global_load_b32 v2, v0, s[0:1] offset:32 glc
	s_waitcnt vmcnt(0)
	v_xor_b32_e32 v2, v2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_lt_u32_e32 vcc_lo, 0xffff, v2
	s_or_b32 s4, vcc_lo, s4
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_29
; %bb.30:                               ; %Flow
	s_or_b32 exec_lo, exec_lo, s4
                                        ; implicit-def: $vgpr0
.LBB0_31:                               ; %Flow255
	s_and_not1_saveexec_b32 s3, s3
	s_cbranch_execz .LBB0_34
; %bb.32:
	s_mov_b32 s3, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v1, s3, 0
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	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_34
; %bb.33:
	v_sub_nc_u32_e32 v0, 0x10000, v0
	s_bcnt1_i32_b32 s3, s3
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_lo_u32 v0, v0, s3
	global_atomic_add_u32 v1, v0, s[0:1] offset:32
.LBB0_34:                               ; %Flow257
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt_vscnt null, 0x0
	s_barrier
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19prewittFilterKernelPKfPfii
		.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 2
		.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	_Z19prewittFilterKernelPKfPfii, .Lfunc_end0-_Z19prewittFilterKernelPKfPfii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1900
; 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: 2
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	h_PrewittX              ; @h_PrewittX
	.type	h_PrewittX,@object
	.data
	.globl	h_PrewittX
	.p2align	4, 0x0
h_PrewittX:
	.long	0x3f800000                      ; float 1
	.long	0x00000000                      ; float 0
	.long	0xbf800000                      ; float -1
	.long	0x3f800000                      ; float 1
	.long	0x00000000                      ; float 0
	.long	0xbf800000                      ; float -1
	.long	0x3f800000                      ; float 1
	.long	0x00000000                      ; float 0
	.long	0xbf800000                      ; float -1
	.size	h_PrewittX, 36

	.protected	h_PrewittY              ; @h_PrewittY
	.type	h_PrewittY,@object
	.globl	h_PrewittY
	.p2align	4, 0x0
h_PrewittY:
	.long	0x3f800000                      ; float 1
	.long	0x3f800000                      ; float 1
	.long	0x3f800000                      ; float 1
	.long	0x00000000                      ; float 0
	.long	0x00000000                      ; float 0
	.long	0x00000000                      ; float 0
	.long	0xbf800000                      ; float -1
	.long	0xbf800000                      ; float -1
	.long	0xbf800000                      ; float -1
	.size	h_PrewittY, 36

	.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 h_PrewittX
	.addrsig_sym h_PrewittY
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         112
        .size:           8
        .value_kind:     hidden_multigrid_sync_arg
      - .offset:         144
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .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:           _Z19prewittFilterKernelPKfPfii
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z19prewittFilterKernelPKfPfii.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
