// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movl %edx, 0x2c(%rsp)
movl %ecx, 0x4(%rsp)
movq %rsi, %rdi
movl %edx, %esi
callq 0xa3ea
movq %rax, %r13
movl %ebx, %eax
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq (%rcx,%rax), %rsi
addq $0x68, %rsi
movq -0x8(%rsi), %rax
leaq 0x60(%rsp), %rbx
movq %rax, -0x8(%rbx)
xorl %r12d, %r12d
movq %r12, (%rbx)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq 0x18(%rsi), %rax
movq %rax, 0x18(%rbx)
movups 0x20(%rsi), %xmm0
movups %xmm0, 0x20(%rbx)
movq %r12, 0x30(%rbx)
leaq 0x8(%rsp), %rdx
movq %rbx, (%rdx)
movq %rbx, %rdi
callq 0xd3c2
cmpq %r12, 0x430(%r15)
je 0x3910e
leaq 0x298(%r15), %r12
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
callq 0x1f4b4
testq %rax, %rax
je 0x3920a
leaq 0x298(%r15), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1f4b4
testq %rax, %rax
je 0x39154
movl 0x4(%rsp), %edx
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x85918(%rip), %rdx     # 0xbea5a
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x5394e
jmp 0x39342
movl 0x4(%rsp), %eax
leaq 0x450(%r15), %rsi
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%r15), %rdx
movq %r15, %rdi
callq 0x2b3ee
leaq 0x58(%rsp), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2b8e0
movq %rax, 0x30(%rsp)
movl 0x4(%rsp), %edx
movq (%r15), %rax
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rcx
movq %r15, %rsi
movq %r13, %rdx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x85899(%rip), %rcx     # 0xbea5a
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x539da
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x391ee
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3935d
movq 0x48(%rsp), %rsi
jmp 0x39355
movq 0x430(%r15), %rax
movl 0xb4(%rax), %esi
movq %r15, %rdi
callq 0x7870
movq 0x68(%rax), %rdi
movq 0x70(%rax), %rcx
movl 0x4(%rsp), %edx
movq %rcx, %r9
subq %rdi, %r9
movq %r9, %r8
sarq $0x5, %r8
testq %r8, %r8
jle 0x3928a
andq $-0x20, %r9
movq %r9, %rsi
addq %rdi, %rsi
incq %r8
addq $0x10, %rdi
cmpl %ebp, -0x10(%rdi)
jne 0x39258
cmpl %edx, -0xc(%rdi)
je 0x392cf
cmpl %ebp, -0x8(%rdi)
jne 0x39262
cmpl %edx, -0x4(%rdi)
je 0x392d5
cmpl %ebp, (%rdi)
jne 0x3926b
cmpl %edx, 0x4(%rdi)
je 0x392df
cmpl %ebp, 0x8(%rdi)
jne 0x39275
cmpl %edx, 0xc(%rdi)
je 0x392db
decq %r8
addq $0x20, %rdi
cmpq $0x1, %r8
jg 0x3924e
movq %rcx, %r9
subq %rsi, %r9
jmp 0x3928d
movq %rdi, %rsi
sarq $0x3, %r9
cmpq $0x1, %r9
je 0x392bd
cmpq $0x2, %r9
je 0x392b0
cmpq $0x3, %r9
jne 0x392e4
cmpl %ebp, (%rsi)
jne 0x392ac
cmpl %edx, 0x4(%rsi)
je 0x392ca
addq $0x8, %rsi
cmpl %ebp, (%rsi)
jne 0x392b9
cmpl %edx, 0x4(%rsi)
je 0x392ca
addq $0x8, %rsi
xorl (%rsi), %ebp
movl 0x4(%rsi), %edi
xorl %edx, %edi
orl %ebp, %edi
cmovneq %rcx, %rsi
movq %rsi, %rdi
jmp 0x392df
addq $-0x10, %rdi
jmp 0x392df
addq $-0x8, %rdi
jmp 0x392df
addq $0x8, %rdi
cmpq %rcx, %rdi
jne 0x3931b
addq $0x68, %rax
leaq 0x2c(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
callq 0x53928
leaq 0x8(%rsp), %rdx
movq %r12, (%rdx)
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
callq 0x1f510
movb $0x1, 0x1d0(%r15)
movl 0x4(%rsp), %edx
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x85725(%rip), %rdx     # 0xbea5a
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x5394e
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3935d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0xd570
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x393bc
jmp 0x393de
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x393a1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x393a1
movq %rax, %r14
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x393e1
movq 0x48(%rsp), %rsi
jmp 0x393d2
jmp 0x393de
jmp 0x393de
jmp 0x393de
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x393e1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x393e1
jmp 0x393de
movq %rax, %r14
movq %rbx, %rdi
callq 0xd570
movq %r14, %rdi
callq 0x64a0
nop