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

	if (std::isnan(float_value) || std::isinf(float_value))
	{
		// Use special representation.
		if (!is_legacy())
		{
			SPIRType out_type;
			SPIRType in_type;
			out_type.basetype = SPIRType::Float;
			in_type.basetype = SPIRType::UInt;
			out_type.vecsize = 1;
			in_type.vecsize = 1;
			out_type.width = 32;
			in_type.width = 32;

			char print_buffer[32];
			sprintf(print_buffer, "0x%xu", c.scalar(col, row));
			res = join(bitcast_glsl_op(out_type, in_type), "(", print_buffer, ")");
		}
		else
		{
			if (float_value == numeric_limits<float>::infinity())
			{
				if (backend.float_literal_suffix)
					res = "(1.0f / 0.0f)";
				else
					res = "(1.0 / 0.0)";
			}
			else if (float_value == -numeric_limits<float>::infinity())
			{
				if (backend.float_literal_suffix)
					res = "(-1.0f / 0.0f)";
				else
					res = "(-1.0 / 0.0)";
			}
			else if (std::isnan(float_value))
			{
				if (backend.float_literal_suffix)
					res = "(0.0f / 0.0f)";
				else
					res = "(0.0 / 0.0)";
			}
			else
				SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant.");
		}
	}
	else
	{
		res = convert_to_string(float_value);
		if (backend.float_literal_suffix)
			res += "f";
	}

	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x2b8(%rbp)
movq %rdi, %rax
movq %rax, -0x2b0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movb $0x0, -0x21(%rbp)
callq 0x7530
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0xa1ea0
movss %xmm0, -0x29c(%rbp)
jmp 0x753dc
movss -0x29c(%rbp), %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x28(%rbp), %xmm0
callq 0xa19b0
movb %al, -0x2b9(%rbp)
jmp 0x753fb
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0x75428
jmp 0x75407
movss -0x28(%rbp), %xmm0
callq 0xa19d0
movb %al, -0x2ba(%rbp)
jmp 0x75419
movb -0x2ba(%rbp), %al
testb $0x1, %al
jne 0x75428
jmp 0x757e4
movq -0x2a8(%rbp), %rdi
callq 0x9f610
movb %al, -0x2bb(%rbp)
jmp 0x7543c
movb -0x2bb(%rbp), %al
testb $0x1, %al
jne 0x755d0
jmp 0x7544c
leaq -0x110(%rbp), %rdi
callq 0x31440
leaq -0x1e8(%rbp), %rdi
callq 0x31440
movl $0xa, -0x104(%rbp)
movl $0x5, -0x1dc(%rbp)
movl $0x1, -0xfc(%rbp)
movl $0x1, -0x1d4(%rbp)
movl $0x20, -0x100(%rbp)
movl $0x20, -0x1d8(%rbp)
leaq -0x210(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x2f560
movl %eax, -0x2c0(%rbp)
jmp 0x754c5
movl -0x2c0(%rbp), %edx
movq -0x2c8(%rbp), %rdi
leaq 0xcd207(%rip), %rsi     # 0x1426e0
xorl %eax, %eax
callq 0x7080
movq -0x2a8(%rbp), %rsi
movq (%rsi), %rax
movq 0x168(%rax), %rax
leaq -0x250(%rbp), %rdi
leaq -0x110(%rbp), %rdx
leaq -0x1e8(%rbp), %rcx
callq *%rax
jmp 0x7550a
leaq 0xd7e1c(%rip), %rdx     # 0x14d32d
leaq 0xcf9e1(%rip), %r8      # 0x144ef9
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x210(%rbp), %rcx
callq 0xa1ed0
jmp 0x75534
movq -0x2b8(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x7430
leaq -0x230(%rbp), %rdi
callq 0x7708
leaq -0x250(%rbp), %rdi
callq 0x7708
leaq -0x1e8(%rbp), %rdi
callq 0x314e0
leaq -0x110(%rbp), %rdi
callq 0x314e0
jmp 0x757e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x75865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x755b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x7708
leaq -0x1e8(%rbp), %rdi
callq 0x314e0
leaq -0x110(%rbp), %rdi
callq 0x314e0
jmp 0x75865
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x2cc(%rbp)
callq 0xa1a00
movaps %xmm0, %xmm1
movss -0x2cc(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jne 0x75637
jp 0x75637
movq -0x2a8(%rbp), %rax
testb $0x1, 0x600(%rax)
je 0x7561b
movq -0x2b8(%rbp), %rdi
leaq 0xcd0d4(%rip), %rsi     # 0x1426e6
callq 0x7510
jmp 0x75619
jmp 0x75632
movq -0x2b8(%rbp), %rdi
leaq 0xcd092(%rip), %rsi     # 0x1426bb
callq 0x7510
jmp 0x75630
jmp 0x75632
jmp 0x757e0
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x2d0(%rbp)
callq 0xa1a00
movaps %xmm0, %xmm1
movss -0x2d0(%rbp), %xmm0
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
ucomiss %xmm1, %xmm0
jne 0x756ab
jp 0x756ab
movq -0x2a8(%rbp), %rax
testb $0x1, 0x600(%rax)
je 0x7568f
movq -0x2b8(%rbp), %rdi
leaq 0xcd06e(%rip), %rsi     # 0x1426f4
callq 0x7510
jmp 0x7568d
jmp 0x756a6
movq -0x2b8(%rbp), %rdi
leaq 0xcd02a(%rip), %rsi     # 0x1426c7
callq 0x7510
jmp 0x756a4
jmp 0x756a6
jmp 0x757de
movss -0x28(%rbp), %xmm0
callq 0xa19b0
movb %al, -0x2d1(%rbp)
jmp 0x756bd
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x756c9
jmp 0x7570c
movq -0x2a8(%rbp), %rax
testb $0x1, 0x600(%rax)
je 0x756f0
movq -0x2b8(%rbp), %rdi
leaq 0xcd01c(%rip), %rsi     # 0x142703
callq 0x7510
jmp 0x756ee
jmp 0x75707
movq -0x2b8(%rbp), %rdi
leaq 0xccfd6(%rip), %rsi     # 0x1426d4
callq 0x7510
jmp 0x75705
jmp 0x75707
jmp 0x757dc
movb $0x1, -0x272(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x2e8(%rbp)
leaq -0x271(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x7650
movq -0x2e0(%rbp), %rdx
leaq 0xccf41(%rip), %rsi     # 0x142686
leaq -0x270(%rbp), %rdi
callq 0x7520
jmp 0x75753
movq -0x2e8(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x9c50
jmp 0x75768
movq -0x2e8(%rbp), %rdi
movb $0x0, -0x272(%rbp)
leaq 0x13865b(%rip), %rsi    # 0x1addd8
leaq -0x6baf4(%rip), %rdx    # 0x9c90
callq 0x7610
jmp 0x7587a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x757b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x7708
leaq -0x271(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x272(%rbp)
jne 0x757cb
jmp 0x757d7
movq -0x2e8(%rbp), %rdi
callq 0x72c0
jmp 0x75865
jmp 0x757de
jmp 0x757e0
jmp 0x757e2
jmp 0x7583f
movss -0x28(%rbp), %xmm0
leaq -0x298(%rbp), %rdi
callq 0xa1d10
jmp 0x757f7
movq -0x2b8(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x7430
leaq -0x298(%rbp), %rdi
callq 0x7708
movq -0x2a8(%rbp), %rax
testb $0x1, 0x600(%rax)
je 0x7583d
movq -0x2b8(%rbp), %rdi
leaq 0xcb904(%rip), %rsi     # 0x141138
callq 0x7340
jmp 0x7583b
jmp 0x7583d
jmp 0x7583f
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x75855
movq -0x2b8(%rbp), %rdi
callq 0x7708
movq -0x2b0(%rbp), %rax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x2b8(%rbp), %rdi
callq 0x7708
movq -0x30(%rbp), %rdi
callq 0x7640
nopw (%rax,%rax)