// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %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 0x57fd5
movl %r8d, %r11d
xorl $0x7, %r11d
movl %edi, %r9d
xorl $0x6, %r9d
movl %r11d, %r10d
orl %r9d, %r10d
jne 0x57ff5
movq (%rsi), %rax
movq %rbx, %rdi
xorl %ecx, %ecx
callq *0x98(%rax)
movq %rbx, %rax
addq $0x38, %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 0x5801a
leaq 0x40f93(%rip), %rsi     # 0x98f9e
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x6100
jmp 0x57fe3
movl %r8d, %r13d
xorl $0x4, %r13d
movl %edi, %r10d
xorl $0x5, %r10d
movl %r13d, %r14d
orl %r10d, %r14d
je 0x57fd5
movl %r8d, %r15d
xorl $0x6, %r15d
movl %edi, %r14d
xorl $0x7, %r14d
movl %r15d, 0x14(%rsp)
movl %r14d, 0x10(%rsp)
orl %r14d, %r15d
je 0x57fd5
orl %r12d, %r13d
jne 0x5805b
leaq 0x40f4c(%rip), %rsi     # 0x98fa5
jmp 0x5800b
movl %r8d, %edx
xorl $0xa, %edx
movl %edx, %r15d
orl %r10d, %r15d
je 0x5806d
orl %ebp, %edx
jne 0x58076
leaq 0x40f37(%rip), %rsi     # 0x98fab
jmp 0x5800b
movl %edi, %edx
xorl $0xb, %edx
orl %edx, 0x14(%rsp)
je 0x5811d
orl %edx, %r11d
je 0x58168
movl %r8d, %edx
xorl $0xb, %edx
orl %edx, %r9d
je 0x5809f
orl 0x10(%rsp), %edx
jne 0x580ab
leaq 0x40f62(%rip), %rsi     # 0x99008
jmp 0x5800b
xorl $0x9, %r8d
orl %r10d, %r8d
movl 0x14(%rcx), %ecx
movl %ecx, %edx
xorl $0x1, %edx
orl %r8d, %edx
jne 0x580e2
cmpb $0x0, 0x793(%rsi)
jne 0x580d6
movb $0x1, %al
movb %al, 0x793(%rsi)
movb %al, 0x1d0(%rsi)
leaq 0x40f34(%rip), %rsi     # 0x99011
jmp 0x5800b
xorl $0x9, %edi
orl %edi, %eax
xorl $0x2, %ecx
orl %eax, %ecx
jne 0x58111
cmpb $0x0, 0x793(%rsi)
jne 0x58105
movb $0x1, %al
movb %al, 0x793(%rsi)
movb %al, 0x1d0(%rsi)
leaq 0x40f21(%rip), %rsi     # 0x9902d
jmp 0x5800b
leaq 0x3776f(%rip), %rsi     # 0x8f887
jmp 0x5800b
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x40e84(%rip), %rsi     # 0x98fb3
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x8ec69(%rip), %rsi     # 0xe6dc0
movq 0x8fe82(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
jmp 0x581b1
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x40e63(%rip), %rsi     # 0x98fdd
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x8ec1e(%rip), %rsi     # 0xe6dc0
movq 0x8fe37(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
jmp 0x581b5
jmp 0x581c9
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x581cc
jmp 0x581d4
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64b0