// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
movl %edx, %esi
callq 0x78fe
cmpl %r15d, %ebp
je 0x4ef28
movq %rax, %r14
movl %r15d, %eax
movq 0x80(%rbx), %rcx
testb $0x2, (%rcx,%rax)
je 0x4ef5a
cmpb $0x1, 0xb1(%r14)
jne 0x4eee7
leaq 0x6e8(%rbx), %rsi
xorl %r15d, %r15d
leaq 0x50(%rsp), %rbp
movq %r15, (%rbp)
movq 0x6f0(%rbx), %rax
movq %rax, 0x8(%rbp)
movq %r15, 0x10(%rbp)
movq 0x700(%rbx), %rax
movq %rax, 0x18(%rbp)
movups 0x708(%rbx), %xmm0
movups %xmm0, 0x20(%rbp)
movq %r15, 0x30(%rbp)
leaq 0x18(%rsp), %r12
movq %rbp, (%r12)
movq %rbp, %rdi
movq %rsi, 0x8(%rsp)
movq %r12, %rdx
callq 0x1d914
leaq 0x198(%rbx), %r13
movq %r15, (%r12)
movq 0x1a0(%rbx), %rax
movq %rax, 0x8(%r12)
movq %r15, 0x10(%r12)
movq 0x1b0(%rbx), %rax
movq %rax, 0x18(%r12)
movups 0x1b8(%rbx), %xmm0
movups %xmm0, 0x20(%r12)
movq %r15, 0x30(%r12)
leaq 0x10(%rsp), %rdx
movq %r12, (%rdx)
movq %r12, %rdi
movq %r13, %rsi
callq 0xd402
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4dc78
movq 0x8(%rsp), %rdi
cmpq %rdi, %rbp
je 0x4eebf
leaq 0x50(%rsp), %rsi
callq 0x1e734
cmpq %r13, %r12
je 0x4eed1
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x1dcd0
leaq 0x18(%rsp), %rdi
callq 0xd5b0
leaq 0x50(%rsp), %rdi
callq 0xdd10
jmp 0x4ef28
movq %rbx, %rdi
movl %ebp, %esi
callq 0x78fe
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 0x4ef3a
movq %rbx, %rdi
callq 0x78fe
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x152b2
testb %al, %al
je 0x4ef3a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6caae(%rip), %rsi     # 0xbb9ef
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x590f2
leaq 0x6ca37(%rip), %rdi     # 0xbb998
leaq 0x68df0(%rip), %rsi     # 0xb7d58
leaq 0x6ca39(%rip), %rcx     # 0xbb9a8
movl $0x23fc, %edx           # imm = 0x23FC
callq 0x61b0
movq %rax, %rbx
jmp 0x4ef8b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xd5b0
leaq 0x50(%rsp), %rdi
callq 0xdd10
movq %rbx, %rdi
callq 0x64a0
nop