// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl %edx, 0x4(%rsp)
movl %ecx, (%rsp)
movq %rsi, %rdi
movl %edx, %esi
callq 0xa426
movq %rax, %r13
movl (%rsp), %eax
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq (%rcx,%rax), %rsi
addq $0x68, %rsi
movq -0x8(%rsi), %rax
leaq 0x58(%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 0xd402
cmpq %r12, 0x430(%r15)
je 0x3987f
leaq 0x298(%r15), %r12
movq %rsp, %rsi
movq %r12, %rdi
callq 0x1fbce
testq %rax, %rax
je 0x39976
leaq 0x298(%r15), %rdi
movq %rsp, %rsi
callq 0x1fbce
testq %rax, %rax
je 0x398c2
movl (%rsp), %edx
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x861a2(%rip), %rdx     # 0xbfa52
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x54148
jmp 0x39ab3
movl (%rsp), %eax
leaq 0x450(%r15), %rsi
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%r15), %rdx
movq %r15, %rdi
callq 0x2b9f6
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2beea
movq %rax, 0x28(%rsp)
movl (%rsp), %edx
movq (%r15), %rax
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movq %r15, %rsi
movq %r13, %rdx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x86125(%rip), %rcx     # 0xbfa52
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x541d4
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3995a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39ace
movq 0x40(%rsp), %rsi
jmp 0x39ac6
movq 0x430(%r15), %rax
movl 0xb4(%rax), %esi
movq %r15, %rdi
callq 0x78fe
movq 0x68(%rax), %rdi
movq 0x70(%rax), %rcx
movl 0x4(%rsp), %edx
movl (%rsp), %esi
movq %rcx, %r9
subq %rdi, %r9
movq %r9, %r10
sarq $0x5, %r10
testq %r10, %r10
jle 0x399fc
andq $-0x20, %r9
addq %rdi, %r9
incq %r10
addq $0x10, %rdi
movq %rdi, %r8
cmpl %edx, -0x10(%r8)
jne 0x399c9
cmpl %esi, -0xc(%r8)
je 0x39a45
cmpl %edx, -0x8(%r8)
jne 0x399d5
cmpl %esi, -0x4(%r8)
je 0x39a4b
cmpl %edx, (%r8)
jne 0x399e0
cmpl %esi, 0x4(%r8)
je 0x39a55
cmpl %edx, 0x8(%r8)
jne 0x399ec
cmpl %esi, 0xc(%r8)
je 0x39a51
decq %r10
addq $0x20, %r8
cmpq $0x1, %r10
jg 0x399bd
movq %r9, %rdi
movq %rcx, %r9
subq %rdi, %r9
sarq $0x3, %r9
cmpq $0x1, %r9
je 0x39a35
cmpq $0x2, %r9
je 0x39a28
movq %rcx, %r8
cmpq $0x3, %r9
jne 0x39a55
cmpl %edx, (%rdi)
jne 0x39a24
cmpl %esi, 0x4(%rdi)
je 0x39a40
addq $0x8, %rdi
cmpl %edx, (%rdi)
jne 0x39a31
cmpl %esi, 0x4(%rdi)
je 0x39a40
addq $0x8, %rdi
xorl (%rdi), %edx
xorl 0x4(%rdi), %esi
orl %edx, %esi
cmovneq %rcx, %rdi
movq %rdi, %r8
jmp 0x39a55
addq $-0x10, %r8
jmp 0x39a55
addq $-0x8, %r8
jmp 0x39a55
addq $0x8, %r8
cmpq %rcx, %r8
jne 0x39a89
addq $0x68, %rax
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %rax, %rdi
callq 0x54122
leaq 0x8(%rsp), %rdx
movq %r12, (%rdx)
movq %rsp, %rsi
movq %r12, %rdi
callq 0x1fc02
movb $0x1, 0x1d0(%r15)
movl (%rsp), %edx
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x85fac(%rip), %rdx     # 0xbfa52
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x54148
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39ace
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0xd5b0
movq %r14, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x39b2c
jmp 0x39b4e
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39b11
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x39b11
movq %rax, %r14
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39b51
movq 0x40(%rsp), %rsi
jmp 0x39b42
jmp 0x39b4e
jmp 0x39b4e
jmp 0x39b4e
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39b51
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x39b51
jmp 0x39b4e
movq %rax, %r14
movq %rbx, %rdi
callq 0xd5b0
movq %r14, %rdi
callq 0x64a0
nop