LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::get_int(std::basic_ifstream<char, std::char_traits<char>>&) const
unsigned Emulator::get_int(ifstream& fi) const
{
    unsigned res = 0;

    char *ptr = (char *) &res;
    char byte = 0;

    if(machine_type==big_endian)    // just read byte and put it
    {
        fi.read(&byte, 1);
        *ptr = byte;
        ptr++;

        fi.read(&byte, 1);
        *ptr = byte;
        ptr++;

        fi.read(&byte, 1);
        *ptr = byte;
        ptr++;

        fi.read(&byte, 1);
        *ptr = byte;
    }

    else    // read and put in reverse order
    {
        ptr += 3;

        fi.read(&byte, 1);
        *ptr = byte;
        ptr--;

        fi.read(&byte, 1);
        *ptr = byte;
        ptr--;

        fi.read(&byte, 1);
        *ptr = byte;
        ptr--;

        fi.read(&byte, 1);
        *ptr = byte;
    }
    
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x3(%rsp), %rbx
movb $0x0, (%rbx)
movl 0x59d2(%rip), %eax      # 0x9200
movl %eax, 0x4(%rsp)
pushq $0x1
popq %r15
movq %rsi, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21e0
movzbl (%rbx), %r13d
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21e0
movzbl (%rbx), %r12d
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21e0
movzbl (%rbx), %ebp
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21e0
cmpl $0x1, 0x4(%rsp)
movzbl (%rbx), %eax
movl %r13d, %ecx
cmovel %eax, %ecx
movl %r12d, %edx
cmovel %ebp, %edx
cmovel %r12d, %ebp
cmovel %r13d, %eax
shll $0x18, %ecx
movl $0xff, %esi
andl %esi, %edx
shll $0x10, %edx
orl %ecx, %edx
andl %esi, %ebp
shll $0x8, %ebp
orl %edx, %ebp
andl %esi, %eax
orl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::current_state[abi:cxx11]() const
string Emulator::current_state() const
{
    ostringstream oss;

    oss<<setw(11)<<"PC = "<<PC<<"   ";
    oss<<setw(11)<<"SP = "<<SP<<"   ";
    oss<<setw(11)<<"A = "<<A<<"   ";
    oss<<setw(11)<<"B = "<<B<<"   ";
    
    oss<<"Memory Content = "<<"0x"<<setw(8)<<setfill('0')<<hex<<mempory_space[PC]<<dec<<setfill(' ')<<"   ";

    oss<<" "<<reverse_decode(mempory_space[PC]);


    return oss.str();

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x2220
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x38(%rsp,%rax)
leaq 0x273f(%rip), %rsi      # 0x6519
movq %r15, %rdi
callq 0x2180
movl 0x28(%r14), %esi
movq %rax, %rdi
callq 0x22a0
leaq 0x272a(%rip), %rsi      # 0x651f
movq %rax, %rdi
callq 0x2180
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x38(%rsp,%rax)
leaq 0x2767(%rip), %rsi      # 0x6580
callq 0x2180
movl 0x2c(%r14), %esi
movq %rax, %rdi
callq 0x22a0
leaq 0x26ee(%rip), %rsi      # 0x651f
movq %rax, %rdi
callq 0x2180
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x38(%rsp,%rax)
leaq 0x2731(%rip), %rsi      # 0x6586
callq 0x2180
movl 0x20(%r14), %esi
movq %rax, %rdi
callq 0x22a0
leaq 0x26b2(%rip), %rsi      # 0x651f
movq %rax, %rdi
callq 0x2180
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x38(%rsp,%rax)
leaq 0x26fa(%rip), %rsi      # 0x658b
callq 0x2180
movl 0x24(%r14), %esi
movq %rax, %rdi
callq 0x22a0
leaq 0x2676(%rip), %rsi      # 0x651f
movq %rax, %rdi
callq 0x2180
leaq 0x266b(%rip), %rsi      # 0x6523
leaq 0x28(%rsp), %rdi
callq 0x2180
leaq 0x266c(%rip), %rsi      # 0x6535
movq %rax, %rdi
callq 0x2180
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x8, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq 0x30(%r14), %rcx
movslq 0x28(%r14), %rdx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x22a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x2260
leaq 0x25e4(%rip), %rsi      # 0x651f
movq %rax, %rdi
callq 0x2180
leaq 0x25d7(%rip), %rsi      # 0x6521
leaq 0x28(%rsp), %rdi
callq 0x2180
movq %rax, %r15
movq 0x30(%r14), %rax
movslq 0x28(%r14), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x8(%rsp), %rdi
callq 0x432a
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2170
leaq 0x8(%rsp), %rdi
callq 0x20c0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x2270
leaq 0x28(%rsp), %rdi
callq 0x2060
movq %rbx, %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
jmp 0x3fbe
jmp 0x3fbb
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::check_PC(int)
bool Emulator::check_PC(int a)
{
    if(a<0 || a>pc_upper)
    {
        fault = true;
        string tmp = faults.find(0)->second;
        PC--;
        string tmp2 = current_state();
        PC++;

        fault_cause = tmp + " when executing " + tmp2;

        return false;
    }

    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl %esi, %ebx
cmpl $0x400, %esi            # imm = 0x400
jb 0x4084
movq %rdi, %r14
movb $0x1, 0x51(%rdi)
movq %rsp, %rsi
andl $0x0, (%rsi)
leaq 0x51d2(%rip), %rdi      # 0x91d0
callq 0x4f9e
leaq 0x28(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0x2230
decl 0x28(%r14)
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3da4
incl 0x28(%r14)
leaq 0x24dd(%rip), %rdx      # 0x6508
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x48e1
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x4919
addq $0x58, %r14
leaq 0x60(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d0
movq %r15, %rdi
callq 0x20c0
leaq 0x20(%rsp), %rdi
callq 0x20c0
movq %rsp, %rdi
callq 0x20c0
leaq 0x40(%rsp), %rdi
callq 0x20c0
cmpl $0x400, %ebx            # imm = 0x400
setb %al
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20c0
jmp 0x40ac
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20c0
jmp 0x40b9
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::check_SP(int)
bool Emulator::check_SP(int a)
{
    if(a>end_address || a<=data_upper)
    {
        fault = true;
        string tmp = faults.find(1)->second;
        PC--;
        string tmp2 = current_state();
        PC++;

        fault_cause = tmp + " when executing " + tmp2;
        return false;
    }

    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
cmpl $0x10000, %esi          # imm = 0x10000
setb %al
cmpl %esi, 0x38(%rdi)
setl %bl
andb %al, %bl
jne 0x42d4
movq %rdi, %r14
movb $0x1, 0x51(%rdi)
movq %rsp, %rsi
movl $0x1, (%rsi)
leaq 0x4f82(%rip), %rdi      # 0x91d0
callq 0x4f9e
leaq 0x28(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0x2230
decl 0x28(%r14)
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3da4
incl 0x28(%r14)
leaq 0x228d(%rip), %rdx      # 0x6508
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x48e1
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x4919
addq $0x58, %r14
leaq 0x60(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d0
movq %r15, %rdi
callq 0x20c0
leaq 0x20(%rsp), %rdi
callq 0x20c0
movq %rsp, %rdi
callq 0x20c0
leaq 0x40(%rsp), %rdi
callq 0x20c0
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20c0
jmp 0x42f5
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20c0
jmp 0x4302
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::reverse_decode[abi:cxx11](unsigned int) const
string Emulator::reverse_decode(unsigned a) const
{
    unsigned opcode = (a<<24)>>24;

    ostringstream oss;

    map<unsigned, pair<unsigned, string> >::const_iterator mt = decoder.find(opcode);

    string mnem = mt->second.second;    // storing the mnemonic

    oss<<mnem;

    if(mt->second.first==1)     // operand also present
    {
        int tmp = a & 0xffffff00;
        tmp /= 256;

        oss<<" "<<tmp;
    }

    return oss.str();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movl %edx, %ebp
movq %rdi, %rbx
movzbl %bpl, %eax
leaq 0x4(%rsp), %r14
movl %eax, (%r14)
leaq 0x28(%rsp), %rdi
callq 0x2220
leaq 0x4e49(%rip), %rdi      # 0x91a0
movq %r14, %rsi
callq 0x4ff0
movq %rax, %r14
leaq 0x30(%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0x2230
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2170
cmpl $0x1, 0x28(%r14)
jne 0x43a4
leaq 0x2194(%rip), %rsi      # 0x6521
leaq 0x28(%rsp), %rdi
callq 0x2180
sarl $0x8, %ebp
movq %rax, %rdi
movl %ebp, %esi
callq 0x22a0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
callq 0x20c0
leaq 0x28(%rsp), %rdi
callq 0x2060
movq %rbx, %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x43dd
jmp 0x43d8
movq %rax, %rbx
jmp 0x43ea
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
leaq 0x28(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::disassemble(std::ostream&) const
void Emulator::disassemble(ostream& os) const
{
    for(int i=0; i<text_size; ++i)
    {
        string tmp = reverse_decode(mempory_space[i]);

        os<<"PC = ";
        os<<setw(10)<<setfill('0')<<i<<setfill(' ')<<"   ";

        os<<"Memory Content = ";
        os<<"0x"<<setw(8)<<setfill('0')<<hex<<mempory_space[i]<<dec<<setfill(' ')<<"   ";

        cout<<" "<<tmp<<endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
pushq $0x20
popq %r13
leaq 0x20fc(%rip), %rbp      # 0x651f
movl 0x48(%r14), %eax
cmpq %rax, %r15
jae 0x454a
movq 0x30(%r14), %rax
movl (%rax,%r15,4), %edx
movq %r12, %rdi
callq 0x432a
movq %rbx, %rdi
leaq 0x20cf(%rip), %rsi      # 0x6519
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%rbx,%rax)
movq %rbx, %rdi
pushq $0x30
popq %rsi
callq 0x2260
movq %rax, %rdi
movl %r15d, %esi
callq 0x22a0
movq %rax, %rdi
movl %r13d, %esi
callq 0x2260
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2180
movq %rbx, %rdi
leaq 0x208e(%rip), %rsi      # 0x6523
callq 0x2180
movq %rbx, %rdi
leaq 0x2091(%rip), %rsi      # 0x6535
callq 0x2180
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x8, 0x10(%rax,%rcx)
movq %rax, %rdi
pushq $0x30
popq %rsi
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq 0x30(%r14), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x22a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movl %r13d, %esi
callq 0x2260
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2180
movq 0x4ab5(%rip), %rdi      # 0x8fd0
leaq 0x1fff(%rip), %rsi      # 0x6521
callq 0x2180
movq %rax, %rdi
movq %r12, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %r12, %rdi
callq 0x20c0
incq %r15
jmp 0x4423
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::memory_dump(std::ostream&) const
void Emulator::memory_dump(ostream& os) const
{
    int per_line = 4;

    os<<hex<<showbase;

    os<<"Text Segment :-\n\tsize = "<<text_size<<'\n';

    unsigned i = pc_lower;
    while(i<text_size)
    {
        os<<i<<": "<<mempory_space[i]<<'\n';
        i++;
    }

    os<<"\n\n";

    os<<"Data Segment :-\n\tsize = "<<data_size<<'\n';
    i = 0;
    while(i<data_size)
    {
        os<<i+data_lower<<": "<<mempory_space[i+data_lower];
        os<<"  (In decimal: "<<dec<<mempory_space[i+data_lower]<<hex<<")\n";
        i++;
    }


    os<<'\n'<<noshowbase;

    os<<dec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq -0x18(%rax), %rcx
movl 0x18(%rsi,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rsi,%rcx)
movq -0x18(%rax), %rax
orl $0x200, 0x18(%rsi,%rax) # imm = 0x200
leaq 0x1f91(%rip), %rsi      # 0x6538
movq %rbx, %rdi
callq 0x2180
movl 0x48(%r14), %esi
movq %rax, %rdi
callq 0x2110
pushq $0xa
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x21c0
xorl %r15d, %r15d
leaq 0x1fa8(%rip), %r12      # 0x657a
movl 0x48(%r14), %eax
cmpq %rax, %r15
jae 0x4610
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2110
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movq 0x30(%r14), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x22a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x21c0
incq %r15
jmp 0x45d2
leaq 0x1f3a(%rip), %rsi      # 0x6551
movq %rbx, %rdi
callq 0x2180
leaq 0x1f2e(%rip), %rsi      # 0x6554
movq %rbx, %rdi
callq 0x2180
movl 0x4c(%r14), %esi
movq %rax, %rdi
callq 0x2110
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x21c0
movl $0x400, %r15d           # imm = 0x400
leaq 0x1f1b(%rip), %r12      # 0x656d
leaq 0x1f24(%rip), %r13      # 0x657d
leaq -0x400(%r15), %rax
movl 0x4c(%r14), %ecx
cmpq %rcx, %rax
jae 0x46f0
movl %r15d, %ebp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2110
movq %rax, %rdi
leaq 0x1ef5(%rip), %rsi      # 0x657a
callq 0x2180
movq 0x30(%r14), %rcx
movl (%rcx,%rbp,4), %esi
movq %rax, %rdi
callq 0x22a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2180
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movq 0x30(%r14), %rcx
movl (%rcx,%rbp,4), %esi
movq %rax, %rdi
callq 0x22a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
incq %r15
jmp 0x4659
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x21c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
andl $0xfffffdff, 0x18(%rax,%rcx) # imm = 0xFFFFFDFF
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nmmmnu[P]HM3/hm3/flushlist.h
// Function: bool hm3::FlushList<hm3::SkipList, hm3::flusher::DiskFileFlusher<hm3::idgenerator::IDGeneratorDate>, std::nullptr_t>::putT_<hm3::Pair>(hm3::Pair&&)
bool putT_(UPAIR &&data){
		bool const result = list_.put( std::forward<UPAIR>(data) );

		if (list_.getBytes() > maxSize_){
			flush();
			list_.removeAll();
			notifyLoader_(loader_);
		}

		return result;
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x348a
movl %eax, %ebp
movq (%rbx), %rax
movq 0x210(%rax), %rax
cmpq 0x60(%rbx), %rax
jbe 0x3086
movq %rbx, %rdi
callq 0x2a82
movq (%rbx), %rdi
callq 0x3264
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scn2img/scn2img.cpp
// Function: CaptureInteger(gaps::R2Grid&)
static int
CaptureInteger(R2Grid& image)
{
  // Allocate pixel buffer
  unsigned char *pixels = new unsigned char [ 3 * width * height ];

  // Set packing parameters for glReadPixels
  if ((width % 4) != 0) glPixelStorei(GL_PACK_ALIGNMENT, 1);

  // Run main loop  -- never returns   // Read pixels
  glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels);

  // Fill image
  unsigned char *pixelp = pixels;
  for (int iy = 0; iy < height; iy++) {
    for (int ix = 0; ix < width; ix++) {
      unsigned int red = *pixelp++;
      unsigned int green = *pixelp++;
      unsigned int blue = *pixelp++;
      unsigned int value = 0;
      value |= red << 16;
      value |= green <<  8;
      value |= blue;
      image.SetGridValue(ix, iy, value);
    }
  }

  // Delete pixels
  delete [] pixels;
  
  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x11c613(%rip), %ebp    # 0x1439c0
movl 0x11c610(%rip), %r15d   # 0x1439c4
movl %ebp, %eax
imull %r15d, %eax
leal (%rax,%rax,2), %eax
movslq %eax, %rdi
callq 0x22040
movq %rax, %r14
testb $0x3, %bpl
je 0x273e8
pushq $0x1
popq %rsi
movl $0xd05, %edi            # imm = 0xD05
callq 0x22400
movl 0x11c5df(%rip), %ebp    # 0x1439c0
movl 0x11c5dc(%rip), %r15d   # 0x1439c4
movq %r14, (%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x1907, %r8d           # imm = 0x1907
movl $0x1401, %r9d           # imm = 0x1401
callq 0x223b0
movl 0x11c5b5(%rip), %eax    # 0x1439c4
movl 0x11c5ab(%rip), %ecx    # 0x1439c0
testl %ecx, %ecx
cmovlel %r12d, %ecx
testl %eax, %eax
cmovlel %r12d, %eax
movq %r14, %rdx
cmpl %eax, %r12d
je 0x2747c
movl 0xc8(%rbx), %esi
imull %r12d, %esi
movslq %esi, %rsi
shlq $0x3, %rsi
addq 0xb8(%rbx), %rsi
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x27477
movzbl (%rdx), %r8d
movzbl 0x1(%rdx), %r9d
movzbl 0x2(%rdx), %r10d
addq $0x3, %rdx
shll $0x10, %r8d
shll $0x8, %r9d
orl %r8d, %r9d
orl %r10d, %r9d
cvtsi2sd %r9d, %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
jmp 0x27443
incl %r12d
jmp 0x27424
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22c00
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scn2img/scn2img.cpp
// Function: DrawRootWithOpenGL(gaps::R3Camera const&, gaps::R3Scene*, int, int)
static void
DrawRootWithOpenGL(const R3Camera& camera, R3Scene *scene, int color_scheme, RNBoolean omit_objects = FALSE)
{
  // This is a hack to account for coincident front and back faces
  glDepthRange(0, 0.999999);
  glEnable(GL_CULL_FACE);
  R3null_material.Draw();
  DrawNodeWithOpenGL(camera, scene, scene->Root(), color_scheme, omit_objects);
  glDisable(GL_CULL_FACE);
  glDepthRange(0, 1);
  R3null_material.Draw();
  DrawNodeWithOpenGL(camera, scene, scene->Root(), color_scheme, omit_objects);
  R3null_material.Draw();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movsd 0xabdd1(%rip), %xmm1    # 0xd50b0
xorps %xmm0, %xmm0
callq 0x23050
movl $0xb44, %edi            # imm = 0xB44
callq 0x227f0
leaq 0x11fb08(%rip), %r12    # 0x148e00
movq %r12, %rdi
xorl %esi, %esi
callq 0x417ec
movq (%r14), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x2935e
movl $0xb44, %edi            # imm = 0xB44
callq 0x22200
movsd 0xabd49(%rip), %xmm1    # 0xd5070
xorps %xmm0, %xmm0
callq 0x23050
movq %r12, %rdi
xorl %esi, %esi
callq 0x417ec
movq (%r14), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x2935e
movq %r12, %rdi
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x417ec
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scn2img/scn2img.cpp
// Function: LoadInteger(int)
static void
LoadInteger(int value)
{
  // Set color to represent an integer (24 bits)
  unsigned char color[4];
  color[0] = (value >> 16) & 0xFF;
  color[1] = (value >>  8) & 0xFF;
  color[2] = (value      ) & 0xFF;
  RNLoadRgb(color);
}

// Assembly:
pushq %rax
movl %edi, %eax
movl %edi, %ecx
shrl $0x10, %ecx
leaq 0x4(%rsp), %rdi
movb %cl, (%rdi)
movb %ah, 0x5(%rsp)
movb %al, 0x2(%rdi)
callq 0x22b80
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scn2img/scn2img.cpp
// Function: EstimateGroundY(gaps::R3Camera const&, gaps::R3Scene*)
static RNScalar
EstimateGroundY(const R3Camera& camera, R3Scene *scene)
{
  // Get convenient variables
  if (!scene) return 0;

  // Check if scene has a node named "Room#*" containing camera
  for (int i = 0; i < scene->NNodes(); i++) {
    R3SceneNode *node = scene->Node(i);
    if (node->Name() && !strncmp(node->Name(), "Room#", 5)) {
      if (R3Contains(node->BBox(), camera.Origin())) {
        return node->BBox().YMin();
      }
    }
  }

#if 0
  // Check first intersection with ray cast straight down
  if (R3Contains(scene->BBox(), camera.Origin())) {
    R3Ray ray(camera.Origin(), R3negy_vector);
    R3Point position;
    R3Vector normal;
    if (scene->Intersects(ray, NULL, NULL, NULL, &position, &normal)) {
      if (normal.Y() > 0.9) return position.Y();
    }
  }
#endif
  
  // If all else fails, return bounding box ymin
  return scene->BBox().YMin();
}

// Assembly:
testq %rsi, %rsi
je 0x29b6a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0xab867(%rip), %r15     # 0xd5369
pushq $0x5
popq %r12
movslq 0x14(%rbx), %rax
cmpq %rax, %rbp
jge 0x29b4e
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %r13
movq 0x1a0(%r13), %rdi
testq %rdi, %rdi
je 0x29b49
movq %r15, %rsi
movq %r12, %rdx
callq 0x223d0
testl %eax, %eax
jne 0x29b49
movq %r13, %rdi
callq 0x3ae92
movq %rax, %rdi
movq %r14, %rsi
callq 0x490b0
testl %eax, %eax
jne 0x29b6e
incq %rbp
jmp 0x29b06
movq %rbx, %rdi
callq 0x29f28
movsd 0x10(%rax), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
retq
movq %r13, %rdi
callq 0x3ae92
jmp 0x29b56
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: purselcp(unsigned int*, int*, int*, int*, int)
int purselcp(unsigned int *T,int *P,int *P_2,int *I,int p){
    //Get Longest Common Prefix of the purse No.i and the purse No.i-1
    // if i = 0 : return 0.
    if(p<1){return 0;} 
    int a = 0;
    while(a<P_2[I[p-1]]){ 
        if(T[P[I[p-1]]+a] == T[P[I[p]]+a]){ 
            a++;
        }
        else{
            break;
        }
    }
    return a; 
}

// Assembly:
testl %r8d, %r8d
jle 0x134e
movl %r8d, %r8d
movslq -0x4(%rcx,%r8,4), %r9
movl (%rdx,%r9,4), %eax
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpl %edx, %eax
je 0x1353
movl (%rsi,%r9,4), %r10d
addl %edx, %r10d
movslq %r10d, %r10
movl (%rdi,%r10,4), %r10d
movslq (%rcx,%r8,4), %r11
movl (%rsi,%r11,4), %r11d
addl %edx, %r11d
movslq %r11d, %r11
cmpl (%rdi,%r11,4), %r10d
jne 0x1351
incl %edx
jmp 0x1324
xorl %eax, %eax
retq
movl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: bbsort(unsigned int*, int*, int*, int*, int, int, int)
void bbsort(unsigned int *T,int *P,int *P_2,int *I,int a,int b,int c){
    //to sort [c] purse(s) with [a]-th character from position [b] in I.
    //[c is really small] 
    sortstack--;
    if(DEBUGFLAG==1){printf("\nbbsort(%d,%d,%d)",a,b,c);}
    for(int i = 0;i<c;i++){
        int k = i;
        //int bc = T[P[I[b+i]]+a]; //a-th character in I[b+i]
        if(a+1 > P_2[I[b+i]]){continue;} //
        for(int j = i; j<c; j++){
            if(a+1 > P_2[I[b+j]]){k = j;break;}  //if the purse [i] doesn't have a-th character,exactly it's smaller;
            else{ //check next cheracter until one of each purse reaches the end
                int d = a;
                while(1){
                    //printf("\n[%d]",d);
                    if(T[P[I[b+k]]+d] > T[P[I[b+j]]+d]){k = j;break;}
                    if(T[P[I[b+k]]+d] < T[P[I[b+j]]+d]){break;}
                    d++;
                    if(d+1 > P_2[I[b+k]]){break;}
                    if(d+1 > P_2[I[b+j]]){k=j;break;}
                }
            }
        }
        if(k!=i){
            //printf("swap!");
            int tem = I[b+i];
            I[b+i] = I[b+k];
            I[b+k] = tem;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r9d, %eax
movl 0x38(%rsp), %r10d
decl 0x3df4(%rip)            # 0x5160
movslq %r8d, %r9
movq %rax, -0x20(%rsp)
cltq
xorl %ebx, %ebx
testl %r10d, %r10d
movl $0x0, %r15d
cmovgl %r10d, %r15d
leaq (%rcx,%rax,4), %r14
incq %r9
movq %r15, -0x18(%rsp)
cmpq %r15, %rbx
je 0x144d
movslq (%r14,%rbx,4), %rax
cmpl %r8d, (%rdx,%rax,4)
jle 0x1445
movq %rax, -0x10(%rsp)
movq %rbx, %r12
movq %rbx, %r13
movq %rbx, -0x8(%rsp)
movl 0x38(%rsp), %eax
cmpq %rax, %r13
je 0x141a
movslq (%r14,%r13,4), %rax
movslq (%rdx,%rax,4), %rbp
cmpl %r8d, %ebp
jle 0x1417
movq -0x20(%rsp), %r10
addl %r12d, %r10d
movslq %r10d, %r10
movslq (%rcx,%r10,4), %rbx
movslq (%rsi,%rbx,4), %r10
movslq (%rsi,%rax,4), %rax
leaq (%rdi,%r10,4), %r15
leaq (%rdi,%rax,4), %rax
movq %r9, %r10
movl -0x4(%rax,%r10,4), %r11d
cmpl %r11d, -0x4(%r15,%r10,4)
ja 0x140f
jb 0x1412
incq %r10
movslq (%rdx,%rbx,4), %r11
cmpq %r11, %r10
jg 0x1412
cmpq %rbp, %r10
jle 0x13f0
movl %r13d, %r12d
incq %r13
jmp 0x13b8
movl %r13d, %r12d
movl %r12d, %eax
movq -0x8(%rsp), %rbx
cmpq %rax, %rbx
movq -0x18(%rsp), %r15
movq -0x10(%rsp), %r13
je 0x1445
addl -0x20(%rsp), %r12d
movslq %r12d, %rax
movl (%rcx,%rax,4), %r10d
movl %r10d, (%r14,%rbx,4)
movl %r13d, (%rcx,%rax,4)
incq %rbx
jmp 0x1391
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: purse(unsigned int*, int*, int*, long)
int purse(unsigned int *T,int *P,int *P_2,long int fsize){ //purse T and set P.
    std::cout << std::endl;
    int tn = -1; //temporary number
    int pn = 1;
    P[0] = 0;
    for (int i = 0 ; i < fsize-1 ; i++){
        if(T[i] > T[i+1]){ //T[i]がL 
            tn = i;
        }
        if(T[i] < T[i+1] && tn != -1){
            P[pn] = tn+1;
            P_2[pn-1] = P[pn] - P[pn-1];
            pn++;
            tn = -1;
        }
    }
    P[pn] = tn+1;
    P_2[pn-1] = fsize - P[pn-1]; //not to left last character
    
    int k = 0;
    for(int i = 0 ; i < fsize ; i++){
        if(P[k]==i){
            if(i+40 > fsize){printf("(%d,%d)",P[k],P_2[k]);}
            k++;
        }
        //if(i > fsize/2){exit(3);}
        if(i+40 > fsize){
            std::cout << std::hex << int(T[i]);
            std::cout << " ";
        }
    }
    return pn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, (%rsp)
movq %rsi, %r14
movq %rdi, %r12
movq 0x3982(%rip), %rdi      # 0x4fd8
callq 0x1080
movq %rbx, %r11
movq %r14, 0x8(%rsp)
andl $0x0, (%r14)
cmpq $0x2, %rbx
pushq $0x1
popq %rax
cmovgeq %rbx, %rax
decq %rax
pushq $0x1
popq %rbp
xorl %edi, %edi
pushq $-0x1
popq %rcx
movq %rdi, %r9
movl %ecx, %esi
movl %ebp, %r8d
movslq %ebp, %rdx
cmpq %r9, %rax
je 0x16ca
movl (%r12,%r9,4), %r10d
leaq 0x1(%r9), %rdi
cmpl 0x4(%r12,%r9,4), %r10d
cmoval %r9d, %esi
movq %rdi, %r9
jae 0x1682
movq %rdi, %r9
cmpl $-0x1, %esi
je 0x1682
incl %esi
movq 0x8(%rsp), %r9
movl %esi, (%r9,%r8,4)
subl -0x4(%r9,%rdx,4), %esi
movq (%rsp), %r8
movl %esi, -0x4(%r8,%rdx,4)
incl %edx
movl %edx, %ebp
jmp 0x167d
incl %esi
movq 0x8(%rsp), %rax
movl %esi, (%rax,%r8,4)
movl -0x4(%rax,%rdx,4), %eax
movl %r11d, %ecx
subl %eax, %ecx
movq (%rsp), %rax
movl %ecx, -0x4(%rax,%rdx,4)
testq %r11, %r11
movl $0x0, %r14d
cmovgq %r11, %r14
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %r11, 0x10(%rsp)
cmpq %r15, %r14
je 0x1782
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movl (%rcx,%rax,4), %esi
leaq 0x28(%r15), %rbx
cmpq %rsi, %r15
jne 0x1739
cmpq %r11, %rbx
jbe 0x1736
movq (%rsp), %rcx
movl (%rcx,%rax,4), %edx
leaq 0x18e6(%rip), %rdi      # 0x3010
xorl %eax, %eax
callq 0x1030
movq 0x10(%rsp), %r11
incl %r13d
cmpq %r11, %rbx
jbe 0x177a
movq 0x3893(%rip), %rbx      # 0x4fd8
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl (%r12,%r15,4), %esi
movq %rbx, %rdi
callq 0x11a0
movq %rbx, %rdi
leaq 0x1abe(%rip), %rsi      # 0x322e
callq 0x10f0
movq 0x10(%rsp), %r11
incq %r15
jmp 0x16fe
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: pnsort(unsigned int*, int*, int*, int*, int)
void pnsort(unsigned int *T,int *P,int *P_2, int *I,int pn){ //Sort all purses
    nextsort = (int(*)[3])malloc(sizeof(int) * 1000000 * 3);
    sortstack = 0; 
    csort(T,P,P_2,I,0,0,pn); //sort (one time)
    while(sortstack >= 0){
        if(nextsort[sortstack][2]<1000){
            bbsort(T,P,P_2,I,nextsort[sortstack][0],nextsort[sortstack][1],nextsort[sortstack][2]);
        }
        else{
            csort(T,P,P_2,I,nextsort[sortstack][0],nextsort[sortstack][1],nextsort[sortstack][2]);
        }
    }
    free(nextsort);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0xb71b00, %edi         # imm = 0xB71B00
callq 0x1140
movq %rax, 0x3999(%rip)      # 0x5158
andl $0x0, 0x399a(%rip)      # 0x5160
movl %ebp, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1458
movslq 0x3979(%rip), %rax      # 0x5160
movq 0x396a(%rip), %rdi      # 0x5158
testq %rax, %rax
js 0x1832
imulq $0xc, %rax, %rcx
movl 0x8(%rdi,%rcx), %eax
movl (%rdi,%rcx), %r8d
movl 0x4(%rdi,%rcx), %r9d
cmpl $0x3e7, %eax            # imm = 0x3E7
jg 0x1821
movl %eax, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1354
jmp 0x17e0
movl %eax, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
jmp 0x17db
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1120
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: makedic(unsigned int*, int*, int*, int*, unsigned int*, unsigned int*, int*, int*, int)
void makedic(unsigned int *T,int *P,int *P_2,int *K,unsigned int *NS,unsigned int *D,int *D_2,int *D_3,int f){ 
    //make dictionary
    printf("\nf = %d / dcs[%d]=%d dc2s[%d] = %d\n",f,f+1,dcs[f+1],f+1,dc2s[f+1]);
    int t = 0; //the number of the kind of different purse
    int starti = dc2s[f];
    int starts = dcs[f]; 
    int s = starts;
    if(DEBUGFLAG==1){printf("\n%d,%d,%d",dc2s[f+1],dcs[f+1],starts);}
    for(int i = starti;i<=dc2s[f+1];i++){ //t = dc2s[f+1]
        int a = 0;
        D_3[i] = 0;
        D_2[i] = s;
        if(DEBUGFLAG==1){printf("\n[%d]",i);}
        while(a<P_2[K[t]]){
            D[s] = T[P[K[t]]+a];
            if(DEBUGFLAG==1){printf("%x ",D[s]);}
            if(f>0){D_3[i]+= D_3[dc2s[f-1]+T[P[K[t]]+a]];}
            if(f==0){D_3[i]++;}
            s++;
            a++;
        }
        if(DEBUGFLAG==1){printf(" / %d:%d:%d /",i,D_2[i],D_3[i]);}
        t++;
    }
    dc2s[f+1]++;
    D_2[dc2s[f+1]] = s;
    printf("\ns = %d, t = %d, dc2s[f+1] = %d\n",s,t,dc2s[f+1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movslq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rbp
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x1(%rsi), %rax
movq %rax, 0x10(%rsp)
leal 0x1(%rsi), %edx
leaq 0x38e7(%rip), %rax      # 0x5170
movl 0x4(%rax,%rsi,4), %ecx
leaq 0x392c(%rip), %rax      # 0x51c0
movl 0x4(%rax,%rsi,4), %r9d
movq %rsi, 0x18(%rsp)
leaq 0x1773(%rip), %rdi      # 0x3018
xorl %ebx, %ebx
movl %edx, %r8d
xorl %eax, %eax
callq 0x1030
leaq 0x3908(%rip), %rax      # 0x51c0
movq %rax, %r10
movq 0x18(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
leaq 0x38a5(%rip), %rdx      # 0x5170
movl (%rdx,%rcx,4), %esi
movq %rcx, %r11
decl %ecx
pushq $0x1
popq %rdx
movq 0x10(%rsp), %rdi
movslq (%r10,%rdi,4), %rdi
cmpq %rdi, %rax
jg 0x1952
andl $0x0, (%rbp,%rax,4)
movq 0x8(%rsp), %rdi
movl %esi, (%rdi,%rax,4)
movslq %esi, %rdi
movq 0x20(%rsp), %r8
leaq (%r8,%rdi,4), %r8
xorl %edi, %edi
movslq (%r14,%rbx,4), %r9
cmpl (%r15,%r9,4), %edi
jge 0x1948
movslq (%r12,%r9,4), %r9
addq %rdi, %r9
movl (%r13,%r9,4), %r9d
movl %r9d, (%r8,%rdi,4)
testl %r11d, %r11d
jle 0x193e
movslq (%r14,%rbx,4), %r9
movslq (%r12,%r9,4), %r9
addq %rdi, %r9
movl (%r13,%r9,4), %r9d
addl (%r10,%rcx,4), %r9d
movl (%rbp,%r9,4), %r9d
addl %r9d, (%rbp,%rax,4)
jmp 0x1943
movl %edx, %r9d
je 0x1937
incq %rdi
jmp 0x18ff
addl %edi, %esi
incq %rbx
incq %rax
jmp 0x18d6
leaq 0x1(%rdi), %rax
movq 0x10(%rsp), %rcx
movl %eax, (%r10,%rcx,4)
movq 0x8(%rsp), %rax
movl %esi, 0x4(%rax,%rdi,4)
movl (%r10,%rcx,4), %ecx
leaq 0x16c9(%rip), %rdi      # 0x303c
movl %ebx, %edx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: grammarmake(unsigned int*, int*, int*, int*, unsigned int*, int*, int)
int grammarmake(unsigned int *T,int *P,int *P_2,int *I,unsigned int *NS,int *K,int pn){ //文法を表示し，文法の総数tを返す．
    int t = -1; 
    for(int i = 0; i < pn; i++){ //check all purse in lexiorder
        int k = purselcp(T,P,P_2,I,i);
        if(k != P_2[I[i]]){
            codeA += P_2[I[i]];
            codeB += P_2[I[i]] - k;
            t++;
            K[t] = I[i]; //K[t] = t-th smallest purse in current round
        }
        NS[I[i]] = t; //transform T and put it into NS
    }
    printf("\nthe kind of all purse = %d",t+1);
    printf("\nsum of length of rightside characters = %d",codeA);
    printf("\n(when Front Encoding = %d)\n",codeB);
    return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, (%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movl 0x50(%rsp), %ebp
xorl %r15d, %r15d
testl %ebp, %ebp
cmovlel %r15d, %ebp
pushq $-0x1
popq %rbx
cmpq %r15, %rbp
je 0x1a1c
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x130c
movslq (%r12,%r15,4), %rcx
movl (%r13,%rcx,4), %edx
cmpl %edx, %eax
je 0x1a0f
addl %edx, 0x3777(%rip)      # 0x5164
movslq (%r12,%r15,4), %rcx
movl (%r13,%rcx,4), %ecx
subl %eax, %ecx
addl %ecx, 0x376a(%rip)      # 0x5168
movslq (%r12,%r15,4), %rcx
movslq %ebx, %rax
incl %ebx
movq (%rsp), %rdx
movl %ecx, 0x4(%rdx,%rax,4)
movq 0x10(%rsp), %rax
movl %ebx, (%rax,%rcx,4)
incq %r15
jmp 0x19bf
leal 0x1(%rbx), %esi
leaq 0x1637(%rip), %rdi      # 0x305d
xorl %eax, %eax
callq 0x1030
movl 0x3731(%rip), %esi      # 0x5164
leaq 0x163f(%rip), %rdi      # 0x3079
xorl %eax, %eax
callq 0x1030
movl 0x3721(%rip), %esi      # 0x5168
leaq 0x1657(%rip), %rdi      # 0x30a5
xorl %eax, %eax
callq 0x1030
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: write6(unsigned int*, int*, int*, unsigned int*, int)
int write6(unsigned int *D,int *D_2,int *D_3,unsigned int *NS,int NSsize){
    FILE *fp;
    //unsigned char chr;
    //unsigned int a;
    fp = fopen(wname, "w"); // open file or return null
    fwrite(&loops, sizeof(int),1, fp); //0:loops
    fwrite(&dcs[1], sizeof(int), loops, fp); //1:dcs[1][2][3]...
    fwrite(&dc2s[1], sizeof(int), loops, fp); //2:dc2s
    fwrite(D, sizeof(unsigned int), dcs[loops], fp); //3:D
    fwrite(D_2, sizeof(unsigned int), dc2s[loops]+1, fp); //4:D_2
    fwrite(D_3, sizeof(unsigned int), dc2s[loops], fp); //5:D_3
    fwrite(&NSsize, sizeof(int),1, fp); //6:NSsize
    fwrite(NS, sizeof(unsigned int),NSsize, fp); //7:NS
    fclose(fp); // open file or return null
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x4(%rsp), %rax
movl %r8d, (%rax)
movq 0x36bd(%rip), %rdi      # 0x5150
leaq 0x1628(%rip), %rsi      # 0x30c2
callq 0x1110
movq %rax, %r14
leaq 0x3673(%rip), %rdi      # 0x511c
pushq $0x4
popq %r12
pushq $0x1
popq %rdx
movq %r12, %rsi
movq %rax, %rcx
callq 0x11d0
movslq 0x365a(%rip), %rdx      # 0x511c
leaq 0x36ab(%rip), %rdi      # 0x5174
movq %r12, %rsi
movq %r14, %rcx
callq 0x11d0
leaq 0x3695(%rip), %r15      # 0x5170
movslq 0x363a(%rip), %rdx      # 0x511c
leaq 0x36db(%rip), %rdi      # 0x51c4
movq %r12, %rsi
movq %r14, %rcx
callq 0x11d0
leaq 0x36c5(%rip), %r13      # 0x51c0
movslq 0x361a(%rip), %rax      # 0x511c
movslq (%r15,%rax,4), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x11d0
movslq 0x3601(%rip), %rax      # 0x511c
movslq (%r13,%rax,4), %rdx
incq %rdx
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x11d0
movslq 0x35e4(%rip), %rax      # 0x511c
movslq (%r13,%rax,4), %rdx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x11d0
leaq 0x4(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x11d0
movslq (%rbx), %rdx
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x11d0
movq %r14, %rdi
callq 0x1100
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_build.cpp
// Function: shelp()
int shelp(){
    printf("--Simple Usage------------------\n");
    printf("\nRead <file> and make <indexfile>. \n");
    printf(": ./gcis_nep_build -i <file>\n");
    printf("\nYou can set the name of output by using option -o. \n");
    printf(": ./gcis_nep_build -i <file> -o <outputfile>\n");
    printf("\n");
    printf("\n");
    return 0;
}

// Assembly:
pushq %rbx
leaq 0x1654(%rip), %rdi      # 0x31eb
callq 0x1180
leaq 0x1669(%rip), %rdi      # 0x320c
callq 0x1180
leaq 0x1681(%rip), %rdi      # 0x3230
callq 0x1180
leaq 0x1692(%rip), %rdi      # 0x324d
callq 0x1180
leaq 0x16bb(%rip), %rdi      # 0x3282
callq 0x1180
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1160
movl %ebx, %edi
callq 0x1160
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/enemies/goblin/Goblin.cpp
// Function: Goblin::printCharacter()
void Goblin::printCharacter()
{
    std::cout << "      _" << '\n';
    std::cout << "     \\_/" << '\n';
    std::cout << "   |\\/|\\|" << '\n';
    std::cout << "   \\_\\| |" << '\n';
    std::cout << "     / \\" << '\n';
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0xe752(%rip), %rbx      # 0x11fd0
leaq 0x67db(%rip), %rsi      # 0xa060
movq %rbx, %rdi
callq 0x3130
pushq $0xa
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x67c7(%rip), %rsi      # 0xa068
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x67b7(%rip), %rsi      # 0xa071
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x67a8(%rip), %rsi      # 0xa07b
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x6799(%rip), %rsi      # 0xa085
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3170
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/enemies/goblin/Goblin.cpp
// Function: Goblin::Goblin()
Goblin::Goblin():Enemy(e_enemy_goblin, 20, "Goblin", 25, 10, 10, 10, 60, 0)
{
    skills[0] = e_move_attack;
    skills[1] = e_move_attack;
    skills[2] = e_move_attack;
    skills[3] = e_move_poison;
    uses = {10, 10, 10 ,10};
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x6781(%rip), %rsi      # 0xa096
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x39ea
pushq $0xa
popq %r9
pushq $0x1
popq %rsi
pushq $0x14
popq %rdx
pushq $0x19
popq %r8
movq %rbx, %rdi
movq %r14, %rcx
pushq $0x0
pushq $0x3c
pushq %r9
pushq %r9
callq 0x37c8
addq $0x20, %rsp
leaq 0x8(%rsp), %rdi
callq 0x3090
leaq 0xdd63(%rip), %rax      # 0x116c0
movq %rax, (%rbx)
movaps 0x66d9(%rip), %xmm0     # 0xa040
movups %xmm0, 0x1c(%rbx)
movaps 0x66de(%rip), %xmm0     # 0xa050
movups %xmm0, 0x2c(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3200
nop
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/enemies/orc/Orc.cpp
// Function: Orc::printCharacter()
void Orc::printCharacter()
{
    std::cout << "      _" << '\n';
    std::cout << "     )_(" << '\n';
    std::cout << "   C|/|\\|D" << '\n';
    std::cout << "    | | |" << '\n';
    std::cout << "     / \\" << '\n';
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0xe50a(%rip), %rbx      # 0x11fd0
leaq 0x6593(%rip), %rsi      # 0xa060
movq %rbx, %rdi
callq 0x3130
pushq $0xa
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x65f7(%rip), %rsi      # 0xa0e0
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x65e7(%rip), %rsi      # 0xa0e9
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x65d9(%rip), %rsi      # 0xa0f4
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
callq 0x3170
leaq 0x6551(%rip), %rsi      # 0xa085
movq %rbx, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3170
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/enemies/orc/Orc.cpp
// Function: Orc::Orc()
Orc::Orc():Enemy(e_enemy_orc, 40, "Orc", 50, 15, 10, 5, 20, 0)
{
    skills[0] = e_move_attack;
    skills[1] = e_move_attack;
    skills[2] = e_move_throw;
    skills[3] = e_move_power_attack;
    uses = {10, 10, 10 ,10};
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x65a1(%rip), %rsi      # 0xa0fe
leaq 0x28(%rsp), %r14
leaq 0x27(%rsp), %rdx
movq %r14, %rdi
callq 0x39ea
andl $0x0, 0x18(%rsp)
movl $0x14, 0x10(%rsp)
movl $0x5, 0x8(%rsp)
movl $0xa, (%rsp)
pushq $0x28
popq %rdx
pushq $0x32
popq %r8
pushq $0xf
popq %r9
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x37c8
leaq 0x28(%rsp), %rdi
callq 0x3090
leaq 0xdb4c(%rip), %rax      # 0x11700
movq %rax, (%rbx)
movaps 0x6512(%rip), %xmm0     # 0xa0d0
movups %xmm0, 0x1c(%rbx)
movaps 0x6487(%rip), %xmm0     # 0xa050
movups %xmm0, 0x2c(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3200
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/enemies/warlock/Warlock.cpp
// Function: Warlock::printCharacter()
void Warlock::printCharacter()
{
    std::cout << "      _" << '\n'
              << "    @(O)" << '\n'
              << "    |/|\\" << '\n'
              << "    | |" << '\n'
              << "    |/ \\" << '\n';
}

// Assembly:
pushq %rbx
movq 0xe388(%rip), %rdi      # 0x11fd0
leaq 0x6411(%rip), %rsi      # 0xa060
callq 0x3130
pushq $0xa
popq %rbx
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x64c8(%rip), %rsi      # 0xa130
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x64b8(%rip), %rsi      # 0xa139
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x659c(%rip), %rsi      # 0xa236
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x648f(%rip), %rsi      # 0xa142
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
popq %rbx
jmp 0x3170
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/enemies/warlock/Warlock.cpp
// Function: Warlock::Warlock()
Warlock::Warlock():Enemy(e_enemy_warlock, 60, "Warlock", 100, 5, 10, 15, 40, 0)
{
    skills[0] = e_move_attack;
    skills[1] = e_move_attack;
    skills[2] = e_move_heal;
    skills[3] = e_move_firebolt;
    uses = {10, 10, 10, 10};
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x647c(%rip), %rsi      # 0xa153
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x39ea
pushq $0x2
popq %rsi
pushq $0x3c
popq %rdx
pushq $0x64
popq %r8
pushq $0x5
popq %r9
movq %rbx, %rdi
movq %r14, %rcx
pushq $0x0
pushq $0x28
pushq $0xf
pushq $0xa
callq 0x37c8
addq $0x20, %rsp
leaq 0x8(%rsp), %rdi
callq 0x3090
leaq 0xda21(%rip), %rax      # 0x11740
movq %rax, (%rbx)
movaps 0x63f7(%rip), %xmm0     # 0xa120
movups %xmm0, 0x1c(%rbx)
movaps 0x631c(%rip), %xmm0     # 0xa050
movups %xmm0, 0x2c(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3200
nop
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/players/warrior/Warrior.cpp
// Function: Warrior::Warrior()
Warrior::Warrior() :Player(e_player_warrior,    //ID
                           "Warrior",           //NAME
                           100,                 //HP
                           15,                  //STRENGTH
                           10,                  //AGILITY
                           5)                   //INTELLIGENCE
{
    skills[0] = e_move_attack;
    skills[1] = e_move_power_attack;
    skills[2] = e_move_bash;
    skills[3] = e_move_heal;
    uses = {10, 10, 10 ,10};
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x61df(%rip), %rsi      # 0xa10a
leaq 0x18(%rsp), %r14
leaq 0x17(%rsp), %rdx
movq %r14, %rdi
callq 0x39ea
movl $0x5, (%rsp)
pushq $0x1
popq %rsi
pushq $0x64
popq %rcx
pushq $0xf
popq %r8
pushq $0xa
popq %r9
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3dec
leaq 0x18(%rsp), %rdi
callq 0x3090
leaq 0xd852(%rip), %rax      # 0x117c0
movq %rax, (%rbx)
movaps 0x6208(%rip), %xmm0     # 0xa180
movups %xmm0, 0x1c(%rbx)
movaps 0x60cd(%rip), %xmm0     # 0xa050
movups %xmm0, 0x2c(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3200
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/players/rogue/Rogue.cpp
// Function: Rogue::Rogue()
Rogue::Rogue() :Player(e_player_rogue,    //ID
                       "Rogue",           //NAME
                       100,               //HP
                       10,                //STRENGTH
                       10,                //AGILITY
                       10)                //INTELLIGENCE
{
    skills[0] = e_move_attack;
    skills[1] = e_move_throw;
    skills[2] = e_move_poison;
    skills[3] = e_move_heal;
    uses = {10, 10, 10 ,10};
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x6166(%rip), %rsi      # 0xa203
leaq 0x18(%rsp), %r14
leaq 0x17(%rsp), %rdx
movq %r14, %rdi
callq 0x39ea
movl $0xa, (%rsp)
pushq $0x2
popq %rsi
pushq $0x64
popq %rcx
pushq $0xa
popq %r8
movq %rbx, %rdi
movq %r14, %rdx
movl %r8d, %r9d
callq 0x3dec
leaq 0x18(%rsp), %rdi
callq 0x3090
leaq 0xd721(%rip), %rax      # 0x11800
movq %rax, (%rbx)
movaps 0x60e7(%rip), %xmm0     # 0xa1d0
movups %xmm0, 0x1c(%rbx)
movaps 0x5f5c(%rip), %xmm0     # 0xa050
movups %xmm0, 0x2c(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3200
nop
// File: /workspace/github_cpp_makefile_star2_O2/rozpo[P]enemy/data/characters/players/mage/Mage.cpp
// Function: Mage::printCharacter()
void Mage::printCharacter()
{
    std::cout << "      _" << '\n'
              << "     (0)*" << '\n'
              << "     /|\\|" << '\n'
              << "      | |" << '\n'
              << "     / \\|" << '\n';
}

// Assembly:
pushq %rbx
movq 0xde5c(%rip), %rdi      # 0x11fd0
leaq 0x5ee5(%rip), %rsi      # 0xa060
callq 0x3130
pushq $0xa
popq %rbx
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x608c(%rip), %rsi      # 0xa220
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x607d(%rip), %rsi      # 0xa22a
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x606e(%rip), %rsi      # 0xa234
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
callq 0x3170
leaq 0x605f(%rip), %rsi      # 0xa23e
movq %rax, %rdi
callq 0x3130
movq %rax, %rdi
movl %ebx, %esi
popq %rbx
jmp 0x3170