// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::to_ternary_expression[abi:cxx11](spirv_cross::SPIRType const&, unsigned int, unsigned int, unsigned int)
string CompilerGLSL::to_ternary_expression(const SPIRType &restype, uint32_t select, uint32_t true_value,
                                           uint32_t false_value)
{
	string expr;
	auto &lerptype = expression_type(select);

	if (lerptype.vecsize == 1)
		expr = join(to_enclosed_expression(select), " ? ", to_enclosed_expression(true_value), " : ",
		            to_enclosed_expression(false_value));
	else
	{
		auto swiz = [this](uint32_t expression, uint32_t i) { return to_extract_component_expression(expression, i); };

		expr = type_to_glsl_constructor(restype);
		expr += "(";
		for (uint32_t i = 0; i < restype.vecsize; i++)
		{
			expr += swiz(select, i);
			expr += " ? ";
			expr += swiz(true_value, i);
			expr += " : ";
			expr += swiz(false_value, i);
			if (i + 1 < restype.vecsize)
				expr += ", ";
		}
		expr += ")";
	}

	return expr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r9d, (%rsp)
movl %r8d, 0x4(%rsp)
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq %rsi, %rdi
movl %ecx, %esi
callq 0x104b0
cmpl $0x1, 0x14(%rax)
jne 0x2c62d
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x2beca
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movl 0x4(%rsp), %edx
callq 0x2beca
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movl (%rsp), %edx
callq 0x2beca
leaq 0x70c66(%rip), %rdx     # 0x9d238
leaq 0x62d69(%rip), %r8      # 0x8f342
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rcx
leaq 0x28(%rsp), %r9
callq 0x4402f
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6320
movq %r14, %rdi
callq 0x6548
leaq 0x28(%rsp), %rdi
callq 0x6548
leaq 0x48(%rsp), %rdi
callq 0x6548
leaq 0x68(%rsp), %rdi
callq 0x6548
jmp 0x2c72c
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2c226
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6320
movq %r15, %rdi
callq 0x6548
leaq 0x715cd(%rip), %rsi     # 0x9dc29
movq %rbx, %rdi
callq 0x64d0
xorl %ebp, %ebp
leaq 0x8(%rsp), %r15
cmpl 0x14(%r13), %ebp
jae 0x2c71d
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %ebp, %ecx
callq 0x2c04a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64f0
movq %r15, %rdi
callq 0x6548
movq %rbx, %rdi
leaq 0x70b96(%rip), %rsi     # 0x9d238
callq 0x64d0
movq %r15, %rdi
movq %r14, %rsi
movl 0x4(%rsp), %edx
movl %ebp, %ecx
callq 0x2c04a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64f0
movq %r15, %rdi
callq 0x6548
movq %rbx, %rdi
leaq 0x62c6d(%rip), %rsi     # 0x8f342
callq 0x64d0
movq %r15, %rdi
movq %r14, %rsi
movl (%rsp), %edx
movl %ebp, %ecx
callq 0x2c04a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64f0
movq %r15, %rdi
callq 0x6548
incl %ebp
cmpl 0x14(%r13), %ebp
jae 0x2c66b
movq %rbx, %rdi
leaq 0x68978(%rip), %rsi     # 0x9508b
callq 0x64d0
jmp 0x2c66b
leaq 0x692d1(%rip), %rsi     # 0x959f5
movq %rbx, %rdi
callq 0x64d0
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x6548
jmp 0x2c753
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x6548
jmp 0x2c762
movq %rax, %r14
leaq 0x68(%rsp), %rdi
jmp 0x2c783
jmp 0x2c78a
jmp 0x2c78a
jmp 0x2c78a
jmp 0x2c78a
jmp 0x2c77b
jmp 0x2c78a
jmp 0x2c77b
jmp 0x2c78a
jmp 0x2c78a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x2c78d
movq %rax, %r14
movq %rbx, %rdi
callq 0x6548
movq %r14, %rdi
callq 0x64b0
nop