// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::emit_hoisted_temporaries(std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&)
void CompilerGLSL::emit_hoisted_temporaries(vector<pair<uint32_t, uint32_t>> &temporaries)
{
	// If we need to force temporaries for certain IDs due to continue blocks, do it before starting loop header.
	// Need to sort these to ensure that reference output is stable.
	sort(begin(temporaries), end(temporaries),
	     [](const pair<uint32_t, uint32_t> &a, const pair<uint32_t, uint32_t> &b) { return a.second < b.second; });

	for (auto &tmp : temporaries)
	{
		add_local_variable_name(tmp.second);
		auto flags = ir.meta[tmp.second].decoration.decoration_flags;
		auto &type = get<SPIRType>(tmp.first);
		statement(flags_to_precision_qualifiers_glsl(type, flags), variable_decl(type, to_name(tmp.second)), ";");

		hoisted_temporaries.insert(tmp.second);
		forced_temporaries.insert(tmp.second);

		// The temporary might be read from before it's assigned, set up the expression now.
		set<SPIRExpression>(tmp.second, to_name(tmp.second), tmp.first, true);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r12
movq 0x8(%rsi), %r15
cmpq %r15, %r12
je 0x40950
movq %r15, %r13
subq %r12, %r13
movq %r13, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x40cd8
cmpq $0x81, %r13
jl 0x40945
leaq 0x80(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x40f23
cmpq %r15, %r13
je 0x40950
movq %r13, %rdi
callq 0x40f7a
addq $0x8, %r13
jmp 0x40932
movq %r12, %rdi
movq %r15, %rsi
callq 0x40f23
movq (%rbx), %r15
movq 0x8(%rbx), %r12
leaq 0x298(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x228(%r14), %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %rbp
cmpq %r12, %r15
je 0x40a8d
movl 0x4(%r15), %esi
movq %r14, %rdi
callq 0x2f168
movl 0x4(%r15), %eax
movq 0x38(%r14), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq (%rcx,%rax), %rsi
addq $0x60, %rsi
leaq 0x58(%rsp), %rdi
callq 0x934a
movl (%r15), %esi
movq %r14, %rdi
callq 0x90a4
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
leaq 0x58(%rsp), %rdx
callq 0x25714
movq %rax, 0x10(%rsp)
movl 0x4(%r15), %edx
movq (%r14), %rax
movq %rbx, %rdi
movq %r14, %rsi
pushq $0x1
popq %rcx
callq *0x38(%rax)
movq (%r14), %rax
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq *0xc8(%rax)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
leaq 0x59073(%rip), %rcx     # 0x99a81
callq 0x440bc
movq %rbp, %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x6548
addq $0x4, %r15
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x1af30
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x1af30
movl (%r15), %r13d
movq (%r14), %rax
movq %rbp, %rdi
movq %r14, %rsi
movl %r13d, %edx
pushq $0x1
popq %rcx
callq *0x38(%rax)
movb $0x1, 0x18(%rsp)
addq $-0x4, %r15
movq %r14, %rdi
movl %r13d, %esi
movq %rbp, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0x436b4
movq %rbp, %rdi
callq 0x6548
leaq 0x60(%rsp), %rdi
callq 0xb51c
addq $0x8, %r15
jmp 0x40978
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x40acd
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x40ac6
jmp 0x40acd
jmp 0x40acd
movq %rax, %rbx
jmp 0x40ac1
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x6548
leaq 0x18(%rsp), %rdi
callq 0x6548
jmp 0x40ad0
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xb51c
movq %rbx, %rdi
callq 0x64b0