// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::declare_temporary[abi:cxx11](unsigned int, unsigned int)
string CompilerGLSL::declare_temporary(uint32_t result_type, uint32_t result_id)
{
	auto &type = get<SPIRType>(result_type);
	auto flags = ir.meta[result_id].decoration.decoration_flags;

	// If we're declaring temporaries inside continue blocks,
	// we must declare the temporary in the loop header so that the continue block can avoid declaring new variables.
	if (current_continue_block && !hoisted_temporaries.count(result_id))
	{
		auto &header = get<SPIRBlock>(current_continue_block->loop_dominator);
		if (find_if(begin(header.declare_temporary), end(header.declare_temporary),
		            [result_type, result_id](const pair<uint32_t, uint32_t> &tmp) {
			            return tmp.first == result_type && tmp.second == result_id;
		            }) == end(header.declare_temporary))
		{
			header.declare_temporary.emplace_back(result_type, result_id);
			hoisted_temporaries.insert(result_id);
			force_recompile = true;
		}

		return join(to_name(result_id), " = ");
	}
	else if (hoisted_temporaries.count(result_id))
	{
		// The temporary has already been declared earlier, so just "declare" the temporary by writing to it.
		return join(to_name(result_id), " = ");
	}
	else
	{
		// The result_id has not been made into an expression yet, so use flags interface.
		add_local_variable_name(result_id);
		return join(flags_to_precision_qualifiers_glsl(type, flags), variable_decl(type, to_name(result_id)), " = ");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movl %ecx, (%rsp)
movq %rsi, %rdi
movl %edx, %esi
callq 0x90a4
movq %rax, %r12
movl %r15d, %eax
movq 0x38(%r14), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq (%rcx,%rax), %rsi
addq $0x60, %rsi
leaq 0x50(%rsp), %rdi
callq 0x934a
cmpq $0x0, 0x430(%r14)
je 0x2ef03
leaq 0x298(%r14), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0x1aeea
testq %rax, %rax
je 0x2efc1
leaq 0x298(%r14), %rdi
movq %rsp, %rsi
callq 0x1aeea
testq %rax, %rax
je 0x2ef44
movl (%rsp), %edx
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rsi
callq *0x38(%rax)
leaq 0x6aab8(%rip), %rdx     # 0x999ea
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x434ba
jmp 0x2f0bc
movl (%rsp), %esi
movq %r14, %rdi
callq 0x2f168
leaq 0x50(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x25714
movq %rax, 0x28(%rsp)
movl (%rsp), %edx
movq (%r14), %rax
leaq 0x30(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rsi
callq *0x38(%rax)
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movq %r14, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x6aa4f(%rip), %rcx     # 0x999ea
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x43524
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x30(%rsp), %rdi
jmp 0x2f0c1
movq 0x430(%r14), %rax
movl 0xb4(%rax), %esi
movq %r14, %rdi
callq 0x6bf0
movq %rax, %rcx
addq $0x68, %rax
movq 0x68(%rcx), %rsi
movq 0x70(%rcx), %rcx
movl (%rsp), %edx
movq %rcx, %rdi
subq %rsi, %rdi
movq %rdi, %r8
sarq $0x5, %r8
addq $0x10, %rsi
testq %r8, %r8
jle 0x2f032
cmpl %ebp, -0x10(%rsi)
jne 0x2f008
cmpl %edx, -0xc(%rsi)
je 0x2f059
cmpl %ebp, -0x8(%rsi)
jne 0x2f012
cmpl %edx, -0x4(%rsi)
je 0x2f05f
cmpl %ebp, (%rsi)
jne 0x2f01b
cmpl %edx, 0x4(%rsi)
je 0x2f069
cmpl %ebp, 0x8(%rsi)
jne 0x2f025
cmpl %edx, 0xc(%rsi)
je 0x2f065
decq %r8
addq $0x20, %rsi
addq $-0x20, %rdi
jmp 0x2eff9
sarq $0x3, %rdi
leaq -0x10(%rsi), %r8
cmpq $0x1, %rdi
je 0x2f10b
cmpq $0x3, %rdi
je 0x2f0e3
cmpq $0x2, %rdi
jne 0x2f071
jmp 0x2f0f8
addq $-0x10, %rsi
jmp 0x2f069
addq $-0x8, %rsi
jmp 0x2f069
addq $0x8, %rsi
movq %rsi, %r8
cmpq %rcx, %r8
jne 0x2f097
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %rax, %rdi
callq 0x43494
movq %rsp, %rsi
movq %r15, %rdi
callq 0x1af30
movb $0x1, 0x1d0(%r14)
movl (%rsp), %edx
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rsi
callq *0x38(%rax)
leaq 0x6a93b(%rip), %rdx     # 0x999ea
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x434ba
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x58(%rsp), %rdi
callq 0xb51c
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl %ebp, -0x10(%rsi)
jne 0x2f0f1
cmpl %edx, -0xc(%rsi)
je 0x2f06c
addq $-0x8, %rsi
movq %rsi, %r8
cmpl %ebp, (%r8)
jne 0x2f107
cmpl %edx, 0x4(%r8)
je 0x2f06c
addq $0x8, %r8
xorl (%r8), %ebp
movl 0x4(%r8), %esi
xorl %edx, %esi
orl %ebp, %esi
cmovneq %rcx, %r8
jmp 0x2f06c
jmp 0x2f142
jmp 0x2f153
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x2f135
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x2f14a
jmp 0x2f153
jmp 0x2f153
jmp 0x2f153
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x2f156
jmp 0x2f153
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xb51c
movq %rbx, %rdi
callq 0x64b0