#include <stdio.h>
#include <cufft.h>

cufftHandle plan;
cufftResult result;

// 1D FFT single precision ====================================================

void sPlan1dCUFFT(int n, void *stream) {
  result = cufftPlan1d(&plan, n, CUFFT_C2C, 1);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftPlan1d failed: code = %i\n",result);
     return;
  }
  result = cufftSetStream(plan, (cudaStream_t)stream);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftSetStream failed: code = %i\n",result);
     return;
  }
}

// 2D FFT single precision ====================================================

void sPlan2dCUFFT(int nx, int ny, void *stream) {
  result = cufftPlan2d(&plan, nx, ny, CUFFT_C2C);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftPlan2d failed: code = %i\n",result);
     return;
  }
  result = cufftSetStream(plan, (cudaStream_t)stream);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftSetStream failed: code = %i\n",result);
     return;
  }
}

// single precision execute & destroy =========================================

void sExecCUFFT(float *sdata) {
  result = cufftExecC2C(plan, (cufftComplex*)sdata, (cufftComplex*)sdata, CUFFT_FORWARD);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftExecC2C failed: code = %i\n",result);
     return;
  }
}

void sDestroyCUFFT() {
  result = cufftDestroy(plan);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftDestroy failed: code = %i\n",result);
     return;
  }
}

// 1D FFT double precision ====================================================

void dPlan1dCUFFT(int n, void *stream) {
  result = cufftPlan1d(&plan, n, CUFFT_Z2Z, 1);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftPlan1d failed: code = %i\n",result);
     return;
  }
  result = cufftSetStream(plan, (cudaStream_t)stream);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftSetStream failed: code = %i\n",result);
     return;
  }
}

// 2D FFT double precision ====================================================

void dPlan2dCUFFT(int nx, int ny, void *stream) {
  result = cufftPlan2d(&plan, nx, ny, CUFFT_Z2Z);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftPlan2d failed: code = %i\n",result);
     return;
  }
  result = cufftSetStream(plan, (cudaStream_t)stream);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftSetStream failed: code = %i\n",result);
     return;
  }
}

// double precision execute & destroy =========================================

void dExecCUFFT(double *ddata) {
  result = cufftExecZ2Z(plan, (cufftDoubleComplex*)ddata, (cufftDoubleComplex*)ddata, CUFFT_FORWARD);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftExecZ2Z failed: code = %i\n",result);
     return;
  }
}

void dDestroyCUFFT() {
  result = cufftDestroy(plan);
  if (result!=CUFFT_SUCCESS) { 
     printf ("Error: cufftDestroy failed: code = %i\n",result);
     return;
  }
}

/*
// Original versions from the OLCF website
// https://www.olcf.ornl.gov/tutorials/mixing-openacc-with-gpu-libraries/
//
void sLaunchCUFFT(float *sdata, int n, void *stream) {
  cufftHandle plan;
  cufftPlan1d(&plan, n, CUFFT_C2C, 1);
  cufftSetStream(plan, (cudaStream_t)stream);
  cufftExecC2C(plan, (cufftComplex*)sdata, (cufftComplex*)sdata, CUFFT_FORWARD);
  cufftDestroy(plan);
}

void dLaunchCUFFT(double *ddata, int n, void *stream) {
  cufftHandle plan;
  cufftPlan1d(&plan, n, CUFFT_Z2Z, 1);
  cufftSetStream(plan, (cudaStream_t)stream);
  cufftExecZ2Z(plan, (cufftDoubleComplex*)ddata, (cufftDoubleComplex*)ddata, CUFFT_FORWARD);
  cufftDestroy(plan);
}
*/

	.file	"tmpxft_00202b74_00000000-6_cufft.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2060:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2060:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Error: cufftPlan1d failed: code = %i\n"
.LC1:
	.string	"Error: cufftSetStream failed: code = %i\n"
	.text
	.globl	_Z12sPlan1dCUFFTiPv
	.type	_Z12sPlan1dCUFFTiPv, @function
_Z12sPlan1dCUFFTiPv:
.LFB2050:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$41, %edx
	movq	%rsi, %rbx
	movl	$1, %ecx
	movl	%edi, %esi
	leaq	plan(%rip), %rdi
	call	cufftPlan1d@PLT
	leaq	.LC0(%rip), %rsi
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L6
	movl	plan(%rip), %edi
	movq	%rbx, %rsi
	call	cufftSetStream@PLT
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	je	.L2
	leaq	.LC1(%rip), %rsi
.L6:
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L2:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2050:
	.size	_Z12sPlan1dCUFFTiPv, .-_Z12sPlan1dCUFFTiPv
	.section	.rodata.str1.1
.LC2:
	.string	"Error: cufftPlan2d failed: code = %i\n"
	.text
	.globl	_Z12sPlan2dCUFFTiiPv
	.type	_Z12sPlan2dCUFFTiiPv, @function
_Z12sPlan2dCUFFTiiPv:
.LFB2051:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$41, %ecx
	movq	%rdx, %rbx
	movl	%esi, %edx
	movl	%edi, %esi
	leaq	plan(%rip), %rdi
	call	cufftPlan2d@PLT
	leaq	.LC2(%rip), %rsi
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L12
	movl	plan(%rip), %edi
	movq	%rbx, %rsi
	call	cufftSetStream@PLT
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	je	.L8
	leaq	.LC1(%rip), %rsi
.L12:
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L8:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2051:
	.size	_Z12sPlan2dCUFFTiiPv, .-_Z12sPlan2dCUFFTiiPv
	.section	.rodata.str1.1
.LC3:
	.string	"Error: cufftExecC2C failed: code = %i\n"
	.text
	.globl	_Z10sExecCUFFTPf
	.type	_Z10sExecCUFFTPf, @function
_Z10sExecCUFFTPf:
.LFB2052:
	.cfi_startproc
	endbr64
	pushq	%rsi
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	movq	%rdi, %rsi
	movl	plan(%rip), %edi
	orl	$-1, %ecx
	call	cufftExecC2C@PLT
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.L13
	movl	%eax, %edx
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L13:
	.cfi_restore_state
	popq	%rax
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z10sExecCUFFTPf, .-_Z10sExecCUFFTPf
	.section	.rodata.str1.1
.LC4:
	.string	"Error: cufftDestroy failed: code = %i\n"
	.text
	.globl	_Z13sDestroyCUFFTv
	.type	_Z13sDestroyCUFFTv, @function
_Z13sDestroyCUFFTv:
.LFB2053:
	.cfi_startproc
	endbr64
	pushq	%rsi
	.cfi_def_cfa_offset 16
	movl	plan(%rip), %edi
	call	cufftDestroy@PLT
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.L16
	movl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L16:
	.cfi_restore_state
	popq	%rax
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2053:
	.size	_Z13sDestroyCUFFTv, .-_Z13sDestroyCUFFTv
	.globl	_Z12dPlan1dCUFFTiPv
	.type	_Z12dPlan1dCUFFTiPv, @function
_Z12dPlan1dCUFFTiPv:
.LFB2054:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$105, %edx
	movq	%rsi, %rbx
	movl	$1, %ecx
	movl	%edi, %esi
	leaq	plan(%rip), %rdi
	call	cufftPlan1d@PLT
	leaq	.LC0(%rip), %rsi
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L23
	movl	plan(%rip), %edi
	movq	%rbx, %rsi
	call	cufftSetStream@PLT
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	je	.L19
	leaq	.LC1(%rip), %rsi
.L23:
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L19:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z12dPlan1dCUFFTiPv, .-_Z12dPlan1dCUFFTiPv
	.globl	_Z12dPlan2dCUFFTiiPv
	.type	_Z12dPlan2dCUFFTiiPv, @function
_Z12dPlan2dCUFFTiiPv:
.LFB2055:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$105, %ecx
	movq	%rdx, %rbx
	movl	%esi, %edx
	movl	%edi, %esi
	leaq	plan(%rip), %rdi
	call	cufftPlan2d@PLT
	leaq	.LC2(%rip), %rsi
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L28
	movl	plan(%rip), %edi
	movq	%rbx, %rsi
	call	cufftSetStream@PLT
	movl	%eax, result(%rip)
	movl	%eax, %edx
	testl	%eax, %eax
	je	.L24
	leaq	.LC1(%rip), %rsi
.L28:
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L24:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z12dPlan2dCUFFTiiPv, .-_Z12dPlan2dCUFFTiiPv
	.section	.rodata.str1.1
.LC5:
	.string	"Error: cufftExecZ2Z failed: code = %i\n"
	.text
	.globl	_Z10dExecCUFFTPd
	.type	_Z10dExecCUFFTPd, @function
_Z10dExecCUFFTPd:
.LFB2056:
	.cfi_startproc
	endbr64
	pushq	%rsi
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	movq	%rdi, %rsi
	movl	plan(%rip), %edi
	orl	$-1, %ecx
	call	cufftExecZ2Z@PLT
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.L29
	movl	%eax, %edx
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L29:
	.cfi_restore_state
	popq	%rax
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z10dExecCUFFTPd, .-_Z10dExecCUFFTPd
	.globl	_Z13dDestroyCUFFTv
	.type	_Z13dDestroyCUFFTv, @function
_Z13dDestroyCUFFTv:
.LFB2199:
	.cfi_startproc
	endbr64
	jmp	_Z13sDestroyCUFFTv
	.cfi_endproc
.LFE2199:
	.size	_Z13dDestroyCUFFTv, .-_Z13dDestroyCUFFTv
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2083:
	.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
.LFE2083:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	result
	.bss
	.align 4
	.type	result, @object
	.size	result, 4
result:
	.zero	4
	.globl	plan
	.align 4
	.type	plan, @object
	.size	plan, 4
plan:
	.zero	4
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <hipfft/hipfft.h>

hipfftHandle plan;
hipfftResult result;

// 1D FFT single precision ====================================================

void sPlan1dCUFFT(int n, void *stream) {
  result = hipfftPlan1d(&plan, n, HIPFFT_C2C, 1);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftPlan1d failed: code = %i\n",result);
     return;
  }
  result = hipfftSetStream(plan, (hipStream_t)stream);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftSetStream failed: code = %i\n",result);
     return;
  }
}

// 2D FFT single precision ====================================================

void sPlan2dCUFFT(int nx, int ny, void *stream) {
  result = hipfftPlan2d(&plan, nx, ny, HIPFFT_C2C);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftPlan2d failed: code = %i\n",result);
     return;
  }
  result = hipfftSetStream(plan, (hipStream_t)stream);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftSetStream failed: code = %i\n",result);
     return;
  }
}

// single precision execute & destroy =========================================

void sExecCUFFT(float *sdata) {
  result = hipfftExecC2C(plan, (hipfftComplex*)sdata, (hipfftComplex*)sdata, HIPFFT_FORWARD);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftExecC2C failed: code = %i\n",result);
     return;
  }
}

void sDestroyCUFFT() {
  result = hipfftDestroy(plan);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftDestroy failed: code = %i\n",result);
     return;
  }
}

// 1D FFT double precision ====================================================

void dPlan1dCUFFT(int n, void *stream) {
  result = hipfftPlan1d(&plan, n, HIPFFT_Z2Z, 1);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftPlan1d failed: code = %i\n",result);
     return;
  }
  result = hipfftSetStream(plan, (hipStream_t)stream);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftSetStream failed: code = %i\n",result);
     return;
  }
}

// 2D FFT double precision ====================================================

void dPlan2dCUFFT(int nx, int ny, void *stream) {
  result = hipfftPlan2d(&plan, nx, ny, HIPFFT_Z2Z);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftPlan2d failed: code = %i\n",result);
     return;
  }
  result = hipfftSetStream(plan, (hipStream_t)stream);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftSetStream failed: code = %i\n",result);
     return;
  }
}

// double precision execute & destroy =========================================

void dExecCUFFT(double *ddata) {
  result = hipfftExecZ2Z(plan, (hipfftDoubleComplex*)ddata, (hipfftDoubleComplex*)ddata, HIPFFT_FORWARD);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftExecZ2Z failed: code = %i\n",result);
     return;
  }
}

void dDestroyCUFFT() {
  result = hipfftDestroy(plan);
  if (result!=HIPFFT_SUCCESS) { 
     printf ("Error: hipfftDestroy failed: code = %i\n",result);
     return;
  }
}

/*
// Original versions from the OLCF website
// https://www.olcf.ornl.gov/tutorials/mixing-openacc-with-gpu-libraries/
//
void sLaunchCUFFT(float *sdata, int n, void *stream) {
  cufftHandle plan;
  cufftPlan1d(&plan, n, CUFFT_C2C, 1);
  cufftSetStream(plan, (cudaStream_t)stream);
  cufftExecC2C(plan, (cufftComplex*)sdata, (cufftComplex*)sdata, CUFFT_FORWARD);
  cufftDestroy(plan);
}

void dLaunchCUFFT(double *ddata, int n, void *stream) {
  cufftHandle plan;
  cufftPlan1d(&plan, n, CUFFT_Z2Z, 1);
  cufftSetStream(plan, (cudaStream_t)stream);
  cufftExecZ2Z(plan, (cufftDoubleComplex*)ddata, (cufftDoubleComplex*)ddata, CUFFT_FORWARD);
  cufftDestroy(plan);
}
*/

	.text
	.file	"cufft.hip"
	.globl	_Z12sPlan1dCUFFTiPv             # -- Begin function _Z12sPlan1dCUFFTiPv
	.type	_Z12sPlan1dCUFFTiPv,@function
_Z12sPlan1dCUFFTiPv:                    # @_Z12sPlan1dCUFFTiPv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rbx
	movl	%edi, %esi
	movl	$plan, %edi
	movl	$41, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB0_3
# %bb.1:
	movl	$.L.str, %edi
	jmp	.LBB0_2
.LBB0_3:
	movq	plan(%rip), %rdi
	movq	%rbx, %rsi
	callq	hipfftSetStream
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB0_5
# %bb.4:
	movl	$.L.str.1, %edi
.LBB0_2:
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB0_5:
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z12sPlan1dCUFFTiPv, .Lfunc_end0-_Z12sPlan1dCUFFTiPv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12sPlan2dCUFFTiiPv            # -- Begin function _Z12sPlan2dCUFFTiiPv
	.type	_Z12sPlan2dCUFFTiiPv,@function
_Z12sPlan2dCUFFTiiPv:                   # @_Z12sPlan2dCUFFTiiPv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdx, %rbx
	movl	%esi, %edx
	movl	%edi, %esi
	movl	$plan, %edi
	movl	$41, %ecx
	callq	hipfftPlan2d
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB1_3
# %bb.1:
	movl	$.L.str.2, %edi
	jmp	.LBB1_2
.LBB1_3:
	movq	plan(%rip), %rdi
	movq	%rbx, %rsi
	callq	hipfftSetStream
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB1_5
# %bb.4:
	movl	$.L.str.1, %edi
.LBB1_2:
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB1_5:
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z12sPlan2dCUFFTiiPv, .Lfunc_end1-_Z12sPlan2dCUFFTiiPv
	.cfi_endproc
                                        # -- End function
	.globl	_Z10sExecCUFFTPf                # -- Begin function _Z10sExecCUFFTPf
	.type	_Z10sExecCUFFTPf,@function
_Z10sExecCUFFTPf:                       # @_Z10sExecCUFFTPf
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	movq	plan(%rip), %rdi
	movq	%rdx, %rsi
	movl	$-1, %ecx
	callq	hipfftExecC2C
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB2_1
# %bb.2:
	movl	$.L.str.3, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB2_1:
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z10sExecCUFFTPf, .Lfunc_end2-_Z10sExecCUFFTPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z13sDestroyCUFFTv              # -- Begin function _Z13sDestroyCUFFTv
	.type	_Z13sDestroyCUFFTv,@function
_Z13sDestroyCUFFTv:                     # @_Z13sDestroyCUFFTv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	plan(%rip), %rdi
	callq	hipfftDestroy
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB3_1
# %bb.2:
	movl	$.L.str.4, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB3_1:
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z13sDestroyCUFFTv, .Lfunc_end3-_Z13sDestroyCUFFTv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12dPlan1dCUFFTiPv             # -- Begin function _Z12dPlan1dCUFFTiPv
	.type	_Z12dPlan1dCUFFTiPv,@function
_Z12dPlan1dCUFFTiPv:                    # @_Z12dPlan1dCUFFTiPv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rbx
	movl	%edi, %esi
	movl	$plan, %edi
	movl	$105, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB4_3
# %bb.1:
	movl	$.L.str, %edi
	jmp	.LBB4_2
.LBB4_3:
	movq	plan(%rip), %rdi
	movq	%rbx, %rsi
	callq	hipfftSetStream
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB4_5
# %bb.4:
	movl	$.L.str.1, %edi
.LBB4_2:
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB4_5:
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z12dPlan1dCUFFTiPv, .Lfunc_end4-_Z12dPlan1dCUFFTiPv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12dPlan2dCUFFTiiPv            # -- Begin function _Z12dPlan2dCUFFTiiPv
	.type	_Z12dPlan2dCUFFTiiPv,@function
_Z12dPlan2dCUFFTiiPv:                   # @_Z12dPlan2dCUFFTiiPv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdx, %rbx
	movl	%esi, %edx
	movl	%edi, %esi
	movl	$plan, %edi
	movl	$105, %ecx
	callq	hipfftPlan2d
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB5_3
# %bb.1:
	movl	$.L.str.2, %edi
	jmp	.LBB5_2
.LBB5_3:
	movq	plan(%rip), %rdi
	movq	%rbx, %rsi
	callq	hipfftSetStream
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB5_5
# %bb.4:
	movl	$.L.str.1, %edi
.LBB5_2:
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB5_5:
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z12dPlan2dCUFFTiiPv, .Lfunc_end5-_Z12dPlan2dCUFFTiiPv
	.cfi_endproc
                                        # -- End function
	.globl	_Z10dExecCUFFTPd                # -- Begin function _Z10dExecCUFFTPd
	.type	_Z10dExecCUFFTPd,@function
_Z10dExecCUFFTPd:                       # @_Z10dExecCUFFTPd
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	movq	plan(%rip), %rdi
	movq	%rdx, %rsi
	movl	$-1, %ecx
	callq	hipfftExecZ2Z
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB6_1
# %bb.2:
	movl	$.L.str.5, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB6_1:
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z10dExecCUFFTPd, .Lfunc_end6-_Z10dExecCUFFTPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z13dDestroyCUFFTv              # -- Begin function _Z13dDestroyCUFFTv
	.type	_Z13dDestroyCUFFTv,@function
_Z13dDestroyCUFFTv:                     # @_Z13dDestroyCUFFTv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	plan(%rip), %rdi
	callq	hipfftDestroy
	movl	%eax, result(%rip)
	testl	%eax, %eax
	je	.LBB7_1
# %bb.2:
	movl	$.L.str.4, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB7_1:
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z13dDestroyCUFFTv, .Lfunc_end7-_Z13dDestroyCUFFTv
	.cfi_endproc
                                        # -- End function
	.type	plan,@object                    # @plan
	.bss
	.globl	plan
	.p2align	3, 0x0
plan:
	.quad	0
	.size	plan, 8

	.type	result,@object                  # @result
	.globl	result
	.p2align	2, 0x0
result:
	.long	0                               # 0x0
	.size	result, 4

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error: hipfftPlan1d failed: code = %i\n"
	.size	.L.str, 39

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Error: hipfftSetStream failed: code = %i\n"
	.size	.L.str.1, 42

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Error: hipfftPlan2d failed: code = %i\n"
	.size	.L.str.2, 39

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Error: hipfftExecC2C failed: code = %i\n"
	.size	.L.str.3, 40

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Error: hipfftDestroy failed: code = %i\n"
	.size	.L.str.4, 40

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Error: hipfftExecZ2Z failed: code = %i\n"
	.size	.L.str.5, 40

	.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 plan
	.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
