// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::branch_to_continue(unsigned int, unsigned int)
void CompilerGLSL::branch_to_continue(uint32_t from, uint32_t to)
{
	auto &to_block = get<SPIRBlock>(to);
	if (from == to)
		return;

	assert(is_continue(to));
	if (to_block.complex_continue)
	{
		// Just emit the whole block chain as is.
		auto usage_counts = expression_usage_counts;
		auto invalid = invalid_expressions;

		emit_block_chain(to_block);

		// Expression usage counts and invalid expressions
		// are moot after returning from the continue block.
		// Since we emit the same block multiple times,
		// we don't want to invalidate ourselves.
		expression_usage_counts = usage_counts;
		invalid_expressions = invalid;
	}
	else
	{
		auto &from_block = get<SPIRBlock>(from);
		bool outside_control_flow = false;
		uint32_t loop_dominator = 0;

		// FIXME: Refactor this to not use the old loop_dominator tracking.
		if (from_block.merge_block)
		{
			// If we are a loop header, we don't set the loop dominator,
			// so just use "self" here.
			loop_dominator = from;
		}
		else if (from_block.loop_dominator != SPIRBlock::NoDominator)
		{
			loop_dominator = from_block.loop_dominator;
		}

		if (loop_dominator != 0)
		{
			auto &dominator = get<SPIRBlock>(loop_dominator);

			// For non-complex continue blocks, we implicitly branch to the continue block
			// by having the continue block be part of the loop header in for (; ; continue-block).
			outside_control_flow = block_is_outside_flow_control_from_block(dominator, from_block);
		}

		// Some simplification for for-loops. We always end up with a useless continue;
		// statement since we branch to a loop block.
		// Walk the CFG, if we uncoditionally execute the block calling continue assuming we're in the loop block,
		// we can avoid writing out an explicit continue statement.
		// Similar optimization to return statements if we know we're outside flow control.
		if (!outside_control_flow)
			statement("continue;");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
movl %edx, %esi
callq 0x6bf0
cmpl %r15d, %ebp
je 0x3f873
movq %rax, %r14
movl %r15d, %eax
movq 0x80(%rbx), %rcx
testb $0x2, (%rcx,%rax)
je 0x3f89b
cmpb $0x1, 0xb1(%r14)
jne 0x3f832
leaq 0x6e8(%rbx), %r12
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x18d76
leaq 0x198(%rbx), %r15
movq %rsp, %rdi
movq %r15, %rsi
callq 0xb29a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3eae8
leaq 0x38(%rsp), %rsi
movq %r12, %rdi
callq 0x198be
movq %rsp, %rsi
movq %r15, %rdi
callq 0x19162
movq %rsp, %rdi
callq 0xb51c
leaq 0x38(%rsp), %rdi
callq 0xbbf6
jmp 0x3f873
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6bf0
movq %rax, %r14
movl 0xb4(%rax), %eax
xorl %esi, %esi
cmpl $-0x1, %eax
cmovnel %eax, %esi
cmpl $0x0, 0x1c(%r14)
cmovnel %ebp, %esi
testl %esi, %esi
je 0x3f880
movq %rbx, %rdi
callq 0x6bf0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1239e
testb %al, %al
je 0x3f880
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x56138(%rip), %rsi     # 0x959bf
movq %rbx, %rdi
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x46dde
leaq 0x560c6(%rip), %rdi     # 0x95968
leaq 0x5247f(%rip), %rsi     # 0x91d28
leaq 0x560c8(%rip), %rcx     # 0x95978
movl $0x23fc, %edx           # imm = 0x23FC
callq 0x61c0
movq %rax, %rbx
jmp 0x3f8ca
movq %rax, %rbx
movq %rsp, %rdi
callq 0xb51c
leaq 0x38(%rsp), %rdi
callq 0xbbf6
movq %rbx, %rdi
callq 0x64b0