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

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

#define CHECK_CUFFT(call)                                                      \
{                                                                              \
    const cufftResult_t result = call;                                         \
    if (result != CUFFT_SUCCESS)                                               \
    {                                                                          \
        std::cerr << "CUFFT Error: " << result << ":\n";                       \
        std::cerr << __FILE__ << ":" << __LINE__ << std::endl;                   \
        exit(EXIT_FAILURE);                                                    \
    }                                                                          \
}

const int N = 1 << 5; // 32D FFT, each dimension size is 32
const int NUM_GPUS = 2;

void initialize_data(cufftComplex* h_data, int size) {
    for (int i = 0; i < size; ++i) {
        h_data[i].x = static_cast<float>(rand()) / RAND_MAX;
        h_data[i].y = 0.0f;
    }
}

void print_data(cufftComplex* data, int size) {
    for (int i = 0; i < size; ++i) {
        std::cout << data[i].x << " + " << data[i].y << "i ";
        if ((i + 1) % N == 0) std::cout << std::endl;
    }
}

int main() {
    int device_count;
    cudaGetDeviceCount(&device_count);
    if (device_count < NUM_GPUS) {
        std::cerr << "Not enough GPUs available. Required: " << NUM_GPUS << ", Available: " << device_count << std::endl;
        return EXIT_FAILURE;
    }

    int size = N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N;
    std::vector<cufftComplex> h_data(size);

    initialize_data(h_data.data(), size);

    cufftHandle plans[NUM_GPUS];
    cufftComplex *d_data[NUM_GPUS];

    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        CHECK(cudaMalloc(&d_data[gpu], size * sizeof(cufftComplex)));
        CHECK(cudaMemcpy(d_data[gpu], h_data.data(), size * sizeof(cufftComplex), cudaMemcpyHostToDevice));

        int rank = 32;
        int n[32];
        for (int i = 0; i < rank; ++i) n[i] = N;

        CHECK_CUFFT(cufftPlanMany(&plans[gpu], rank, n, NULL, 1, 0, NULL, 1, 0, CUFFT_C2C, size / NUM_GPUS));
    }

    // Execute the FFTs in parallel across GPUs
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        CHECK_CUFFT(cufftExecC2C(plans[gpu], d_data[gpu], d_data[gpu], CUFFT_FORWARD));
    }

    // Synchronize all GPUs
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        CHECK(cudaDeviceSynchronize());
    }

    // Copy results back to host
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        CHECK(cudaMemcpy(h_data.data() + gpu * (size / NUM_GPUS), d_data[gpu], (size / NUM_GPUS) * sizeof(cufftComplex), cudaMemcpyDeviceToHost));
    }

    // Print results (optional, for small sizes)
    // print_data(h_data.data(), size);

    // Clean up
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        CHECK(cudaFree(d_data[gpu]));
        CHECK_CUFFT(cufftDestroy(plans[gpu]));
    }

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4026:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4026:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4753:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4753:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z15initialize_dataP6float2i
	.type	_Z15initialize_dataP6float2i, @function
_Z15initialize_dataP6float2i:
.LFB4021:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
.L4:
	cmpl	%ebx, %r12d
	jle	.L8
	call	rand@PLT
	movl	$0x00000000, 4(%rbp,%rbx,8)
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC0(%rip), %xmm0
	movss	%xmm0, 0(%rbp,%rbx,8)
	incq	%rbx
	jmp	.L4
.L8:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4021:
	.size	_Z15initialize_dataP6float2i, .-_Z15initialize_dataP6float2i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	" + "
.LC3:
	.string	"i "
	.text
	.globl	_Z10print_dataP6float2i
	.type	_Z10print_dataP6float2i, @function
_Z10print_dataP6float2i:
.LFB4022:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	_ZSt4cout(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L10:
	cmpl	%ebx, %r12d
	jle	.L14
	movq	%r13, %rdi
	cvtss2sd	0(%rbp,%rbx,8), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	4(%rbp,%rbx,8), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leal	1(%rbx), %eax
	testb	$31, %al
	jne	.L11
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L11:
	incq	%rbx
	jmp	.L10
.L14:
	popq	%rax
	.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
.LFE4022:
	.size	_Z10print_dataP6float2i, .-_Z10print_dataP6float2i
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4049:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4049:
	.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:
.LFB4363:
	.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
.LFE4363:
	.size	_ZNSt6vectorI6float2SaIS0_EED2Ev, .-_ZNSt6vectorI6float2SaIS0_EED2Ev
	.weak	_ZNSt6vectorI6float2SaIS0_EED1Ev
	.set	_ZNSt6vectorI6float2SaIS0_EED1Ev,_ZNSt6vectorI6float2SaIS0_EED2Ev
	.section	.rodata.str1.1
.LC4:
	.string	"Not enough GPUs available. Required: "
.LC5:
	.string	", Available: "
.LC6:
	.string	"Error: "
.LC7:
	.string	":\n"
.LC8:
	.string	"/home/ubuntu/Datasets/cuda-codes-80k-from-llm-dedup/cuda_code_142087.cu"
.LC9:
	.string	":"
.LC10:
	.string	"CUFFT Error: "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4023:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4023
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-220(%rbp), %rdi
	pushq	%r12
	pushq	%rbx
	subq	$192, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
.LEHB0:
	call	cudaGetDeviceCount@PLT
	cmpl	$1, -220(%rbp)
	jg	.L20
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$2, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-220(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE0:
	movl	$1, %eax
	jmp	.L19
.L20:
	xorl	%edx, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	movq	%rdx, -216(%rbp)
	leaq	-168(%rbp), %r13
	movq	%rdx, -200(%rbp)
	movq	%rdx, -208(%rbp)
	call	_Z15initialize_dataP6float2i
	leaq	-184(%rbp), %rax
	movq	%rax, %r14
.L26:
	movl	%ebx, %edi
.LEHB1:
	call	cudaSetDevice@PLT
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	cudaMalloc@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L22
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$63, %esi
.L55:
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$1, %edi
	call	exit@PLT
.L22:
	movq	(%r14), %rdi
	movl	$1, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	call	cudaMemcpy@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L40
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$64, %esi
	jmp	.L55
.L40:
	xorl	%eax, %eax
.L23:
	movl	$32, 0(%r13,%rax,4)
	incq	%rax
	cmpq	$32, %rax
	jne	.L23
	pushq	%rax
	leaq	-192(%rbp,%rbx,4), %rdi
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	pushq	$0
	movl	$1, %r8d
	movq	%r13, %rdx
	movl	$32, %esi
	pushq	$41
	pushq	$0
	pushq	$1
	pushq	$0
	.cfi_escape 0x2e,0x30
	call	cufftPlanMany@PLT
	movl	%eax, %r12d
	addq	$48, %rsp
	testl	%eax, %eax
	je	.L25
	leaq	_ZSt4cerr(%rip), %rbx
	leaq	.LC10(%rip), %rsi
	movq	%rbx, %rdi
	.cfi_escape 0x2e,0
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$70, %esi
	jmp	.L55
.L25:
	movq	%r14, %rax
	addq	$8, %rax
	movq	%rax, %r14
	testq	%rbx, %rbx
	jne	.L62
	movl	$1, %ebx
	jmp	.L26
.L62:
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	movq	-184(%rbp), %rsi
	movl	-192(%rbp), %edi
	orl	$-1, %ecx
	movq	%rsi, %rdx
	call	cufftExecC2C@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L27
	movl	$1, %edi
	call	cudaSetDevice@PLT
	movq	-176(%rbp), %rsi
	movl	-188(%rbp), %edi
	orl	$-1, %ecx
	movq	%rsi, %rdx
	call	cufftExecC2C@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L28
.L27:
	leaq	.LC10(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$76, %esi
	jmp	.L55
.L28:
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L29
	movl	$1, %edi
	call	cudaSetDevice@PLT
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L30
.L29:
	leaq	_ZSt4cerr(%rip), %r12
	leaq	.LC6(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$82, %esi
	jmp	.L55
.L30:
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	movq	-184(%rbp), %rsi
	movl	$2, %ecx
	xorl	%edx, %edx
	xorl	%edi, %edi
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L31
	movl	$1, %edi
	call	cudaSetDevice@PLT
	movq	-176(%rbp), %rsi
	movl	$2, %ecx
	xorl	%edx, %edx
	xorl	%edi, %edi
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L32
.L31:
	leaq	_ZSt4cerr(%rip), %r12
	leaq	.LC6(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$88, %esi
	jmp	.L55
.L32:
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	movq	-184(%rbp), %rdi
	call	cudaFree@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L33
	movl	-192(%rbp), %edi
	call	cufftDestroy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L34
	movl	$1, %edi
	call	cudaSetDevice@PLT
	movq	-176(%rbp), %rdi
	call	cudaFree@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L35
.L33:
	leaq	_ZSt4cerr(%rip), %r12
	leaq	.LC6(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$97, %esi
	jmp	.L55
.L35:
	movl	-188(%rbp), %edi
	call	cufftDestroy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L36
.L34:
	leaq	.LC10(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE1:
	movq	%rax, %rdi
	movl	$98, %esi
	jmp	.L55
.L36:
	leaq	-216(%rbp), %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	xorl	%eax, %eax
	jmp	.L19
.L42:
	endbr64
	movq	%rax, %rbx
.L37:
	leaq	-216(%rbp), %rdi
	call	_ZNSt6vectorI6float2SaIS0_EED1Ev
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L53
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L19:
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
.L53:
	call	__stack_chk_fail@PLT
.L39:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4023:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4023:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4023-.LLSDACSB4023
.LLSDACSB4023:
	.uleb128 .LEHB0-.LFB4023
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4023
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L42-.LFB4023
	.uleb128 0
	.uleb128 .LEHB2-.LFB4023
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4023:
	.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
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	805306368
	.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 <vector>

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

#define CHECK_CUFFT(call)                                                      \
{                                                                              \
    const hipfftResult_t result = call;                                         \
    if (result != HIPFFT_SUCCESS)                                               \
    {                                                                          \
        std::cerr << "CUFFT Error: " << result << ":\n";                       \
        std::cerr << __FILE__ << ":" << __LINE__ << std::endl;                   \
        exit(EXIT_FAILURE);                                                    \
    }                                                                          \
}

const int N = 1 << 5; // 32D FFT, each dimension size is 32
const int NUM_GPUS = 2;

void initialize_data(hipfftComplex* h_data, int size) {
    for (int i = 0; i < size; ++i) {
        h_data[i].x = static_cast<float>(rand()) / RAND_MAX;
        h_data[i].y = 0.0f;
    }
}

void print_data(hipfftComplex* data, int size) {
    for (int i = 0; i < size; ++i) {
        std::cout << data[i].x << " + " << data[i].y << "i ";
        if ((i + 1) % N == 0) std::cout << std::endl;
    }
}

int main() {
    int device_count;
    hipGetDeviceCount(&device_count);
    if (device_count < NUM_GPUS) {
        std::cerr << "Not enough GPUs available. Required: " << NUM_GPUS << ", Available: " << device_count << std::endl;
        return EXIT_FAILURE;
    }

    int size = N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N * N;
    std::vector<hipfftComplex> h_data(size);

    initialize_data(h_data.data(), size);

    hipfftHandle plans[NUM_GPUS];
    hipfftComplex *d_data[NUM_GPUS];

    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        CHECK(hipMalloc(&d_data[gpu], size * sizeof(hipfftComplex)));
        CHECK(hipMemcpy(d_data[gpu], h_data.data(), size * sizeof(hipfftComplex), hipMemcpyHostToDevice));

        int rank = 32;
        int n[32];
        for (int i = 0; i < rank; ++i) n[i] = N;

        CHECK_CUFFT(hipfftPlanMany(&plans[gpu], rank, n, NULL, 1, 0, NULL, 1, 0, HIPFFT_C2C, size / NUM_GPUS));
    }

    // Execute the FFTs in parallel across GPUs
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        CHECK_CUFFT(hipfftExecC2C(plans[gpu], d_data[gpu], d_data[gpu], HIPFFT_FORWARD));
    }

    // Synchronize all GPUs
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        CHECK(hipDeviceSynchronize());
    }

    // Copy results back to host
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        CHECK(hipMemcpy(h_data.data() + gpu * (size / NUM_GPUS), d_data[gpu], (size / NUM_GPUS) * sizeof(hipfftComplex), hipMemcpyDeviceToHost));
    }

    // Print results (optional, for small sizes)
    // print_data(h_data.data(), size);

    // Clean up
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        CHECK(hipFree(d_data[gpu]));
        CHECK_CUFFT(hipfftDestroy(plans[gpu]));
    }

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

                                        # End of file scope inline assembly
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15initialize_dataP15HIP_vector_typeIfLj2EEi
.LCPI0_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z15initialize_dataP15HIP_vector_typeIfLj2EEi
	.type	_Z15initialize_dataP15HIP_vector_typeIfLj2EEi,@function
_Z15initialize_dataP15HIP_vector_typeIfLj2EEi: # @_Z15initialize_dataP15HIP_vector_typeIfLj2EEi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB0_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI0_0(%rip), %xmm0
	movss	%xmm0, (%rbx,%r15,8)
	movl	$0, 4(%rbx,%r15,8)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB0_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB0_4:                                # %._crit_edge
	retq
.Lfunc_end0:
	.size	_Z15initialize_dataP15HIP_vector_typeIfLj2EEi, .Lfunc_end0-_Z15initialize_dataP15HIP_vector_typeIfLj2EEi
	.cfi_endproc
                                        # -- End function
	.globl	_Z10print_dataP15HIP_vector_typeIfLj2EEi # -- Begin function _Z10print_dataP15HIP_vector_typeIfLj2EEi
	.type	_Z10print_dataP15HIP_vector_typeIfLj2EEi,@function
_Z10print_dataP15HIP_vector_typeIfLj2EEi: # @_Z10print_dataP15HIP_vector_typeIfLj2EEi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB1_6
# %bb.1:                                # %.lr.ph.preheader
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r15d
	negq	%r15
	movl	$1, %r12d
	movl	$_ZSt4cout, %r13d
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	-8(%rbx,%r12,8), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movl	$.L.str, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	-4(%rbx,%r12,8), %xmm0
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	testb	$31, %r12b
	jne	.LBB1_4
# %bb.3:                                #   in Loop: Header=BB1_2 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB1_4:                                #   in Loop: Header=BB1_2 Depth=1
	leaq	(%r15,%r12), %rax
	incq	%rax
	incq	%r12
	cmpq	$1, %rax
	jne	.LBB1_2
# %bb.5:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
.LBB1_6:                                # %._crit_edge
	retq
.Lfunc_end1:
	.size	_Z10print_dataP15HIP_vector_typeIfLj2EEi, .Lfunc_end1-_Z10print_dataP15HIP_vector_typeIfLj2EEi
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	12(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	cmpl	$1, (%rbx)
	jg	.LBB2_3
# %bb.1:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$37, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$2, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movl	$.L.str.3, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	12(%rsp), %esi
	movq	%rbx, %rdi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$1, %eax
	jmp	.LBB2_2
.LBB2_3:
	movb	$1, %r12b
	xorl	%r13d, %r13d
	leaq	48(%rsp), %rbx
	xorl	%r14d, %r14d
.LBB2_4:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj2EEE10hipError_tPPT_m.exit
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_9 Depth 2
	movl	%r14d, %edi
	callq	hipSetDevice
	leaq	(%rsp,%r14,8), %r15
	addq	$16, %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB2_5
# %bb.6:                                #   in Loop: Header=BB2_4 Depth=1
	movq	(%r15), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB2_7
# %bb.8:                                #   in Loop: Header=BB2_4 Depth=1
	xorl	%eax, %eax
.LBB2_9:                                #   Parent Loop BB2_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$32, 48(%rsp,%rax,4)
	incq	%rax
	cmpq	$32, %rax
	jne	.LBB2_9
# %bb.10:                               #   in Loop: Header=BB2_4 Depth=1
	leaq	(%rsp,%r14,8), %rdi
	addq	$32, %rdi
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	$32, %esi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	pushq	$41
	.cfi_adjust_cfa_offset 8
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	hipfftPlanMany
	addq	$48, %rsp
	.cfi_adjust_cfa_offset -48
	testl	%eax, %eax
	jne	.LBB2_11
# %bb.13:                               #   in Loop: Header=BB2_4 Depth=1
	movl	$1, %r14d
	testb	$1, %r12b
	movl	$0, %r12d
	jne	.LBB2_4
# %bb.14:                               # %.preheader145.preheader
	movb	$1, %bpl
	xorl	%ebx, %ebx
.LBB2_15:                               # %.preheader145
                                        # =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	hipSetDevice
	movq	32(%rsp,%rbx,8), %rdi
	movq	16(%rsp,%rbx,8), %rdx
	movq	%rdx, %rsi
	movl	$-1, %ecx
	callq	hipfftExecC2C
	testl	%eax, %eax
	jne	.LBB2_20
# %bb.16:                               #   in Loop: Header=BB2_15 Depth=1
	movl	$1, %ebx
	xorl	%edi, %edi
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB2_15
# %bb.17:                               # %.preheader144.preheader
	movb	$1, %bpl
.LBB2_18:                               # %.preheader144
                                        # =>This Inner Loop Header: Depth=1
	callq	hipSetDevice
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB2_19
# %bb.21:                               #   in Loop: Header=BB2_18 Depth=1
	movl	$1, %edi
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB2_18
# %bb.22:                               # %.preheader143.preheader
	movb	$1, %bpl
	xorl	%ebx, %ebx
.LBB2_23:                               # %.preheader143
                                        # =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	hipSetDevice
	movq	16(%rsp,%rbx,8), %rsi
	xorl	%edi, %edi
	xorl	%edx, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB2_26
# %bb.24:                               #   in Loop: Header=BB2_23 Depth=1
	movl	$1, %ebx
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB2_23
# %bb.25:                               # %.preheader.preheader
	movb	$1, %r14b
	xorl	%ebx, %ebx
.LBB2_28:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	hipSetDevice
	movq	16(%rsp,%rbx,8), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB2_29
# %bb.30:                               #   in Loop: Header=BB2_28 Depth=1
	movq	32(%rsp,%rbx,8), %rdi
	callq	hipfftDestroy
	testl	%eax, %eax
	jne	.LBB2_31
# %bb.27:                               #   in Loop: Header=BB2_28 Depth=1
	movl	$1, %ebx
	xorl	%eax, %eax
	testb	$1, %r14b
	movl	$0, %r14d
	jne	.LBB2_28
.LBB2_2:
	addq	$184, %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_11:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit103
	.cfi_def_cfa_offset 240
	movl	%eax, %ebp
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.8, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$70, %esi
	jmp	.LBB2_12
.LBB2_7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit98
	movl	%eax, %ebp
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$64, %esi
	jmp	.LBB2_12
.LBB2_5:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movl	%eax, %ebp
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$63, %esi
	jmp	.LBB2_12
.LBB2_20:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit108
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.8, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$76, %esi
	jmp	.LBB2_12
.LBB2_19:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit113
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebx, %edi
	callq	hipGetErrorString
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$82, %esi
	jmp	.LBB2_12
.LBB2_26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit118
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebx, %edi
	callq	hipGetErrorString
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$88, %esi
	jmp	.LBB2_12
.LBB2_31:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit128
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.8, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$98, %esi
	jmp	.LBB2_12
.LBB2_29:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit123
	movl	%eax, %ebp
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$88, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cerr, %edi
	movl	$97, %esi
.LBB2_12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit103
	callq	_ZNSolsEi
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	" + "
	.size	.L.str, 4

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Not enough GPUs available. Required: "
	.size	.L.str.2, 38

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

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

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

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

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

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"CUFFT Error: "
	.size	.L.str.8, 14

	.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 __gxx_personality_v0
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt4cerr
	.addrsig_sym __hip_cuid_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
