// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %r12
movq 0x8(%rsi), %r15
cmpq %r15, %r12
je 0x4fdb1
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 0x502f1
cmpq $0x81, %r13
jl 0x4fda6
leaq 0x80(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x505a2
cmpq %r15, %r13
je 0x4fdb1
addq $0x84, %r12
movq (%r13), %rax
movq %rax, %rcx
shrq $0x20, %rcx
movl -0x4(%r13), %esi
movq %r13, %rdx
cmpl %ecx, %esi
jbe 0x4fd92
movq %r12, %rdx
movl -0x10(%rdx), %edi
movl -0xc(%rdx), %r8d
movl %r8d, -0x4(%rdx)
movl %esi, (%rdx)
addq $-0x8, %rdx
movl %edi, %esi
cmpl %ecx, %edi
ja 0x4fd77
addq $-0x4, %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
addq $0x8, %r13
addq $0x8, %r12
cmpq %r15, %r13
jne 0x4fd5e
jmp 0x4fdb1
movq %r12, %rdi
movq %r15, %rsi
callq 0x505a2
movq (%r14), %r15
movq 0x8(%r14), %rax
movq %rax, 0x58(%rsp)
cmpq %rax, %r15
je 0x4ffb1
leaq 0x450(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x70(%rsp), %r14
leaq 0x298(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x228(%rbx), %rax
movq %rax, 0x40(%rsp)
addq $0x4, %r15
movq %rsp, %r12
movl (%r15), %eax
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%rbx), %rdx
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0x2b3ee
movl (%r15), %eax
movq 0x38(%rbx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq (%rcx,%rax), %rsi
addq $0x68, %rsi
movq -0x8(%rsi), %rax
movq %rax, 0x68(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x70(%rsp)
movq 0x8(%rsi), %rax
movq %rax, 0x78(%rsp)
movq %rcx, 0x80(%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x88(%rsp)
movups 0x20(%rsi), %xmm0
movups %xmm0, 0x20(%r14)
movq %rcx, 0xa0(%rsp)
movq %r14, (%rsp)
movq %r14, %r13
movq %r14, %rdi
movq %r12, %rdx
callq 0xd3c2
movl -0x4(%r15), %esi
movq %rbx, %rdi
callq 0xa3ea
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
leaq 0x68(%rsp), %rdx
callq 0x2b8e0
movq %rax, 0x60(%rsp)
movl (%r15), %edx
movq (%rbx), %rax
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movq (%rbx), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq *0xc8(%rax)
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
movq %r12, %rdx
leaq 0x6ec13(%rip), %rcx     # 0xbeaf1
callq 0x54978
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4fefe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4ff1a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
movq %rdi, (%rsp)
movq %r15, %rsi
movq %r12, %rdx
callq 0x1f510
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
movq %r15, %rsi
movq %r12, %rdx
callq 0x1f510
movl (%r15), %r14d
movq (%rbx), %rax
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl $0x1, %ecx
callq *0x38(%rax)
leaq -0x4(%r15), %rcx
movb $0x1, 0x20(%rsp)
movq %rbx, %rdi
movl %r14d, %esi
movq %r12, %rdx
leaq 0x20(%rsp), %r8
callq 0x53c18
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
movq %r13, %r14
je 0x4ff93
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0xd570
leaq 0x8(%r15), %rax
addq $0x4, %r15
cmpq 0x58(%rsp), %r15
movq %rax, %r15
jne 0x4fdf6
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x50022
jmp 0x50022
movq %rax, %rbx
jmp 0x4ffea
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4ffea
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x50025
movq 0x30(%rsp), %rsi
jmp 0x50018
jmp 0x50022
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x50025
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x50025
movq %rax, %rbx
movq %r13, %rdi
callq 0xd570
movq %rbx, %rdi
callq 0x64a0
nop