// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::branch(unsigned int, unsigned int, unsigned int, unsigned int)
void CompilerGLSL::branch(uint32_t from, uint32_t cond, uint32_t true_block, uint32_t false_block)
{
	// If we branch directly to a selection merge target, we don't really need a code path.
	bool true_sub = !is_conditional(true_block);
	bool false_sub = !is_conditional(false_block);

	if (true_sub)
	{
		emit_block_hints(get<SPIRBlock>(from));
		statement("if (", to_expression(cond), ")");
		begin_scope();
		branch(from, true_block);
		end_scope();

		if (false_sub || is_continue(false_block) || is_break(false_block))
		{
			statement("else");
			begin_scope();
			branch(from, false_block);
			end_scope();
		}
		else if (flush_phi_required(from, false_block))
		{
			statement("else");
			begin_scope();
			flush_phi(from, false_block);
			end_scope();
		}
	}
	else if (false_sub && !true_sub)
	{
		// Only need false path, use negative conditional.
		emit_block_hints(get<SPIRBlock>(from));
		statement("if (!", to_enclosed_expression(cond), ")");
		begin_scope();
		branch(from, false_block);
		end_scope();

		if (is_continue(true_block) || is_break(true_block))
		{
			statement("else");
			begin_scope();
			branch(from, true_block);
			end_scope();
		}
		else if (flush_phi_required(from, true_block))
		{
			statement("else");
			begin_scope();
			flush_phi(from, true_block);
			end_scope();
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %r15d
movl %edx, %r12d
movq %rdi, %rbx
movl %ecx, %r13d
movq 0x80(%rdi), %rax
testb $0x18, (%rax,%r13)
movl %r8d, %ebp
movb (%rax,%rbp), %r14b
je 0x3fb02
testb $0x18, %r14b
jne 0x3fbbc
movl %ecx, (%rsp)
movq %rbx, %rdi
movl %esi, %ebp
callq 0x6bf0
movq (%rbx), %rcx
movq %rbx, %rdi
movq %rax, %rsi
callq *0x158(%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2beca
leaq 0x55f51(%rip), %rsi     # 0x959e4
leaq 0x55f5b(%rip), %rcx     # 0x959f5
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4710a
leaq 0x8(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x22d28
movq %rbx, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x3f8dc
movq %rbx, %rdi
callq 0x3650a
movq 0x80(%rbx), %rax
testb $0x16, (%rax,%r13)
je 0x3fbcb
leaq 0x51d1e(%rip), %rsi     # 0x91803
movq %rbx, %rdi
callq 0x4704e
movq %rbx, %rdi
callq 0x22d28
movq %rbx, %rdi
movl %ebp, %esi
movl (%rsp), %edx
jmp 0x3fbaf
movl %ecx, (%rsp)
movl %r15d, 0x4(%rsp)
movq %rbx, %rdi
movl %esi, %r15d
callq 0x6bf0
movq (%rbx), %rcx
movq %rbx, %rdi
movq %rax, %rsi
callq *0x158(%rcx)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2b9f0
leaq 0x55ea1(%rip), %rsi     # 0x959df
leaq 0x55eb0(%rip), %rcx     # 0x959f5
movq %rbx, %rdi
movq %r13, %rdx
callq 0x46f74
leaq 0x8(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x22d28
movq %rbx, %rdi
movl %r15d, %r12d
movl %r15d, %esi
movl (%rsp), %edx
callq 0x3f8dc
movq %rbx, %rdi
callq 0x3650a
testb $0x18, %r14b
je 0x3fb8e
movq 0x80(%rbx), %rax
testb $0x16, (%rax,%rbp)
je 0x3fbfe
leaq 0x51c6e(%rip), %rsi     # 0x91803
movq %rbx, %rdi
callq 0x4704e
movq %rbx, %rdi
callq 0x22d28
movq %rbx, %rdi
movl %r12d, %esi
movl 0x4(%rsp), %edx
callq 0x3f8dc
movq %rbx, %rdi
callq 0x3650a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl %ebp, %esi
movl (%rsp), %r14d
movl %r14d, %edx
callq 0x3f644
testb %al, %al
je 0x3fbbc
leaq 0x51c1c(%rip), %rsi     # 0x91803
movq %rbx, %rdi
callq 0x4704e
movq %rbx, %rdi
callq 0x22d28
movq %rbx, %rdi
movl %ebp, %esi
jmp 0x3fc32
movq %rbx, %rdi
movl %r12d, %esi
movl 0x4(%rsp), %r14d
movl %r14d, %edx
callq 0x3f644
testb %al, %al
je 0x3fbbc
leaq 0x51be7(%rip), %rsi     # 0x91803
movq %rbx, %rdi
callq 0x4704e
movq %rbx, %rdi
callq 0x22d28
movq %rbx, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x3f670
jmp 0x3fbb4
jmp 0x3fc41
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0