// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::convert_half_to_string[abi:cxx11](spirv_cross::SPIRConstant const&, unsigned int, unsigned int)
string CompilerGLSL::convert_half_to_string(const SPIRConstant &c, uint32_t col, uint32_t row)
{
	string res;
	float float_value = c.scalar_f16(col, row);

	if (std::isnan(float_value) || std::isinf(float_value))
	{
		if (backend.half_literal_suffix)
		{
			// There is no uintBitsToFloat for 16-bit, so have to rely on legacy fallback here.
			if (float_value == numeric_limits<float>::infinity())
				res = join("(1.0", backend.half_literal_suffix, " / 0.0", backend.half_literal_suffix, ")");
			else if (float_value == -numeric_limits<float>::infinity())
				res = join("(-1.0", backend.half_literal_suffix, " / 0.0", backend.half_literal_suffix, ")");
			else if (std::isnan(float_value))
				res = join("(0.0", backend.half_literal_suffix, " / 0.0", backend.half_literal_suffix, ")");
			else
				SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant.");
		}
		else
		{
			SPIRType type;
			type.basetype = SPIRType::Half;
			type.vecsize = 1;
			type.columns = 1;

			if (float_value == numeric_limits<float>::infinity())
				res = join(type_to_glsl(type), "(1.0 / 0.0)");
			else if (float_value == -numeric_limits<float>::infinity())
				res = join(type_to_glsl(type), "(-1.0 / 0.0)");
			else if (std::isnan(float_value))
				res = join(type_to_glsl(type), "(0.0 / 0.0)");
			else
				SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant.");
		}
	}
	else
	{
		if (backend.half_literal_suffix)
			res = convert_to_string(float_value) + backend.half_literal_suffix;
		else
		{
			// In HLSL (FXC), it's important to cast the literals to half precision right away.
			// There is no literal for it.
			SPIRType type;
			type.basetype = SPIRType::Half;
			type.vecsize = 1;
			type.columns = 1;
			res = join(type_to_glsl(type), "(", convert_to_string(float_value), ")");
		}
	}

	return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
movl %ecx, %eax
imulq $0x38, %rax, %rax
addq %rdx, %rax
movl %r8d, %ecx
movzwl 0x10(%rax,%rcx,8), %edi
callq 0x47e70
movd %xmm0, %eax
ucomiss %xmm0, %xmm0
setnp %dl
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x7f800000, %eax       # imm = 0x7F800000
setne %sil
leaq 0x618(%r14), %r15
movq 0x618(%r14), %rcx
movabsq $0x100000001, %rax      # imm = 0x100000001
testb %sil, %dl
jne 0x2d4b2
testq %rcx, %rcx
je 0x2d4f9
ucomiss 0x64022(%rip), %xmm0    # 0x914a4
jb 0x2d6d7
leaq 0x65cdc(%rip), %rsi     # 0x9316b
leaq 0x65cda(%rip), %rcx     # 0x93170
leaq 0x68558(%rip), %r9      # 0x959f5
leaq 0x70(%rsp), %rdi
movq %r15, %rdx
movq %r15, %r8
callq 0x43045
jmp 0x2d776
testq %rcx, %rcx
je 0x2d5cf
leaq 0x28(%rsp), %rdi
callq 0x43231
movq (%r15), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xab3f
leaq 0x70(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6320
movq %r14, %rdi
callq 0x6548
leaq 0x28(%rsp), %rdi
jmp 0x2d789
leaq 0x140(%rsp), %rcx
andl $0x0, -0xc8(%rcx)
leaq 0xb9ee1(%rip), %rdx     # 0xe73f0
addq $0x10, %rdx
movq %rdx, -0xd0(%rcx)
andl $0x0, -0xc0(%rcx)
andq $0x0, -0x88(%rcx)
andl $0x0, -0x80(%rcx)
andq $0x0, -0x78(%rcx)
movb $0x0, -0x70(%rcx)
xorps %xmm1, %xmm1
movups %xmm1, -0xb0(%rcx)
movups %xmm1, -0xa0(%rcx)
andl $0x0, -0x90(%rcx)
movl $0x8, -0x6c(%rcx)
andq $0x0, -0x58(%rcx)
movups %xmm1, -0x68(%rcx)
andq $0x0, -0x38(%rcx)
movq %rcx, -0x30(%rcx)
movq $0x1, -0x28(%rcx)
movups %xmm1, -0x20(%rcx)
movl $0x3f800000, -0x10(%rcx) # imm = 0x3F800000
movups %xmm1, -0x8(%rcx)
movl $0x9, -0xc4(%rcx)
movq %rax, -0xbc(%rcx)
ucomiss 0x63f0e(%rip), %xmm0    # 0x914a4
jb 0x2d70b
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x65bfc(%rip), %rdx     # 0x931b7
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4315d
jmp 0x2d7c7
movss %xmm0, 0x4c(%rsp)
leaq 0x140(%rsp), %rcx
andl $0x0, -0xc8(%rcx)
leaq 0xb9e05(%rip), %rdx     # 0xe73f0
addq $0x10, %rdx
movq %rdx, -0xd0(%rcx)
andl $0x0, -0xc0(%rcx)
andq $0x0, -0x88(%rcx)
andl $0x0, -0x80(%rcx)
andq $0x0, -0x78(%rcx)
movb $0x0, -0x70(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, -0xb0(%rcx)
movups %xmm0, -0xa0(%rcx)
andl $0x0, -0x90(%rcx)
movl $0x8, -0x6c(%rcx)
andq $0x0, -0x58(%rcx)
movups %xmm0, -0x68(%rcx)
andq $0x0, -0x38(%rcx)
movq %rcx, -0x30(%rcx)
movq $0x1, -0x28(%rcx)
movups %xmm0, -0x20(%rcx)
movl $0x3f800000, -0x10(%rcx) # imm = 0x3F800000
movups %xmm0, -0x8(%rcx)
movl $0x9, -0xc4(%rcx)
movq %rax, -0xbc(%rcx)
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x50(%rsp), %rdi
movss 0x4c(%rsp), %xmm0
callq 0x43231
leaq 0x7058f(%rip), %rdx     # 0x9dc29
leaq 0x68354(%rip), %r8      # 0x959f5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x50(%rsp), %rcx
callq 0x432aa
leaq 0x28(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6320
movq %r14, %rdi
callq 0x6548
leaq 0x50(%rsp), %rdi
jmp 0x2d7da
movss 0x63dc9(%rip), %xmm1    # 0x914a8
ucomiss %xmm0, %xmm1
jb 0x2d748
leaq 0x65a8c(%rip), %rsi     # 0x93177
leaq 0x65a7e(%rip), %rcx     # 0x93170
leaq 0x682fc(%rip), %r9      # 0x959f5
leaq 0x70(%rsp), %rdi
movq %r15, %rdx
movq %r15, %r8
callq 0x430d1
jmp 0x2d776
movss 0x63d95(%rip), %xmm1    # 0x914a8
ucomiss %xmm0, %xmm1
jb 0x2d790
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x65a8c(%rip), %rdx     # 0x931c3
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x431c7
jmp 0x2d7c7
ucomiss %xmm0, %xmm0
jnp 0x2d804
leaq 0x65a25(%rip), %rsi     # 0x9317d
leaq 0x65a11(%rip), %rcx     # 0x93170
leaq 0x6828f(%rip), %r9      # 0x959f5
leaq 0x70(%rsp), %rdi
movq %r15, %rdx
movq %r15, %r8
callq 0x43045
leaq 0x70(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6320
movq %r14, %rdi
callq 0x6548
jmp 0x2d7f3
ucomiss %xmm0, %xmm0
jnp 0x2d84f
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x65a18(%rip), %rdx     # 0x931d0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4315d
leaq 0x28(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6320
movq %r14, %rdi
callq 0x6548
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x70(%rsp), %rdi
callq 0x17a3e
movq %rbx, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %r15
leaq 0x6596c(%rip), %rsi     # 0x93182
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x70(%rsp), %rsi
movq %r15, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0xb9582(%rip), %rsi     # 0xe6dc0
movq 0xba79b(%rip), %rdx     # 0xe7fe0
movq %r15, %rdi
callq 0x6490
jmp 0x2d898
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %r15
leaq 0x65921(%rip), %rsi     # 0x93182
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0xb9537(%rip), %rsi     # 0xe6dc0
movq 0xba750(%rip), %rdx     # 0xe7fe0
movq %r15, %rdi
callq 0x6490
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x2d8af
jmp 0x2d90b
movq %rax, %r14
movq %r15, %rdi
callq 0x6200
jmp 0x2d90b
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x2d8d0
jmp 0x2d92b
movq %rax, %r14
movq %r15, %rdi
callq 0x6200
jmp 0x2d92b
jmp 0x2d8f9
jmp 0x2d908
jmp 0x2d928
jmp 0x2d8f9
jmp 0x2d908
jmp 0x2d928
jmp 0x2d8f9
jmp 0x2d908
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x6548
jmp 0x2d8fc
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x2d90b
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x17a3e
jmp 0x2d92b
jmp 0x2d928
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x6548
jmp 0x2d92b
movq %rax, %r14
movq %rbx, %rdi
callq 0x6548
movq %r14, %rdi
callq 0x64b0
nop