/**
* @file coeff.cu
* @brief Filter coefficients
* @author John Melton, G0ORX/N6LYT
*/


/* Copyright (C)
* 2015 - John Melton, G0ORX/N6LYT
*
* Based on code from WDSP written by Warren Pratt, NR0V
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*
*/

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

static double Ino(double x) {
  /*
   * This function calculates the zeroth order Bessel function
   */
  double d = 0.0, ds = 1.0, s = 1.0;
  do
  {
    d += 2.0;
    ds *= x*x/(d*d);
    s += ds;
  }
  while (ds > s*1e-6);
  return s;
}

double *calcFilter(double Fs, double Fa, double Fb, int M, double Att) {

  int Np = (M-1)/2;
  double A[Np+1];
  double Alpha;
  int j;
  double pi = 3.1415926535897932;
  double Inoalpha;
  double *H;

  H=(double*)malloc(M*sizeof(double));
    // Calculate the impulse response of the ideal filter
    A[0] = 2.0*(Fb-Fa)/Fs;
    for(j=1; j<=Np; j++)
    {
      A[j] = (sin(2.0*(double)j*pi*Fb/Fs)-sin(2.0*(double)j*pi*Fa/Fs))/((double)j*pi);
    }
    // Calculate the desired shape factor for the Kaiser-Bessel window
    if (Att<21.0)
    {
      Alpha = 0.0;
    }
    else if (Att>50.0)
    {
      Alpha = 0.1102*(Att-8.7);
    }
    else
    {
      Alpha = 0.5842*pow((Att-21.0), 0.4)+0.07886*(Att-21.0);
    }
    // Window the ideal response with the Kaiser-Bessel window
    Inoalpha = Ino(Alpha);
    for (j=0; j<=Np; j++)
    {
      H[Np+j] = A[j]*Ino(Alpha*sqrt(1.0-((double)j*(double)j/((double)Np*(double)Np))))/Inoalpha;
    }
    for (j=0; j<Np; j++)
    {
      H[j] = H[M-1-j];
    }

    return H;
}


	.file	"tmpxft_0037beee_00000000-6_coeff.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2031:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10calcFilterdddid
	.type	_Z10calcFilterdddid, @function
_Z10calcFilterdddid:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movslq	%edi, %rcx
	movl	$2, %esi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movsd	%xmm0, -72(%rbp)
	movsd	%xmm1, -88(%rbp)
	movsd	%xmm2, -96(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leal	-1(%rcx), %eax
	cltd
	idivl	%esi
	movq	%rsp, %rsi
	leal	1(%rax), %r13d
	movl	%eax, %ebx
	movslq	%r13d, %r13
	salq	$3, %r13
	leaq	15(%r13), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rsi
.L3:
	cmpq	%rsi, %rsp
	je	.L4
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L3
.L4:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L5
	orq	$0, -8(%rsp,%rax)
.L5:
	leaq	0(,%rcx,8), %rax
	movsd	%xmm3, -104(%rbp)
	leaq	7(%rsp), %r14
	movq	%rax, %rdi
	movq	%rax, -80(%rbp)
	movq	%r14, %r15
	andq	$-8, %r14
	call	malloc@PLT
	movsd	-96(%rbp), %xmm0
	subsd	-88(%rbp), %xmm0
	shrq	$3, %r15
	movsd	-104(%rbp), %xmm3
	movq	%rax, %r12
	addsd	%xmm0, %xmm0
	divsd	-72(%rbp), %xmm0
	movsd	%xmm0, 0(,%r15,8)
	movl	$1, %r15d
.L6:
	cmpl	%r15d, %ebx
	jl	.L28
	cvtsi2sdl	%r15d, %xmm2
	movsd	-96(%rbp), %xmm0
	movsd	%xmm3, -128(%rbp)
	movaps	%xmm2, %xmm1
	movsd	%xmm2, -120(%rbp)
	addsd	%xmm2, %xmm1
	mulsd	.LC2(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm1, -112(%rbp)
	divsd	-72(%rbp), %xmm0
	call	sin@PLT
	movsd	-112(%rbp), %xmm1
	mulsd	-88(%rbp), %xmm1
	movsd	%xmm0, -104(%rbp)
	movaps	%xmm1, %xmm0
	divsd	-72(%rbp), %xmm0
	call	sin@PLT
	movsd	-104(%rbp), %xmm4
	movsd	-120(%rbp), %xmm2
	mulsd	.LC2(%rip), %xmm2
	movsd	-128(%rbp), %xmm3
	subsd	%xmm0, %xmm4
	movaps	%xmm4, %xmm0
	divsd	%xmm2, %xmm0
	movsd	%xmm0, (%r14,%r15,8)
	incq	%r15
	jmp	.L6
.L28:
	movsd	.LC3(%rip), %xmm0
	xorps	%xmm1, %xmm1
	comisd	%xmm3, %xmm0
	ja	.L8
	comisd	.LC4(%rip), %xmm3
	jbe	.L25
	subsd	.LC5(%rip), %xmm3
	movsd	.LC6(%rip), %xmm1
	mulsd	%xmm3, %xmm1
	jmp	.L8
.L25:
	subsd	%xmm0, %xmm3
	movsd	.LC7(%rip), %xmm1
	movaps	%xmm3, %xmm0
	movsd	%xmm3, -72(%rbp)
	call	pow@PLT
	movsd	.LC8(%rip), %xmm1
	movsd	-72(%rbp), %xmm3
	mulsd	.LC9(%rip), %xmm3
	mulsd	%xmm0, %xmm1
	addsd	%xmm3, %xmm1
.L8:
	movaps	%xmm1, %xmm7
	movsd	.LC1(%rip), %xmm2
	xorps	%xmm3, %xmm3
	mulsd	%xmm1, %xmm7
	movaps	%xmm2, %xmm0
	movaps	%xmm2, %xmm4
.L11:
	addsd	.LC10(%rip), %xmm3
	movaps	%xmm7, %xmm5
	movaps	%xmm3, %xmm6
	mulsd	%xmm3, %xmm6
	divsd	%xmm6, %xmm5
	mulsd	%xmm5, %xmm0
	movsd	.LC11(%rip), %xmm5
	addsd	%xmm0, %xmm2
	mulsd	%xmm2, %xmm5
	comisd	%xmm5, %xmm0
	ja	.L11
	leaq	-8(%r12,%r13), %r15
	xorl	%r13d, %r13d
.L12:
	cmpl	%r13d, %ebx
	jl	.L29
	cvtsi2sdl	%r13d, %xmm0
	movsd	(%r14,%r13,8), %xmm6
	movsd	%xmm2, -96(%rbp)
	cvtsi2sdl	%ebx, %xmm3
	movsd	%xmm1, -88(%rbp)
	movsd	%xmm6, -72(%rbp)
	mulsd	%xmm0, %xmm0
	mulsd	%xmm3, %xmm3
	divsd	%xmm3, %xmm0
	movaps	%xmm4, %xmm3
	subsd	%xmm0, %xmm3
	movaps	%xmm3, %xmm0
	call	sqrt@PLT
	movsd	-88(%rbp), %xmm1
	movsd	-96(%rbp), %xmm2
	xorps	%xmm6, %xmm6
	movsd	.LC1(%rip), %xmm4
	mulsd	%xmm1, %xmm0
	movaps	%xmm4, %xmm3
	movaps	%xmm4, %xmm5
	mulsd	%xmm0, %xmm0
.L13:
	addsd	.LC10(%rip), %xmm6
	movaps	%xmm0, %xmm7
	movaps	%xmm6, %xmm8
	mulsd	%xmm6, %xmm8
	divsd	%xmm8, %xmm7
	mulsd	%xmm7, %xmm5
	movsd	.LC11(%rip), %xmm7
	addsd	%xmm5, %xmm3
	mulsd	%xmm3, %xmm7
	comisd	%xmm7, %xmm5
	ja	.L13
	movsd	-72(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	divsd	%xmm2, %xmm0
	movsd	%xmm0, (%r15,%r13,8)
	incq	%r13
	jmp	.L12
.L29:
	movq	-80(%rbp), %rdx
	xorl	%eax, %eax
	addq	%r12, %rdx
.L15:
	cmpl	%eax, %ebx
	jle	.L30
	imulq	$-8, %rax, %rcx
	movsd	-8(%rdx,%rcx), %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	incq	%rax
	jmp	.L15
.L30:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z10calcFilterdddid, .-_Z10calcFilterdddid
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2054:
	.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
.LFE2054:
	.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
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	1413754136
	.long	1074340347
	.align 8
.LC3:
	.long	0
	.long	1077215232
	.align 8
.LC4:
	.long	0
	.long	1078525952
	.align 8
.LC5:
	.long	1717986918
	.long	1075930726
	.align 8
.LC6:
	.long	872737355
	.long	1069299217
	.align 8
.LC7:
	.long	-1717986918
	.long	1071225241
	.align 8
.LC8:
	.long	852121512
	.long	1071821252
	.align 8
.LC9:
	.long	1089890901
	.long	1068773419
	.align 8
.LC10:
	.long	0
	.long	1073741824
	.align 8
.LC11:
	.long	-1598689907
	.long	1051772663
	.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:

/**
* @file coeff.cu
* @brief Filter coefficients
* @author John Melton, G0ORX/N6LYT
*/


/* Copyright (C)
* 2015 - John Melton, G0ORX/N6LYT
*
* Based on code from WDSP written by Warren Pratt, NR0V
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*
*/


#include <hip/hip_runtime.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

static double Ino(double x) {
  /*
   * This function calculates the zeroth order Bessel function
   */
  double d = 0.0, ds = 1.0, s = 1.0;
  do
  {
    d += 2.0;
    ds *= x*x/(d*d);
    s += ds;
  }
  while (ds > s*1e-6);
  return s;
}

double *calcFilter(double Fs, double Fa, double Fb, int M, double Att) {

  int Np = (M-1)/2;
  double A[Np+1];
  double Alpha;
  int j;
  double pi = 3.1415926535897932;
  double Inoalpha;
  double *H;

  H=(double*)malloc(M*sizeof(double));
    // Calculate the impulse response of the ideal filter
    A[0] = 2.0*(Fb-Fa)/Fs;
    for(j=1; j<=Np; j++)
    {
      A[j] = (sin(2.0*(double)j*pi*Fb/Fs)-sin(2.0*(double)j*pi*Fa/Fs))/((double)j*pi);
    }
    // Calculate the desired shape factor for the Kaiser-Bessel window
    if (Att<21.0)
    {
      Alpha = 0.0;
    }
    else if (Att>50.0)
    {
      Alpha = 0.1102*(Att-8.7);
    }
    else
    {
      Alpha = 0.5842*pow((Att-21.0), 0.4)+0.07886*(Att-21.0);
    }
    // Window the ideal response with the Kaiser-Bessel window
    Inoalpha = Ino(Alpha);
    for (j=0; j<=Np; j++)
    {
      H[Np+j] = A[j]*Ino(Alpha*sqrt(1.0-((double)j*(double)j/((double)Np*(double)Np))))/Inoalpha;
    }
    for (j=0; j<Np; j++)
    {
      H[j] = H[M-1-j];
    }

    return H;
}


	.text
	.file	"coeff.hip"
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10calcFilterdddid
.LCPI0_0:
	.quad	0x400921fb54442d18              # double 3.1415926535897931
.LCPI0_1:
	.quad	0x4035000000000000              # double 21
.LCPI0_2:
	.quad	0x4049000000000000              # double 50
.LCPI0_3:
	.quad	0xc035000000000000              # double -21
.LCPI0_4:
	.quad	0x3fd999999999999a              # double 0.40000000000000002
.LCPI0_5:
	.quad	0x3fe2b1c432ca57a8              # double 0.58420000000000005
.LCPI0_6:
	.quad	0x3fb4302b40f66a55              # double 0.07886
.LCPI0_7:
	.quad	0xc021666666666666              # double -8.6999999999999993
.LCPI0_8:
	.quad	0x3fbc36113404ea4b              # double 0.11020000000000001
.LCPI0_9:
	.quad	0x3ff0000000000000              # double 1
.LCPI0_10:
	.quad	0x4000000000000000              # double 2
.LCPI0_11:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.text
	.globl	_Z10calcFilterdddid
	.type	_Z10calcFilterdddid,@function
_Z10calcFilterdddid:                    # @_Z10calcFilterdddid
	.cfi_startproc
# %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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movsd	%xmm3, -64(%rbp)                # 8-byte Spill
                                        # kill: def $edi killed $edi def $rdi
	movsd	%xmm2, -120(%rbp)               # 8-byte Spill
	movsd	%xmm1, -112(%rbp)               # 8-byte Spill
	movsd	%xmm0, -48(%rbp)                # 8-byte Spill
	leal	-1(%rdi), %eax
	movl	%eax, -92(%rbp)                 # 4-byte Spill
                                        # kill: def $eax killed $eax def $rax
	shrl	$31, %eax
	addl	%edi, %eax
	decl	%eax
	sarl	%eax
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	incl	%eax
	leaq	15(,%rax,8), %rbx
	andq	$-16, %rbx
	movq	%rsp, %r15
	movq	%r15, %r13
	subq	%rbx, %r13
	negq	%rbx
	movq	%r13, %rsp
	movq	%rdi, -104(%rbp)                # 8-byte Spill
	movslq	%edi, %r12
	leaq	(,%r12,8), %rdi
	callq	malloc
	movsd	-48(%rbp), %xmm2                # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movsd	-120(%rbp), %xmm1               # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movq	%rax, %r14
	movapd	%xmm1, %xmm0
	subsd	-112(%rbp), %xmm0               # 8-byte Folded Reload
	addsd	%xmm0, %xmm0
	divsd	%xmm2, %xmm0
	movsd	%xmm0, (%r15,%rbx)
	cmpl	$3, %r12d
	jl	.LBB0_3
# %bb.1:                                # %.lr.ph.preheader
	movq	-56(%rbp), %rax                 # 8-byte Reload
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovgel	%eax, %ebx
	negq	%rbx
	movl	$1, %r15d
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15d, %xmm0
	movsd	%xmm0, -88(%rbp)                # 8-byte Spill
	movapd	%xmm0, %xmm3
	addsd	%xmm0, %xmm3
	movsd	.LCPI0_0(%rip), %xmm0           # xmm0 = mem[0],zero
	mulsd	%xmm0, %xmm3
	movsd	%xmm3, -72(%rbp)                # 8-byte Spill
	movapd	%xmm3, %xmm0
	mulsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	callq	sin
	movsd	%xmm0, -80(%rbp)                # 8-byte Spill
	movsd	-72(%rbp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	mulsd	-112(%rbp), %xmm0               # 8-byte Folded Reload
	divsd	-48(%rbp), %xmm0                # 8-byte Folded Reload
	callq	sin
	movsd	-48(%rbp), %xmm2                # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movsd	-120(%rbp), %xmm1               # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movsd	-80(%rbp), %xmm3                # 8-byte Reload
                                        # xmm3 = mem[0],zero
	subsd	%xmm0, %xmm3
	movsd	-88(%rbp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	mulsd	.LCPI0_0(%rip), %xmm0
	divsd	%xmm0, %xmm3
	movsd	%xmm3, (%r13,%r15,8)
	leaq	(%rbx,%r15), %rax
	incq	%rax
	incq	%r15
	cmpq	$1, %rax
	jne	.LBB0_2
.LBB0_3:                                # %._crit_edge
	xorpd	%xmm4, %xmm4
	movsd	.LCPI0_1(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	-64(%rbp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	xorpd	%xmm6, %xmm6
	ja	.LBB0_7
# %bb.4:
	ucomisd	.LCPI0_2(%rip), %xmm0
	jbe	.LBB0_6
# %bb.5:
	addsd	.LCPI0_7(%rip), %xmm0
	mulsd	.LCPI0_8(%rip), %xmm0
	movapd	%xmm0, %xmm6
	jmp	.LBB0_7
.LBB0_6:
	addsd	.LCPI0_3(%rip), %xmm0
	movsd	%xmm0, -64(%rbp)                # 8-byte Spill
	movsd	.LCPI0_4(%rip), %xmm1           # xmm1 = mem[0],zero
	callq	pow
	xorpd	%xmm4, %xmm4
	mulsd	.LCPI0_5(%rip), %xmm0
	movsd	-64(%rbp), %xmm6                # 8-byte Reload
                                        # xmm6 = mem[0],zero
	mulsd	.LCPI0_6(%rip), %xmm6
	addsd	%xmm0, %xmm6
.LBB0_7:
	movapd	%xmm6, %xmm0
	mulsd	%xmm6, %xmm0
	movsd	.LCPI0_9(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	.LCPI0_10(%rip), %xmm7          # xmm7 = mem[0],zero
	movsd	.LCPI0_11(%rip), %xmm8          # xmm8 = mem[0],zero
	movapd	%xmm1, %xmm9
.LBB0_8:                                # =>This Inner Loop Header: Depth=1
	addsd	%xmm7, %xmm4
	movapd	%xmm4, %xmm2
	mulsd	%xmm4, %xmm2
	movapd	%xmm0, %xmm3
	divsd	%xmm2, %xmm3
	mulsd	%xmm3, %xmm1
	addsd	%xmm1, %xmm9
	movapd	%xmm9, %xmm2
	mulsd	%xmm8, %xmm2
	ucomisd	%xmm2, %xmm1
	ja	.LBB0_8
# %bb.9:                                # %_ZL3Inod.exit.preheader
	cmpl	$0, -104(%rbp)                  # 4-byte Folded Reload
	js	.LBB0_16
# %bb.10:                               # %.lr.ph61
	movq	-56(%rbp), %rcx                 # 8-byte Reload
	cvtsi2sd	%ecx, %xmm10
	mulsd	%xmm10, %xmm10
	movslq	%ecx, %rax
	xorl	%r15d, %r15d
	testl	%ecx, %ecx
	movl	$0, %ebx
	cmovgl	%ecx, %ebx
	incl	%ebx
	leaq	(%r14,%rax,8), %r12
	movsd	.LCPI0_9(%rip), %xmm11          # xmm11 = mem[0],zero
	xorpd	%xmm12, %xmm12
	movsd	%xmm6, -88(%rbp)                # 8-byte Spill
	movsd	%xmm9, -80(%rbp)                # 8-byte Spill
	movsd	%xmm10, -72(%rbp)               # 8-byte Spill
.LBB0_11:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_19 Depth 2
	movsd	(%r13,%r15,8), %xmm13           # xmm13 = mem[0],zero
	xorps	%xmm1, %xmm1
	cvtsi2sd	%r15d, %xmm1
	mulsd	%xmm1, %xmm1
	divsd	%xmm10, %xmm1
	movapd	%xmm11, %xmm0
	subsd	%xmm1, %xmm0
	ucomisd	%xmm12, %xmm0
	jb	.LBB0_17
# %bb.12:                               #   in Loop: Header=BB0_11 Depth=1
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB0_18
.LBB0_17:                               # %call.sqrt
                                        #   in Loop: Header=BB0_11 Depth=1
	movsd	%xmm13, -48(%rbp)               # 8-byte Spill
	callq	sqrt
	movsd	-48(%rbp), %xmm13               # 8-byte Reload
                                        # xmm13 = mem[0],zero
	xorpd	%xmm12, %xmm12
	movsd	.LCPI0_9(%rip), %xmm11          # xmm11 = mem[0],zero
	movsd	-72(%rbp), %xmm10               # 8-byte Reload
                                        # xmm10 = mem[0],zero
	movsd	-80(%rbp), %xmm9                # 8-byte Reload
                                        # xmm9 = mem[0],zero
	movsd	.LCPI0_11(%rip), %xmm8          # xmm8 = mem[0],zero
	movsd	.LCPI0_10(%rip), %xmm7          # xmm7 = mem[0],zero
	movsd	-88(%rbp), %xmm6                # 8-byte Reload
                                        # xmm6 = mem[0],zero
.LBB0_18:                               # %.split
                                        #   in Loop: Header=BB0_11 Depth=1
	mulsd	%xmm6, %xmm0
	mulsd	%xmm0, %xmm0
	xorpd	%xmm1, %xmm1
	movapd	%xmm11, %xmm3
	movapd	%xmm11, %xmm2
.LBB0_19:                               #   Parent Loop BB0_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	addsd	%xmm7, %xmm1
	movapd	%xmm1, %xmm4
	mulsd	%xmm1, %xmm4
	movapd	%xmm0, %xmm5
	divsd	%xmm4, %xmm5
	mulsd	%xmm5, %xmm3
	addsd	%xmm3, %xmm2
	movapd	%xmm2, %xmm4
	mulsd	%xmm8, %xmm4
	ucomisd	%xmm4, %xmm3
	ja	.LBB0_19
# %bb.20:                               # %_ZL3Inod.exit55
                                        #   in Loop: Header=BB0_11 Depth=1
	mulsd	%xmm2, %xmm13
	divsd	%xmm9, %xmm13
	movsd	%xmm13, (%r12,%r15,8)
	incq	%r15
	cmpq	%rbx, %r15
	jne	.LBB0_11
# %bb.13:                               # %.preheader
	cmpl	$3, -104(%rbp)                  # 4-byte Folded Reload
	jl	.LBB0_16
# %bb.14:                               # %.lr.ph63.preheader
	movl	-92(%rbp), %ecx                 # 4-byte Reload
	movq	-56(%rbp), %rdx                 # 8-byte Reload
	cmpl	$2, %edx
	movl	$1, %eax
	cmovgel	%edx, %eax
	leaq	(%r14,%rcx,8), %rcx
	xorl	%edx, %edx
.LBB0_15:                               # %.lr.ph63
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rcx), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%r14,%rdx,8)
	incq	%rdx
	addq	$-8, %rcx
	cmpq	%rdx, %rax
	jne	.LBB0_15
.LBB0_16:                               # %._crit_edge64
	movq	%r14, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end0:
	.size	_Z10calcFilterdddid, .Lfunc_end0-_Z10calcFilterdddid
	.cfi_endproc
                                        # -- End function
	.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 __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
