// File: /workspace/github_cpp_makefile_star2_O3/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 0x7870
cmpl %r15d, %ebp
je 0x4e766
movq %rax, %r14
movl %r15d, %eax
movq 0x80(%rbx), %rcx
testb $0x2, (%rcx,%rax)
je 0x4e798
cmpb $0x1, 0xb1(%r14)
jne 0x4e725
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 0x1d1fc
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 0xd3c2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d4da
movq 0x8(%rsp), %rdi
cmpq %rdi, %rbp
je 0x4e6fd
leaq 0x50(%rsp), %rsi
callq 0x1e032
cmpq %r13, %r12
je 0x4e70f
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x1d5b4
leaq 0x18(%rsp), %rdi
callq 0xd570
leaq 0x50(%rsp), %rdi
callq 0xdcda
jmp 0x4e766
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7870
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 0x4e778
movq %rbx, %rdi
callq 0x7870
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x150ec
testb %al, %al
je 0x4e778
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6c260(%rip), %rsi     # 0xba9df
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x588f8
leaq 0x6c1e9(%rip), %rdi     # 0xba988
leaq 0x685a2(%rip), %rsi     # 0xb6d48
leaq 0x6c1eb(%rip), %rcx     # 0xba998
movl $0x23fc, %edx           # imm = 0x23FC
callq 0x61b0
movq %rax, %rbx
jmp 0x4e7c9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xd570
leaq 0x50(%rsp), %rdi
callq 0xdcda
movq %rbx, %rdi
callq 0x64a0
nop