#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>

// Kernel for bitonic sort
__global__ void bitonicSortKernel(int *data, int j, int k)
{
    unsigned int i = blockDim.x * blockIdx.x + threadIdx.x;
    unsigned int ixj = i ^ j;
    
    // Only threads with ixj > i participate in comparisons
    if (ixj > i) {
        // Calculate the direction of sort (ascending or descending)
        int direction = ((i & k) == 0);
        // Compare elements and swap if needed
        if (direction == (data[i] > data[ixj])) {
            // Swap elements
            int temp = data[i];
            data[i] = data[ixj];
            data[ixj] = temp;
        }
    }
}

// CUDA error checking helper function
void checkCudaError(cudaError_t err, const char* msg) {
    if (err != cudaSuccess) {
        fprintf(stderr, "%s failed with error: %s\n", msg, cudaGetErrorString(err));
        exit(EXIT_FAILURE);
    }
}

// Host function to execute the bitonic sort on GPU
void bitonicSort(int *d_data, int n) {
    // Number of threads per block
    int threadsPerBlock = 256;
    // Number of blocks in the grid
    int blocksPerGrid = (n + threadsPerBlock - 1) / threadsPerBlock;
    
    // Bitonic sort stages
    for (int k = 2; k <= n; k *= 2) {
        for (int j = k/2; j > 0; j /= 2) {
            bitonicSortKernel<<<blocksPerGrid, threadsPerBlock>>>(d_data, j, k);
            cudaDeviceSynchronize();
        }
    }
}

int main(int argc, char **argv) {
    int n = 1024; // Size of array - must be a power of 2 for bitonic sort
    size_t size = n * sizeof(int);
    
    // Allocate memory for host array
    int *h_data = (int*)malloc(size);
    if (h_data == NULL) {
        fprintf(stderr, "Failed to allocate host memory\n");
        return 1;
    }
    
    // Initialize data with random values
    for (int i = 0; i < n; i++) {
        h_data[i] = rand() % 1000;
    }
    
    // Print first few elements of the unsorted array
    printf("Unsorted array (first 10 elements): ");
    for (int i = 0; i < 10 && i < n; i++) {
        printf("%d ", h_data[i]);
    }
    printf("\n");
    
    // Allocate device memory
    int *d_data = NULL;
    cudaError_t err = cudaMalloc((void**)&d_data, size);
    checkCudaError(err, "cudaMalloc");
    
    // Copy data from host to device
    err = cudaMemcpy(d_data, h_data, size, cudaMemcpyHostToDevice);
    checkCudaError(err, "cudaMemcpy Host to Device");
    
    // Run bitonic sort on device
    bitonicSort(d_data, n);
    
    // Check for any errors during kernel execution
    err = cudaGetLastError();
    checkCudaError(err, "Kernel execution");
    
    // Copy sorted data back to host
    err = cudaMemcpy(h_data, d_data, size, cudaMemcpyDeviceToHost);
    checkCudaError(err, "cudaMemcpy Device to Host");
    
    // Print first few elements of the sorted array
    printf("Sorted array (first 10 elements): ");
    for (int i = 0; i < 10 && i < n; i++) {
        printf("%d ", h_data[i]);
    }
    printf("\n");
    
    // Verify sort
    bool sorted = true;
    for (int i = 0; i < n-1; i++) {
        if (h_data[i] > h_data[i+1]) {
            sorted = false;
            printf("Sort failed at index %d (%d > %d)\n", i, h_data[i], h_data[i+1]);
            break;
        }
    }
    if (sorted) {
        printf("Array is correctly sorted\n");
    }
    
    // Free device memory
    cudaFree(d_data);
    // Free host memory
    free(h_data);
    
    return 0;
}
	.file	"tmpxft_00047e75_00000000-6_28.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB1984:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE1984:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s failed with error: %s\n"
	.text
	.globl	_Z14checkCudaError9cudaErrorPKc
	.type	_Z14checkCudaError9cudaErrorPKc, @function
_Z14checkCudaError9cudaErrorPKc:
.LFB1979:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movq	%r12, %rcx
	leaq	.LC0(%rip), %rdx
	movq	%rax, %r8
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE1979:
	.size	_Z14checkCudaError9cudaErrorPKc, .-_Z14checkCudaError9cudaErrorPKc
	.globl	_Z39__device_stub__Z17bitonicSortKernelPiiiPiii
	.type	_Z39__device_stub__Z17bitonicSortKernelPiiiPiii, @function
_Z39__device_stub__Z17bitonicSortKernelPiiiPiii:
.LFB2006:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	32(%rsp), %rdi
	movl	%esi, 4(%rsp)
	leaq	44(%rsp), %rsi
	movl	%edx, (%rsp)
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z17bitonicSortKernelPiii(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L8:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2006:
	.size	_Z39__device_stub__Z17bitonicSortKernelPiiiPiii, .-_Z39__device_stub__Z17bitonicSortKernelPiiiPiii
	.globl	_Z17bitonicSortKernelPiii
	.type	_Z17bitonicSortKernelPiii, @function
_Z17bitonicSortKernelPiii:
.LFB2007:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z17bitonicSortKernelPiiiPiii
	.cfi_endproc
.LFE2007:
	.size	_Z17bitonicSortKernelPiii, .-_Z17bitonicSortKernelPiii
	.globl	_Z11bitonicSortPii
	.type	_Z11bitonicSortPii, @function
_Z11bitonicSortPii:
.LFB1980:
	.cfi_startproc
	endbr64
	leal	255(%rsi), %eax
	movl	$256, %ecx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movabsq	$4294967552, %r15
	cltd
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	idivl	%ecx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$2, %r12d
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%esi, %ebx
	movl	%eax, %ebp
.L14:
	cmpl	%ebx, %r12d
	jg	.L20
	movl	%r12d, %eax
	movl	$2, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %r13d
.L15:
	testl	%r13d, %r13d
	jle	.L21
	movl	%ebp, 8(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	movabsq	$4294967297, %rax
	movl	$1, %ecx
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	movl	%r12d, %edx
	movl	%r13d, %esi
	movq	%r14, %rdi
	call	_Z39__device_stub__Z17bitonicSortKernelPiiiPiii
.L16:
	call	cudaDeviceSynchronize@PLT
	sarl	%r13d
	jmp	.L15
.L21:
	addl	%r12d, %r12d
	jmp	.L14
.L20:
	addq	$40, %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
.LFE1980:
	.size	_Z11bitonicSortPii, .-_Z11bitonicSortPii
	.section	.rodata.str1.1
.LC1:
	.string	"Failed to allocate host memory\n"
.LC2:
	.string	"Unsorted array (first 10 elements): "
.LC3:
	.string	"%d "
.LC4:
	.string	"\n"
.LC5:
	.string	"cudaMalloc"
.LC6:
	.string	"cudaMemcpy Host to Device"
.LC7:
	.string	"Kernel execution"
.LC8:
	.string	"cudaMemcpy Device to Host"
.LC9:
	.string	"Sorted array (first 10 elements): "
.LC10:
	.string	"Sort failed at index %d (%d > %d)\n"
.LC11:
	.string	"Array is correctly sorted\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB1981:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$4096, %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	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	testq	%rax, %rax
	jne	.L37
	movq	stderr(%rip), %rdi
	leaq	.LC1(%rip), %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %eax
	jmp	.L22
.L37:
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	movl	$1000, %r12d
.L23:
	call	rand@PLT
	cltd
	idivl	%r12d
	movl	%edx, 0(%rbp,%rbx,4)
	incq	%rbx
	cmpq	$1024, %rbx
	jne	.L23
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	leaq	.LC3(%rip), %r12
.L25:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$10, %rbx
	jne	.L25
	leaq	.LC4(%rip), %r13
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	movq	%r13, %rsi
	call	__printf_chk@PLT
	movq	%rsp, %rdi
	movl	$4096, %esi
	movq	$0, (%rsp)
	call	cudaMalloc@PLT
	leaq	.LC5(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$4096, %edx
	call	cudaMemcpy@PLT
	leaq	.LC6(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	(%rsp), %rdi
	movl	$1024, %esi
	call	_Z11bitonicSortPii
	call	cudaGetLastError@PLT
	leaq	.LC7(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdi
	movl	$4096, %edx
	call	cudaMemcpy@PLT
	leaq	.LC8(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	leaq	.LC9(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L26:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$10, %rbx
	jne	.L26
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
.L29:
	movl	0(%rbp,%rax,4), %ecx
	movl	4(%rbp,%rax,4), %r8d
	movl	%eax, %edx
	cmpl	%r8d, %ecx
	jle	.L27
	leaq	.LC10(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L28
.L27:
	incq	%rax
	cmpq	$1023, %rax
	jne	.L29
	leaq	.LC11(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L28:
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbp, %rdi
	call	free@PLT
	xorl	%eax, %eax
.L22:
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE1981:
	.size	main, .-main
	.section	.rodata.str1.1
.LC12:
	.string	"_Z17bitonicSortKernelPiii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2009:
	.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	.LC12(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z17bitonicSortKernelPiii(%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
.LFE2009:
	.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 11.4.0-1ubuntu1~22.04) 11.4.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 <stdio.h>
#include <stdlib.h>
#include <hip/hip_runtime.h>

// Kernel for bitonic sort
__global__ void bitonicSortKernel(int *data, int j, int k)
{
    unsigned int i = blockDim.x * blockIdx.x + threadIdx.x;
    unsigned int ixj = i ^ j;
    
    // Only threads with ixj > i participate in comparisons
    if (ixj > i) {
        // Calculate the direction of sort (ascending or descending)
        int direction = ((i & k) == 0);
        // Compare elements and swap if needed
        if (direction == (data[i] > data[ixj])) {
            // Swap elements
            int temp = data[i];
            data[i] = data[ixj];
            data[ixj] = temp;
        }
    }
}

// HIP error checking helper function
void checkHipError(hipError_t err, const char* msg) {
    if (err != hipSuccess) {
        fprintf(stderr, "%s failed with error: %s\n", msg, hipGetErrorString(err));
        exit(EXIT_FAILURE);
    }
}

// Host function to execute the bitonic sort on GPU
void bitonicSort(int *d_data, int n) {
    // Number of threads per block
    int threadsPerBlock = 256;
    // Number of blocks in the grid
    int blocksPerGrid = (n + threadsPerBlock - 1) / threadsPerBlock;
    
    // Bitonic sort stages
    for (int k = 2; k <= n; k *= 2) {
        for (int j = k/2; j > 0; j /= 2) {
            hipLaunchKernelGGL(bitonicSortKernel, dim3(blocksPerGrid), dim3(threadsPerBlock), 0, 0, d_data, j, k);
            hipDeviceSynchronize();
        }
    }
}

int main(int argc, char **argv) {
    int n = 1024; // Size of array - must be a power of 2 for bitonic sort
    size_t size = n * sizeof(int);
    
    // Allocate memory for host array
    int *h_data = (int*)malloc(size);
    if (h_data == NULL) {
        fprintf(stderr, "Failed to allocate host memory\n");
        return 1;
    }
    
    // Initialize data with random values
    for (int i = 0; i < n; i++) {
        h_data[i] = rand() % 1000;
    }
    
    // Print first few elements of the unsorted array
    printf("Unsorted array (first 10 elements): ");
    for (int i = 0; i < 10 && i < n; i++) {
        printf("%d ", h_data[i]);
    }
    printf("\n");
    
    // Allocate device memory
    int *d_data = NULL;
    hipError_t err = hipMalloc((void**)&d_data, size);
    checkHipError(err, "hipMalloc");
    
    // Copy data from host to device
    err = hipMemcpy(d_data, h_data, size, hipMemcpyHostToDevice);
    checkHipError(err, "hipMemcpy Host to Device");
    
    // Run bitonic sort on device
    bitonicSort(d_data, n);
    
    // Check for any errors during kernel execution
    err = hipGetLastError();
    checkHipError(err, "Kernel execution");
    
    // Copy sorted data back to host
    err = hipMemcpy(h_data, d_data, size, hipMemcpyDeviceToHost);
    checkHipError(err, "hipMemcpy Device to Host");
    
    // Print first few elements of the sorted array
    printf("Sorted array (first 10 elements): ");
    for (int i = 0; i < 10 && i < n; i++) {
        printf("%d ", h_data[i]);
    }
    printf("\n");
    
    // Verify sort
    bool sorted = true;
    for (int i = 0; i < n-1; i++) {
        if (h_data[i] > h_data[i+1]) {
            sorted = false;
            printf("Sort failed at index %d (%d > %d)\n", i, h_data[i], h_data[i+1]);
            break;
        }
    }
    if (sorted) {
        printf("Array is correctly sorted\n");
    }
    
    // Free device memory
    hipFree(d_data);
    // Free host memory
    free(h_data);
    
    return 0;
}
	.text
	.file	"28.cpp"
	.globl	_Z32__device_stub__bitonicSortKernelPiii # -- Begin function _Z32__device_stub__bitonicSortKernelPiii
	.p2align	4, 0x90
	.type	_Z32__device_stub__bitonicSortKernelPiii,@function
_Z32__device_stub__bitonicSortKernelPiii: # @_Z32__device_stub__bitonicSortKernelPiii
	.cfi_startproc
# %bb.0:
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 56(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 64(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 72(%rsp)
	movq	%rsp, %rax
	movq	%rax, 80(%rsp)
	leaq	40(%rsp), %rdi
	leaq	24(%rsp), %rsi
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rcx
	callq	__hipPopCallConfiguration
	movq	40(%rsp), %rsi
	movl	48(%rsp), %edx
	movq	24(%rsp), %rcx
	movl	32(%rsp), %r8d
	leaq	64(%rsp), %r9
	movl	$_Z17bitonicSortKernelPiii, %edi
	pushq	8(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$104, %rsp
	.cfi_adjust_cfa_offset -104
	retq
.Lfunc_end0:
	.size	_Z32__device_stub__bitonicSortKernelPiii, .Lfunc_end0-_Z32__device_stub__bitonicSortKernelPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13checkHipError10hipError_tPKc # -- Begin function _Z13checkHipError10hipError_tPKc
	.p2align	4, 0x90
	.type	_Z13checkHipError10hipError_tPKc,@function
_Z13checkHipError10hipError_tPKc:       # @_Z13checkHipError10hipError_tPKc
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB1_2
# %bb.1:
	retq
.LBB1_2:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	stderr(%rip), %rbx
	movq	%rsi, %r14
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end1:
	.size	_Z13checkHipError10hipError_tPKc, .Lfunc_end1-_Z13checkHipError10hipError_tPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z11bitonicSortPii              # -- Begin function _Z11bitonicSortPii
	.p2align	4, 0x90
	.type	_Z11bitonicSortPii,@function
_Z11bitonicSortPii:                     # @_Z11bitonicSortPii
	.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	$104, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $esi killed $esi def $rsi
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	cmpl	$2, %esi
	jge	.LBB2_1
.LBB2_7:                                # %._crit_edge26
	addq	$104, %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
.LBB2_1:                                # %.preheader.lr.ph
	.cfi_def_cfa_offset 160
	movq	%rdi, %r14
	movabsq	$4294967296, %r15               # imm = 0x100000000
	movq	16(%rsp), %rax                  # 8-byte Reload
	leal	255(%rax), %r12d
	shrl	$8, %r12d
	orq	%r15, %r12
	movl	$2, %ebx
	addq	$256, %r15                      # imm = 0x100
	jmp	.LBB2_2
	.p2align	4, 0x90
.LBB2_6:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	addl	%ebx, %ebx
	cmpl	16(%rsp), %ebx                  # 4-byte Folded Reload
	jg	.LBB2_7
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	movl	%ebx, %r13d
	movl	%ebx, %ebp
	jmp	.LBB2_3
	.p2align	4, 0x90
.LBB2_5:                                #   in Loop: Header=BB2_3 Depth=2
	callq	hipDeviceSynchronize
	cmpl	$4, %r13d
	movl	%ebp, %r13d
	jb	.LBB2_6
.LBB2_3:                                # %.lr.ph
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	shrl	%ebp
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_5
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=2
	movq	%r14, 72(%rsp)
	movl	%ebp, 12(%rsp)
	movl	%ebx, 8(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 80(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 88(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 96(%rsp)
	leaq	56(%rsp), %rdi
	leaq	40(%rsp), %rsi
	leaq	32(%rsp), %rdx
	leaq	24(%rsp), %rcx
	callq	__hipPopCallConfiguration
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	movq	40(%rsp), %rcx
	movl	48(%rsp), %r8d
	movl	$_Z17bitonicSortKernelPiii, %edi
	leaq	80(%rsp), %r9
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	40(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	jmp	.LBB2_5
.Lfunc_end2:
	.size	_Z11bitonicSortPii, .Lfunc_end2-_Z11bitonicSortPii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.p2align	4, 0x90
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$4096, %edi                     # imm = 0x1000
	callq	malloc
	testq	%rax, %rax
	je	.LBB3_23
# %bb.1:                                # %.preheader.preheader
	movq	%rax, %rbx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
.LBB3_2:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	movl	%eax, (%rbx,%r14,4)
	incq	%r14
	cmpq	$1024, %r14                     # imm = 0x400
	jne	.LBB3_2
# %bb.3:
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%r14d, %r14d
	.p2align	4, 0x90
.LBB3_4:                                # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r14,4), %esi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	cmpq	$10, %r14
	jne	.LBB3_4
# %bb.5:
	movl	$10, %edi
	callq	putchar@PLT
	movq	$0, (%rsp)
	movq	%rsp, %rdi
	movl	$4096, %esi                     # imm = 0x1000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB3_6
# %bb.8:                                # %_Z13checkHipError10hipError_tPKc.exit
	movq	(%rsp), %rdi
	movl	$4096, %edx                     # imm = 0x1000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB3_9
# %bb.10:                               # %_Z13checkHipError10hipError_tPKc.exit54
	movq	(%rsp), %rdi
	movl	$1024, %esi                     # imm = 0x400
	callq	_Z11bitonicSortPii
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB3_11
# %bb.12:                               # %_Z13checkHipError10hipError_tPKc.exit56
	movq	(%rsp), %rsi
	movl	$4096, %edx                     # imm = 0x1000
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB3_13
# %bb.14:                               # %_Z13checkHipError10hipError_tPKc.exit58
	movl	$.L.str.9, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%r14d, %r14d
	.p2align	4, 0x90
.LBB3_15:                               # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r14,4), %esi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	cmpq	$10, %r14
	jne	.LBB3_15
# %bb.16:
	movl	$10, %edi
	callq	putchar@PLT
	xorl	%esi, %esi
	.p2align	4, 0x90
.LBB3_17:                               # =>This Inner Loop Header: Depth=1
	cmpq	$1023, %rsi                     # imm = 0x3FF
	je	.LBB3_20
# %bb.18:                               #   in Loop: Header=BB3_17 Depth=1
	movl	(%rbx,%rsi,4), %edx
	movl	4(%rbx,%rsi,4), %ecx
	incq	%rsi
	cmpl	%ecx, %edx
	jle	.LBB3_17
# %bb.19:
	decl	%esi
	movl	$.L.str.10, %edi
                                        # kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB3_21
.LBB3_20:                               # %.critedge
	movl	$.Lstr, %edi
	callq	puts@PLT
.LBB3_21:
	movq	(%rsp), %rdi
	callq	hipFree
	movq	%rbx, %rdi
	callq	free
	xorl	%eax, %eax
.LBB3_22:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB3_23:
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %rcx
	movl	$.L.str.1, %edi
	movl	$31, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$1, %eax
	jmp	.LBB3_22
.LBB3_6:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.5, %edx
	jmp	.LBB3_7
.LBB3_9:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.6, %edx
	jmp	.LBB3_7
.LBB3_11:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.7, %edx
	jmp	.LBB3_7
.LBB3_13:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.8, %edx
.LBB3_7:
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	cmpq	$0, __hip_gpubin_handle(%rip)
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	movq	__hip_gpubin_handle(%rip), %rdi
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17bitonicSortKernelPiii, %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_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z17bitonicSortKernelPiii,@object # @_Z17bitonicSortKernelPiii
	.section	.rodata,"a",@progbits
	.globl	_Z17bitonicSortKernelPiii
	.p2align	3, 0x0
_Z17bitonicSortKernelPiii:
	.quad	_Z32__device_stub__bitonicSortKernelPiii
	.size	_Z17bitonicSortKernelPiii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%s failed with error: %s\n"
	.size	.L.str, 26

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Failed to allocate host memory\n"
	.size	.L.str.1, 32

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Unsorted array (first 10 elements): "
	.size	.L.str.2, 37

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"hipMalloc"
	.size	.L.str.5, 10

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"hipMemcpy Host to Device"
	.size	.L.str.6, 25

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Kernel execution"
	.size	.L.str.7, 17

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"hipMemcpy Device to Host"
	.size	.L.str.8, 25

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Sorted array (first 10 elements): "
	.size	.L.str.9, 35

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Sort failed at index %d (%d > %d)\n"
	.size	.L.str.10, 35

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z17bitonicSortKernelPiii"
	.size	.L__unnamed_1, 26

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Array is correctly sorted"
	.size	.Lstr, 26

	.section	".linker-options","e",@llvm_linker_options
	.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 _Z32__device_stub__bitonicSortKernelPiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z17bitonicSortKernelPiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z17bitonicSortKernelPiii ; -- Begin function _Z17bitonicSortKernelPiii
	.globl	_Z17bitonicSortKernelPiii
	.p2align	8
	.type	_Z17bitonicSortKernelPiii,@function
_Z17bitonicSortKernelPiii:              ; @_Z17bitonicSortKernelPiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x1c
	s_load_b32 s3, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_xor_b32_e32 v3, s3, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e64 v3, v1
	s_cbranch_execz .LBB0_3
; %bb.1:
	s_clause 0x1
	s_load_b64 s[2:3], s[0:1], 0x0
	s_load_b32 s0, s[0:1], 0xc
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[5:6], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_dual_mov_b32 v4, v2 :: v_dual_and_b32 v1, s0, v1
	v_add_co_u32 v2, vcc_lo, s2, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_lshlrev_b64 v[7:8], 2, v[3:4]
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v4, vcc_lo, s2, v7
	v_add_co_ci_u32_e32 v5, vcc_lo, s3, v8, vcc_lo
	s_clause 0x1
	global_load_b32 v0, v[2:3], off
	global_load_b32 v6, v[4:5], off
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	s_waitcnt vmcnt(0)
	v_cmp_le_i32_e64 s0, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s0, vcc_lo, s0
	s_and_b32 exec_lo, exec_lo, s0
; %bb.2:
	s_clause 0x1
	global_store_b32 v[2:3], v6, off
	global_store_b32 v[4:5], v0, off
.LBB0_3:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17bitonicSortKernelPiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z17bitonicSortKernelPiii, .Lfunc_end0-_Z17bitonicSortKernelPiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 236
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
