// File: /workspace/github_cpp_makefile_star2_O3/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 0x88fbd(%rip), %r12     # 0xb48af
cmpl $0xf, %eax
ja 0x2b9f6
movl $0xe430, %ecx           # imm = 0xE430
btl %eax, %ecx
jae 0x2b9f6
movq %rdx, %r14
movq %rdi, %rbx
cmpb $0x1, 0x43c(%rdi)
jne 0x2b961
movq %rsi, %r15
movq %rbx, %rdi
callq 0x15f76
movq %rax, %rcx
testb $0x1, (%r14)
movl 0xc(%r15), %edx
jne 0x2b989
cmpl $0xa, %edx
jne 0x2b9cc
cmpl $0x3, 0x448(%rbx)
sete %al
cmpl $0x4, 0xb8(%rcx)
setne %cl
orb %al, %cl
jne 0x2b9f6
leaq 0x8ec56(%rip), %rax     # 0xba5b2
jmp 0x2b9f9
cmpb $0x1, 0x62b(%rbx)
movq %r12, %rax
jne 0x2b9f9
testb $0x1, (%r14)
leaq 0x88f33(%rip), %rcx     # 0xb48af
leaq 0x8ec26(%rip), %rax     # 0xba5a9
cmoveq %rcx, %rax
jmp 0x2b9f9
cmpl $0xa, %edx
jne 0x2b9a9
cmpl $0x2, 0x448(%rbx)
jne 0x2b9a9
cmpl $0x4, 0xb8(%rcx)
je 0x2b9f6
leaq 0x8ec02(%rip), %rax     # 0xba5a9
jmp 0x2b9f9
andl $-0x2, %edx
leaq 0x8ebf6(%rip), %rax     # 0xba5a9
cmpl $0x4, %edx
jne 0x2b9f9
cmpl $0x2, 0x44c(%rbx)
jne 0x2b9f9
cmpl $0x4, 0xb8(%rcx)
je 0x2b9f6
jmp 0x2b9f9
andl $-0x2, %edx
leaq 0x8ebdc(%rip), %rax     # 0xba5b2
cmpl $0x4, %edx
jne 0x2b9f9
cmpl $0x3, 0x44c(%rbx)
sete %dl
cmpl $0x4, 0xb8(%rcx)
setne %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x2b9f9
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop