// File: /workspace/github_cpp_makefile_star2_O1/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 0x505c8
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 0x50b07
cmpq $0x81, %r13
jl 0x505bd
leaq 0x80(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x50daa
cmpq %r15, %r13
je 0x505c8
addq $0x84, %r12
movq (%r13), %rax
movq %rax, %rcx
shrq $0x20, %rcx
movq %r13, %rdx
cmpl %ecx, -0x4(%r13)
jbe 0x505a9
movq %r12, %rdx
movq %rdx, %rsi
movq -0xc(%rdx), %rdx
movq %rdx, -0x4(%rsi)
leaq -0x8(%rsi), %rdx
cmpl %ecx, -0x10(%rsi)
ja 0x50591
addq $-0x4, %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
addq $0x8, %r13
addq $0x8, %r12
cmpq %r15, %r13
jne 0x5057a
jmp 0x505c8
movq %r12, %rdi
movq %r15, %rsi
callq 0x50daa
movq (%r14), %r15
movq 0x8(%r14), %rax
movq %rax, 0x58(%rsp)
cmpq %rax, %r15
je 0x507c8
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 0x2b9f6
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 0xd402
movl -0x4(%r15), %esi
movq %rbx, %rdi
callq 0xa426
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
leaq 0x68(%rsp), %rdx
callq 0x2beea
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 0x6f3f4(%rip), %rcx     # 0xbfae9
callq 0x55172
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x50715
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x50731
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
movq %rdi, (%rsp)
movq %r15, %rsi
movq %r12, %rdx
callq 0x1fc02
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
movq %r15, %rsi
movq %r12, %rdx
callq 0x1fc02
movl (%r15), %r14d
movl (%r15), %edx
movq (%rbx), %rax
movq %r12, %rdi
movq %rbx, %rsi
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 0x54412
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
movq %r13, %r14
je 0x507aa
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0xd5b0
leaq 0x8(%r15), %rax
addq $0x4, %r15
cmpq 0x58(%rsp), %r15
movq %rax, %r15
jne 0x5060d
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x50839
jmp 0x50839
movq %rax, %rbx
jmp 0x50801
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x50801
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x5083c
movq 0x30(%rsp), %rsi
jmp 0x5082f
jmp 0x50839
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5083c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x5083c
movq %rax, %rbx
movq %r13, %rdi
callq 0xd5b0
movq %rbx, %rdi
callq 0x64a0