// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::bitcast_glsl_op[abi:cxx11](spirv_cross::SPIRType const&, spirv_cross::SPIRType const&)
string CompilerHLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type)
{
	if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Int)
		return type_to_glsl(out_type);
	else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::Int64)
		return type_to_glsl(out_type);
	else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Float)
		return "asuint";
	else if (out_type.basetype == SPIRType::Int && in_type.basetype == SPIRType::UInt)
		return type_to_glsl(out_type);
	else if (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::UInt64)
		return type_to_glsl(out_type);
	else if (out_type.basetype == SPIRType::Int && in_type.basetype == SPIRType::Float)
		return "asint";
	else if (out_type.basetype == SPIRType::Float && in_type.basetype == SPIRType::UInt)
		return "asfloat";
	else if (out_type.basetype == SPIRType::Float && in_type.basetype == SPIRType::Int)
		return "asfloat";
	else if (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::Double)
		SPIRV_CROSS_THROW("Double to Int64 is not supported in HLSL.");
	else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::Double)
		SPIRV_CROSS_THROW("Double to UInt64 is not supported in HLSL.");
	else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::Int64)
		return "asdouble";
	else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::UInt64)
		return "asdouble";
	else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UInt && in_type.vecsize == 1)
	{
		if (!requires_explicit_fp16_packing)
		{
			requires_explicit_fp16_packing = true;
			force_recompile = true;
		}
		return "SPIRV_Cross_unpackFloat2x16";
	}
	else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Half && in_type.vecsize == 2)
	{
		if (!requires_explicit_fp16_packing)
		{
			requires_explicit_fp16_packing = true;
			force_recompile = true;
		}
		return "SPIRV_Cross_packFloat2x16";
	}
	else
		return "";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0xc(%rdx), %r8d
movl %r8d, %eax
xorl $0x5, %eax
movl 0xc(%rcx), %edi
movl %edi, %ebp
xorl $0x4, %ebp
movl %eax, %r9d
orl %ebp, %r9d
je 0x6d3a9
movl %r8d, %r11d
xorl $0x7, %r11d
movl %edi, %r9d
xorl $0x6, %r9d
movl %r11d, %r10d
orl %r9d, %r10d
jne 0x6d3c9
movq (%rsi), %rax
movq %rbx, %rdi
xorl %ecx, %ecx
callq *0x98(%rax)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edi, %r12d
xorl $0xa, %r12d
movl %eax, %r10d
orl %r12d, %r10d
jne 0x6d3f7
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x51c20(%rip), %rsi     # 0xbf006
leaq 0x51c1f(%rip), %rdx     # 0xbf00c
movq %rbx, %rdi
callq 0x7c64
jmp 0x6d3b7
movl %r8d, %r13d
xorl $0x4, %r13d
movl %edi, %r10d
xorl $0x5, %r10d
movl %r13d, %r14d
orl %r10d, %r14d
je 0x6d3a9
movl %r8d, %r15d
xorl $0x6, %r15d
movl %edi, %r14d
xorl $0x7, %r14d
movl %r15d, 0x4(%rsp)
movl %r14d, (%rsp)
orl %r14d, %r15d
je 0x6d3a9
orl %r12d, %r13d
jne 0x6d445
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x51bd1(%rip), %rsi     # 0xbf00d
leaq 0x51bcf(%rip), %rdx     # 0xbf012
jmp 0x6d3ed
movl %r8d, %edx
xorl $0xa, %edx
movl %edx, %r15d
orl %r10d, %r15d
je 0x6d457
orl %ebp, %edx
jne 0x6d471
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x51bae(%rip), %rsi     # 0xbf013
leaq 0x51bae(%rip), %rdx     # 0xbf01a
jmp 0x6d3ed
movl %edi, %edx
xorl $0xb, %edx
orl %edx, 0x4(%rsp)
je 0x6d54e
orl %edx, %r11d
je 0x6d5b4
movl %r8d, %edx
xorl $0xb, %edx
orl %edx, %r9d
je 0x6d499
orl (%rsp), %edx
jne 0x6d4b3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x51bc9(%rip), %rsi     # 0xbf070
leaq 0x51bca(%rip), %rdx     # 0xbf078
jmp 0x6d3ed
xorl $0x9, %r8d
orl %r10d, %r8d
movl 0x14(%rcx), %ecx
movl %ecx, %edx
xorl $0x1, %edx
orl %r8d, %edx
jne 0x6d4f8
cmpb $0x0, 0x793(%rsi)
jne 0x6d4de
movb $0x1, %al
movb %al, 0x793(%rsi)
movb %al, 0x1d0(%rsi)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x51b8d(%rip), %rsi     # 0xbf079
leaq 0x51ba1(%rip), %rdx     # 0xbf094
jmp 0x6d3ed
xorl $0x9, %edi
orl %edi, %eax
xorl $0x2, %ecx
orl %eax, %ecx
jne 0x6d535
cmpb $0x0, 0x793(%rsi)
jne 0x6d51b
movb $0x1, %al
movb %al, 0x793(%rsi)
movb %al, 0x1d0(%rsi)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x51b6c(%rip), %rsi     # 0xbf095
leaq 0x51b7e(%rip), %rdx     # 0xbf0ae
jmp 0x6d3ed
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x4836c(%rip), %rdx     # 0xb58af
movq %rbx, %rdi
movq %rdx, %rsi
jmp 0x6d3f0
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x51ab0(%rip), %rsi     # 0xbf01b
leaq 0x51ad2(%rip), %rdx     # 0xbf044
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x8f805(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x8f7dd(%rip), %rsi     # 0xfcd80
movq 0x90a2e(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x6d618
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x51a74(%rip), %rsi     # 0xbf045
leaq 0x51a97(%rip), %rdx     # 0xbf06f
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x8f79f(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x8f777(%rip), %rsi     # 0xfcd80
movq 0x909c8(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x6d61c
jmp 0x6d638
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x6d63e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x6d63e
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x6d64b
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0
nop