#include <device_launch_parameters.h>
#include <cuda_runtime.h>
#include <cufft.h>
#include <vector>
#include <cmath>
#include <stdio.h>
#include <string>
#include <iostream>

/*The multicplication algorithm with cuFFT is from the following source:
Source: https://programmer.group/implementing-large-integer-multiplication-with-cufft.html
The multWithFFT-function is edited by Max & Johannes*/

const auto BATCH = 1;

__global__ void ComplexPointwiseMulAndScale(cufftComplex *a, cufftComplex *b, int size)
{
    const int numThreads = blockDim.x * gridDim.x;
    const int threadID = blockIdx.x * blockDim.x + threadIdx.x;
    float scale = 1.0f / (float)size;
    cufftComplex c;
    for (int i = threadID; i < size; i += numThreads)
    {
        c = cuCmulf(a[i], b[i]);
        b[i] = make_cuFloatComplex(scale*cuCrealf(c), scale*cuCimagf(c));
    }
}

__global__ void ConvertToInt(cufftReal *a, int size)
{
    const int numThreads = blockDim.x * gridDim.x;
    const int threadID = blockIdx.x * blockDim.x + threadIdx.x;
    auto b = (int*)a;
    for (int i = threadID; i < size; i += numThreads)
        b[i] = static_cast<int>(round(a[i]));
}

std::vector<int> multiply(const std::vector<float> &a, const std::vector<float> &b)
{
    const auto NX = a.size();
    cufftHandle plan_a, plan_b, plan_c;
    cufftComplex *data_a, *data_b;
    std::vector<int> c(a.size() + 1);
    c[0] = 0;

    //Allocate graphics card memory and initialize, assuming sizeof(int)==sizeof(float), sizeof(cufftComplex)==2*sizeof(float)
    cudaMalloc((void**)&data_a, sizeof(cufftComplex) * (NX / 2 + 1) * BATCH);
    cudaMalloc((void**)&data_b, sizeof(cufftComplex) * (NX / 2 + 1) * BATCH);
    cudaMemcpy(data_a, a.data(), sizeof(float) * a.size(), cudaMemcpyHostToDevice);
    cudaMemcpy(data_b, b.data(), sizeof(float) * b.size(), cudaMemcpyHostToDevice);
    if (cudaGetLastError() != cudaSuccess) { fprintf(stderr, "Cuda error: Failed to allocate\n"); return c; }

    if (cufftPlan1d(&plan_a, NX, CUFFT_R2C, BATCH) != CUFFT_SUCCESS) { fprintf(stderr, "CUFFT error: Plan creation failed"); return c; }
    if (cufftPlan1d(&plan_b, NX, CUFFT_R2C, BATCH) != CUFFT_SUCCESS) { fprintf(stderr, "CUFFT error: Plan creation failed"); return c; }
    if (cufftPlan1d(&plan_c, NX, CUFFT_C2R, BATCH) != CUFFT_SUCCESS) { fprintf(stderr, "CUFFT error: Plan creation failed"); return c; }

    //Converting A(x) to Frequency Domain
    if (cufftExecR2C(plan_a, (cufftReal*)data_a, data_a) != CUFFT_SUCCESS)
    {
        fprintf(stderr, "CUFFT error: ExecR2C Forward failed");
        return c;
    }

    //Converting B(x) to Frequency Domain
    if (cufftExecR2C(plan_b, (cufftReal*)data_b, data_b) != CUFFT_SUCCESS)
    {
        fprintf(stderr, "CUFFT error: ExecR2C Forward failed");
        return c;
    }

    //Point multiplication
    ComplexPointwiseMulAndScale<<<NX / 256 + 1, 256>>>(data_a, data_b, NX);

    //Converting C(x) back to time domain
    if (cufftExecC2R(plan_c, data_b, (cufftReal*)data_b) != CUFFT_SUCCESS)
    {
        fprintf(stderr, "CUFFT error: ExecC2R Forward failed");
        return c;
    }

    //Converting the results of floating-point numbers to integers
    ConvertToInt<<<NX / 256 + 1, 256>>>((cufftReal*)data_b, NX);

    if (cudaDeviceSynchronize() != cudaSuccess)
    {
        fprintf(stderr, "Cuda error: Failed to synchronize\n");
        return c;
    }

    cudaMemcpy(&c[1], data_b, sizeof(float) * b.size(), cudaMemcpyDeviceToHost);

    cufftDestroy(plan_a);
    cufftDestroy(plan_b);
    cufftDestroy(plan_c);
    cudaFree(data_a);
    cudaFree(data_b);
    return c;
}

void print(std::vector<float> const &input)
{
	for (int i = 0; i < input.size(); i++) {
		std::cout << input.at(i) << ' ';
	}
}

extern "C" void multWithFFT(char* a, char *b, char **c)
{
    //Set base
    const int base = 10;

    printf("a = %s\n\n",a);
    printf("b = %s\n\n",b);

    int lengthA = strlen(a);
    int lengthB = strlen(b);

    //length of multiplication result has the size of the sum of the two factors
    int result_length = lengthA + lengthB;

    //factors are stored in these vectors
    std::vector<float> av{};
    std::vector<float> bv{};

    //fill vectors step by step
    for(int i=0; i<lengthA; ++i){
    	av.push_back((float)(a[i])-'0');
    }
    for(int i=0; i<lengthB; ++i){
    	bv.push_back((float)(b[i])-'0');
    }

    //vectors need to be same size
    while (av.size() != result_length){
    	 av.insert(av.begin(),(float) 0);
    }
    while (bv.size() != result_length){
    	bv.insert(bv.begin(),(float) 0);
    }

    //call cuda-kernel-function
    std::vector<int> cv = multiply(av, bv);

    //Processing carry
    for (int i = cv.size() - 1; i > 0; i--)
    {
        if (cv[i] >= base)
        {
            cv[i - 1] += cv[i] / base;
            cv[i] %= base;
        }
    }

    //Remove excess zeros
    cv.pop_back();
    auto i = 0;

    //For some multiplications the result has a zero as a first digit (for example 999*1 = 999 will be 0999)
    if (cv[0] == 0)
        i++;

    //If i++ will be executed the array still has to begin at element tmp[0]
    int k = 0;

	char tmp[cv.size()];

	//convert integer vector to string
    for (; i < cv.size(); i++){
    	tmp[k] = (char) cv.at(i) + '0';
    	k++;
    }
    tmp[k] = '\0';

    //transfer result to cuda_mult.c
    memcpy(*c,tmp,sizeof(tmp));

    return;
}

	.file	"tmpxft_00275a96_00000000-6_cuda_FFT_mult.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4045:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4045:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z5printRKSt6vectorIfSaIfEE
	.type	_Z5printRKSt6vectorIfSaIfEE, @function
_Z5printRKSt6vectorIfSaIfEE:
.LFB4031:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	_ZSt4cout(%rip), %r12
	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
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
.L3:
	movq	0(%rbp), %rdx
	movq	8(%rbp), %rax
	subq	%rdx, %rax
	sarq	$2, %rax
	cmpq	%rax, %rbx
	jnb	.L10
	movq	%r12, %rdi
	cvtss2sd	(%rdx,%rbx,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movb	$32, 7(%rsp)
	movq	%rax, %rdi
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%rdi,%rax)
	je	.L4
	leaq	7(%rsp), %rsi
	movl	$1, %edx
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	jmp	.L5
.L4:
	movl	$32, %esi
	call	_ZNSo3putEc@PLT
.L5:
	incq	%rbx
	jmp	.L3
.L10:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4031:
	.size	_Z5printRKSt6vectorIfSaIfEE, .-_Z5printRKSt6vectorIfSaIfEE
	.globl	_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i
	.type	_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i, @function
_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i:
.LFB4067:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z27ComplexPointwiseMulAndScaleP6float2S0_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L11:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4067:
	.size	_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i, .-_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i
	.globl	_Z27ComplexPointwiseMulAndScaleP6float2S0_i
	.type	_Z27ComplexPointwiseMulAndScaleP6float2S0_i, @function
_Z27ComplexPointwiseMulAndScaleP6float2S0_i:
.LFB4068:
	.cfi_startproc
	endbr64
	jmp	_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i
	.cfi_endproc
.LFE4068:
	.size	_Z27ComplexPointwiseMulAndScaleP6float2S0_i, .-_Z27ComplexPointwiseMulAndScaleP6float2S0_i
	.globl	_Z33__device_stub__Z12ConvertToIntPfiPfi
	.type	_Z33__device_stub__Z12ConvertToIntPfiPfi, @function
_Z33__device_stub__Z12ConvertToIntPfiPfi:
.LFB4069:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z12ConvertToIntPfi(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L16:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4069:
	.size	_Z33__device_stub__Z12ConvertToIntPfiPfi, .-_Z33__device_stub__Z12ConvertToIntPfiPfi
	.globl	_Z12ConvertToIntPfi
	.type	_Z12ConvertToIntPfi, @function
_Z12ConvertToIntPfi:
.LFB4070:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z12ConvertToIntPfiPfi
	.cfi_endproc
.LFE4070:
	.size	_Z12ConvertToIntPfi, .-_Z12ConvertToIntPfi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z12ConvertToIntPfi"
.LC1:
	.string	"_Z27ComplexPointwiseMulAndScaleP6float2S0_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4072:
	.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	_Z12ConvertToIntPfi(%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	_Z27ComplexPointwiseMulAndScaleP6float2S0_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
.LFE4072:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt6vectorIiSaIiEEC2EmRKS0_.str1.1,"aMS",@progbits,1
.LC2:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIiSaIiEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC5EmRKS0_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.type	_ZNSt6vectorIiSaIiEEC2EmRKS0_, @function
_ZNSt6vectorIiSaIiEEC2EmRKS0_:
.LFB4380:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpq	%rsi, %rax
	jnb	.L24
	leaq	.LC2(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L24:
	movq	%rsi, %rbp
	xorl	%esi, %esi
	movq	%rdi, %rbx
	xorl	%eax, %eax
	movq	%rsi, (%rdi)
	leaq	0(,%rbp,4), %r12
	movq	%rsi, 8(%rdi)
	movq	%rsi, 16(%rdi)
	testq	%rbp, %rbp
	je	.L25
	movq	%r12, %rdi
	call	_Znwm@PLT
.L25:
	addq	%rax, %r12
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%r12, 16(%rbx)
	testq	%rbp, %rbp
	je	.L26
	xorl	%ecx, %ecx
	addq	$4, %rax
	movl	%ecx, -4(%rax)
	decq	%rbp
	je	.L26
.L27:
	cmpq	%rax, %r12
	je	.L26
	xorl	%edx, %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	jmp	.L27
.L26:
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4380:
	.size	_ZNSt6vectorIiSaIiEEC2EmRKS0_, .-_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.weak	_ZNSt6vectorIiSaIiEEC1EmRKS0_
	.set	_ZNSt6vectorIiSaIiEEC1EmRKS0_,_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4383:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L38
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L38:
	ret
	.cfi_endproc
.LFE4383:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.rodata.str1.1
.LC3:
	.string	"Cuda error: Failed to allocate\n"
.LC4:
	.string	"CUFFT error: Plan creation failed"
.LC5:
	.string	"CUFFT error: ExecR2C Forward failed"
.LC6:
	.string	"CUFFT error: ExecC2R Forward failed"
.LC7:
	.string	"Cuda error: Failed to synchronize\n"
	.text
	.globl	_Z8multiplyRKSt6vectorIfSaIfEES3_
	.type	_Z8multiplyRKSt6vectorIfSaIfEES3_, @function
_Z8multiplyRKSt6vectorIfSaIfEES3_:
.LFB4021:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4021
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	8(%rsi), %rbx
	subq	(%rsi), %rbx
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	sarq	$2, %rbx
	leaq	44(%rsp), %rdx
	leaq	1(%rbx), %rsi
.LEHB0:
	call	_ZNSt6vectorIiSaIiEEC1EmRKS0_
.LEHE0:
	movq	0(%rbp), %rax
	xorl	%edx, %edx
	leaq	16(%rsp), %rdi
	movl	%edx, (%rax)
	movq	%rbx, %rax
	shrq	%rax
	leaq	8(,%rax,8), %r14
	movq	%r14, %rsi
.LEHB1:
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	call	cudaMalloc@PLT
	movq	0(%r13), %rsi
	movq	8(%r13), %rdx
	movl	$1, %ecx
	movq	16(%rsp), %rdi
	subq	%rsi, %rdx
	call	cudaMemcpy@PLT
	movq	(%r12), %rsi
	movq	8(%r12), %rdx
	movl	$1, %ecx
	movq	24(%rsp), %rdi
	subq	%rsi, %rdx
	call	cudaMemcpy@PLT
	call	cudaGetLastError@PLT
	leaq	.LC3(%rip), %rdx
	testl	%eax, %eax
	jne	.L58
	leaq	4(%rsp), %rdi
	movl	$1, %ecx
	movl	%ebx, %esi
	movl	%ebx, %r13d
	movl	$42, %edx
	call	cufftPlan1d@PLT
	testl	%eax, %eax
	jne	.L67
	leaq	8(%rsp), %rdi
	movl	$1, %ecx
	movl	$42, %edx
	movl	%ebx, %esi
	call	cufftPlan1d@PLT
	testl	%eax, %eax
	jne	.L67
	leaq	12(%rsp), %rdi
	movl	$1, %ecx
	movl	$44, %edx
	movl	%ebx, %esi
	call	cufftPlan1d@PLT
	testl	%eax, %eax
	je	.L45
.L67:
	leaq	.LC4(%rip), %rdx
	jmp	.L58
.L45:
	movq	16(%rsp), %rsi
	movl	4(%rsp), %edi
	movq	%rsi, %rdx
	call	cufftExecR2C@PLT
	testl	%eax, %eax
	jne	.L68
	movq	24(%rsp), %rsi
	movl	8(%rsp), %edi
	movq	%rsi, %rdx
	call	cufftExecR2C@PLT
	testl	%eax, %eax
	je	.L47
.L68:
	leaq	.LC5(%rip), %rdx
	jmp	.L58
.L47:
	shrq	$8, %rbx
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	incl	%ebx
	salq	$8, %rdx
	movabsq	$4294967297, %rax
	movl	$1, %ecx
	movq	%rax, 36(%rsp)
	movl	40(%rsp), %esi
	movl	%ebx, 32(%rsp)
	movq	32(%rsp), %rdi
	movq	%rdx, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPushCallConfiguration@PLT
	movq	24(%rsp), %rsi
	testl	%eax, %eax
	jne	.L48
	movq	16(%rsp), %rdi
	movl	%r13d, %edx
	call	_Z57__device_stub__Z27ComplexPointwiseMulAndScaleP6float2S0_iP6float2S0_i
.L48:
	movq	24(%rsp), %rsi
	movl	12(%rsp), %edi
	movq	%rsi, %rdx
	call	cufftExecC2R@PLT
	leaq	.LC6(%rip), %rdx
	testl	%eax, %eax
	jne	.L58
	movl	%ebx, 32(%rsp)
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rax
	salq	$8, %rdx
	movl	$1, %ecx
	movl	$1, 52(%rsp)
	movq	%rax, 36(%rsp)
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	movq	%rdx, 44(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L50
	movq	24(%rsp), %rdi
	movl	%r13d, %esi
	call	_Z33__device_stub__Z12ConvertToIntPfiPfi
.L50:
	call	cudaDeviceSynchronize@PLT
	testl	%eax, %eax
	je	.L51
	leaq	.LC7(%rip), %rdx
.L58:
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	jmp	.L40
.L51:
	movq	0(%rbp), %rax
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	8(%r12), %rdx
	subq	(%r12), %rdx
	leaq	4(%rax), %rdi
	call	cudaMemcpy@PLT
	movl	4(%rsp), %edi
	call	cufftDestroy@PLT
	movl	8(%rsp), %edi
	call	cufftDestroy@PLT
	movl	12(%rsp), %edi
	call	cufftDestroy@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
.LEHE1:
	jmp	.L40
.L55:
	endbr64
	movq	%rax, %rbx
.L52:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L40:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
.L65:
	call	__stack_chk_fail@PLT
.L54:
	addq	$64, %rsp
	.cfi_def_cfa_offset 48
	movq	%rbp, %rax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4021:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4021:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4021-.LLSDACSB4021
.LLSDACSB4021:
	.uleb128 .LEHB0-.LFB4021
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4021
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L55-.LFB4021
	.uleb128 0
	.uleb128 .LEHB2-.LFB4021
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4021:
	.text
	.size	_Z8multiplyRKSt6vectorIfSaIfEES3_, .-_Z8multiplyRKSt6vectorIfSaIfEES3_
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB4406:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L69
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L69:
	ret
	.cfi_endproc
.LFE4406:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.rodata._ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC8:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.type	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_, @function
_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_:
.LFB4712:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L72
	leaq	.LC8(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L72:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L82
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L77
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L76
.L82:
	movq	%rcx, %rbx
.L76:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L77:
	movss	(%rdx), %xmm0
	movss	%xmm0, (%r12,%r15)
	testq	%r15, %r15
	jle	.L78
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L78:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L79
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L79:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L80
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L80:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4712:
	.size	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_, .-_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.section	.text._ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf,"axG",@progbits,_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	.type	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf, @function
_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf:
.LFB4601:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %r12
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	subq	(%rdi), %r13
	movq	8(%rdi), %rdi
	cmpq	16(%rbx), %rdi
	je	.L90
	leaq	4(%rdi), %rax
	cmpq	%rsi, %rdi
	jne	.L91
	movss	(%rdx), %xmm0
	movss	%xmm0, (%rdi)
	movq	%rax, 8(%rbx)
	jmp	.L92
.L91:
	movss	-4(%rdi), %xmm0
	leaq	-4(%rdi), %rdx
	subq	%rsi, %rdx
	movss	%xmm0, (%rdi)
	movq	%rax, 8(%rbx)
	cmpq	$4, %rdx
	jle	.L93
	subq	%rdx, %rdi
	movq	%rsi, 8(%rsp)
	call	memmove@PLT
	movq	8(%rsp), %rsi
	jmp	.L94
.L93:
	jne	.L94
	movss	(%rsi), %xmm0
	movss	%xmm0, -4(%rdi)
.L94:
	movss	(%r12), %xmm0
	movss	%xmm0, (%rsi)
	jmp	.L92
.L90:
	movq	%rbx, %rdi
	call	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
.L92:
	movq	(%rbx), %rax
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	addq	%r13, %rax
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4601:
	.size	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf, .-_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	.text
	.align 2
	.type	_ZNSt6vectorIfSaIfEE12emplace_backIJfEEERfDpOT_.isra.0, @function
_ZNSt6vectorIfSaIfEE12emplace_backIJfEEERfDpOT_.isra.0:
.LFB4895:
	.cfi_startproc
	movq	%rsi, %rdx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.L97
	movss	(%rdx), %xmm0
	addq	$4, %rsi
	movss	%xmm0, -4(%rsi)
	movq	%rsi, 8(%rdi)
	ret
.L97:
	jmp	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.cfi_endproc
.LFE4895:
	.size	_ZNSt6vectorIfSaIfEE12emplace_backIJfEEERfDpOT_.isra.0, .-_ZNSt6vectorIfSaIfEE12emplace_backIJfEEERfDpOT_.isra.0
	.section	.rodata.str1.1
.LC9:
	.string	"a = %s\n\n"
.LC10:
	.string	"b = %s\n\n"
	.text
	.globl	multWithFFT
	.type	multWithFFT, @function
multWithFFT:
.LFB4032:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4032
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	movq	%rdx, %r14
	movq	%rdi, %rdx
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movq	%rdi, %r12
	movl	$2, %edi
	pushq	%rbx
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	leaq	.LC9(%rip), %rsi
	subq	$104, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.LEHB3:
	call	__printf_chk@PLT
	movq	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC10(%rip), %rsi
	call	__printf_chk@PLT
.LEHE3:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbx, %rdi
	movq	%rax, %r13
	movl	%eax, %r15d
	call	strlen@PLT
	movl	%eax, -140(%rbp)
	addl	%r13d, %eax
	xorl	%r13d, %r13d
	movl	%eax, -144(%rbp)
	xorl	%eax, %eax
	movq	%rax, -128(%rbp)
	movq	%rax, -120(%rbp)
	movq	%rax, -112(%rbp)
	movq	%rax, -104(%rbp)
	movq	%rax, -96(%rbp)
	movq	%rax, -88(%rbp)
.L101:
	leaq	-80(%rbp), %rax
	cmpl	%r13d, %r15d
	movq	%rax, -136(%rbp)
	jle	.L126
	movsbl	(%r12,%r13), %eax
	movq	-136(%rbp), %rsi
	leaq	-128(%rbp), %rdi
	cvtsi2ssl	%eax, %xmm0
	subss	.LC11(%rip), %xmm0
	movss	%xmm0, -80(%rbp)
.LEHB4:
	call	_ZNSt6vectorIfSaIfEE12emplace_backIJfEEERfDpOT_.isra.0
	incq	%r13
	jmp	.L101
.L126:
	xorl	%r12d, %r12d
.L103:
	cmpl	%r12d, -140(%rbp)
	jle	.L127
	movsbl	(%rbx,%r12), %eax
	movq	-136(%rbp), %rsi
	leaq	-104(%rbp), %rdi
	cvtsi2ssl	%eax, %xmm0
	subss	.LC11(%rip), %xmm0
	movss	%xmm0, -80(%rbp)
	call	_ZNSt6vectorIfSaIfEE12emplace_backIJfEEERfDpOT_.isra.0
	incq	%r12
	jmp	.L103
.L127:
	movslq	-144(%rbp), %r12
.L105:
	movq	-128(%rbp), %rsi
	movq	-120(%rbp), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
	cmpq	%rax, %r12
	je	.L128
	movq	-136(%rbp), %rdx
	leaq	-128(%rbp), %rdi
	movl	$0x00000000, -80(%rbp)
	call	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	jmp	.L105
.L128:
	leaq	-104(%rbp), %rbx
.L107:
	movq	-104(%rbp), %rsi
	movq	-96(%rbp), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
	cmpq	%rax, %r12
	je	.L129
	movq	-136(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$0x00000000, -80(%rbp)
	call	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	jmp	.L107
.L129:
	leaq	-128(%rbp), %r12
	movq	-136(%rbp), %rdi
	movq	%rbx, %rdx
	movq	%r12, %rsi
	call	_Z8multiplyRKSt6vectorIfSaIfEES3_
.LEHE4:
	movq	-72(%rbp), %rcx
	movq	-80(%rbp), %rdi
	movl	$10, %r8d
	movq	%rcx, %rsi
	subq	%rdi, %rsi
	sarq	$2, %rsi
	decl	%esi
	movslq	%esi, %rsi
.L109:
	testl	%esi, %esi
	jle	.L130
	movl	(%rdi,%rsi,4), %eax
	cmpl	$9, %eax
	jle	.L110
	cltd
	idivl	%r8d
	addl	%eax, -4(%rdi,%rsi,4)
	movl	%edx, (%rdi,%rsi,4)
.L110:
	decq	%rsi
	jmp	.L109
.L130:
	subq	$4, %rcx
	cmpl	$0, (%rdi)
	movq	%rsp, %r8
	sete	%dl
	movq	%rcx, -72(%rbp)
	subq	%rdi, %rcx
	sarq	$2, %rcx
	leaq	15(%rcx), %rsi
	movq	%rsi, %rax
	andq	$-4096, %rsi
	andq	$-16, %rax
	subq	%rsi, %r8
.L112:
	cmpq	%r8, %rsp
	je	.L113
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L112
.L113:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L114
	orq	$0, -8(%rsp,%rax)
.L114:
	movq	%rsp, %rsi
	movzbl	%dl, %edx
	xorl	%eax, %eax
.L115:
	cmpq	%rcx, %rdx
	jnb	.L131
	movb	(%rdi,%rdx,4), %r9b
	incq	%rdx
	leal	48(%r9), %r8d
	movb	%r8b, (%rsi,%rax)
	incq	%rax
	jmp	.L115
.L131:
	cltq
	movq	(%r14), %rdi
	movb	$0, (%rsi,%rax)
	rep movsb
	movq	-136(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	%rbx, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	%r12, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L119
	jmp	.L124
.L120:
	endbr64
	movq	%rax, %rbx
.L117:
	leaq	-104(%rbp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	-128(%rbp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L124
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L124:
	call	__stack_chk_fail@PLT
.L119:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4032:
	.section	.gcc_except_table
.LLSDA4032:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4032-.LLSDACSB4032
.LLSDACSB4032:
	.uleb128 .LEHB3-.LFB4032
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4032
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L120-.LFB4032
	.uleb128 0
	.uleb128 .LEHB5-.LFB4032
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE4032:
	.text
	.size	multWithFFT, .-multWithFFT
	.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
.LC11:
	.long	1111490560
	.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 <hip/hip_runtime.h>
#include <hipfft/hipfft.h>
#include <vector>
#include <cmath>
#include <stdio.h>
#include <string>
#include <iostream>

/*The multicplication algorithm with cuFFT is from the following source:
Source: https://programmer.group/implementing-large-integer-multiplication-with-cufft.html
The multWithFFT-function is edited by Max & Johannes*/

const auto BATCH = 1;

__global__ void ComplexPointwiseMulAndScale(hipfftComplex *a, hipfftComplex *b, int size)
{
    const int numThreads = blockDim.x * gridDim.x;
    const int threadID = blockIdx.x * blockDim.x + threadIdx.x;
    float scale = 1.0f / (float)size;
    hipfftComplex c;
    for (int i = threadID; i < size; i += numThreads)
    {
        c = hipCmulf(a[i], b[i]);
        b[i] = make_hipFloatComplex(scale*hipCrealf(c), scale*hipCimagf(c));
    }
}

__global__ void ConvertToInt(hipfftReal *a, int size)
{
    const int numThreads = blockDim.x * gridDim.x;
    const int threadID = blockIdx.x * blockDim.x + threadIdx.x;
    auto b = (int*)a;
    for (int i = threadID; i < size; i += numThreads)
        b[i] = static_cast<int>(round(a[i]));
}

std::vector<int> multiply(const std::vector<float> &a, const std::vector<float> &b)
{
    const auto NX = a.size();
    hipfftHandle plan_a, plan_b, plan_c;
    hipfftComplex *data_a, *data_b;
    std::vector<int> c(a.size() + 1);
    c[0] = 0;

    //Allocate graphics card memory and initialize, assuming sizeof(int)==sizeof(float), sizeof(cufftComplex)==2*sizeof(float)
    hipMalloc((void**)&data_a, sizeof(hipfftComplex) * (NX / 2 + 1) * BATCH);
    hipMalloc((void**)&data_b, sizeof(hipfftComplex) * (NX / 2 + 1) * BATCH);
    hipMemcpy(data_a, a.data(), sizeof(float) * a.size(), hipMemcpyHostToDevice);
    hipMemcpy(data_b, b.data(), sizeof(float) * b.size(), hipMemcpyHostToDevice);
    if (hipGetLastError() != hipSuccess) { fprintf(stderr, "Cuda error: Failed to allocate\n"); return c; }

    if (hipfftPlan1d(&plan_a, NX, HIPFFT_R2C, BATCH) != HIPFFT_SUCCESS) { fprintf(stderr, "CUFFT error: Plan creation failed"); return c; }
    if (hipfftPlan1d(&plan_b, NX, HIPFFT_R2C, BATCH) != HIPFFT_SUCCESS) { fprintf(stderr, "CUFFT error: Plan creation failed"); return c; }
    if (hipfftPlan1d(&plan_c, NX, HIPFFT_C2R, BATCH) != HIPFFT_SUCCESS) { fprintf(stderr, "CUFFT error: Plan creation failed"); return c; }

    //Converting A(x) to Frequency Domain
    if (hipfftExecR2C(plan_a, (hipfftReal*)data_a, data_a) != HIPFFT_SUCCESS)
    {
        fprintf(stderr, "CUFFT error: ExecR2C Forward failed");
        return c;
    }

    //Converting B(x) to Frequency Domain
    if (hipfftExecR2C(plan_b, (hipfftReal*)data_b, data_b) != HIPFFT_SUCCESS)
    {
        fprintf(stderr, "CUFFT error: ExecR2C Forward failed");
        return c;
    }

    //Point multiplication
    ComplexPointwiseMulAndScale<<<NX / 256 + 1, 256>>>(data_a, data_b, NX);

    //Converting C(x) back to time domain
    if (hipfftExecC2R(plan_c, data_b, (hipfftReal*)data_b) != HIPFFT_SUCCESS)
    {
        fprintf(stderr, "CUFFT error: ExecC2R Forward failed");
        return c;
    }

    //Converting the results of floating-point numbers to integers
    ConvertToInt<<<NX / 256 + 1, 256>>>((hipfftReal*)data_b, NX);

    if (hipDeviceSynchronize() != hipSuccess)
    {
        fprintf(stderr, "Cuda error: Failed to synchronize\n");
        return c;
    }

    hipMemcpy(&c[1], data_b, sizeof(float) * b.size(), hipMemcpyDeviceToHost);

    hipfftDestroy(plan_a);
    hipfftDestroy(plan_b);
    hipfftDestroy(plan_c);
    hipFree(data_a);
    hipFree(data_b);
    return c;
}

void print(std::vector<float> const &input)
{
	for (int i = 0; i < input.size(); i++) {
		std::cout << input.at(i) << ' ';
	}
}

extern "C" void multWithFFT(char* a, char *b, char **c)
{
    //Set base
    const int base = 10;

    printf("a = %s\n\n",a);
    printf("b = %s\n\n",b);

    int lengthA = strlen(a);
    int lengthB = strlen(b);

    //length of multiplication result has the size of the sum of the two factors
    int result_length = lengthA + lengthB;

    //factors are stored in these vectors
    std::vector<float> av{};
    std::vector<float> bv{};

    //fill vectors step by step
    for(int i=0; i<lengthA; ++i){
    	av.push_back((float)(a[i])-'0');
    }
    for(int i=0; i<lengthB; ++i){
    	bv.push_back((float)(b[i])-'0');
    }

    //vectors need to be same size
    while (av.size() != result_length){
    	 av.insert(av.begin(),(float) 0);
    }
    while (bv.size() != result_length){
    	bv.insert(bv.begin(),(float) 0);
    }

    //call cuda-kernel-function
    std::vector<int> cv = multiply(av, bv);

    //Processing carry
    for (int i = cv.size() - 1; i > 0; i--)
    {
        if (cv[i] >= base)
        {
            cv[i - 1] += cv[i] / base;
            cv[i] %= base;
        }
    }

    //Remove excess zeros
    cv.pop_back();
    auto i = 0;

    //For some multiplications the result has a zero as a first digit (for example 999*1 = 999 will be 0999)
    if (cv[0] == 0)
        i++;

    //If i++ will be executed the array still has to begin at element tmp[0]
    int k = 0;

	char tmp[cv.size()];

	//convert integer vector to string
    for (; i < cv.size(); i++){
    	tmp[k] = (char) cv.at(i) + '0';
    	k++;
    }
    tmp[k] = '\0';

    //transfer result to cuda_mult.c
    memcpy(*c,tmp,sizeof(tmp));

    return;
}

	.text
	.file	"cuda_FFT_mult.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i # -- Begin function _Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.type	_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i,@function
_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i: # @_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_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), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_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	_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i, .Lfunc_end0-_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__ConvertToIntPfi # -- Begin function _Z27__device_stub__ConvertToIntPfi
	.type	_Z27__device_stub__ConvertToIntPfi,@function
_Z27__device_stub__ConvertToIntPfi:     # @_Z27__device_stub__ConvertToIntPfi
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z12ConvertToIntPfi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z27__device_stub__ConvertToIntPfi, .Lfunc_end1-_Z27__device_stub__ConvertToIntPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z8multiplyRKSt6vectorIfSaIfEES3_ # -- Begin function _Z8multiplyRKSt6vectorIfSaIfEES3_
	.type	_Z8multiplyRKSt6vectorIfSaIfEES3_,@function
_Z8multiplyRKSt6vectorIfSaIfEES3_:      # @_Z8multiplyRKSt6vectorIfSaIfEES3_
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %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	$48, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	8(%rsi), %r13
	subq	(%rsi), %r13
	movq	%rdi, %rbx
	movq	%r13, %r15
	sarq	$2, %r15
	leaq	1(%r15), %rsi
	leaq	15(%rsp), %rdx
	callq	_ZNSt6vectorIiSaIiEEC2EmRKS0_
	movq	(%rbx), %rax
	movl	$0, (%rax)
	andq	$-8, %r13
	addq	$8, %r13
.Ltmp0:
	leaq	16(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
.Ltmp1:
# %bb.1:
.Ltmp2:
	movq	%rsp, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
.Ltmp3:
# %bb.2:
	movq	16(%rsp), %rdi
	movq	(%r12), %rsi
	movq	8(%r12), %rdx
	subq	%rsi, %rdx
.Ltmp4:
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp5:
# %bb.3:
	movq	(%rsp), %rdi
	movq	(%r14), %rsi
	movq	8(%r14), %rdx
	subq	%rsi, %rdx
.Ltmp6:
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp7:
# %bb.4:
.Ltmp8:
	callq	hipGetLastError
.Ltmp9:
# %bb.5:
	testl	%eax, %eax
	jne	.LBB2_6
# %bb.10:
.Ltmp10:
	leaq	40(%rsp), %rdi
	movl	%r15d, %esi
	movl	$42, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
.Ltmp11:
# %bb.11:
	testl	%eax, %eax
	jne	.LBB2_12
# %bb.13:
.Ltmp12:
	leaq	32(%rsp), %rdi
	movl	%r15d, %esi
	movl	$42, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
.Ltmp13:
# %bb.14:
	testl	%eax, %eax
	jne	.LBB2_12
# %bb.15:
.Ltmp14:
	leaq	24(%rsp), %rdi
	movl	%r15d, %esi
	movl	$44, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
.Ltmp15:
# %bb.16:
	testl	%eax, %eax
	jne	.LBB2_12
# %bb.17:
	movq	40(%rsp), %rdi
	movq	16(%rsp), %rdx
.Ltmp16:
	movq	%rdx, %rsi
	callq	hipfftExecR2C
.Ltmp17:
# %bb.18:
	testl	%eax, %eax
	jne	.LBB2_19
# %bb.22:
	movq	32(%rsp), %rdi
	movq	(%rsp), %rdx
.Ltmp18:
	movq	%rdx, %rsi
	callq	hipfftExecR2C
.Ltmp19:
# %bb.23:
	testl	%eax, %eax
	jne	.LBB2_19
# %bb.24:
	movq	%r15, %r12
	shrq	$8, %r12
	incl	%r12d
	btsq	$32, %r12
.Ltmp20:
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp21:
# %bb.25:
	testl	%eax, %eax
	jne	.LBB2_27
# %bb.26:
	movq	16(%rsp), %rdi
	movq	(%rsp), %rsi
.Ltmp22:
	movl	%r15d, %edx
	callq	_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
.Ltmp23:
.LBB2_27:
	movq	24(%rsp), %rdi
	movq	(%rsp), %rdx
.Ltmp24:
	movq	%rdx, %rsi
	callq	hipfftExecC2R
.Ltmp25:
# %bb.28:
	testl	%eax, %eax
	jne	.LBB2_29
# %bb.30:
.Ltmp26:
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp27:
# %bb.31:
	testl	%eax, %eax
	jne	.LBB2_33
# %bb.32:
	movq	(%rsp), %rdi
.Ltmp28:
	movl	%r15d, %esi
	callq	_Z27__device_stub__ConvertToIntPfi
.Ltmp29:
.LBB2_33:
.Ltmp30:
	callq	hipDeviceSynchronize
.Ltmp31:
# %bb.34:
	testl	%eax, %eax
	jne	.LBB2_35
# %bb.36:
	movq	(%rbx), %rdi
	addq	$4, %rdi
	movq	(%rsp), %rsi
	movq	8(%r14), %rdx
	subq	(%r14), %rdx
.Ltmp32:
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp33:
# %bb.37:
	movq	40(%rsp), %rdi
.Ltmp34:
	callq	hipfftDestroy
.Ltmp35:
# %bb.38:
	movq	32(%rsp), %rdi
.Ltmp36:
	callq	hipfftDestroy
.Ltmp37:
# %bb.39:
	movq	24(%rsp), %rdi
.Ltmp38:
	callq	hipfftDestroy
.Ltmp39:
# %bb.40:
	movq	16(%rsp), %rdi
.Ltmp40:
	callq	hipFree
.Ltmp41:
# %bb.41:
	movq	(%rsp), %rdi
.Ltmp42:
	callq	hipFree
.Ltmp43:
	jmp	.LBB2_42
.LBB2_12:
	movq	stderr(%rip), %rcx
	movl	$.L.str.1, %edi
	movl	$33, %esi
	jmp	.LBB2_21
.LBB2_19:
	movq	stderr(%rip), %rcx
	movl	$.L.str.2, %edi
	jmp	.LBB2_20
.LBB2_6:
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$31, %esi
	jmp	.LBB2_21
.LBB2_29:
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
.LBB2_20:
	movl	$35, %esi
	jmp	.LBB2_21
.LBB2_35:
	movq	stderr(%rip), %rcx
	movl	$.L.str.4, %edi
	movl	$34, %esi
.LBB2_21:
	movl	$1, %edx
	callq	fwrite@PLT
.LBB2_42:
	movq	%rbx, %rax
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	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
.LBB2_7:
	.cfi_def_cfa_offset 96
.Ltmp44:
	movq	%rax, %r14
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB2_9
# %bb.8:
	callq	_ZdlPv
.LBB2_9:                                # %_ZNSt6vectorIiSaIiEED2Ev.exit
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z8multiplyRKSt6vectorIfSaIfEES3_, .Lfunc_end2-_Z8multiplyRKSt6vectorIfSaIfEES3_
	.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 .Ltmp43-.Ltmp0                 #   Call between .Ltmp0 and .Ltmp43
	.uleb128 .Ltmp44-.Lfunc_begin0          #     jumps to .Ltmp44
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp43-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Lfunc_end2-.Ltmp43            #   Call between .Ltmp43 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2EmRKS0_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2EmRKS0_   # -- Begin function _ZNSt6vectorIiSaIiEEC2EmRKS0_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2EmRKS0_,@function
_ZNSt6vectorIiSaIiEEC2EmRKS0_:          # @_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.cfi_startproc
# %bb.0:
	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	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB3_7
# %bb.1:                                # %_ZNSt6vectorIiSaIiEE17_S_check_init_lenEmRKS0_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB3_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,4), %r15
	movq	%r15, 16(%rbx)
	movl	$0, (%rax)
	addq	$4, %rax
	cmpq	$1, %r14
	jne	.LBB3_5
# %bb.4:
	movq	%rax, %r15
	jmp	.LBB3_6
.LBB3_2:                                # %_ZNSt12_Vector_baseIiSaIiEEC2EmRKS0_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r15d, %r15d
	jmp	.LBB3_6
.LBB3_5:                                # %_ZSt6fill_nIPimiET_S1_T0_RKT1_.exit.loopexit.i.i.i.i
	leaq	-4(,%r14,4), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB3_6:
	movq	%r15, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB3_7:
	.cfi_def_cfa_offset 32
	movl	$.L.str.7, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end3:
	.size	_ZNSt6vectorIiSaIiEEC2EmRKS0_, .Lfunc_end3-_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_Z5printRKSt6vectorIfSaIfEE     # -- Begin function _Z5printRKSt6vectorIfSaIfEE
	.type	_Z5printRKSt6vectorIfSaIfEE,@function
_Z5printRKSt6vectorIfSaIfEE:            # @_Z5printRKSt6vectorIfSaIfEE
	.cfi_startproc
# %bb.0:
	movq	(%rdi), %rax
	cmpq	%rax, 8(%rdi)
	je	.LBB4_7
# %bb.1:                                # %_ZNKSt6vectorIfSaIfEE2atEm.exit.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	leaq	15(%rsp), %r14
.LBB4_2:                                # %_ZNKSt6vectorIfSaIfEE2atEm.exit
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r15,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movb	$32, 15(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB4_4
# %bb.3:                                #   in Loop: Header=BB4_2 Depth=1
	movl	$1, %edx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB4_5
.LBB4_4:                                #   in Loop: Header=BB4_2 Depth=1
	movq	%rax, %rdi
	movl	$32, %esi
	callq	_ZNSo3putEc
.LBB4_5:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit
                                        #   in Loop: Header=BB4_2 Depth=1
	incq	%r15
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	subq	%rax, %rcx
	sarq	$2, %rcx
	cmpq	%r15, %rcx
	ja	.LBB4_2
# %bb.6:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	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
.LBB4_7:                                # %._crit_edge
	retq
.Lfunc_end4:
	.size	_Z5printRKSt6vectorIfSaIfEE, .Lfunc_end4-_Z5printRKSt6vectorIfSaIfEE
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function multWithFFT
.LCPI5_0:
	.long	0xc2400000                      # float -48
	.text
	.globl	multWithFFT
	.type	multWithFFT,@function
multWithFFT:                            # @multWithFFT
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -152(%rbp)                # 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r13
	xorl	%ebx, %ebx
	movl	$.L.str.5, %edi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.6, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	%r13, %rdi
	callq	strlen
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	strlen
	movq	%rax, -136(%rbp)                # 8-byte Spill
	movq	%rbx, -112(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -128(%rbp)
	movq	%rbx, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movq	%r15, -144(%rbp)                # 8-byte Spill
	testl	%r15d, %r15d
	jle	.LBB5_4
# %bb.1:                                # %.lr.ph
	movl	-144(%rbp), %r12d               # 4-byte Reload
	xorl	%ebx, %ebx
	leaq	-64(%rbp), %r15
.LBB5_2:                                # =>This Inner Loop Header: Depth=1
	movsbl	(%r13,%rbx), %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	addss	.LCPI5_0(%rip), %xmm0
	movss	%xmm0, -64(%rbp)
	movq	-120(%rbp), %rsi
	cmpq	-112(%rbp), %rsi
	je	.LBB5_8
# %bb.3:                                #   in Loop: Header=BB5_2 Depth=1
	movss	%xmm0, (%rsi)
	addq	$4, %rsi
	movq	%rsi, -120(%rbp)
	jmp	.LBB5_9
.LBB5_8:                                #   in Loop: Header=BB5_2 Depth=1
.Ltmp45:
	leaq	-128(%rbp), %rdi
	movq	%r15, %rdx
	callq	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
.Ltmp46:
.LBB5_9:                                # %_ZNSt6vectorIfSaIfEE9push_backEOf.exit
                                        #   in Loop: Header=BB5_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	jne	.LBB5_2
.LBB5_4:                                # %.preheader70
	cmpl	$0, -136(%rbp)                  # 4-byte Folded Reload
	jle	.LBB5_11
# %bb.5:                                # %.lr.ph74
	movl	-136(%rbp), %r12d               # 4-byte Reload
	xorl	%r13d, %r13d
	leaq	-96(%rbp), %rbx
	leaq	-64(%rbp), %r15
.LBB5_6:                                # =>This Inner Loop Header: Depth=1
	movsbl	(%r14,%r13), %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	addss	.LCPI5_0(%rip), %xmm0
	movss	%xmm0, -64(%rbp)
	movq	-88(%rbp), %rsi
	cmpq	-80(%rbp), %rsi
	je	.LBB5_27
# %bb.7:                                #   in Loop: Header=BB5_6 Depth=1
	movss	%xmm0, (%rsi)
	addq	$4, %rsi
	movq	%rsi, -88(%rbp)
	jmp	.LBB5_28
.LBB5_27:                               #   in Loop: Header=BB5_6 Depth=1
.Ltmp48:
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
.Ltmp49:
.LBB5_28:                               # %_ZNSt6vectorIfSaIfEE9push_backEOf.exit51
                                        #   in Loop: Header=BB5_6 Depth=1
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB5_6
.LBB5_11:                               # %.preheader69
	movq	-136(%rbp), %rax                # 8-byte Reload
	addq	-144(%rbp), %rax                # 8-byte Folded Reload
	movslq	%eax, %r15
	movq	-128(%rbp), %rsi
	movq	-120(%rbp), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
	cmpq	%r15, %rax
	je	.LBB5_15
# %bb.12:
	leaq	-128(%rbp), %rbx
	leaq	-64(%rbp), %r14
.LBB5_13:                               # %.lr.ph76
                                        # =>This Inner Loop Header: Depth=1
	movl	$0, -64(%rbp)
.Ltmp51:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
.Ltmp52:
# %bb.14:                               # %_ZNSt6vectorIfSaIfEE6insertEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf.exit
                                        #   in Loop: Header=BB5_13 Depth=1
	movq	-128(%rbp), %rsi
	movq	-120(%rbp), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
	cmpq	%r15, %rax
	jne	.LBB5_13
.LBB5_15:                               # %.preheader
	movq	-96(%rbp), %rsi
	movq	-88(%rbp), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
	cmpq	%r15, %rax
	je	.LBB5_19
# %bb.16:
	leaq	-96(%rbp), %rbx
	leaq	-64(%rbp), %r14
.LBB5_17:                               # %.lr.ph78
                                        # =>This Inner Loop Header: Depth=1
	movl	$0, -64(%rbp)
.Ltmp54:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
.Ltmp55:
# %bb.18:                               # %_ZNSt6vectorIfSaIfEE6insertEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf.exit54
                                        #   in Loop: Header=BB5_17 Depth=1
	movq	-96(%rbp), %rsi
	movq	-88(%rbp), %rax
	subq	%rsi, %rax
	sarq	$2, %rax
	cmpq	%r15, %rax
	jne	.LBB5_17
.LBB5_19:                               # %._crit_edge
.Ltmp57:
	leaq	-64(%rbp), %rdi
	leaq	-128(%rbp), %rsi
	leaq	-96(%rbp), %rdx
	callq	_Z8multiplyRKSt6vectorIfSaIfEES3_
.Ltmp58:
# %bb.20:
	movq	-64(%rbp), %rax
	movq	-56(%rbp), %rdx
	movq	%rdx, %rsi
	subq	%rax, %rsi
	shrq	$2, %rsi
	leal	-1(%rsi), %ecx
	testl	%ecx, %ecx
	jle	.LBB5_25
# %bb.21:                               # %.lr.ph83.preheader
	movl	%ecx, %ecx
	movl	%esi, %edi
	movl	$4294967294, %esi               # imm = 0xFFFFFFFE
	addq	%rdi, %rsi
	incq	%rcx
	movl	$3435973837, %edi               # imm = 0xCCCCCCCD
.LBB5_22:                               # %.lr.ph83
                                        # =>This Inner Loop Header: Depth=1
	movl	-4(%rax,%rcx,4), %r8d
	cmpl	$10, %r8d
	jl	.LBB5_24
# %bb.23:                               #   in Loop: Header=BB5_22 Depth=1
	movl	%esi, %r9d
	movl	%r8d, %r10d
	imulq	%rdi, %r10
	shrq	$35, %r10
	addl	%r10d, (%rax,%r9,4)
	addl	%r10d, %r10d
	leal	(%r10,%r10,4), %r9d
	subl	%r9d, %r8d
	movl	%r8d, -4(%rax,%rcx,4)
.LBB5_24:                               #   in Loop: Header=BB5_22 Depth=1
	decq	%rsi
	decq	%rcx
	cmpq	$1, %rcx
	jg	.LBB5_22
.LBB5_25:                               # %._crit_edge84
	movq	%rsp, %rbx
	addq	$-4, %rdx
	movq	%rdx, -56(%rbp)
	xorl	%ecx, %ecx
	cmpl	$0, (%rax)
	sete	%cl
	subq	%rax, %rdx
	sarq	$2, %rdx
	leaq	15(%rdx), %rax
	andq	$-16, %rax
	movq	%rsp, %rsi
	subq	%rax, %rsi
	movq	%rsi, %rsp
	movq	-64(%rbp), %rdi
	movq	-56(%rbp), %rax
	subq	%rdi, %rax
	sarq	$2, %rax
	subq	%rcx, %rax
	jbe	.LBB5_26
# %bb.30:                               # %.lr.ph88.preheader
	leaq	(%rdi,%rcx,4), %rcx
	xorl	%edi, %edi
.LBB5_31:                               # %.lr.ph88
                                        # =>This Inner Loop Header: Depth=1
	movb	(%rcx,%rdi,4), %r8b
	addb	$48, %r8b
	movb	%r8b, (%rsi,%rdi)
	incq	%rdi
	cmpq	%rdi, %rax
	jne	.LBB5_31
# %bb.32:                               # %._crit_edge89.loopexit
	movl	%eax, %eax
	jmp	.LBB5_33
.LBB5_26:
	xorl	%eax, %eax
.LBB5_33:                               # %._crit_edge89
	movb	$0, (%rsi,%rax)
	movq	-152(%rbp), %rax                # 8-byte Reload
	movq	(%rax), %rdi
	callq	memcpy@PLT
	movq	%rbx, %rsp
	movq	-64(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB5_35
# %bb.34:
	callq	_ZdlPv
.LBB5_35:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit58
	movq	-96(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB5_37
# %bb.36:
	callq	_ZdlPv
.LBB5_37:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit
	movq	-128(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB5_39
# %bb.38:
	callq	_ZdlPv
.LBB5_39:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit61
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB5_40:
	.cfi_def_cfa %rbp, 16
.Ltmp59:
	jmp	.LBB5_41
.LBB5_29:
.Ltmp50:
	jmp	.LBB5_41
.LBB5_10:
.Ltmp47:
	jmp	.LBB5_41
.LBB5_47:
.Ltmp56:
	jmp	.LBB5_41
.LBB5_46:
.Ltmp53:
.LBB5_41:
	movq	%rax, %rbx
	movq	-96(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB5_43
# %bb.42:
	callq	_ZdlPv
.LBB5_43:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit63
	movq	-128(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB5_45
# %bb.44:
	callq	_ZdlPv
.LBB5_45:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit65
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	multWithFFT, .Lfunc_end5-multWithFFT
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp45-.Lfunc_begin1          # >> Call Site 1 <<
	.uleb128 .Ltmp46-.Ltmp45                #   Call between .Ltmp45 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin1          #     jumps to .Ltmp47
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp48-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp49-.Ltmp48                #   Call between .Ltmp48 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin1          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp52-.Ltmp51                #   Call between .Ltmp51 and .Ltmp52
	.uleb128 .Ltmp53-.Lfunc_begin1          #     jumps to .Ltmp53
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp54-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp55-.Ltmp54                #   Call between .Ltmp54 and .Ltmp55
	.uleb128 .Ltmp56-.Lfunc_begin1          #     jumps to .Ltmp56
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp57-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp58-.Ltmp57                #   Call between .Ltmp57 and .Ltmp58
	.uleb128 .Ltmp59-.Lfunc_begin1          #     jumps to .Ltmp59
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp58-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Lfunc_end5-.Ltmp58            #   Call between .Ltmp58 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB6_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB6_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB6_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB6_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end6:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end6-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_ # -- Begin function _ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,@function
_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_: # @_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.9, %edx
	callq	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB7_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIfE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB7_3
.LBB7_1:
	xorl	%ebp, %ebp
.LBB7_3:                                # %_ZNSt12_Vector_baseIfSaIfEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movss	(%rax), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB7_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB7_5:                                # %_ZNSt6vectorIfSaIfEE11_S_relocateEPfS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB7_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB7_7:                                # %_ZNSt6vectorIfSaIfEE11_S_relocateEPfS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB7_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB7_9:                                # %_ZNSt12_Vector_baseIfSaIfEE13_M_deallocateEPfm.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %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
.Lfunc_end7:
	.size	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_, .Lfunc_end7-_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB8_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB8_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end8:
	.size	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc, .Lfunc_end8-_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIfE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIfE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIfE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIfE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIfE8allocateEmPKv,@function
_ZNSt15__new_allocatorIfE8allocateEmPKv: # @_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB9_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB9_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB9_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB9_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end9:
	.size	_ZNSt15__new_allocatorIfE8allocateEmPKv, .Lfunc_end9-_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf,"axG",@progbits,_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf,comdat
	.weak	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf # -- Begin function _ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	.p2align	1, 0x90
	.type	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf,@function
_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf: # @_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movq	8(%rdi), %rdi
	movq	%rsi, %r14
	subq	%r12, %r14
	cmpq	16(%rbx), %rdi
	je	.LBB10_8
# %bb.1:
	cmpq	%rsi, %rdi
	je	.LBB10_2
# %bb.3:
	addq	%r14, %r12
	leaq	-4(%rdi), %rax
	movss	-4(%rdi), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rdi)
	leaq	4(%rdi), %rcx
	movq	%rcx, 8(%rbx)
	movq	%rax, %rdx
	subq	%rsi, %rdx
	movq	%rdx, %rcx
	sarq	$2, %rcx
	cmpq	$2, %rcx
	jl	.LBB10_5
# %bb.4:
	shlq	$2, %rcx
	subq	%rcx, %rdi
	movq	%r12, %rsi
	callq	memmove@PLT
.LBB10_7:                               # %_ZNSt6vectorIfSaIfEE13_M_insert_auxIfEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEOT_.exit
	movss	(%r15), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r12)
	jmp	.LBB10_9
.LBB10_8:
	addq	%r14, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	jmp	.LBB10_9
.LBB10_2:
	movss	(%r15), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 8(%rbx)
.LBB10_9:
	addq	(%rbx), %r14
	movq	%r14, %rax
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB10_5:
	.cfi_def_cfa_offset 48
	cmpq	$4, %rdx
	jne	.LBB10_7
# %bb.6:
	movss	(%r12), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rax)
	jmp	.LBB10_7
.Lfunc_end10:
	.size	_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf, .Lfunc_end10-_ZNSt6vectorIfSaIfEE14_M_insert_rvalEN9__gnu_cxx17__normal_iteratorIPKfS1_EEOf
	.cfi_endproc
                                        # -- 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	.LBB11_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB11_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_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	$_Z12ConvertToIntPfi, %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_end11:
	.size	__hip_module_ctor, .Lfunc_end11-__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	.LBB12_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
.LBB12_2:
	retq
.Lfunc_end12:
	.size	__hip_module_dtor, .Lfunc_end12-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i,@object # @_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.section	.rodata,"a",@progbits
	.globl	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.p2align	3, 0x0
_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i:
	.quad	_Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.size	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i, 8

	.type	_Z12ConvertToIntPfi,@object     # @_Z12ConvertToIntPfi
	.globl	_Z12ConvertToIntPfi
	.p2align	3, 0x0
_Z12ConvertToIntPfi:
	.quad	_Z27__device_stub__ConvertToIntPfi
	.size	_Z12ConvertToIntPfi, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Cuda error: Failed to allocate\n"
	.size	.L.str, 32

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"CUFFT error: Plan creation failed"
	.size	.L.str.1, 34

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"CUFFT error: ExecR2C Forward failed"
	.size	.L.str.2, 36

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"CUFFT error: ExecC2R Forward failed"
	.size	.L.str.3, 36

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Cuda error: Failed to synchronize\n"
	.size	.L.str.4, 35

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"a = %s\n\n"
	.size	.L.str.5, 9

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"b = %s\n\n"
	.size	.L.str.6, 9

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"cannot create std::vector larger than max_size()"
	.size	.L.str.7, 49

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.9, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i"
	.size	.L__unnamed_1, 61

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z12ConvertToIntPfi"
	.size	.L__unnamed_2, 20

	.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 _Z42__device_stub__ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.addrsig_sym _Z27__device_stub__ConvertToIntPfi
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.addrsig_sym _Z12ConvertToIntPfi
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i ; -- Begin function _Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.globl	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
	.p2align	8
	.type	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i,@function
_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i: ; @_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x24
	s_load_b32 s10, s[0:1], 0x10
	s_add_u32 s2, s0, 24
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s4, 0xffff
	s_mov_b32 s4, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s10, v1
	s_cbranch_execz .LBB0_3
; %bb.1:                                ; %.lr.ph.preheader
	v_cvt_f32_i32_e32 v0, s10
	s_load_b32 s2, s[2:3], 0x0
	s_load_b128 s[4:7], s[0:1], 0x0
	s_mov_b32 s1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v2, null, v0, v0, 1.0
	v_div_scale_f32 v5, vcc_lo, 1.0, v0, 1.0
	v_rcp_f32_e32 v3, v2
	s_waitcnt_depctr 0xfff
	v_fma_f32 v4, -v2, v3, 1.0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s2, s2, s8
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_ashr_i32 s3, s2, 31
	s_lshl_b64 s[8:9], s[2:3], 3
	v_fmac_f32_e32 v3, v4, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, v5, v3
	v_fma_f32 v6, -v2, v4, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v6, v3
	v_fma_f32 v5, -v2, v4, v5
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v4, v5, v3, v4
	v_lshlrev_b64 v[2:3], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_2)
	v_div_fixup_f32 v0, v4, v0, 1.0
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v4, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v3, vcc_lo
	v_add_co_u32 v2, vcc_lo, v2, s8
	global_load_b64 v[4:5], v[4:5], off
	global_load_b64 v[8:9], v[6:7], off
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v3, vcc_lo
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v10, v5, v9
	v_mul_f32_e32 v9, v4, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f32 v4, v4, v8, -v10
	v_add_nc_u32_e32 v1, s2, v1
	v_fmac_f32_e32 v9, v5, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v4, v0, v4
	v_cmp_le_i32_e64 s0, s10, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v5, v0, v9
	s_or_b32 s1, s0, s1
	global_store_b64 v[6:7], v[4:5], off
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_2
.LBB0_3:                                ; %Flow54
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 11
		.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	_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i, .Lfunc_end0-_Z27ComplexPointwiseMulAndScaleP15HIP_vector_typeIfLj2EES1_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 364
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z12ConvertToIntPfi     ; -- Begin function _Z12ConvertToIntPfi
	.globl	_Z12ConvertToIntPfi
	.p2align	8
	.type	_Z12ConvertToIntPfi,@function
_Z12ConvertToIntPfi:                    ; @_Z12ConvertToIntPfi
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x1c
	s_load_b32 s6, s[0:1], 0x8
	s_add_u32 s2, s0, 16
	s_addc_u32 s3, s1, 0
	s_mov_b32 s5, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	v_cmpx_gt_i32_e64 s6, v1
	s_cbranch_execz .LBB1_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b32 s2, s[2:3], 0x0
	s_load_b64 s[0:1], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s2, s2, s4
	v_add_co_u32 v2, vcc_lo, s0, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	s_ashr_i32 s3, s2, 31
	s_mov_b32 s1, 0
	s_lshl_b64 s[4:5], s[2:3], 2
.LBB1_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v0, v[2:3], off
	v_add_nc_u32_e32 v1, s2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e32 vcc_lo, s6, v1
	s_or_b32 s1, vcc_lo, s1
	s_waitcnt vmcnt(0)
	v_trunc_f32_e32 v4, v0
	v_sub_f32_e32 v5, v0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, |v5|, 0.5
	v_cndmask_b32_e64 v5, 0, 1.0, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_bfi_b32 v0, 0x7fffffff, v5, v0
	v_add_f32_e32 v0, v4, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cvt_i32_f32_e32 v0, v0
	global_store_b32 v[2:3], v0, off
	v_add_co_u32 v2, s0, v2, s4
	v_add_co_ci_u32_e64 v3, s0, s5, v3, s0
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB1_2
.LBB1_3:                                ; %Flow15
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12ConvertToIntPfi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 6
		.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	_Z12ConvertToIntPfi, .Lfunc_end1-_Z12ConvertToIntPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 264
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
