LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/orbitcowboy[P]gnuplot-cpp/./gnuplot_i.hpp
// Function: Gnuplot::plot_equation3d(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Gnuplot& Gnuplot::plot_equation3d(const std::string &equation,
                                  const std::string &title)
{
    std::ostringstream cmdstr;
    //
    // command to be sent to gnuplot
    //
    if (nplots > 0  &&  two_dim == false)
    {
        cmdstr << "replot ";
    }
    else
    {
        cmdstr << "splot ";
    }

    cmdstr << equation << " title \"";

    if (title.empty())
    {
        cmdstr << "f(x,y) = " << equation;
    }
    else
    {
        cmdstr << title;
    }

    cmdstr << "\" with " << pstyle;

    //
    // Do the actual plot
    //
    return cmd(cmdstr.str());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x32b0
cmpl $0x0, 0xc(%rbx)
setg %al
cmpb $0x0, 0x9(%rbx)
sete %cl
andb %al, %cl
leaq 0x7fe2(%rip), %rax      # 0xd21b
leaq 0x8004(%rip), %rsi      # 0xd244
cmovneq %rax, %rsi
movzbl %cl, %edx
orq $0x6, %rdx
movq %r12, %rdi
callq 0x3250
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x20(%rsp), %rdi
callq 0x3250
leaq 0x8036(%rip), %rsi      # 0xd2a1
movl $0x8, %edx
movq %rax, %rdi
callq 0x3250
movq 0x8(%r15), %rdx
testq %rdx, %rdx
jne 0x529e
leaq 0x7fc3(%rip), %rsi      # 0xd24b
leaq 0x20(%rsp), %rdi
movl $0x9, %edx
callq 0x3250
movq 0x8(%r14), %rdx
movq %r14, %r15
movq (%r15), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3250
leaq 0x7f81(%rip), %rsi      # 0xd233
leaq 0x20(%rsp), %rdi
movl $0x7, %edx
callq 0x3250
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
leaq 0x20(%rsp), %rdi
callq 0x3250
leaq 0x28(%rsp), %rsi
movq %rsp, %rdi
callq 0x3340
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3ab8
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5306
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3210
movq 0xbca3(%rip), %rsi      # 0x10fb0
leaq 0x20(%rsp), %rdi
callq 0x3140
leaq 0x90(%rsp), %rdi
callq 0x30c0
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x535b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x535b
jmp 0x5358
movq %rax, %rbx
movq 0xbc4e(%rip), %rsi      # 0x10fb0
leaq 0x20(%rsp), %rdi
callq 0x3140
leaq 0x90(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x33f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/orbitcowboy[P]gnuplot-cpp/./gnuplot_i.hpp
// Function: Gnuplot::file_available(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Gnuplot::file_available(const std::string &filename)
{
    std::ostringstream except;
    if( Gnuplot::file_exists(filename, 0) ) // check existence
    {
        if( !(Gnuplot::file_exists(filename, 4)) ) // check read permission
        {
            except << "No read permission for File \"" << filename << "\"";
            throw GnuplotException( except.str() );
        }
        return true;
    }
    except << "File \"" << filename << "\" does not exist";
    throw GnuplotException( except.str() );
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, %rbx
leaq 0x28(%rsp), %rdi
callq 0x32b0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x3380
testl %eax, %eax
jne 0x55ed
movq (%rbx), %rdi
movl $0x4, %esi
callq 0x3380
testl %eax, %eax
jne 0x567b
movq 0xb9e8(%rip), %rsi      # 0x10fb0
leaq 0x28(%rsp), %rdi
callq 0x3140
leaq 0x98(%rsp), %rdi
callq 0x30c0
movb $0x1, %al
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7d99(%rip), %rsi      # 0xd38d
leaq 0x28(%rsp), %rdi
movl $0x6, %edx
callq 0x3250
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x28(%rsp), %rdi
callq 0x3250
leaq 0x7d79(%rip), %rsi      # 0xd394
movl $0x10, %edx
movq %rax, %rdi
callq 0x3250
movl $0x10, %edi
callq 0x3120
movq %rax, %r14
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3340
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x32a0
leaq 0xb705(%rip), %rax      # 0x10d60
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xb6d1(%rip), %rsi      # 0x10d38
movq 0xb94a(%rip), %rdx      # 0x10fb8
movq %r14, %rdi
callq 0x33c0
jmp 0x5704
leaq 0x7cf4(%rip), %rsi      # 0xd376
leaq 0x28(%rsp), %rdi
movl $0x1d, %edx
callq 0x3250
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x28(%rsp), %rdi
callq 0x3250
leaq 0x7ce9(%rip), %rsi      # 0xd392
movl $0x1, %edx
movq %rax, %rdi
callq 0x3250
movl $0x10, %edi
callq 0x3120
movq %rax, %r14
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3340
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x32a0
leaq 0xb677(%rip), %rax      # 0x10d60
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xb643(%rip), %rsi      # 0x10d38
movq 0xb8bc(%rip), %rdx      # 0x10fb8
movq %r14, %rdi
callq 0x33c0
jmp 0x5708
jmp 0x5728
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x572e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x572e
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x5740
movq %r14, %rdi
callq 0x3190
jmp 0x5740
movq %rax, %rbx
movq 0xb869(%rip), %rsi      # 0x10fb0
leaq 0x28(%rsp), %rdi
callq 0x3140
leaq 0x98(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x33f0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::CFG::CFG(spirv_cross::Compiler&, spirv_cross::SPIRFunction const&)
CFG::CFG(Compiler &compiler_, const SPIRFunction &func_)
    : compiler(compiler_)
    , func(func_)
{
	preceding_edges.resize(compiler.get_current_id_bound());
	succeeding_edges.resize(compiler.get_current_id_bound());
	visit_order.resize(compiler.get_current_id_bound());
	immediate_dominators.resize(compiler.get_current_id_bound());

	build_post_order_visit_order();
	build_immediate_dominators();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
leaq 0x10(%rdi), %rbx
leaq 0x28(%rdi), %r15
leaq 0x40(%rdi), %r12
leaq 0x58(%rdi), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movups %xmm0, 0x7c(%rdi)
movq 0x28(%rsi), %rax
subq 0x20(%rsi), %rax
shrq $0x4, %rax
movl %eax, %esi
movq %rbx, %rdi
callq 0x7810
movq (%r14), %rax
movq 0x28(%rax), %rcx
subq 0x20(%rax), %rcx
shrq $0x4, %rcx
movl %ecx, %esi
movq %r15, %rdi
callq 0x7810
movq (%r14), %rax
movq 0x28(%rax), %rcx
subq 0x20(%rax), %rcx
shrq $0x4, %rcx
movl %ecx, %esi
movq %r13, %rdi
callq 0x784c
movq (%r14), %rax
movq 0x28(%rax), %rcx
subq 0x20(%rax), %rcx
shrq $0x4, %rcx
movl %ecx, %esi
movq %r12, %rdi
callq 0x787e
movq %r14, %rdi
callq 0x72f4
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7350
movq %rax, %rbp
movq 0x70(%r14), %rdi
testq %rdi, %rdi
je 0x72ce
movq 0x80(%r14), %rsi
subq %rdi, %rsi
callq 0x6260
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x6520
movq %r15, %rdi
callq 0x78b0
movq %rbx, %rdi
callq 0x78b0
movq %rbp, %rdi
callq 0x64a0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::CFG::build_post_order_visit_order()
void CFG::build_post_order_visit_order()
{
	uint32_t block = func.entry_block;
	visit_count = 0;
	fill(begin(visit_order), end(visit_order), -1);
	post_order.clear();
	post_order_visit(block);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x58(%rdi), %rdi
movl 0x60(%rax), %ebp
movl $0x0, 0x88(%rbx)
movq 0x60(%rbx), %rdx
cmpq %rdx, %rdi
je 0x7331
subq %rdi, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movl $0xff, %esi
callq 0x6180
movq 0x70(%rbx), %rax
cmpq %rax, 0x78(%rbx)
je 0x733f
movq %rax, 0x78(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x747c
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::CFG::build_immediate_dominators()
void CFG::build_immediate_dominators()
{
	// Traverse the post-order in reverse and build up the immediate dominator tree.
	fill(begin(immediate_dominators), end(immediate_dominators), 0);
	immediate_dominators[func.entry_block] = func.entry_block;

	for (auto i = post_order.size(); i; i--)
	{
		uint32_t block = post_order[i - 1];
		auto &pred = preceding_edges[block];
		if (pred.empty()) // This is for the entry block, but we've already set up the dominators.
			continue;

		for (auto &edge : pred)
		{
			if (immediate_dominators[block])
			{
				assert(immediate_dominators[edge]);
				immediate_dominators[block] = find_common_dominator(block, edge);
			}
			else
				immediate_dominators[block] = edge;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %r14
movq 0x48(%rdi), %rdx
cmpq %rdx, %r14
je 0x7384
subq %r14, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x6180
movq 0x8(%rbx), %rax
movl 0x60(%rax), %eax
movl %eax, (%r14,%rax,4)
movq 0x70(%rbx), %rax
movq 0x78(%rbx), %rcx
subq %rax, %rcx
je 0x7414
sarq $0x2, %rcx
movq 0x10(%rbx), %rdx
movl -0x4(%rax,%rcx,4), %esi
leaq (%rsi,%rsi,2), %r8
movq (%rdx,%r8,8), %rdi
movq 0x8(%rdx,%r8,8), %r8
cmpq %r8, %rdi
je 0x740f
movq 0x58(%rbx), %r9
cmpl $0x0, (%r14,%rsi,4)
movl (%rdi), %r10d
je 0x73ff
cmpl $0x0, (%r14,%r10,4)
je 0x7423
movl %esi, %r11d
cmpl %r10d, %esi
je 0x7402
movq 0x40(%rbx), %r15
movl %esi, %r11d
movl %r11d, %r12d
movl (%r9,%r12,4), %ebp
movl %r10d, %r13d
cmpl (%r9,%r13,4), %ebp
jge 0x73f4
movl (%r15,%r12,4), %r11d
jmp 0x73f8
movl (%r15,%r13,4), %r10d
cmpl %r10d, %r11d
jne 0x73de
jmp 0x7402
movl %r10d, %r11d
movl %r11d, (%r14,%rsi,4)
addq $0x4, %rdi
cmpq %r8, %rdi
jne 0x73be
decq %rcx
jne 0x73a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xadbd6(%rip), %rdi     # 0xb5000
leaq 0xadbea(%rip), %rsi     # 0xb501b
leaq 0xadbfd(%rip), %rcx     # 0xb5035
movl $0x44, %edx
callq 0x61b0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::CFG::find_common_dominator(unsigned int, unsigned int) const
uint32_t CFG::find_common_dominator(uint32_t a, uint32_t b) const
{
	while (a != b)
	{
		if (visit_order[a] < visit_order[b])
			a = immediate_dominators[a];
		else
			b = immediate_dominators[b];
	}
	return a;
}

// Assembly:
movl %esi, %eax
cmpl %edx, %esi
je 0x746c
movq 0x40(%rdi), %rcx
movq 0x58(%rdi), %rsi
movl %eax, %edi
movl (%rsi,%rdi,4), %r9d
movl %edx, %r8d
cmpl (%rsi,%r8,4), %r9d
jge 0x7464
movl (%rcx,%rdi,4), %eax
jmp 0x7468
movl (%rcx,%r8,4), %edx
cmpl %edx, %eax
jne 0x7450
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::CFG::add_branch(unsigned int, unsigned int)
void CFG::add_branch(uint32_t from, uint32_t to)
{
	const auto add_unique = [](vector<uint32_t> &l, uint32_t value) {
		auto itr = find(begin(l), end(l), value);
		if (itr == end(l))
			l.push_back(value);
	};
	add_unique(preceding_edges[to], from);
	add_unique(succeeding_edges[from], to);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %edx, %eax
movq 0x10(%rdi), %r15
leaq (%rax,%rax,2), %r12
leaq 0x8(%rsp), %rdx
movl %esi, (%rdx)
movq (%r15,%r12,8), %rdi
movq 0x8(%r15,%r12,8), %rsi
callq 0x7966
movq 0x8(%r15,%r12,8), %rsi
cmpq %rsi, %rax
jne 0x7650
leaq (%r15,%r12,8), %rdi
cmpq 0x10(%rdi), %rsi
je 0x7646
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x7650
leaq 0x8(%rsp), %rdx
callq 0x7a00
movl %ebp, %eax
movq 0x28(%r14), %r14
leaq (%rax,%rax,2), %r15
leaq 0xc(%rsp), %rdx
movl %ebx, (%rdx)
movq (%r14,%r15,8), %rdi
movq 0x8(%r14,%r15,8), %rsi
callq 0x7966
movq 0x8(%r14,%r15,8), %rsi
cmpq %rsi, %rax
jne 0x769d
leaq (%r14,%r15,8), %rdi
cmpq 0x10(%rdi), %rsi
je 0x7693
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x769d
leaq 0xc(%rsp), %rdx
callq 0x7a00
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::DominatorBuilder::add_block(unsigned int)
void DominatorBuilder::add_block(uint32_t block)
{
	if (!cfg.get_immediate_dominator(block))
	{
		// Unreachable block via the CFG, we will never emit this code anyways.
		return;
	}

	if (!dominator)
	{
		dominator = block;
		return;
	}

	if (block != dominator)
		dominator = cfg.find_common_dominator(block, dominator);
}

// Assembly:
movq (%rdi), %rdx
movl %esi, %ecx
movq 0x40(%rdx), %rax
cmpl $0x0, (%rax,%rcx,4)
je 0x76f5
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
je 0x76f2
cmpl %esi, %ecx
je 0x76f5
movq 0x58(%rdx), %rdx
movl %esi, %r8d
movl (%rdx,%r8,4), %r10d
movl %ecx, %r9d
cmpl (%rdx,%r9,4), %r10d
jge 0x76ea
movl (%rax,%r8,4), %esi
jmp 0x76ee
movl (%rax,%r9,4), %ecx
cmpl %ecx, %esi
jne 0x76d4
movl %esi, 0x8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cfg.cpp
// Function: spirv_cross::DominatorBuilder::lift_continue_block_dominator()
void DominatorBuilder::lift_continue_block_dominator()
{
	// It is possible for a continue block to be the dominator of a variable is only accessed inside the while block of a do-while loop.
	// We cannot safely declare variables inside a continue block, so move any variable declared
	// in a continue block to the entry block to simplify.
	// It makes very little sense for a continue block to ever be a dominator, so fall back to the simplest
	// solution.

	if (!dominator)
		return;

	auto &block = cfg.get_compiler().get<SPIRBlock>(dominator);
	auto post_order = cfg.get_visit_order(dominator);

	// If we are branching to a block with a higher post-order traversal index (continue blocks), we have a problem
	// since we cannot create sensible GLSL code for this, fallback to entry block.
	bool back_edge_dominator = false;
	switch (block.terminator)
	{
	case SPIRBlock::Direct:
		if (cfg.get_visit_order(block.next_block) > post_order)
			back_edge_dominator = true;
		break;

	case SPIRBlock::Select:
		if (cfg.get_visit_order(block.true_block) > post_order)
			back_edge_dominator = true;
		if (cfg.get_visit_order(block.false_block) > post_order)
			back_edge_dominator = true;
		break;

	case SPIRBlock::MultiSelect:
		for (auto &target : block.cases)
		{
			if (cfg.get_visit_order(target.block) > post_order)
				back_edge_dominator = true;
		}
		if (block.default_block && cfg.get_visit_order(block.default_block) > post_order)
			back_edge_dominator = true;
		break;

	default:
		break;
	}

	if (back_edge_dominator)
		dominator = cfg.get_function().entry_block;
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %esi
testl %esi, %esi
je 0x77ee
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rdi
callq 0x7932
movq (%rbx), %rcx
movl 0x8(%rbx), %edx
movq 0x58(%rcx), %rsi
movl (%rsi,%rdx,4), %edx
testl %edx, %edx
jle 0x77f0
movl 0xc(%rax), %edi
cmpl $0x3, %edi
je 0x7781
cmpl $0x2, %edi
je 0x7754
cmpl $0x1, %edi
jne 0x77dc
movl 0x18(%rax), %eax
movl (%rsi,%rax,4), %eax
testl %eax, %eax
jle 0x77f0
cmpl %edx, %eax
seta %dil
jmp 0x77de
movl 0x2c(%rax), %edi
movl (%rsi,%rdi,4), %edi
testl %edi, %edi
jle 0x77f0
movl 0x30(%rax), %eax
movl (%rsi,%rax,4), %eax
testl %eax, %eax
jle 0x77f0
cmpl %edx, %edi
seta %sil
cmpl %edx, %eax
seta %dil
orb %sil, %dil
jmp 0x77de
movq 0x98(%rax), %r8
movq 0xa0(%rax), %r9
xorl %edi, %edi
cmpq %r9, %r8
je 0x77bd
movl $0x1, %r10d
movl 0x4(%r8), %r11d
movl (%rsi,%r11,4), %r11d
testl %r11d, %r11d
jle 0x77f0
cmpl %edx, %r11d
movzbl %dil, %edi
cmoval %r10d, %edi
addq $0x8, %r8
cmpq %r9, %r8
jne 0x779c
movl 0x34(%rax), %eax
testq %rax, %rax
je 0x77de
movl (%rsi,%rax,4), %eax
testl %eax, %eax
jle 0x77f0
cmpl %edx, %eax
movzbl %dil, %eax
movl $0x1, %edi
cmovbel %eax, %edi
jmp 0x77de
xorl %edi, %edi
testb $0x1, %dil
je 0x77ee
movq 0x8(%rcx), %rax
movl 0x60(%rax), %eax
movl %eax, 0x8(%rbx)
popq %rbx
retq
leaq 0xad872(%rip), %rdi     # 0xb5069
leaq 0xad871(%rip), %rsi     # 0xb506f
leaq 0xad884(%rip), %rcx     # 0xb5089
movl $0x36, %edx
callq 0x61b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cpp.cpp
// Function: spirv_cross::CompilerCPP::emit_shared(spirv_cross::SPIRVariable const&)
void CompilerCPP::emit_shared(const SPIRVariable &var)
{
	add_resource_name(var.self);

	auto instance_name = to_name(var.self);
	statement(CompilerGLSL::variable_decl(var), ";");
	statement_no_indent("#define ", instance_name, " __res->", instance_name);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %esi
callq 0x287ea
movl 0x8(%r14), %edx
movq (%rbx), %rax
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movq %rsp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2ce16
leaq 0xb7209(%rip), %rdx     # 0xbfae9
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xaa50
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8906
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x638(%rbx), %ebp
movl $0x0, 0x638(%rbx)
leaq 0xac8cf(%rip), %rsi     # 0xb51ec
leaq 0xac8d1(%rip), %rcx     # 0xb51f5
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
callq 0xf47a
movl %ebp, 0x638(%rbx)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8955
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x8980
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8983
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x8983
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x899e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.hpp
// Function: spirv_cross::SPIRVariable* spirv_cross::Compiler::maybe_get<spirv_cross::SPIRVariable>(unsigned int)
T *maybe_get(uint32_t id)
	{
		if (ir.ids.at(id).get_type() == T::type)
			return &get<T>(id);
		else
			return nullptr;
	}

// Assembly:
movl %esi, %eax
movq 0x20(%rdi), %rcx
movq 0x28(%rdi), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
cmpq %rax, %rdx
jbe 0xc81c
shlq $0x4, %rax
cmpl $0x2, 0x8(%rcx,%rax)
je 0xb40a
xorl %eax, %eax
retq
pushq %rax
leaq 0xa88f5(%rip), %rdi     # 0xb5119
movq %rax, %rsi
xorl %eax, %eax
callq 0x63d0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::parse_fixup()
void Compiler::parse_fixup()
{
	// Figure out specialization constants for work group sizes.
	for (auto &id : ir.ids)
	{
		if (id.get_type() == TypeConstant)
		{
			auto &c = id.get<SPIRConstant>();
			if (ir.meta[c.self].decoration.builtin && ir.meta[c.self].decoration.builtin_type == BuiltInWorkgroupSize)
			{
				// In current SPIR-V, there can be just one constant like this.
				// All entry points will receive the constant value.
				for (auto &entry : ir.entry_points)
				{
					entry.second.workgroup_size.constant = c.self;
					entry.second.workgroup_size.x = c.scalar(0, 0);
					entry.second.workgroup_size.y = c.scalar(0, 1);
					entry.second.workgroup_size.z = c.scalar(0, 2);
				}
			}
		}
		else if (id.get_type() == TypeVariable)
		{
			auto &var = id.get<SPIRVariable>();
			if (var.storage == StorageClassPrivate || var.storage == StorageClassWorkgroup ||
			    var.storage == StorageClassOutput)
				global_variables.push_back(var.self);
			if (variable_storage_is_aliased(var))
				aliased_variables.push_back(var.self);
		}
	}

	fixup_type_alias();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
movq 0x28(%rdi), %rbp
cmpq %rbp, %r14
je 0x12874
leaq 0x118(%rbx), %r15
leaq 0x130(%rbx), %rax
movq %rax, (%rsp)
movl $0x58, %r12d
movl 0x8(%r14), %eax
cmpl $0x2, %eax
je 0x127df
cmpl $0x3, %eax
jne 0x12867
movq %r14, %rdi
callq 0x1be66
movl 0x8(%rax), %ecx
movq 0x38(%rbx), %rdx
imulq $0x148, %rcx, %rsi      # imm = 0x148
cmpb $0x1, 0xcc(%rdx,%rsi)
jne 0x12867
addq %rsi, %rdx
cmpl $0x19, 0xa0(%rdx)
jne 0x12867
movq 0xe0(%rbx), %rdx
testq %rdx, %rdx
je 0x12867
movl %ecx, 0xbc(%rdx)
movl 0x10(%rax), %esi
movl %esi, 0xb0(%rdx)
movl 0x18(%rax), %esi
movl %esi, 0xb4(%rdx)
movl 0x20(%rax), %esi
movl %esi, 0xb8(%rdx)
movq (%rdx), %rdx
jmp 0x127b0
movq %r14, %rdi
callq 0xb2e2
movq %rax, %r13
movl 0x10(%rax), %eax
cmpl $0x6, %eax
ja 0x12825
btl %eax, %r12d
jae 0x12825
leaq 0x8(%r13), %rdx
movq 0x120(%rbx), %rsi
cmpq 0x128(%rbx), %rsi
je 0x1281d
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x120(%rbx)
jmp 0x12825
movq %r15, %rdi
callq 0x7a00
movq %rbx, %rdi
movq %r13, %rsi
callq 0x128de
testb %al, %al
je 0x12867
addq $0x8, %r13
movq 0x138(%rbx), %rsi
cmpq 0x140(%rbx), %rsi
je 0x1285b
movl (%r13), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x138(%rbx)
jmp 0x12867
movq (%rsp), %rdi
movq %r13, %rdx
callq 0x7a00
addq $0x10, %r14
cmpq %rbp, %r14
jne 0x12763
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1422c
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::variable_storage_is_aliased(spirv_cross::SPIRVariable const&)
bool Compiler::variable_storage_is_aliased(const SPIRVariable &v)
{
	auto &type = get<SPIRType>(v.basetype);
	bool ssbo = v.storage == StorageClassStorageBuffer ||
	            ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock);
	bool image = type.basetype == SPIRType::Image;
	bool counter = type.basetype == SPIRType::AtomicCounter;

	bool is_restrict;
	if (ssbo)
		is_restrict = ir.get_buffer_block_flags(v).get(DecorationRestrict);
	else
		is_restrict = has_decoration(v.self, DecorationRestrict);

	return !is_restrict && (ssbo || image || counter);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rsi), %esi
callq 0xa426
movb $0x1, %bpl
cmpl $0xc, 0x10(%r14)
je 0x1291d
movl 0x8(%rax), %ecx
movq 0x38(%rbx), %rdx
imulq $0x148, %rcx, %rcx      # imm = 0x148
movb 0x60(%rdx,%rcx), %bpl
andb $0x8, %bpl
shrb $0x3, %bpl
movl 0xc(%rax), %r12d
testb %bpl, %bpl
je 0x12950
addq $0x8, %rbx
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x24ca0
movl (%r15), %ebx
shrl $0x13, %ebx
andl $0x1, %ebx
leaq 0x8(%rsp), %rdi
callq 0xd5b0
jmp 0x12967
movl 0x8(%r14), %esi
addq $0x8, %rbx
movq %rbx, %rdi
movl $0x13, %edx
callq 0x24fbc
movl %eax, %ebx
cmpl $0x8, %r12d
sete %al
cmpl $0xd, %r12d
sete %cl
movl %ebx, %edx
xorb $0x1, %dl
orb %al, %cl
movzbl %cl, %eax
movzbl %dl, %ecx
testb %bl, %bl
cmovnel %ecx, %eax
testb %bpl, %bpl
cmovnel %ecx, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::to_name[abi:cxx11](unsigned int, bool) const
string Compiler::to_name(uint32_t id, bool allow_alias) const
{
	if (allow_alias && ir.ids.at(id).get_type() == TypeType)
	{
		// If this type is a simple alias, emit the
		// name of the original type instead.
		// We don't want to override the meta alias
		// as that can be overridden by the reflection APIs after parse.
		auto &type = get<SPIRType>(id);
		if (type.type_alias)
		{
			// If the alias master has been specially packed, we will have emitted a clean variant as well,
			// so skip the name aliasing here.
			if (!has_decoration(type.type_alias, DecorationCPacked))
				return to_name(type.type_alias);
		}
	}

	if (ir.meta[id].decoration.alias.empty())
		return join("_", id);
	else
		return ir.meta[id].decoration.alias;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, 0xc(%rsp)
testl %ecx, %ecx
je 0x12b33
movl %edx, %esi
movq 0x20(%r14), %rcx
movq 0x28(%r14), %rax
subq %rcx, %rax
sarq $0x4, %rax
cmpq %rsi, %rax
jbe 0x12ba1
shlq $0x4, %rsi
cmpl $0x1, 0x8(%rcx,%rsi)
jne 0x12b33
movq %r14, %rdi
movl %edx, %esi
callq 0x1b9de
movl 0x98(%rax), %esi
testl %esi, %esi
je 0x12b33
movq %rax, %r15
leaq 0x8(%r14), %rdi
movl $0xa, %edx
callq 0x24fbc
testb %al, %al
je 0x12b87
movl 0xc(%rsp), %ecx
movq 0x38(%r14), %rax
imulq $0x148, %rcx, %rcx      # imm = 0x148
movq 0x8(%rax,%rcx), %rdx
testq %rdx, %rdx
je 0x12b66
addq %rcx, %rax
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%rax), %rsi
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xe480
jmp 0x12b7a
leaq 0xac442(%rip), %rsi     # 0xbefaf
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xe3c1
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl 0x98(%r15), %edx
movq (%r14), %rax
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
jmp 0x12b7a
leaq 0xa2571(%rip), %rdi     # 0xb5119
movq %rax, %rdx
xorl %eax, %eax
callq 0x63d0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::register_global_read_dependencies(spirv_cross::SPIRBlock const&, unsigned int)
void Compiler::register_global_read_dependencies(const SPIRBlock &block, uint32_t id)
{
	for (auto &i : block.ops)
	{
		auto ops = stream(i);
		auto op = static_cast<Op>(i.op);

		switch (op)
		{
		case OpFunctionCall:
		{
			uint32_t func = ops[2];
			register_global_read_dependencies(get<SPIRFunction>(func), id);
			break;
		}

		case OpLoad:
		case OpImageRead:
		{
			// If we're in a storage class which does not get invalidated, adding dependencies here is no big deal.
			auto *var = maybe_get_backing_variable(ops[2]);
			if (var && var->storage != StorageClassFunction)
			{
				auto &type = get<SPIRType>(var->basetype);

				// InputTargets are immutable.
				if (type.basetype != SPIRType::Image && type.image.dim != DimSubpassData)
					var->dependees.push_back(id);
			}
			break;
		}

		default:
			break;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, 0xc(%rsp)
movq 0x38(%rsi), %r14
movq 0x40(%rsi), %r13
cmpq %r13, %r14
je 0x12c84
movq %rdi, %rbx
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1b906
movzwl (%r14), %ecx
cmpl $0x62, %ecx
je 0x12c16
cmpl $0x3d, %ecx
je 0x12c16
cmpl $0x39, %ecx
jne 0x12c77
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0xb9ca
movl 0xc(%rsp), %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12c92
jmp 0x12c77
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x12cda
testq %rax, %rax
je 0x12c77
movq %rax, %r12
cmpl $0x7, 0x10(%rax)
je 0x12c77
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0xa426
cmpl $0xd, 0xc(%rax)
je 0x12c77
cmpl $0x6, 0x84(%rax)
je 0x12c77
movq 0x48(%r12), %rsi
cmpq 0x50(%r12), %rsi
je 0x12c68
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%r12)
jmp 0x12c77
addq $0x40, %r12
movq %r12, %rdi
movq %r15, %rdx
callq 0x7a00
addq $0xc, %r14
cmpq %r13, %r14
jne 0x12bdc
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::maybe_get_backing_variable(unsigned int)
SPIRVariable *Compiler::maybe_get_backing_variable(uint32_t chain)
{
	auto *var = maybe_get<SPIRVariable>(chain);
	if (!var)
	{
		auto *cexpr = maybe_get<SPIRExpression>(chain);
		if (cexpr)
			var = maybe_get<SPIRVariable>(cexpr->loaded_from);

		auto *access_chain = maybe_get<SPIRAccessChain>(chain);
		if (access_chain)
			var = maybe_get<SPIRVariable>(access_chain->loaded_from);
	}

	return var;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0xc7f4
movq %rax, %r14
testq %rax, %rax
je 0x12cf8
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1ba12
testq %rax, %rax
je 0x12d17
movl 0x34(%rax), %esi
movq %rbx, %rdi
callq 0xc7f4
movq %rax, %r14
jmp 0x12d1a
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1ba4c
testq %rax, %rax
je 0x12cf0
movl 0x5c(%rax), %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xc7f4
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::register_read(unsigned int, unsigned int, bool)
void Compiler::register_read(uint32_t expr, uint32_t chain, bool forwarded)
{
	auto &e = get<SPIRExpression>(expr);
	auto *var = maybe_get_backing_variable(chain);

	if (var)
	{
		e.loaded_from = var->self;

		// If the backing variable is immutable, we do not need to depend on the variable.
		if (forwarded && !is_immutable(var->self))
			var->dependees.push_back(e.self);

		// If we load from a parameter, make sure we create "inout" if we also write to the parameter.
		// The default is "in" however, so we never invalidate our compilation by reading.
		if (var && var->parameter)
			var->parameter->read_count++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %ebx
movq %rdi, %r15
callq 0x1ba86
movq %rax, %r14
movq %r15, %rdi
movl %ebx, %esi
callq 0x12cda
testq %rax, %rax
je 0x12db0
movq %rax, %rbx
movl 0x8(%rax), %esi
movl %esi, 0x34(%r14)
testb %bpl, %bpl
je 0x12da4
movq %r15, %rdi
callq 0x12dbc
testb %al, %al
jne 0x12da4
addq $0x8, %r14
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x12d95
movl (%r14), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rbx)
jmp 0x12da4
movq %rbx, %rdi
addq $0x40, %rdi
movq %r14, %rdx
callq 0x7a00
movq 0x68(%rbx), %rax
testq %rax, %rax
je 0x12db0
incl 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::is_immutable(unsigned int) const
bool Compiler::is_immutable(uint32_t id) const
{
	if (ir.ids[id].get_type() == TypeVariable)
	{
		auto &var = get<SPIRVariable>(id);

		// Anything we load from the UniformConstant address space is guaranteed to be immutable.
		bool pointer_to_const = var.storage == StorageClassUniformConstant;
		return pointer_to_const || var.phi_variable || !expression_is_lvalue(id);
	}
	else if (ir.ids[id].get_type() == TypeAccessChain)
		return get<SPIRAccessChain>(id).immutable;
	else if (ir.ids[id].get_type() == TypeExpression)
		return get<SPIRExpression>(id).immutable;
	else if (ir.ids[id].get_type() == TypeConstant || ir.ids[id].get_type() == TypeConstantOp ||
	         ir.ids[id].get_type() == TypeUndef)
		return true;
	else
		return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %eax
movq 0x20(%rdi), %rcx
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %eax
addl $-0x2, %eax
cmpl $0xb, %eax
ja 0x12e37
movl %esi, %ebp
movq %rdi, %rbx
movb $0x1, %r14b
leaq 0xa2acb(%rip), %rcx     # 0xb58b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1baba
cmpl $0x0, 0x10(%rax)
je 0x12e4a
cmpb $0x0, 0x5a(%rax)
jne 0x12e4a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13116
movq %rbx, %rdi
movl %eax, %esi
callq 0x1b9de
movl 0xc(%rax), %eax
addl $-0xd, %eax
cmpl $0x3, %eax
setb %r14b
jmp 0x12e4a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1bbf2
movb 0x65(%rax), %r14b
jmp 0x12e4a
xorl %r14d, %r14d
jmp 0x12e4a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1baee
movb 0x38(%rax), %r14b
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::register_write(unsigned int)
void Compiler::register_write(uint32_t chain)
{
	auto *var = maybe_get<SPIRVariable>(chain);
	if (!var)
	{
		// If we're storing through an access chain, invalidate the backing variable instead.
		auto *expr = maybe_get<SPIRExpression>(chain);
		if (expr && expr->loaded_from)
			var = maybe_get<SPIRVariable>(expr->loaded_from);

		auto *access_chain = maybe_get<SPIRAccessChain>(chain);
		if (access_chain && access_chain->loaded_from)
			var = maybe_get<SPIRVariable>(access_chain->loaded_from);
	}

	if (var)
	{
		// If our variable is in a storage class which can alias with other buffers,
		// invalidate all variables which depend on aliased variables.
		if (variable_storage_is_aliased(*var))
			flush_all_aliased_variables();
		else if (var)
			flush_dependees(*var);

		// We tried to write to a parameter which is not marked with out qualifier, force a recompile.
		if (var->parameter && var->parameter->write_count == 0)
		{
			var->parameter->write_count++;
			force_recompile = true;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0xc7f4
movq %rax, %r14
testq %rax, %rax
je 0x12e86
testq %r14, %r14
je 0x12ece
movq %rbx, %rdi
movq %r14, %rsi
callq 0x128de
movq %rbx, %rdi
testb %al, %al
je 0x12ea9
callq 0x12f00
jmp 0x12eb1
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1ba12
testq %rax, %rax
je 0x12ed3
movl 0x34(%rax), %esi
testl %esi, %esi
je 0x12ed3
movq %rbx, %rdi
callq 0xc7f4
movq %rax, %r14
jmp 0x12ed6
movq %r14, %rsi
callq 0x12f40
movq 0x68(%r14), %rax
testq %rax, %rax
je 0x12ece
cmpl $0x0, 0xc(%rax)
jne 0x12ece
movl $0x1, 0xc(%rax)
movb $0x1, 0x1d0(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1ba4c
testq %rax, %rax
je 0x12e68
movl 0x5c(%rax), %esi
testl %esi, %esi
je 0x12e68
movq %rbx, %rdi
callq 0xc7f4
movq %rax, %r14
jmp 0x12e68
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::flush_control_dependent_expressions(unsigned int)
void Compiler::flush_control_dependent_expressions(uint32_t block_id)
{
	auto &block = get<SPIRBlock>(block_id);
	for (auto &expr : block.invalidate_expressions)
		invalid_expressions.insert(expr);
	block.invalidate_expressions.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x78fe
movq %rax, %rbx
movq 0xe8(%rax), %r15
movq 0xf0(%rax), %r13
cmpq %r13, %r15
je 0x1304b
addq $0x198, %r14            # imm = 0x198
leaq 0x8(%rsp), %r12
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1fc02
addq $0x4, %r15
cmpq %r13, %r15
jne 0x1302f
movq 0xe8(%rbx), %rax
cmpq %rax, 0xf0(%rbx)
je 0x13062
movq %rax, 0xf0(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::flush_all_active_variables()
void Compiler::flush_all_active_variables()
{
	// Invalidate all temporaries we read from variables in this block since they were forwarded.
	// Invalidate all temporaries we read from globals.
	for (auto &v : current_function->local_variables)
		flush_dependees(get<SPIRVariable>(v));
	for (auto &arg : current_function->arguments)
		flush_dependees(get<SPIRVariable>(arg.id));
	for (auto global : global_variables)
		flush_dependees(get<SPIRVariable>(global));

	flush_all_aliased_variables();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x148(%rdi), %rax
movq 0x48(%rax), %r14
movq 0x50(%rax), %r15
cmpq %r15, %r14
je 0x130a8
movl (%r14), %esi
movq %rbx, %rdi
callq 0xb40a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12f40
addq $0x4, %r14
jmp 0x13087
movq 0x148(%rbx), %rax
movq 0x18(%rax), %r14
movq 0x20(%rax), %r15
cmpq %r15, %r14
je 0x130d9
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0xb40a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12f40
addq $0x14, %r14
jmp 0x130b7
movq 0x118(%rbx), %r14
movq 0x120(%rbx), %r15
cmpq %r15, %r14
je 0x13108
movl (%r14), %esi
movq %rbx, %rdi
callq 0xb40a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12f40
addq $0x4, %r14
jmp 0x130e7
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x12f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::expression_type_id(unsigned int) const
uint32_t Compiler::expression_type_id(uint32_t id) const
{
	switch (ir.ids[id].get_type())
	{
	case TypeVariable:
		return get<SPIRVariable>(id).basetype;

	case TypeExpression:
		return get<SPIRExpression>(id).expression_type;

	case TypeConstant:
		return get<SPIRConstant>(id).constant_type;

	case TypeConstantOp:
		return get<SPIRConstantOp>(id).basetype;

	case TypeUndef:
		return get<SPIRUndef>(id).basetype;

	case TypeCombinedImageSampler:
		return get<SPIRCombinedImageSampler>(id).combined_type;

	case TypeAccessChain:
		return get<SPIRAccessChain>(id).basetype;

	default:
		SPIRV_CROSS_THROW("Cannot resolve expression type.");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %eax
movq 0x20(%rdi), %rcx
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %eax
addl $-0x2, %eax
cmpl $0xb, %eax
ja 0x1318e
leaq 0xa27a3(%rip), %rcx     # 0xb58e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x1baba
jmp 0x1317d
callq 0x1bbbe
jmp 0x1317d
callq 0x1bb22
jmp 0x1317d
callq 0x1bbf2
jmp 0x1317d
callq 0x1baee
addq $0x30, %rax
jmp 0x13181
callq 0x1bb56
addq $0x28, %rax
jmp 0x13181
callq 0x1bb8a
addq $0xc, %rax
movl (%rax), %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xa2a75(%rip), %rsi     # 0xb5c20
leaq 0xa2a8d(%rip), %rdx     # 0xb5c3f
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe9bc5(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe9b9d(%rip), %rsi     # 0xfcd80
movq 0xeadee(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x13214
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x13214
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x13221
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::is_hidden_variable(spirv_cross::SPIRVariable const&, bool) const
bool Compiler::is_hidden_variable(const SPIRVariable &var, bool include_builtins) const
{
	if ((is_builtin_variable(var) && !include_builtins) || var.remapped_variable)
		return true;

	// Combined image samplers are always considered active as they are "magic" variables.
	if (find_if(begin(combined_image_samplers), end(combined_image_samplers), [&var](const CombinedImageSampler &samp) {
		    return samp.combined_id == var.self;
	    }) != end(combined_image_samplers))
	{
		return false;
	}

	bool hidden = false;
	if (check_active_interface_variables && storage_class_is_interface(var.storage))
		hidden = active_interface_variables.find(var.self) == end(active_interface_variables);
	return hidden;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x133a2
movl %eax, %ecx
xorb $0x1, %cl
orb %bpl, %cl
movb $0x1, %al
cmpb $0x1, %cl
jne 0x1339d
cmpb $0x0, 0x5b(%rbx)
jne 0x1339d
movq 0x1d8(%r14), %rcx
movq 0x1e0(%r14), %rax
movq %rax, %rdi
subq %rcx, %rdi
sarq $0x2, %rdi
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rdi
sarq $0x2, %rdi
testq %rdi, %rdi
jle 0x132e9
movl 0x8(%rbx), %r9d
leaq (%rdi,%rdi,2), %r8
shlq $0x4, %r8
addq %rcx, %r8
incq %rdi
addq $0x18, %rcx
movq %rcx, %rsi
cmpl %r9d, -0x18(%rsi)
je 0x13330
cmpl %r9d, -0xc(%rsi)
je 0x13336
cmpl %r9d, (%rsi)
je 0x13340
cmpl %r9d, 0xc(%rsi)
je 0x1333c
decq %rdi
addq $0x30, %rsi
cmpq $0x1, %rdi
jg 0x132c2
movq %r8, %rcx
movq %rax, %rdi
subq %rcx, %rdi
sarq $0x2, %rdi
imulq %rdx, %rdi
cmpq $0x1, %rdi
je 0x13322
cmpq $0x2, %rdi
je 0x13317
movq %rax, %rsi
cmpq $0x3, %rdi
jne 0x13340
movl (%rcx), %edx
cmpl 0x8(%rbx), %edx
je 0x1332b
addq $0xc, %rcx
movl (%rcx), %edx
cmpl 0x8(%rbx), %edx
je 0x1332b
addq $0xc, %rcx
movl (%rcx), %edx
cmpl 0x8(%rbx), %edx
cmovneq %rax, %rcx
movq %rcx, %rsi
jmp 0x13340
addq $-0x18, %rsi
jmp 0x13340
addq $-0xc, %rsi
jmp 0x13340
addq $0xc, %rsi
cmpq %rax, %rsi
jne 0x1339b
cmpb $0x1, 0x190(%r14)
jne 0x1339b
movl 0x10(%rbx), %ecx
xorl %eax, %eax
cmpl $0xc, %ecx
ja 0x1339d
movl $0x160f, %edx           # imm = 0x160F
btl %ecx, %edx
jae 0x1339d
leaq 0x158(%r14), %rdi
movl 0x8(%rbx), %ecx
addq $0x8, %rbx
movq %rcx, %rax
xorl %edx, %edx
divq 0x160(%r14)
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x1f088
movq %rax, %rcx
movb $0x1, %al
testq %rcx, %rcx
je 0x1339d
cmpq $0x0, (%rcx)
sete %al
jmp 0x1339d
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::is_builtin_variable(spirv_cross::SPIRVariable const&) const
bool Compiler::is_builtin_variable(const SPIRVariable &var) const
{
	if (var.compat_builtin || ir.meta[var.self].decoration.builtin)
		return true;
	else
		return is_builtin_type(get<SPIRType>(var.basetype));
}

// Assembly:
movb $0x1, %al
cmpb $0x0, 0x38(%rsi)
jne 0x13420
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rsi), %ecx
movq 0x38(%rdi), %rdx
imulq $0x148, %rcx, %rcx      # imm = 0x148
cmpb $0x0, 0xcc(%rdx,%rcx)
jne 0x1341f
movl 0xc(%rsi), %esi
movq %rbx, %rdi
callq 0x1b9de
movl 0x8(%rax), %eax
movq 0x38(%rbx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movq 0xd0(%rcx,%rax), %rdx
movq 0xd8(%rcx,%rax), %rcx
cmpq %rcx, %rdx
setne %al
je 0x1341f
cmpb $0x0, 0xcc(%rdx)
jne 0x1341f
addq $0xd0, %rdx
cmpq %rcx, %rdx
setne %al
je 0x1341f
cmpb $0x1, 0xcc(%rdx)
leaq 0xd0(%rdx), %rdx
jne 0x13407
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::get_first_entry_point(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Compiler::is_builtin_type(const SPIRType &type) const
{
	// We can have builtin structs as well. If one member of a struct is builtin, the struct must also be builtin.
	for (auto &m : ir.meta[type.self].members)
		if (m.builtin)
			return true;

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq 0xe0(%rdi), %rbx
testq %rbx, %rbx
je 0x16902
movq %rsi, %r14
leaq 0x70(%rsp), %r12
leaq 0x40(%rsp), %r13
leaq 0x20(%rsp), %rbp
movl 0x8(%rbx), %eax
movl %eax, (%rsp)
leaq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x1ee0a
movq 0x38(%rsp), %rdx
cmpq 0x8(%r14), %rdx
jne 0x1689c
testq %rdx, %rdx
je 0x168a1
movq (%r14), %rsi
movq 0x30(%rsp), %rdi
callq 0x6280
testl %eax, %eax
sete %r15b
jmp 0x168a4
xorl %r15d, %r15d
jmp 0x168a4
movb $0x1, %r15b
movq %r12, %rdi
callq 0xd5b0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x168c3
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x168da
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x168f1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
testb %r15b, %r15b
jne 0x16902
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x16863
testq %rbx, %rbx
je 0x16920
addq $0x10, %rbx
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9f59c(%rip), %rsi     # 0xb5ed9
leaq 0x9f5b0(%rip), %rdx     # 0xb5ef4
movq %rsp, %rdi
callq 0x7c64
movb $0x1, %bpl
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe6437(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe640f(%rip), %rsi     # 0xfcd80
movq 0xe7660(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x169a1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x169a1
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x169ae
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::is_member_builtin(spirv_cross::SPIRType const&, unsigned int, spv::BuiltIn*) const
bool Compiler::is_member_builtin(const SPIRType &type, uint32_t index, BuiltIn *builtin) const
{
	auto &memb = ir.meta[type.self].members;
	if (index < memb.size() && memb[index].builtin)
	{
		if (builtin)
			*builtin = memb[index].builtin_type;
		return true;
	}

	return false;
}

// Assembly:
movl 0x8(%rsi), %eax
movq 0x38(%rdi), %rsi
imulq $0x148, %rax, %rdi      # imm = 0x148
movl %edx, %eax
movq 0xd0(%rsi,%rdi), %rdx
movq 0xd8(%rsi,%rdi), %rsi
subq %rdx, %rsi
sarq $0x4, %rsi
movabsq $0x4ec4ec4ec4ec4ec5, %rdi # imm = 0x4EC4EC4EC4EC4EC5
imulq %rsi, %rdi
cmpq %rax, %rdi
jbe 0x134d0
imulq $0xd0, %rax, %rsi
cmpb $0x1, 0xcc(%rdx,%rsi)
jne 0x134d0
movb $0x1, %al
testq %rcx, %rcx
je 0x134cf
addq %rsi, %rdx
movl 0xa0(%rdx), %edx
movl %edx, (%rcx)
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::get_active_interface_variables() const
unordered_set<uint32_t> Compiler::get_active_interface_variables() const
{
	// Traverse the call graph and find all interface variables which are in use.
	unordered_set<uint32_t> variables;
	InterfaceVariableAccessHandler handler(*this, variables);
	traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);

	// If we needed to create one, we'll need it.
	if (dummy_sampler_id)
		variables.insert(dummy_sampler_id);

	return variables;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
movq %rax, (%rdi)
movq $0x1, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x3f800000, 0x20(%rdi) # imm = 0x3F800000
movups %xmm0, 0x28(%rdi)
leaq 0xe92ad(%rip), %rax     # 0xfd108
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movl 0x108(%rsi), %esi
movq %r14, %rdi
callq 0x1bc94
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x13ece
cmpl $0x0, 0x39c(%r14)
je 0x13eb0
addq $0x39c, %r14            # imm = 0x39C
leaq 0x20(%rsp), %rdx
movq %rbx, (%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1fc02
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xd5b0
movq %r14, %rdi
callq 0x64a0
// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::interface_variable_exists_in_entry_point(unsigned int) const
bool Compiler::interface_variable_exists_in_entry_point(uint32_t id) const
{
	auto &var = get<SPIRVariable>(id);
	if (var.storage != StorageClassInput && var.storage != StorageClassOutput &&
	    var.storage != StorageClassUniformConstant)
		SPIRV_CROSS_THROW("Only Input, Output variables and Uniform constants are part of a shader linking interface.");

	// This is to avoid potential problems with very old glslang versions which did
	// not emit input/output interfaces properly.
	// We can assume they only had a single entry point, and single entry point
	// shaders could easily be assumed to use every interface variable anyways.
	if (ir.entry_points.size() <= 1)
		return true;

	auto &execution = get_entry_point();
	return find(begin(execution.interface_variables), end(execution.interface_variables), id) !=
	       end(execution.interface_variables);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
callq 0x1baba
movl 0x10(%rax), %eax
cmpl $0x2, %eax
jb 0x13f85
cmpl $0x3, %eax
jne 0x13fe7
movb $0x1, %al
cmpq $0x2, 0xe8(%rbx)
jb 0x13fdc
leaq 0xd0(%rbx), %rdi
leaq 0x108(%rbx), %rcx
movl 0x108(%rbx), %r8d
movq %r8, %rax
xorl %edx, %edx
divq 0xd8(%rbx)
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x22394
movq (%rax), %rbx
movq 0x58(%rbx), %rdi
movq 0x60(%rbx), %rsi
leaq 0x4(%rsp), %rdx
callq 0x223da
cmpq 0x60(%rbx), %rax
setne %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xa1ef1(%rip), %rsi     # 0xb5ef5
leaq 0xa1f44(%rip), %rdx     # 0xb5f4f
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe8d6c(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe8d44(%rip), %rsi     # 0xfcd80
movq 0xe9f95(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1406d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x1406d
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x1407a
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0