// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::flags_to_precision_qualifiers_glsl(spirv_cross::SPIRType const&, spirv_cross::Bitset const&)
const char *CompilerGLSL::flags_to_precision_qualifiers_glsl(const SPIRType &type, const Bitset &flags)
{
	// Structs do not have precision qualifiers, neither do doubles (desktop only anyways, so no mediump/highp).
	if (type.basetype != SPIRType::Float && type.basetype != SPIRType::Int && type.basetype != SPIRType::UInt &&
	    type.basetype != SPIRType::Image && type.basetype != SPIRType::SampledImage &&
	    type.basetype != SPIRType::Sampler)
		return "";

	if (options.es)
	{
		auto &execution = get_entry_point();

		if (flags.get(DecorationRelaxedPrecision))
		{
			bool implied_fmediump = type.basetype == SPIRType::Float &&
			                        options.fragment.default_float_precision == Options::Mediump &&
			                        execution.model == ExecutionModelFragment;

			bool implied_imediump = (type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt) &&
			                        options.fragment.default_int_precision == Options::Mediump &&
			                        execution.model == ExecutionModelFragment;

			return implied_fmediump || implied_imediump ? "" : "mediump ";
		}
		else
		{
			bool implied_fhighp =
			    type.basetype == SPIRType::Float && ((options.fragment.default_float_precision == Options::Highp &&
			                                          execution.model == ExecutionModelFragment) ||
			                                         (execution.model != ExecutionModelFragment));

			bool implied_ihighp = (type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt) &&
			                      ((options.fragment.default_int_precision == Options::Highp &&
			                        execution.model == ExecutionModelFragment) ||
			                       (execution.model != ExecutionModelFragment));

			return implied_fhighp || implied_ihighp ? "" : "highp ";
		}
	}
	else if (backend.allow_precision_qualifiers)
	{
		// Vulkan GLSL supports precision qualifiers, even in desktop profiles, which is convenient.
		// The default is highp however, so only emit mediump in the rare case that a shader has these.
		if (flags.get(DecorationRelaxedPrecision))
			return "mediump ";
		else
			return "";
	}
	else
		return "";
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0xc(%rsi), %eax
leaq 0x6a161(%rip), %r12     # 0x8f887
cmpl $0xf, %eax
ja 0x25833
movl $0xe430, %ecx           # imm = 0xE430
btl %eax, %ecx
jae 0x25833
movq %rdx, %r14
movq %rdi, %rbx
cmpb $0x1, 0x43c(%rdi)
jne 0x25792
movq %rsi, %r15
movq %rbx, %rdi
callq 0x12fa4
testb $0x1, (%r14)
movl 0xc(%r15), %esi
jne 0x257ba
cmpl $0xa, %esi
jne 0x2580a
cmpl $0x3, 0x448(%rbx)
sete %cl
cmpl $0x4, 0xb8(%rax)
setne %al
orb %cl, %al
jne 0x25833
leaq 0x6fe05(%rip), %rcx     # 0x95592
jmp 0x25836
cmpb $0x1, 0x62b(%rbx)
movq %r12, %rcx
jne 0x25836
testb $0x1, (%r14)
leaq 0x6a0da(%rip), %rax     # 0x8f887
leaq 0x6fdd5(%rip), %rcx     # 0x95589
cmoveq %rax, %rcx
jmp 0x25836
xorl %edx, %edx
cmpl $0xa, %esi
jne 0x257d4
cmpl $0x2, 0x448(%rbx)
jne 0x257d4
cmpl $0x4, 0xb8(%rax)
sete %dl
andl $-0x2, %esi
xorl %ecx, %ecx
cmpl $0x4, %esi
jne 0x257f1
cmpl $0x2, 0x44c(%rbx)
jne 0x257f1
cmpl $0x4, 0xb8(%rax)
sete %cl
orb %cl, %dl
leaq 0x6a08d(%rip), %rax     # 0x8f887
leaq 0x6fd88(%rip), %rcx     # 0x95589
testb $0x1, %dl
cmovneq %rax, %rcx
jmp 0x25836
andl $-0x2, %esi
leaq 0x6fd7e(%rip), %rcx     # 0x95592
cmpl $0x4, %esi
jne 0x25836
cmpl $0x3, 0x44c(%rbx)
sete %dl
cmpl $0x4, 0xb8(%rax)
setne %al
orb %dl, %al
cmpb $0x1, %al
jne 0x25836
movq %r12, %rcx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop