// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movl %r9d, 0x2c(%rsp)
movl %r8d, 0x30(%rsp)
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq %rsi, %rdi
movl %ecx, 0x34(%rsp)
movl %ecx, %esi
callq 0x12a72
cmpl $0x1, 0x14(%rax)
jne 0x34f61
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
movl 0x34(%rsp), %edx
callq 0x34600
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movl 0x30(%rsp), %edx
callq 0x34600
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movl 0x2c(%rsp), %edx
callq 0x34600
leaq 0x8d3c9(%rip), %rdx     # 0xc2280
leaq 0x7f4ac(%rip), %r8      # 0xb436a
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x58(%rsp), %rcx
leaq 0x38(%rsp), %r9
callq 0x548b4
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x34f01
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34f1c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34f37
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x350c0
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x350c0
movq %r15, (%rsp)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x34a5c
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6310
movq (%r15), %rdi
leaq 0x18(%rsp), %r12
cmpq %r12, %rdi
je 0x34f9f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x8dccb(%rip), %rsi     # 0xc2c71
movq %rbx, %rdi
callq 0x64e0
cmpl $0x0, 0x14(%r13)
je 0x350b1
xorl %ebp, %ebp
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl 0x34(%rsp), %edx
movl %ebp, %ecx
callq 0x347f2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x34ffa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
leaq 0x8d27c(%rip), %rsi     # 0xc2280
callq 0x64e0
movq %r15, %rdi
movq %r14, %rsi
movl 0x30(%rsp), %edx
movl %ebp, %ecx
callq 0x347f2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x35043
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
leaq 0x7f31d(%rip), %rsi     # 0xb436a
callq 0x64e0
movq %r15, %rdi
movq %r14, %rsi
movl 0x2c(%rsp), %edx
movl %ebp, %ecx
callq 0x347f2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3508c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
incl %ebp
movl 0x14(%r13), %eax
cmpl %eax, %ebp
jae 0x350a9
movq %rbx, %rdi
leaq 0x8500b(%rip), %rsi     # 0xba0ab
callq 0x64e0
movl 0x14(%r13), %eax
cmpl %eax, %ebp
jb 0x34fc0
leaq 0x8595d(%rip), %rsi     # 0xbaa15
movq %rbx, %rdi
callq 0x64e0
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, (%rsp)
movq %rax, %r14
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35100
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x35100
movq %r15, (%rsp)
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35124
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x35124
movq %r15, (%rsp)
movq %rax, %r14
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35174
movq 0x88(%rsp), %rsi
jmp 0x35167
jmp 0x35171
jmp 0x35145
jmp 0x35171
movq %r15, (%rsp)
jmp 0x35171
jmp 0x35171
jmp 0x35155
jmp 0x35171
jmp 0x35155
jmp 0x35171
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x35174
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x35174
movq %rax, %r14
movq (%rbx), %rdi
movq (%rsp), %rax
cmpq %rax, %rdi
je 0x3518b
movq (%rax), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0x64a0
nop