#include <iostream>
#include <cuda_runtime.h>
#include <cufft.h>
#include <cufftXt.h>
#include <vector>
#include <complex>

// Kernel to transform sparse complex data into a dense format for FFT
__global__ void sparseToDenseKernel(const cufftComplex* sparseData, const int* indices, cufftComplex* denseData, int N) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx < N) {
        denseData[indices[idx]] = sparseData[idx];
    }
}

// Kernel to transform dense complex data back into a sparse format
__global__ void denseToSparseKernel(const cufftComplex* denseData, const int* indices, cufftComplex* sparseData, int N) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx < N) {
        sparseData[idx] = denseData[indices[idx]];
    }
}

int main() {
    // Example sparse data and indices
    const int N = 1024; // Number of non-zero elements
    const int M = 2048; // Size of the dense FFT

    // Allocate host memory
    std::vector<cufftComplex> h_sparseData(N);
    std::vector<int> h_indices(N);
    std::vector<cufftComplex> h_denseData(M, {0.0f, 0.0f});
    std::vector<cufftComplex> h_result(N);

    // Initialize sparse data and indices
    for (int i = 0; i < N; ++i) {
        h_sparseData[i] = {static_cast<float>(i), static_cast<float>(i)};
        h_indices[i] = i * 2; // Example: every second element is non-zero
    }

    // Allocate device memory
    cufftComplex* d_sparseData;
    cufftComplex* d_denseData;
    cufftComplex* d_result;
    int* d_indices;

    cudaMalloc(&d_sparseData, N * sizeof(cufftComplex));
    cudaMalloc(&d_denseData, M * sizeof(cufftComplex));
    cudaMalloc(&d_result, N * sizeof(cufftComplex));
    cudaMalloc(&d_indices, N * sizeof(int));

    // Copy data to device
    cudaMemcpy(d_sparseData, h_sparseData.data(), N * sizeof(cufftComplex), cudaMemcpyHostToDevice);
    cudaMemcpy(d_indices, h_indices.data(), N * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(d_denseData, h_denseData.data(), M * sizeof(cufftComplex), cudaMemcpyHostToDevice);

    // Launch kernel to convert sparse to dense
    int threadsPerBlock = 256;
    int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock;
    sparseToDenseKernel<<<blocksPerGrid, threadsPerBlock>>>(d_sparseData, d_indices, d_denseData, N);
    cudaDeviceSynchronize();

    // Create CUFFT plan
    cufftHandle plan;
    cufftPlan1d(&plan, M, CUFFT_C2C, 1);

    // Execute CUFFT
    cufftExecC2C(plan, d_denseData, d_denseData, CUFFT_FORWARD);
    cudaDeviceSynchronize();

    // Launch kernel to convert dense to sparse
    denseToSparseKernel<<<blocksPerGrid, threadsPerBlock>>>(d_denseData, d_indices, d_result, N);
    cudaDeviceSynchronize();

    // Copy result back to host
    cudaMemcpy(h_result.data(), d_result, N * sizeof(cufftComplex), cudaMemcpyDeviceToHost);

    // Free device memory
    cudaFree(d_sparseData);
    cudaFree(d_denseData);
    cudaFree(d_result);
    cudaFree(d_indices);
    cufftDestroy(plan);

    // Output the result
    std::cout << "Sparse FFT Result:" << std::endl;
    for (int i = 0; i < 5; ++i) { // Print first 5 elements for brevity
        std::cout << h_result[i].x << " + " << h_result[i].y << "i" << std::endl;
    }

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4326:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4326:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	.type	_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i, @function
_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i:
.LFB4348:
	.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
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%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	.L2
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z19sparseToDenseKernelPK6float2PKiPS_i(%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
.L2:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4348:
	.size	_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i, .-_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	.globl	_Z19sparseToDenseKernelPK6float2PKiPS_i
	.type	_Z19sparseToDenseKernelPK6float2PKiPS_i, @function
_Z19sparseToDenseKernelPK6float2PKiPS_i:
.LFB4349:
	.cfi_startproc
	endbr64
	jmp	_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	.cfi_endproc
.LFE4349:
	.size	_Z19sparseToDenseKernelPK6float2PKiPS_i, .-_Z19sparseToDenseKernelPK6float2PKiPS_i
	.globl	_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	.type	_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i, @function
_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i:
.LFB4350:
	.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
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z19denseToSparseKernelPK6float2PKiPS_i(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L8:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4350:
	.size	_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i, .-_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	.globl	_Z19denseToSparseKernelPK6float2PKiPS_i
	.type	_Z19denseToSparseKernelPK6float2PKiPS_i, @function
_Z19denseToSparseKernelPK6float2PKiPS_i:
.LFB4351:
	.cfi_startproc
	endbr64
	jmp	_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	.cfi_endproc
.LFE4351:
	.size	_Z19denseToSparseKernelPK6float2PKiPS_i, .-_Z19denseToSparseKernelPK6float2PKiPS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z19denseToSparseKernelPK6float2PKiPS_i"
.LC1:
	.string	"_Z19sparseToDenseKernelPK6float2PKiPS_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4353:
	.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	_Z19denseToSparseKernelPK6float2PKiPS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z19sparseToDenseKernelPK6float2PKiPS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4353:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorI6float2SaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorI6float2SaIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorI6float2SaIS0_EED2Ev
	.type	_ZNSt6vectorI6float2SaIS0_EED2Ev, @function
_ZNSt6vectorI6float2SaIS0_EED2Ev:
.LFB4663:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L15
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L15:
	ret
	.cfi_endproc
.LFE4663:
	.size	_ZNSt6vectorI6float2SaIS0_EED2Ev, .-_ZNSt6vectorI6float2SaIS0_EED2Ev
	.weak	_ZNSt6vectorI6float2SaIS0_EED1Ev
	.set	_ZNSt6vectorI6float2SaIS0_EED1Ev,_ZNSt6vectorI6float2SaIS0_EED2Ev
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4675:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L17
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L17:
	ret
	.cfi_endproc
.LFE4675:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.text._ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm,"axG",@progbits,_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm,comdat
	.align 2
	.weak	_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm
	.type	_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm, @function
_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm:
.LFB4970:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	0(,%rsi,8), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	je	.L23
	movabsq	$1152921504606846975, %rax
	cmpq	%rsi, %rax
	jnb	.L21
	movabsq	$2305843009213693951, %rax
	cmpq	%rsi, %rax
	jnb	.L22
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L22:
	call	_ZSt17__throw_bad_allocv@PLT
.L21:
	movq	%rbp, %rdi
	call	_Znwm@PLT
	jmp	.L20
.L23:
	xorl	%eax, %eax
.L20:
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4970:
	.size	_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm, .-_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm
	.section	.rodata._ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_.str1.1,"aMS",@progbits,1
.LC2:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_,"axG",@progbits,_ZNSt6vectorI6float2SaIS0_EEC5EmRKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_
	.type	_ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_, @function
_ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_:
.LFB4660:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%r8
	.cfi_def_cfa_offset 32
	cmpq	%rsi, %rax
	jnb	.L26
	leaq	.LC2(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L26:
	xorl	%ecx, %ecx
	movq	%rdi, %rbp
	movq	%rsi, %rbx
	movq	%rcx, (%rdi)
	movq	%rcx, 8(%rdi)
	movq	%rcx, 16(%rdi)
	call	_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm
	movq	0(%rbp), %rax
	testq	%rbx, %rbx
	je	.L27
	xorl	%edx, %edx
	movq	%rdx, (%rax)
	leaq	8(%rax), %rdx
	decq	%rbx
	je	.L30
	leaq	(%rdx,%rbx,8), %rcx
	movq	%rdx, %rsi
.L28:
	cmpq	%rsi, %rcx
	je	.L35
	movq	(%rax), %rdi
	addq	$8, %rsi
	movq	%rdi, -8(%rsi)
	jmp	.L28
.L35:
	subq	%rax, %rcx
	leaq	-8(%rdx,%rcx), %rax
	jmp	.L27
.L30:
	movq	%rdx, %rax
.L27:
	movq	%rax, 8(%rbp)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4660:
	.size	_ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_, .-_ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_
	.weak	_ZNSt6vectorI6float2SaIS0_EEC1EmRKS1_
	.set	_ZNSt6vectorI6float2SaIS0_EEC1EmRKS1_,_ZNSt6vectorI6float2SaIS0_EEC2EmRKS1_
	.section	.rodata.str1.1
.LC4:
	.string	"Sparse FFT Result:"
.LC5:
	.string	" + "
.LC6:
	.string	"i"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4323:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4323
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1024, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	160(%rsp), %rbp
	leaq	88(%rsp), %rax
	movq	%rax, %rdi
	movq	%rbp, %rdx
	movq	%rax, 8(%rsp)
.LEHB0:
	call	_ZNSt6vectorI6float2SaIS0_EEC1EmRKS1_
.LEHE0:
	xorl	%edi, %edi
	movq	%rdi, 120(%rsp)
	movq	%rdi, 128(%rsp)
	movl	$4096, %edi
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	leaq	4096(%rax), %rdx
	xorl	%esi, %esi
	movq	%rax, 112(%rsp)
	movq	%rax, %rbx
	movq	%rdx, 128(%rsp)
	movl	%esi, (%rax)
	xorl	%eax, %eax
.L37:
	addq	$4, %rax
	cmpq	$4096, %rax
	je	.L65
	xorl	%ecx, %ecx
	movl	%ecx, (%rbx,%rax)
	jmp	.L37
.L65:
	leaq	136(%rsp), %r13
	xorl	%eax, %eax
	movl	$2048, %esi
	movq	%rdx, 120(%rsp)
	movq	%r13, %rdi
	movq	%rax, 136(%rsp)
	movq	%rax, 144(%rsp)
	movq	%rax, 152(%rsp)
.LEHB2:
	call	_ZNSt12_Vector_baseI6float2SaIS0_EE17_M_create_storageEm
.LEHE2:
	movq	136(%rsp), %r12
	xorl	%eax, %eax
	leaq	16384(%r12), %rdx
.L39:
	movl	$0x00000000, (%r12,%rax)
	movl	$0x00000000, 4(%r12,%rax)
	addq	$8, %rax
	cmpq	$16384, %rax
	jne	.L39
	movq	%rdx, 144(%rsp)
	movl	$1024, %esi
	movq	%rbp, %rdi
	leaq	76(%rsp), %rdx
.LEHB3:
	call	_ZNSt6vectorI6float2SaIS0_EEC1EmRKS1_
.LEHE3:
	movq	88(%rsp), %r14
	xorl	%eax, %eax
.L40:
	cvtsi2ssl	%eax, %xmm0
	leal	(%rax,%rax), %edx
	movss	%xmm0, (%r14,%rax,8)
	movss	%xmm0, 4(%r14,%rax,8)
	movl	%edx, (%rbx,%rax,4)
	incq	%rax
	cmpq	$1024, %rax
	jne	.L40
	leaq	32(%rsp), %rdi
	movl	$8192, %esi
.LEHB4:
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movl	$16384, %esi
	call	cudaMalloc@PLT
	leaq	48(%rsp), %rdi
	movl	$8192, %esi
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$4096, %esi
	call	cudaMalloc@PLT
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movl	$8192, %edx
	movq	%r14, %rsi
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdi
	movl	$1, %ecx
	movl	$4096, %edx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movl	$16384, %edx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movl	$16777217, %edx
	movl	$1073741825, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	salq	$2, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 76(%rsp)
	movl	$1, 84(%rsp)
	movq	%rdi, 64(%rsp)
	movl	$1, 72(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L41
.L43:
	call	cudaDeviceSynchronize@PLT
	jmp	.L66
.L41:
	movq	40(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$1024, %ecx
	movq	32(%rsp), %rdi
	call	_Z53__device_stub__Z19sparseToDenseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	jmp	.L43
.L66:
	leaq	28(%rsp), %rdi
	movl	$1, %ecx
	movl	$41, %edx
	movl	$2048, %esi
	call	cufftPlan1d@PLT
	movq	40(%rsp), %rsi
	movl	28(%rsp), %edi
	orl	$-1, %ecx
	movq	%rsi, %rdx
	call	cufftExecC2C@PLT
	call	cudaDeviceSynchronize@PLT
	movl	$16777217, %edx
	movl	$1073741825, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	salq	$2, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 76(%rsp)
	movl	$1, 84(%rsp)
	movq	%rdi, 64(%rsp)
	movl	$1, 72(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L44
.L46:
	call	cudaDeviceSynchronize@PLT
	jmp	.L67
.L44:
	movq	48(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$1024, %ecx
	movq	40(%rsp), %rdi
	call	_Z53__device_stub__Z19denseToSparseKernelPK6float2PKiPS_iPK6float2PKiPS_i
	jmp	.L46
.L67:
	movq	48(%rsp), %rsi
	movl	$2, %ecx
	movl	$8192, %edx
	movq	160(%rsp), %r12
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movl	28(%rsp), %edi
	call	cufftDestroy@PLT
	leaq	_ZSt4cout(%rip), %r14
	leaq	.LC4(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	xorl	%ebx, %ebx
	leaq	.LC5(%rip), %r15
.L47:
	movq	%r14, %rdi
	cvtss2sd	(%r12,%rbx), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r15, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	4(%r12,%rbx), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC6(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE4:
	addq	$8, %rbx
	cmpq	$40, %rbx
	jne	.L47
	leaq	160(%rsp), %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	leaq	136(%rsp), %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	88(%rsp), %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L53
	jmp	.L63
.L57:
	endbr64
	movq	%rax, %rbx
.L48:
	movq	%rbp, %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	jmp	.L49
.L56:
	endbr64
	movq	%rax, %rbx
.L49:
	movq	%r13, %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	jmp	.L50
.L55:
	endbr64
	movq	%rax, %rbx
.L50:
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L51
.L54:
	endbr64
	movq	%rax, %rbx
.L51:
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L63
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L63:
	call	__stack_chk_fail@PLT
.L53:
	addq	$200, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4323:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4323:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4323-.LLSDACSB4323
.LLSDACSB4323:
	.uleb128 .LEHB0-.LFB4323
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4323
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L54-.LFB4323
	.uleb128 0
	.uleb128 .LEHB2-.LFB4323
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L55-.LFB4323
	.uleb128 0
	.uleb128 .LEHB3-.LFB4323
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L56-.LFB4323
	.uleb128 0
	.uleb128 .LEHB4-.LFB4323
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L57-.LFB4323
	.uleb128 0
	.uleb128 .LEHB5-.LFB4323
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE4323:
	.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
	.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 <hipfft/hipfft.h>
#include <hipfft/hipfftXt.h>
#include <vector>
#include <complex>

// Kernel to transform sparse complex data into a dense format for FFT
__global__ void sparseToDenseKernel(const hipfftComplex* sparseData, const int* indices, hipfftComplex* denseData, int N) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx < N) {
        denseData[indices[idx]] = sparseData[idx];
    }
}

// Kernel to transform dense complex data back into a sparse format
__global__ void denseToSparseKernel(const hipfftComplex* denseData, const int* indices, hipfftComplex* sparseData, int N) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx < N) {
        sparseData[idx] = denseData[indices[idx]];
    }
}

int main() {
    // Example sparse data and indices
    const int N = 1024; // Number of non-zero elements
    const int M = 2048; // Size of the dense FFT

    // Allocate host memory
    std::vector<hipfftComplex> h_sparseData(N);
    std::vector<int> h_indices(N);
    std::vector<hipfftComplex> h_denseData(M, {0.0f, 0.0f});
    std::vector<hipfftComplex> h_result(N);

    // Initialize sparse data and indices
    for (int i = 0; i < N; ++i) {
        h_sparseData[i] = {static_cast<float>(i), static_cast<float>(i)};
        h_indices[i] = i * 2; // Example: every second element is non-zero
    }

    // Allocate device memory
    hipfftComplex* d_sparseData;
    hipfftComplex* d_denseData;
    hipfftComplex* d_result;
    int* d_indices;

    hipMalloc(&d_sparseData, N * sizeof(hipfftComplex));
    hipMalloc(&d_denseData, M * sizeof(hipfftComplex));
    hipMalloc(&d_result, N * sizeof(hipfftComplex));
    hipMalloc(&d_indices, N * sizeof(int));

    // Copy data to device
    hipMemcpy(d_sparseData, h_sparseData.data(), N * sizeof(hipfftComplex), hipMemcpyHostToDevice);
    hipMemcpy(d_indices, h_indices.data(), N * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(d_denseData, h_denseData.data(), M * sizeof(hipfftComplex), hipMemcpyHostToDevice);

    // Launch kernel to convert sparse to dense
    int threadsPerBlock = 256;
    int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock;
    sparseToDenseKernel<<<blocksPerGrid, threadsPerBlock>>>(d_sparseData, d_indices, d_denseData, N);
    hipDeviceSynchronize();

    // Create CUFFT plan
    hipfftHandle plan;
    hipfftPlan1d(&plan, M, HIPFFT_C2C, 1);

    // Execute CUFFT
    hipfftExecC2C(plan, d_denseData, d_denseData, HIPFFT_FORWARD);
    hipDeviceSynchronize();

    // Launch kernel to convert dense to sparse
    denseToSparseKernel<<<blocksPerGrid, threadsPerBlock>>>(d_denseData, d_indices, d_result, N);
    hipDeviceSynchronize();

    // Copy result back to host
    hipMemcpy(h_result.data(), d_result, N * sizeof(hipfftComplex), hipMemcpyDeviceToHost);

    // Free device memory
    hipFree(d_sparseData);
    hipFree(d_denseData);
    hipFree(d_result);
    hipFree(d_indices);
    hipfftDestroy(plan);

    // Output the result
    std::cout << "Sparse FFT Result:" << std::endl;
    for (int i = 0; i < 5; ++i) { // Print first 5 elements for brevity
        std::cout << h_result[i].x << " + " << h_result[i].y << "i" << std::endl;
    }

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

                                        # End of file scope inline assembly
	.globl	_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i # -- Begin function _Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.type	_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i,@function
_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i: # @_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.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	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, %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__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, .Lfunc_end0-_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i # -- Begin function _Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.type	_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i,@function
_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i: # @_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.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	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, %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_end1:
	.size	_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, .Lfunc_end1-_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.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:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$8192, %edi                     # imm = 0x2000
	callq	_Znwm
	movq	%rax, %rbx
	movl	$8192, %edx                     # imm = 0x2000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp0:
	movl	$4096, %edi                     # imm = 0x1000
	callq	_Znwm
.Ltmp1:
# %bb.1:
	movq	%rax, %r14
	movl	$4096, %edx                     # imm = 0x1000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp3:
	movl	$16384, %edi                    # imm = 0x4000
	callq	_Znwm
.Ltmp4:
# %bb.2:                                # %.lr.ph.i.i.i.i.i.i.preheader
	movq	%rax, %r15
	xorl	%r13d, %r13d
	movl	$16384, %edx                    # imm = 0x4000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp6:
	movl	$8192, %edi                     # imm = 0x2000
	callq	_Znwm
.Ltmp7:
# %bb.3:
	movq	%rax, %r12
	movl	$8192, %edx                     # imm = 0x2000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	xorl	%eax, %eax
.LBB2_4:                                # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	unpcklps	%xmm0, %xmm0                    # xmm0 = xmm0[0,0,1,1]
	movlps	%xmm0, (%rbx,%rax,8)
	movl	%r13d, (%r14,%rax,4)
	incq	%rax
	addl	$2, %r13d
	cmpq	$1024, %rax                     # imm = 0x400
	jne	.LBB2_4
# %bb.5:
.Ltmp9:
	leaq	24(%rsp), %rdi
	movl	$8192, %esi                     # imm = 0x2000
	callq	hipMalloc
.Ltmp10:
# %bb.6:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj2EEE10hipError_tPPT_m.exit
.Ltmp11:
	movq	%rsp, %rdi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
.Ltmp12:
# %bb.7:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj2EEE10hipError_tPPT_m.exit47
.Ltmp13:
	leaq	16(%rsp), %rdi
	movl	$8192, %esi                     # imm = 0x2000
	callq	hipMalloc
.Ltmp14:
# %bb.8:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj2EEE10hipError_tPPT_m.exit49
.Ltmp15:
	leaq	8(%rsp), %rdi
	movl	$4096, %esi                     # imm = 0x1000
	callq	hipMalloc
.Ltmp16:
# %bb.9:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
	movq	24(%rsp), %rdi
.Ltmp17:
	movl	$8192, %edx                     # imm = 0x2000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp18:
# %bb.10:
	movq	8(%rsp), %rdi
.Ltmp19:
	movl	$4096, %edx                     # imm = 0x1000
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp20:
# %bb.11:
	movq	(%rsp), %rdi
.Ltmp21:
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp22:
# %bb.12:
.Ltmp24:
	movabsq	$4294967300, %rdi               # imm = 0x100000004
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp25:
# %bb.13:
	testl	%eax, %eax
	jne	.LBB2_15
# %bb.14:
	movq	24(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp26:
	movl	$1024, %ecx                     # imm = 0x400
	callq	_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
.Ltmp27:
.LBB2_15:
.Ltmp28:
	callq	hipDeviceSynchronize
.Ltmp29:
# %bb.16:
.Ltmp31:
	leaq	32(%rsp), %rdi
	movl	$2048, %esi                     # imm = 0x800
	movl	$41, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
.Ltmp32:
# %bb.17:
	movq	32(%rsp), %rdi
	movq	(%rsp), %rdx
.Ltmp33:
	movq	%rdx, %rsi
	movl	$-1, %ecx
	callq	hipfftExecC2C
.Ltmp34:
# %bb.18:
.Ltmp35:
	callq	hipDeviceSynchronize
.Ltmp36:
# %bb.19:
.Ltmp37:
	movabsq	$4294967300, %rdi               # imm = 0x100000004
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp38:
# %bb.20:
	testl	%eax, %eax
	jne	.LBB2_22
# %bb.21:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp39:
	movl	$1024, %ecx                     # imm = 0x400
	callq	_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
.Ltmp40:
.LBB2_22:
.Ltmp41:
	callq	hipDeviceSynchronize
.Ltmp42:
# %bb.23:
	movq	16(%rsp), %rsi
.Ltmp43:
	movl	$8192, %edx                     # imm = 0x2000
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp44:
# %bb.24:
	movq	24(%rsp), %rdi
.Ltmp45:
	callq	hipFree
.Ltmp46:
# %bb.25:
	movq	(%rsp), %rdi
.Ltmp47:
	callq	hipFree
.Ltmp48:
# %bb.26:
	movq	16(%rsp), %rdi
.Ltmp49:
	callq	hipFree
.Ltmp50:
# %bb.27:
	movq	8(%rsp), %rdi
.Ltmp51:
	callq	hipFree
.Ltmp52:
# %bb.28:
	movq	32(%rsp), %rdi
.Ltmp53:
	callq	hipfftDestroy
.Ltmp54:
# %bb.29:
.Ltmp55:
	movl	$_ZSt4cout, %r13d
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp56:
# %bb.30:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r13
.Ltmp57:
	movq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp58:
# %bb.31:                               # %.noexc81
.Ltmp59:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp60:
# %bb.32:                               # %.noexc82
.Ltmp61:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp62:
# %bb.33:                               # %_ZNSolsEPFRSoS_E.exit.preheader.preheader
	xorl	%ebp, %ebp
.LBB2_34:                               # %_ZNSolsEPFRSoS_E.exit.preheader
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r12,%rbp,8), %xmm0
.Ltmp64:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp65:
# %bb.35:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB2_34 Depth=1
.Ltmp66:
	movq	%rax, %r13
	movl	$.L.str.1, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp67:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit60
                                        #   in Loop: Header=BB2_34 Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%r12,%rbp,8), %xmm0
.Ltmp68:
	movq	%r13, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp69:
# %bb.37:                               # %_ZNSolsEf.exit62
                                        #   in Loop: Header=BB2_34 Depth=1
.Ltmp70:
	movq	%rax, %r13
	movl	$.L.str.2, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp71:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit64
                                        #   in Loop: Header=BB2_34 Depth=1
	movq	(%r13), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp72:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp73:
# %bb.39:                               # %.noexc84
                                        #   in Loop: Header=BB2_34 Depth=1
.Ltmp74:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp75:
# %bb.40:                               # %.noexc85
                                        #   in Loop: Header=BB2_34 Depth=1
.Ltmp76:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp77:
# %bb.41:                               # %_ZNSolsEPFRSoS_E.exit66
                                        #   in Loop: Header=BB2_34 Depth=1
	incq	%rbp
	cmpq	$5, %rbp
	jne	.LBB2_34
# %bb.42:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj2EESaIS1_EED2Ev.exit57
	movq	%r12, %rdi
	callq	_ZdlPv
	movq	%r15, %rdi
	callq	_ZdlPv
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_45:
	.cfi_def_cfa_offset 96
.Ltmp8:
	movq	%rax, %r13
	jmp	.LBB2_51
.LBB2_44:
.Ltmp5:
	movq	%rax, %r13
	jmp	.LBB2_52
.LBB2_43:
.Ltmp2:
	movq	%rax, %r13
	jmp	.LBB2_53
.LBB2_47:
.Ltmp30:
	jmp	.LBB2_50
.LBB2_46:
.Ltmp23:
	jmp	.LBB2_50
.LBB2_48:
.Ltmp63:
	jmp	.LBB2_50
.LBB2_49:
.Ltmp78:
.LBB2_50:
	movq	%rax, %r13
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB2_51:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj2EESaIS1_EED2Ev.exit70
	movq	%r15, %rdi
	callq	_ZdlPv
.LBB2_52:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit72
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB2_53:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj2EESaIS1_EED2Ev.exit74
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r13, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.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 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp6-.Ltmp4                  #   Call between .Ltmp4 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 7 <<
	.uleb128 .Ltmp9-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 8 <<
	.uleb128 .Ltmp22-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin0          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp29-.Ltmp24                #   Call between .Ltmp24 and .Ltmp29
	.uleb128 .Ltmp30-.Lfunc_begin0          #     jumps to .Ltmp30
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp31-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp62-.Ltmp31                #   Call between .Ltmp31 and .Ltmp62
	.uleb128 .Ltmp63-.Lfunc_begin0          #     jumps to .Ltmp63
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp64-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp77-.Ltmp64                #   Call between .Ltmp64 and .Ltmp77
	.uleb128 .Ltmp78-.Lfunc_begin0          #     jumps to .Ltmp78
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Lfunc_end2-.Ltmp77            #   Call between .Ltmp77 and .Lfunc_end2
	.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
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB4_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i,@object # @_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.section	.rodata,"a",@progbits
	.globl	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.p2align	3, 0x0
_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i:
	.quad	_Z34__device_stub__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.size	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, 8

	.type	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i,@object # @_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.globl	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.p2align	3, 0x0
_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i:
	.quad	_Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.size	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Sparse FFT Result:"
	.size	.L.str, 19

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

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i"
	.size	.L__unnamed_1, 58

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i"
	.size	.L__unnamed_2, 58

	.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__sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.addrsig_sym _Z34__device_stub__denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.addrsig_sym _Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i ; -- Begin function _Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.globl	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.p2align	8
	.type	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i,@function
_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i: ; @_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	v_lshlrev_b64 v[1:2], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s6, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v4, vcc_lo
	v_add_co_u32 v1, vcc_lo, s4, v1
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v2, vcc_lo, s5, v2, vcc_lo
	global_load_b32 v0, v[3:4], off
	global_load_b64 v[2:3], v[1:2], off
	s_waitcnt vmcnt(1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 3, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b64 v[0:1], v[2:3], off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 5
		.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	_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, .Lfunc_end0-_Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 208
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i ; -- Begin function _Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.globl	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
	.p2align	8
	.type	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i,@function
_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i: ; @_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s6, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v4, vcc_lo
	global_load_b32 v3, v[3:4], off
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 3, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	s_waitcnt vmcnt(0)
	global_store_b64 v[0:1], v[3:4], off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 5
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i, .Lfunc_end1-_Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 204
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 1
; 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
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z19sparseToDenseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z19denseToSparseKernelPK15HIP_vector_typeIfLj2EEPKiPS0_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
