// File: /workspace/github_cpp_makefile_star2_O1/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 0x12aba
cmpl $0x1, 0x14(%rax)
jne 0x35651
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
movl 0x34(%rsp), %edx
callq 0x34d0e
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movl 0x30(%rsp), %edx
callq 0x34d0e
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movl 0x2c(%rsp), %edx
callq 0x34d0e
leaq 0x8dd09(%rip), %rdx     # 0xc32b0
leaq 0x7fdbc(%rip), %r8      # 0xb536a
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x58(%rsp), %rcx
leaq 0x38(%rsp), %r9
callq 0x550ae
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x355f1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3560c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35627
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x357ac
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x357ac
movq %r15, (%rsp)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x35152
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6310
movq (%r15), %rdi
leaq 0x18(%rsp), %r12
cmpq %r12, %rdi
je 0x3568f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x8e60b(%rip), %rsi     # 0xc3ca1
movq %rbx, %rdi
callq 0x64e0
cmpl $0x0, 0x14(%r13)
je 0x3579d
xorl %ebp, %ebp
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl 0x34(%rsp), %edx
movl %ebp, %ecx
callq 0x34f00
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x356ea
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
leaq 0x8dbbc(%rip), %rsi     # 0xc32b0
callq 0x64e0
movq %r15, %rdi
movq %r14, %rsi
movl 0x30(%rsp), %edx
movl %ebp, %ecx
callq 0x34f00
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x35733
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
leaq 0x7fc2d(%rip), %rsi     # 0xb536a
callq 0x64e0
movq %r15, %rdi
movq %r14, %rsi
movl 0x2c(%rsp), %edx
movl %ebp, %ecx
callq 0x34f00
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3577c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
incl %ebp
cmpl 0x14(%r13), %ebp
jae 0x35793
movq %rbx, %rdi
leaq 0x8592d(%rip), %rsi     # 0xbb0bb
callq 0x64e0
cmpl 0x14(%r13), %ebp
jb 0x356b0
leaq 0x86281(%rip), %rsi     # 0xbba25
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 0x357ec
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x357ec
movq %r15, (%rsp)
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35810
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x35810
movq %r15, (%rsp)
movq %rax, %r14
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35860
movq 0x88(%rsp), %rsi
jmp 0x35853
jmp 0x3585d
jmp 0x35831
jmp 0x3585d
movq %r15, (%rsp)
jmp 0x3585d
jmp 0x3585d
jmp 0x35841
jmp 0x3585d
jmp 0x35841
jmp 0x3585d
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x35860
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x35860
movq %rax, %r14
movq (%rbx), %rdi
movq (%rsp), %rax
cmpq %rax, %rdi
je 0x35877
movq (%rax), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0x64a0
nop