// File: rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::emit_continue_block[abi:cxx11](unsigned int)
string CompilerGLSL::emit_continue_block(uint32_t continue_block)
{
	auto *block = &get<SPIRBlock>(continue_block);

	// While emitting the continue block, declare_temporary will check this
	// if we have to emit temporaries.
	current_continue_block = block;

	vector<string> statements;

	// Capture all statements into our list.
	auto *old = redirect_statement;
	redirect_statement = &statements;

	// Stamp out all blocks one after each other.
	while ((ir.block_meta[block->self] & ParsedIR::BLOCK_META_LOOP_HEADER_BIT) == 0)
	{
		propagate_loop_dominators(*block);
		// Write out all instructions we have in this block.
		emit_block_instructions(*block);

		// For plain branchless for/while continue blocks.
		if (block->next_block)
		{
			flush_phi(continue_block, block->next_block);
			block = &get<SPIRBlock>(block->next_block);
		}
		// For do while blocks. The last block will be a select block.
		else if (block->true_block)
		{
			flush_phi(continue_block, block->true_block);
			block = &get<SPIRBlock>(block->true_block);
		}
	}

	// Restore old pointer.
	redirect_statement = old;

	// Somewhat ugly, strip off the last ';' since we use ',' instead.
	// Ideally, we should select this behavior in statement().
	for (auto &s : statements)
	{
		if (!s.empty() && s.back() == ';')
			s.erase(s.size() - 1, 1);
	}

	current_continue_block = nullptr;
	return merge(statements);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movl -0x14(%rbp), %esi
callq 0x87d0
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq %rcx, 0x430(%rax)
leaq -0x38(%rbp), %rdi
callq 0x30390
movq -0x78(%rbp), %rax
movq 0x428(%rax), %rcx
movq %rcx, -0x40(%rbp)
leaq -0x38(%rbp), %rcx
movq %rcx, 0x428(%rax)
movq -0x78(%rbp), %rdi
addq $0x8, %rdi
addq $0x78, %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
callq 0xa82d0
movzbl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x9a38d
movq -0x78(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9a040
jmp 0x9a2d5
movq -0x78(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x891d0
jmp 0x9a2e4
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x9a343
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
callq 0x99760
jmp 0x9a303
movq -0x78(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x87d0
movq %rax, -0x90(%rbp)
jmp 0x9a31c
movq -0x90(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x9a388
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x14cd0
jmp 0x9a46b
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x9a386
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %edx
callq 0x99760
jmp 0x9a362
movq -0x78(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %esi
callq 0x87d0
movq %rax, -0x98(%rbp)
jmp 0x9a37b
movq -0x98(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x9a388
jmp 0x9a29d
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x428(%rax)
leaq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x10140
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0x10170
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x101a0
testb $0x1, %al
jne 0x9a3d1
jmp 0x9a434
leaq -0x60(%rbp), %rdi
callq 0x101e0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x75f0
testb $0x1, %al
jne 0x9a427
movq -0x70(%rbp), %rdi
callq 0x72b0
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0x9a427
movq -0x70(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x7290
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
movl $0x1, %edx
callq 0x70a0
jmp 0x9a425
jmp 0x9a427
jmp 0x9a429
leaq -0x60(%rbp), %rdi
callq 0x10320
jmp 0x9a3be
movq -0x88(%rbp), %rdi
movq -0x78(%rbp), %rax
movq $0x0, 0x430(%rax)
leaq -0x38(%rbp), %rsi
callq 0x9f2c0
jmp 0x9a455
leaq -0x38(%rbp), %rdi
callq 0x14cd0
movq -0x80(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x7640
nopw %cs:(%rax,%rax)