//
// Created by brian on 11/20/18.
//

#include "complex.cuh"

#include <cmath>

__host__ __device__ Complex::Complex() : real(0.0f), imag(0.0f) {}

__host__ __device__ Complex::Complex(float r) : real(r), imag(0.0f) {}

__host__ __device__ Complex::Complex(float r, float i) : real(r), imag(i) {}

__host__ __device__ Complex Complex::operator+(const Complex &b) const {
    Complex c;
    c.real = this->real+b.real;
    c.imag = this->imag+b.imag;
    return c;
}

__host__ __device__ Complex Complex::operator-(const Complex &b) const {
    Complex c;
    c.real = this->real-b.real;
    c.imag = this->imag-b.imag;
    return c;
}

__host__ __device__ Complex Complex::operator*(const Complex &b) const {
    Complex c;
    c.real = this->real*b.real-this->imag*b.imag;
    c.imag = this->real*b.imag+this->imag*b.real;
    return c;
}

Complex Complex::mag() const {
    float x = this->real;
    float y = this->imag;
    float m = sqrt(x*x+y*y);
    return m;
}

Complex Complex::angle() const {
    float a = atanl(this->imag/this->real);
    return a;
}

Complex Complex::conj() const {
    Complex c;
    c.real = this->real;
    c.imag = -this->imag;
    return c;
}

std::ostream& operator<< (std::ostream& os, const Complex& rhs) {
    Complex c(rhs);
    if(fabsf(rhs.imag) < 1e-10) c.imag = 0.0f;
    if(fabsf(rhs.real) < 1e-10) c.real = 0.0f;

    if(c.imag == 0) {
        os << c.real;
    }
    else {
        os << "(" << c.real << "," << c.imag << ")";
    }
    return os;
}

	.file	"tmpxft_0037edc7_00000000-6_complex.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3653:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3653:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.globl	_ZN7ComplexC2Ev
	.type	_ZN7ComplexC2Ev, @function
_ZN7ComplexC2Ev:
.LFB3636:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	movq	%rax, (%rdi)
	ret
	.cfi_endproc
.LFE3636:
	.size	_ZN7ComplexC2Ev, .-_ZN7ComplexC2Ev
	.globl	_ZN7ComplexC1Ev
	.set	_ZN7ComplexC1Ev,_ZN7ComplexC2Ev
	.align 2
	.globl	_ZN7ComplexC2Ef
	.type	_ZN7ComplexC2Ef, @function
_ZN7ComplexC2Ef:
.LFB3639:
	.cfi_startproc
	endbr64
	movl	$0x00000000, 4(%rdi)
	movss	%xmm0, (%rdi)
	ret
	.cfi_endproc
.LFE3639:
	.size	_ZN7ComplexC2Ef, .-_ZN7ComplexC2Ef
	.globl	_ZN7ComplexC1Ef
	.set	_ZN7ComplexC1Ef,_ZN7ComplexC2Ef
	.align 2
	.globl	_ZN7ComplexC2Eff
	.type	_ZN7ComplexC2Eff, @function
_ZN7ComplexC2Eff:
.LFB3642:
	.cfi_startproc
	endbr64
	movss	%xmm0, (%rdi)
	movss	%xmm1, 4(%rdi)
	ret
	.cfi_endproc
.LFE3642:
	.size	_ZN7ComplexC2Eff, .-_ZN7ComplexC2Eff
	.globl	_ZN7ComplexC1Eff
	.set	_ZN7ComplexC1Eff,_ZN7ComplexC2Eff
	.align 2
	.globl	_ZNK7ComplexplERKS_
	.type	_ZNK7ComplexplERKS_, @function
_ZNK7ComplexplERKS_:
.LFB3644:
	.cfi_startproc
	endbr64
	movss	4(%rdi), %xmm1
	addss	4(%rsi), %xmm1
	movss	(%rdi), %xmm0
	addss	(%rsi), %xmm0
	movd	%xmm1, %edx
	salq	$32, %rdx
	movd	%xmm0, %eax
	orq	%rdx, %rax
	movq	%rax, %xmm0
	ret
	.cfi_endproc
.LFE3644:
	.size	_ZNK7ComplexplERKS_, .-_ZNK7ComplexplERKS_
	.align 2
	.globl	_ZNK7ComplexmiERKS_
	.type	_ZNK7ComplexmiERKS_, @function
_ZNK7ComplexmiERKS_:
.LFB3645:
	.cfi_startproc
	endbr64
	movss	4(%rdi), %xmm1
	subss	4(%rsi), %xmm1
	movss	(%rdi), %xmm0
	subss	(%rsi), %xmm0
	movd	%xmm1, %edx
	salq	$32, %rdx
	movd	%xmm0, %eax
	orq	%rdx, %rax
	movq	%rax, %xmm0
	ret
	.cfi_endproc
.LFE3645:
	.size	_ZNK7ComplexmiERKS_, .-_ZNK7ComplexmiERKS_
	.align 2
	.globl	_ZNK7ComplexmlERKS_
	.type	_ZNK7ComplexmlERKS_, @function
_ZNK7ComplexmlERKS_:
.LFB3646:
	.cfi_startproc
	endbr64
	movss	(%rdi), %xmm0
	movss	(%rsi), %xmm2
	movss	4(%rdi), %xmm3
	movss	4(%rsi), %xmm4
	movaps	%xmm0, %xmm1
	mulss	%xmm2, %xmm1
	movaps	%xmm3, %xmm5
	mulss	%xmm4, %xmm0
	mulss	%xmm3, %xmm2
	mulss	%xmm4, %xmm5
	addss	%xmm2, %xmm0
	subss	%xmm5, %xmm1
	movq	%xmm0, %rax
	salq	$32, %rax
	movd	%xmm1, %edx
	orq	%rax, %rdx
	movq	%rdx, %xmm0
	ret
	.cfi_endproc
.LFE3646:
	.size	_ZNK7ComplexmlERKS_, .-_ZNK7ComplexmlERKS_
	.align 2
	.globl	_ZNK7Complex3magEv
	.type	_ZNK7Complex3magEv, @function
_ZNK7Complex3magEv:
.LFB3647:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movss	(%rdi), %xmm0
	movss	4(%rdi), %xmm1
	mulss	%xmm0, %xmm0
	mulss	%xmm1, %xmm1
	addss	%xmm1, %xmm0
	call	sqrtf@PLT
	popq	%rdx
	.cfi_def_cfa_offset 8
	movd	%xmm0, %eax
	movd	%eax, %xmm0
	ret
	.cfi_endproc
.LFE3647:
	.size	_ZNK7Complex3magEv, .-_ZNK7Complex3magEv
	.align 2
	.globl	_ZNK7Complex5angleEv
	.type	_ZNK7Complex5angleEv, @function
_ZNK7Complex5angleEv:
.LFB3648:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movss	4(%rdi), %xmm0
	divss	(%rdi), %xmm0
	movss	%xmm0, 28(%rsp)
	flds	28(%rsp)
	fstpt	(%rsp)
	call	atanl@PLT
	fstps	28(%rsp)
	movl	28(%rsp), %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	movd	%eax, %xmm0
	ret
	.cfi_endproc
.LFE3648:
	.size	_ZNK7Complex5angleEv, .-_ZNK7Complex5angleEv
	.align 2
	.globl	_ZNK7Complex4conjEv
	.type	_ZNK7Complex4conjEv, @function
_ZNK7Complex4conjEv:
.LFB3649:
	.cfi_startproc
	endbr64
	movss	4(%rdi), %xmm0
	xorps	.LC2(%rip), %xmm0
	movl	(%rdi), %edx
	movd	%xmm0, %eax
	salq	$32, %rax
	orq	%rax, %rdx
	movq	%rdx, %xmm0
	ret
	.cfi_endproc
.LFE3649:
	.size	_ZNK7Complex4conjEv, .-_ZNK7Complex4conjEv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"("
.LC6:
	.string	","
.LC7:
	.string	")"
	.text
	.globl	_ZlsRSoRK7Complex
	.type	_ZlsRSoRK7Complex, @function
_ZlsRSoRK7Complex:
.LFB3650:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movss	4(%rsi), %xmm1
	movsd	.LC4(%rip), %xmm4
	movss	.LC3(%rip), %xmm2
	movss	(%rsi), %xmm0
	movaps	%xmm1, %xmm3
	andps	%xmm2, %xmm3
	cvtss2sd	%xmm3, %xmm3
	comisd	%xmm3, %xmm4
	jbe	.L14
	xorps	%xmm1, %xmm1
.L14:
	andps	%xmm0, %xmm2
	cvtss2sd	%xmm2, %xmm2
	comisd	%xmm2, %xmm4
	jbe	.L15
	xorps	%xmm0, %xmm0
.L15:
	xorps	%xmm2, %xmm2
	cvtss2sd	%xmm0, %xmm0
	ucomiss	%xmm2, %xmm1
	jp	.L16
	jne	.L16
	movq	%rbx, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	jmp	.L18
.L16:
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	movss	%xmm1, 4(%rsp)
	movsd	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	8(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	4(%rsp), %xmm1
	movq	%rax, %rdi
	cvtss2sd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L18:
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3650:
	.size	_ZlsRSoRK7Complex, .-_ZlsRSoRK7Complex
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3676:
	.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
.LFE3676:
	.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.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-2147483648
	.long	0
	.long	0
	.long	0
	.align 16
.LC3:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	-640172613
	.long	1037794527
	.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:

//
// Created by brian on 11/20/18.
//


#include <hip/hip_runtime.h>
#include "complex.cuh"

#include <cmath>

__host__ __device__ Complex::Complex() : real(0.0f), imag(0.0f) {}

__host__ __device__ Complex::Complex(float r) : real(r), imag(0.0f) {}

__host__ __device__ Complex::Complex(float r, float i) : real(r), imag(i) {}

__host__ __device__ Complex Complex::operator+(const Complex &b) const {
    Complex c;
    c.real = this->real+b.real;
    c.imag = this->imag+b.imag;
    return c;
}

__host__ __device__ Complex Complex::operator-(const Complex &b) const {
    Complex c;
    c.real = this->real-b.real;
    c.imag = this->imag-b.imag;
    return c;
}

__host__ __device__ Complex Complex::operator*(const Complex &b) const {
    Complex c;
    c.real = this->real*b.real-this->imag*b.imag;
    c.imag = this->real*b.imag+this->imag*b.real;
    return c;
}

Complex Complex::mag() const {
    float x = this->real;
    float y = this->imag;
    float m = sqrt(x*x+y*y);
    return m;
}

Complex Complex::angle() const {
    float a = atanl(this->imag/this->real);
    return a;
}

Complex Complex::conj() const {
    Complex c;
    c.real = this->real;
    c.imag = -this->imag;
    return c;
}

std::ostream& operator<< (std::ostream& os, const Complex& rhs) {
    Complex c(rhs);
    if(fabsf(rhs.imag) < 1e-10) c.imag = 0.0f;
    if(fabsf(rhs.real) < 1e-10) c.real = 0.0f;

    if(c.imag == 0) {
        os << c.real;
    }
    else {
        os << "(" << c.real << "," << c.imag << ")";
    }
    return os;
}

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

                                        # End of file scope inline assembly
	.globl	_ZN7ComplexC2Ev                 # -- Begin function _ZN7ComplexC2Ev
	.p2align	1, 0x90
	.type	_ZN7ComplexC2Ev,@function
_ZN7ComplexC2Ev:                        # @_ZN7ComplexC2Ev
	.cfi_startproc
# %bb.0:
	movq	$0, (%rdi)
	retq
.Lfunc_end0:
	.size	_ZN7ComplexC2Ev, .Lfunc_end0-_ZN7ComplexC2Ev
	.cfi_endproc
                                        # -- End function
	.globl	_ZN7ComplexC2Ef                 # -- Begin function _ZN7ComplexC2Ef
	.p2align	1, 0x90
	.type	_ZN7ComplexC2Ef,@function
_ZN7ComplexC2Ef:                        # @_ZN7ComplexC2Ef
	.cfi_startproc
# %bb.0:
	movss	%xmm0, (%rdi)
	movl	$0, 4(%rdi)
	retq
.Lfunc_end1:
	.size	_ZN7ComplexC2Ef, .Lfunc_end1-_ZN7ComplexC2Ef
	.cfi_endproc
                                        # -- End function
	.globl	_ZN7ComplexC2Eff                # -- Begin function _ZN7ComplexC2Eff
	.p2align	1, 0x90
	.type	_ZN7ComplexC2Eff,@function
_ZN7ComplexC2Eff:                       # @_ZN7ComplexC2Eff
	.cfi_startproc
# %bb.0:
	movss	%xmm0, (%rdi)
	movss	%xmm1, 4(%rdi)
	retq
.Lfunc_end2:
	.size	_ZN7ComplexC2Eff, .Lfunc_end2-_ZN7ComplexC2Eff
	.cfi_endproc
                                        # -- End function
	.globl	_ZNK7ComplexplERKS_             # -- Begin function _ZNK7ComplexplERKS_
	.p2align	1, 0x90
	.type	_ZNK7ComplexplERKS_,@function
_ZNK7ComplexplERKS_:                    # @_ZNK7ComplexplERKS_
	.cfi_startproc
# %bb.0:
	movss	(%rdi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	4(%rdi), %xmm1                  # xmm1 = mem[0],zero,zero,zero
	addss	(%rsi), %xmm0
	addss	4(%rsi), %xmm1
	unpcklps	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
	retq
.Lfunc_end3:
	.size	_ZNK7ComplexplERKS_, .Lfunc_end3-_ZNK7ComplexplERKS_
	.cfi_endproc
                                        # -- End function
	.globl	_ZNK7ComplexmiERKS_             # -- Begin function _ZNK7ComplexmiERKS_
	.p2align	1, 0x90
	.type	_ZNK7ComplexmiERKS_,@function
_ZNK7ComplexmiERKS_:                    # @_ZNK7ComplexmiERKS_
	.cfi_startproc
# %bb.0:
	movss	(%rdi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	4(%rdi), %xmm1                  # xmm1 = mem[0],zero,zero,zero
	subss	(%rsi), %xmm0
	subss	4(%rsi), %xmm1
	unpcklps	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
	retq
.Lfunc_end4:
	.size	_ZNK7ComplexmiERKS_, .Lfunc_end4-_ZNK7ComplexmiERKS_
	.cfi_endproc
                                        # -- End function
	.globl	_ZNK7ComplexmlERKS_             # -- Begin function _ZNK7ComplexmlERKS_
	.p2align	1, 0x90
	.type	_ZNK7ComplexmlERKS_,@function
_ZNK7ComplexmlERKS_:                    # @_ZNK7ComplexmlERKS_
	.cfi_startproc
# %bb.0:
	movss	(%rdi), %xmm1                   # xmm1 = mem[0],zero,zero,zero
	movss	4(%rdi), %xmm2                  # xmm2 = mem[0],zero,zero,zero
	movss	(%rsi), %xmm3                   # xmm3 = mem[0],zero,zero,zero
	movss	4(%rsi), %xmm4                  # xmm4 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm0
	mulss	%xmm3, %xmm0
	mulss	%xmm2, %xmm3
	mulss	%xmm4, %xmm2
	subss	%xmm2, %xmm0
	mulss	%xmm4, %xmm1
	addss	%xmm3, %xmm1
	unpcklps	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
	retq
.Lfunc_end5:
	.size	_ZNK7ComplexmlERKS_, .Lfunc_end5-_ZNK7ComplexmlERKS_
	.cfi_endproc
                                        # -- End function
	.globl	_ZNK7Complex3magEv              # -- Begin function _ZNK7Complex3magEv
	.p2align	1, 0x90
	.type	_ZNK7Complex3magEv,@function
_ZNK7Complex3magEv:                     # @_ZNK7Complex3magEv
	.cfi_startproc
# %bb.0:
	movss	(%rdi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	4(%rdi), %xmm1                  # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm0
	mulss	%xmm1, %xmm1
	addss	%xmm0, %xmm1
	sqrtss	%xmm1, %xmm1
	xorps	%xmm0, %xmm0
	movss	%xmm1, %xmm0                    # xmm0 = xmm1[0],xmm0[1,2,3]
	retq
.Lfunc_end6:
	.size	_ZNK7Complex3magEv, .Lfunc_end6-_ZNK7Complex3magEv
	.cfi_endproc
                                        # -- End function
	.globl	_ZNK7Complex5angleEv            # -- Begin function _ZNK7Complex5angleEv
	.p2align	1, 0x90
	.type	_ZNK7Complex5angleEv,@function
_ZNK7Complex5angleEv:                   # @_ZNK7Complex5angleEv
	.cfi_startproc
# %bb.0:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movss	4(%rdi), %xmm0                  # xmm0 = mem[0],zero,zero,zero
	divss	(%rdi), %xmm0
	movss	%xmm0, 20(%rsp)
	flds	20(%rsp)
	fstpt	(%rsp)
	callq	atanl
	fstps	16(%rsp)
	xorps	%xmm0, %xmm0
	movss	16(%rsp), %xmm1                 # xmm1 = mem[0],zero,zero,zero
	movss	%xmm1, %xmm0                    # xmm0 = xmm1[0],xmm0[1,2,3]
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZNK7Complex5angleEv, .Lfunc_end7-_ZNK7Complex5angleEv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _ZNK7Complex4conjEv
.LCPI8_0:
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.text
	.globl	_ZNK7Complex4conjEv
	.p2align	1, 0x90
	.type	_ZNK7Complex4conjEv,@function
_ZNK7Complex4conjEv:                    # @_ZNK7Complex4conjEv
	.cfi_startproc
# %bb.0:
	movss	(%rdi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	4(%rdi), %xmm1                  # xmm1 = mem[0],zero,zero,zero
	xorps	.LCPI8_0(%rip), %xmm1
	unpcklps	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
	retq
.Lfunc_end8:
	.size	_ZNK7Complex4conjEv, .Lfunc_end8-_ZNK7Complex4conjEv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _ZlsRSoRK7Complex
.LCPI9_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI9_1:
	.quad	0x3ddb7cdfd9d7bdbb              # double 1.0E-10
	.text
	.globl	_ZlsRSoRK7Complex
	.type	_ZlsRSoRK7Complex,@function
_ZlsRSoRK7Complex:                      # @_ZlsRSoRK7Complex
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	movss	(%rsi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	4(%rsi), %xmm4                  # xmm4 = mem[0],zero,zero,zero
	movaps	.LCPI9_0(%rip), %xmm2           # xmm2 = [NaN,NaN,NaN,NaN]
	movaps	%xmm4, %xmm1
	andps	%xmm2, %xmm1
	cvtss2sd	%xmm1, %xmm1
	movsd	.LCPI9_1(%rip), %xmm3           # xmm3 = mem[0],zero
	ucomisd	%xmm1, %xmm3
	xorps	%xmm1, %xmm1
	xorps	%xmm5, %xmm5
	ja	.LBB9_2
# %bb.1:
	movaps	%xmm4, %xmm5
.LBB9_2:
	andps	%xmm0, %xmm2
	cvtss2sd	%xmm2, %xmm2
	ucomisd	%xmm2, %xmm3
	xorps	%xmm2, %xmm2
	ja	.LBB9_4
# %bb.3:
	movaps	%xmm0, %xmm2
.LBB9_4:
	ucomiss	%xmm1, %xmm5
	jne	.LBB9_6
	jp	.LBB9_6
# %bb.5:
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm2, %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	jmp	.LBB9_7
.LBB9_6:
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rbx, %rdi
	movss	%xmm5, 4(%rsp)                  # 4-byte Spill
	movss	%xmm2, (%rsp)                   # 4-byte Spill
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rsp), %xmm0                   # 4-byte Folded Reload
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%rsp), %xmm0                  # 4-byte Folded Reload
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.2, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB9_7:
	movq	%rbx, %rax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZlsRSoRK7Complex, .Lfunc_end9-_ZlsRSoRK7Complex
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"("
	.size	.L.str, 2

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

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

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.globl	_ZN7ComplexC1Ev
	.type	_ZN7ComplexC1Ev,@function
.set _ZN7ComplexC1Ev, _ZN7ComplexC2Ev
	.globl	_ZN7ComplexC1Ef
	.type	_ZN7ComplexC1Ef,@function
.set _ZN7ComplexC1Ef, _ZN7ComplexC2Ef
	.globl	_ZN7ComplexC1Eff
	.type	_ZN7ComplexC1Eff,@function
.set _ZN7ComplexC1Eff, _ZN7ComplexC2Eff
	.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
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.hidden	_ZN7ComplexC1Ev                 ; -- Begin function _ZN7ComplexC1Ev
	.globl	_ZN7ComplexC1Ev
	.p2align	2
	.type	_ZN7ComplexC1Ev,@function
_ZN7ComplexC1Ev:                        ; @_ZN7ComplexC1Ev
; %bb.0:
	s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v3, v2
	flat_store_b64 v[0:1], v[2:3]
	s_waitcnt lgkmcnt(0)
	s_setpc_b64 s[30:31]
.Lfunc_end0:
	.size	_ZN7ComplexC1Ev, .Lfunc_end0-_ZN7ComplexC1Ev
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Function info:
; codeLenInByte = 32
; NumSgprs: 32
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 1
	.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:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
