LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::PixelColor(unsigned char, int, int, bool)
byte LCD::PixelColor(byte ID, int xOffset, int yOffset, bool bank)
{
    ushort startAddr;
    if (bank)
        startAddr = (ushort)(0x8000 + ID * 16);
    else
    {
        char* sb = (char*)&ID;
        startAddr = (ushort)(0x9000 + *sb * 16);
    }
    
    startAddr += (ushort)(yOffset * 2);

    return GetColor(startAddr, xOffset, yOffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %r8d, %r8d
je 0x5051
movzbl %sil, %eax
shll $0x4, %eax
orl $0x8000, %eax           # imm = 0x8000
jmp 0x505d
movsbl %sil, %eax
shll $0x4, %eax
addl $0x9000, %eax           # imm = 0x9000
leal (%rax,%rcx,2), %eax
movzwl %ax, %esi
popq %rbp
jmp 0x4f64
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Background.cpp
// Function: Background::GetPalleteColor(int)
byte Background::GetPalleteColor(int pixel)
{
    byte x = (gb->getScrollX() + pixel) % 256;
    byte y = (gb->getScrollY() + gb->getYCoordinate()) % 256;
    if (gb->getBGDisplayEnable())
        return gb->PixelColor(TileFromMap(x / 8, y / 8), x % 8, y % 8, gb->getBGWindowTileDataSelect());
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rbx
movq 0x48(%rbx), %rax
movb 0xff40(%rax), %r12b
testb $0x1, %r12b
jne 0x50ea
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb 0xff42(%rax), %cl
addb 0xff44(%rax), %cl
addb 0xff43(%rax), %sil
movzbl %sil, %r14d
movl %r14d, %esi
shrl $0x3, %esi
movzbl %cl, %r15d
movl %r15d, %edx
shrl $0x3, %edx
callq 0x506c
andl $0x7, %r14d
andl $0x7, %r15d
andb $0x10, %r12b
shrb $0x4, %r12b
movzbl %al, %esi
movzbl %r12b, %r8d
movq %rbx, %rdi
movl %r14d, %edx
movl %r15d, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2b0a
nop
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Memory.cpp
// Function: Memory::LoadCartridge(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Memory::LoadCartridge(std::string path)
{
	std::fstream is;
    is.open(path, std::fstream::in);

    long int length = is.tellg();
    is.seekg(0, is.end);
    length = (long int)is.tellg() - length;
    is.seekg(0, is.beg);

    try
    {
        if (length % 0x8000 != 0)
            throw new std::exception();
        is.read((char*)RAM, 0x8000);
        
        if (length == 0x8000)
        {
            is.close();
            return;
        }

        cartridgeData = new byte*[length % 0x8000 - 1];

        // проверить??? 0x8000?
        for (int i = 0; i < length % 0x8000 - 1; i++)
        {
            cartridgeData[i] = new byte[0x8000];
            is.read((char*)cartridgeData[i], 0x8000);
        }
    }
    catch (std::exception e)
    {
        std::cout << "Incorrect format" << std::endl;
    }

    
    is.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x230(%rbp), %r15
movq %r15, %rdi
callq 0x2240
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2290
leaq -0x230(%rbp), %rdi
callq 0x2300
movq %rax, %r14
leaq -0x230(%rbp), %rdi
pushq $0x2
popq %rdx
xorl %esi, %esi
callq 0x2280
leaq -0x230(%rbp), %rdi
callq 0x2300
movq %rax, %r15
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2280
subq %r14, %r15
movq %r15, %rax
shlq $0x31, %rax
jne 0x5220
movq 0x28(%rbx), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8000, %edx           # imm = 0x8000
callq 0x2260
cmpq $0x8000, %r15           # imm = 0x8000
jne 0x51ee
leaq -0x230(%rbp), %rdi
callq 0x2070
jmp 0x5206
pushq $-0x1
popq %rdi
callq 0x2040
movq %rax, 0x20(%rbx)
leaq -0x230(%rbp), %rdi
callq 0x2070
leaq -0x230(%rbp), %rdi
callq 0x20a0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rbx
movq %rbx, %rdi
callq 0x2120
movq %rax, %r14
movq %rbx, %rdi
callq 0x2210
movq 0x4d93(%rip), %rcx      # 0x9fd0
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rax, (%r14)
leaq 0x4b32(%rip), %rsi      # 0x9d80
movq %r14, %rdi
xorl %edx, %edx
callq 0x22f0
movq %rdx, %r15
movq %rax, %rbx
movq %r14, %rdi
callq 0x2180
jmp 0x5274
jmp 0x52e4
jmp 0x52e4
jmp 0x52e4
movq %rdx, %r15
movq %rax, %rbx
cmpl $0x1, %r15d
jne 0x52e7
movq %rbx, %rdi
callq 0x2250
movq 0x4d47(%rip), %rax      # 0x9fd0
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq %rbx, %rdi
callq 0x20d0
movq 0x4d38(%rip), %rdi      # 0x9fd8
leaq 0x160b(%rip), %rsi      # 0x68b2
callq 0x2200
movq %rax, %rdi
callq 0x2110
leaq -0x20(%rbp), %rdi
callq 0x2340
callq 0x22e0
jmp 0x51fa
jmp 0x52e4
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x2340
callq 0x22e0
jmp 0x52e7
movq %rax, %rdi
callq 0x2bfb
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Memory.cpp
// Function: Memory::Memory()
Memory::Memory()
{
    //Init all components
    this->gb = GameBoy::getInstance();
    this->RAM = gb->getRAM();
    RAMBank = 0;
    
    
    //Clear this item
    //because 0 means all keys down
    RAM[0xFF00] = 0xFF;

    //Switch to ROM bank on start
    //Copys data from boot.bin to ROM
    isBooting = true;
    std::fstream fs;
    try
    {
        fs.open("boot.bin", std::fstream::in);
        char* tmpR = new char[256];
        fs.read(tmpR, 256);
        ROM = (byte*)tmpR;
    }
    catch (std::exception e)
    {
        std::cout << "Can't find boot.gb" << std::endl;
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
callq 0x271a
movq %rax, (%rbx)
movq 0x48(%rax), %rax
movq %rax, 0x28(%rbx)
movb $0x0, 0x1d(%rbx)
movb $-0x1, 0xff00(%rax)
movb $0x1, 0x1a(%rbx)
leaq -0x228(%rbp), %r14
movq %r14, %rdi
callq 0x2240
leaq 0x1581(%rip), %rsi      # 0x68c3
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x21e0
movl $0x100, %edi            # imm = 0x100
callq 0x2040
movq %rax, %r14
leaq -0x228(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0x2260
movq %r14, 0x8(%rbx)
leaq -0x228(%rbp), %rdi
callq 0x20a0
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x538c
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x53f4
movq %rbx, %rdi
callq 0x2250
movq 0x4c2d(%rip), %rax      # 0x9fd0
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq %rbx, %rdi
callq 0x20d0
movq 0x4c1e(%rip), %rdi      # 0x9fd8
leaq 0x150b(%rip), %rsi      # 0x68cc
callq 0x2200
movq %rax, %rdi
callq 0x2110
leaq -0x18(%rbp), %rdi
callq 0x2340
callq 0x22e0
jmp 0x5372
movq %rax, %rbx
jmp 0x53f4
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x2340
callq 0x22e0
leaq -0x228(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2310
movq %rax, %rdi
callq 0x2bfb
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Memory.cpp
// Function: Memory::Read(int)
byte Memory::Read(int addr)
{
    gb->Sync();
    
    
    //Reads from ROM
    if (isBooting & (addr < 256))
    {
        return ROM[addr];
    }

    //Reads from external RAM
    if ((addr > 0x9FFF) & (addr < 0xBFFF) & (RAMBank != 0))
        return cartridgeData[RAMBank - 1][addr - 0x8000];

    //Reads from RAM
    int x = RAM[addr];
    
    if (addr >= 0xC192 && addr < 0xC200)
        x = x;
    
    return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2aea
cmpl $0xff, %r14d
jg 0x543d
cmpb $0x0, 0x1a(%rbx)
je 0x543d
movslq %r14d, %rax
addq 0x8(%rbx), %rax
jmp 0x5478
leal -0xa000(%r14), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
setae %cl
movzbl 0x1d(%rbx), %eax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x5471
movq 0x20(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rax
movl %r14d, %ecx
addq %rcx, %rax
addq $-0x8000, %rax          # imm = 0x8000
jmp 0x5478
movslq %r14d, %rax
addq 0x28(%rbx), %rax
movb (%rax), %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Memory.cpp
// Function: Memory::ReadWord(int)
ushort Memory::ReadWord(int addr)
{
    ushort temp;
    temp = Read(addr + 1);
    temp <<= 8;
    temp |= Read(addr);
    return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leal 0x1(%rbx), %esi
callq 0x5410
movzbl %al, %r15d
shll $0x8, %r15d
movq %r14, %rdi
movl %ebx, %esi
callq 0x5410
movzbl %al, %eax
orl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Memory.cpp
// Function: Memory::Write(int, unsigned char)
void Memory::Write(int addr, byte value)
{
    gb->Sync();

    if (addr < 0x8000)
        return;
    //    CheckMBC(addr, value);

    //Checks writing to special registers
    //which have unusual behaviour
    switch (addr)
    {
        case 0xFF00:
            //INPUT
            RAM[0xFF00] &= 0b11001111;
            RAM[0xFF00] |= (byte)(value & 0b110000);
            return;

        case 0xFF04:
            //DIV
            RAM[0xFF04] = 0;
            return;

        case 0xFF41:
            //STAT
            value &= 0b11111000;
            RAM[0xFF41] &= 7;
            RAM[0xFF41] |= value;
            return;

        case 0xFF44:
            //LYCounter
            RAM[0xFF44] = 0;
            return;

        case 0xFF46:
            gb->DMATransfer = true;
            break;
    }

    //This space copys value to C000-DE00
    if ((addr >= 0xE000) & (addr < 0xFE00))
    {
        RAM[addr] = value;
        addr -= 0x2000;
    }

    //Writing to external RAM
    if ((addr > 0x9FFF) & (addr < 0xBFFF) & (RAMBank != 0))
        cartridgeData[RAMBank - 1][addr - 0x8000] = value;
    else if (addr > 0x7FFF)
        RAM[addr] = value;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x2aea
cmpl $0x8000, %r15d          # imm = 0x8000
jge 0x54e8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xff46, %r15d          # imm = 0xFF46
je 0x558b
cmpl $0xff04, %r15d          # imm = 0xFF04
je 0x5533
cmpl $0xff41, %r15d          # imm = 0xFF41
je 0x554d
cmpl $0xff44, %r15d          # imm = 0xFF44
je 0x5540
cmpl $0xff00, %r15d          # imm = 0xFF00
jne 0x556a
movq 0x28(%r14), %rax
andb $-0x31, 0xff00(%rax)
andb $0x30, %bl
movq 0x28(%r14), %rax
orb %bl, 0xff00(%rax)
jmp 0x54dd
movq 0x28(%r14), %rax
movb $0x0, 0xff04(%rax)
jmp 0x54dd
movq 0x28(%r14), %rax
movb $0x0, 0xff44(%rax)
jmp 0x54dd
andb $-0x8, %bl
movq 0x28(%r14), %rax
andb $0x7, 0xff41(%rax)
movq 0x28(%r14), %rax
orb %bl, 0xff41(%rax)
jmp 0x54dd
leal -0xe000(%r15), %eax
cmpl $0x1dff, %eax           # imm = 0x1DFF
ja 0x5598
movq 0x28(%r14), %rax
movl %r15d, %ecx
movb %bl, (%rax,%rcx)
addl $0xffffe000, %r15d      # imm = 0xFFFFE000
jmp 0x5598
movq (%r14), %rax
movb $0x1, 0x58(%rax)
movl $0xff46, %r15d          # imm = 0xFF46
leal -0xa000(%r15), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
setae %cl
movzbl 0x1d(%r14), %eax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x55ce
movq 0x20(%r14), %rcx
movq -0x8(%rcx,%rax,8), %rax
movl %r15d, %ecx
movb %bl, -0x8000(%rax,%rcx)
jmp 0x54dd
movq 0x28(%r14), %rax
movl %r15d, %ecx
movb %bl, (%rax,%rcx)
jmp 0x54dd
nop
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Timer.cpp
// Function: Timer::Inc()
void Timer::Inc()
{
    //Syncronization of DIV register
    systemCounter += 4;
    if (systemCounter == 0)
        //DIV
        RAM[0xFF04]++;
   
    //Checks timer (enabled or not)
    enabled = (RAM[0xFF07] & 4) == 4;

    //Sets timer frequency
    switch (RAM[0xFF07] & 3)
    {
        case 0:
            frequency = 1024;
            break;
        case 1:
            frequency = 16;
            break;
        case 2:
            frequency = 64;
            break;
        case 4:
            frequency = 256;
            break;
    }

    if (enabled) {
        //Syncronization of TIMA register
        internalCounter += 4;
        if (internalCounter == frequency) {
            //TIMA
            RAM[0xFF05]++;
            //Checks TIMA overflow
            if (RAM[0xFF05] == 0)
            {
                //copy TMA to TIMA
                RAM[0xFF05] = RAM[0xFF06];
                RAM[0xFF0F] |= 4;
            }
        }
        internalCounter = internalCounter % frequency;
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
addb $0x4, (%rdi)
jne 0x5667
movq 0x8(%rdi), %rax
incb 0xff04(%rax)
movq 0x8(%rdi), %rax
movb 0xff07(%rax), %cl
shrb $0x2, %cl
movl %ecx, %edx
andb $0x1, %dl
movb %dl, 0x10(%rdi)
movzbl 0xff07(%rax), %edx
andl $0x3, %edx
leaq 0x1253(%rip), %rsi      # 0x68e0
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movl $0x400, %edx            # imm = 0x400
jmp 0x56a9
movl $0x10, %edx
jmp 0x56a9
movl $0x40, %edx
movl %edx, 0x14(%rdi)
testb $0x1, %cl
je 0x56f3
movl 0x4(%rdi), %ecx
addl $0x4, %ecx
movl %ecx, 0x4(%rdi)
cmpl 0x14(%rdi), %ecx
jne 0x56e9
incb 0xff05(%rax)
movq 0x8(%rdi), %rax
cmpb $0x0, 0xff05(%rax)
jne 0x56e9
movb 0xff06(%rax), %cl
movb %cl, 0xff05(%rax)
movq 0x8(%rdi), %rax
orb $0x4, 0xff0f(%rax)
movl 0x4(%rdi), %eax
cltd
idivl 0x14(%rdi)
movl %edx, 0x4(%rdi)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Interrupts.cpp
// Function: Interrupts::Manager()
void Interrupts::Manager()
{
    if (gb->Stop)
        return;
    if ((*IE & *IF) != 0)
    {
        gb->Halt = false;
        if (gb->IME)
        {
            gb->IME = false;
            byte interrupts = (byte)(*IE & *IF);
            byte interrupt = 0;
            *IF &= (byte)(~interrupts);
            while (((interrupts >> interrupt) & 1) != 1)
                interrupt++;
            switch (interrupt)
            {
                case 0:
                    gb->Interrupt(0x40);
                    break;
                case 1:
                    gb->Interrupt(0x48);
                    break;
                case 2:
                    gb->Interrupt(0x50);
                    break;
                case 4:
                    gb->Interrupt(0x60);
                    break;
            }
        }
    }

    if (gb->Halt)
        gb->Sync();
    else
        gb->Clock();
}

// Assembly:
movq (%rdi), %rcx
cmpb $0x0, 0x5b(%rcx)
je 0x574e
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdx
movq 0x20(%rdi), %rax
movb (%rax), %sil
testb %sil, (%rdx)
je 0x57ad
movb $0x0, 0x5a(%rcx)
cmpb $0x1, 0x59(%rcx)
jne 0x57ad
movb $0x0, 0x59(%rcx)
movzbl (%rdx), %ecx
movzbl (%rax), %edx
andl %edx, %ecx
xorl %ecx, %edx
movb %dl, (%rax)
movb $-0x1, %dl
incb %dl
movzbl %dl, %eax
btl %eax, %ecx
jae 0x5783
cmpb $0x4, %dl
ja 0x57ad
pushq $0x17
popq %rcx
btl %eax, %ecx
jae 0x57ad
leaq 0x115f(%rip), %rcx      # 0x6900
movzwl (%rcx,%rax,2), %esi
movq (%rbx), %rdi
callq 0x2b6c
movq (%rbx), %rdi
cmpb $0x1, 0x5a(%rdi)
leaq 0x8(%rsp), %rsp
popq %rbx
popq %rbp
je 0x2aea
jmp 0x2b7a
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/Interrupts.cpp
// Function: Interrupts::EnterHALTMode()
bool Interrupts::EnterHALTMode() {
    gb->Halt = true;
    if (gb->IME && !(*IE & *IF)) {
        gb->Halt = false;
    }
    return gb->Halt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movb $0x1, 0x5a(%rcx)
movb $0x1, %al
cmpb $0x1, 0x59(%rcx)
jne 0x59b1
movq 0x18(%rdi), %rdx
movq 0x20(%rdi), %rsi
movb (%rsi), %sil
testb %sil, (%rdx)
jne 0x59b1
movb $0x0, 0x5a(%rcx)
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/klyushinmisha[P]GBEmu/./src/main.cpp
// Function: main
int main(int argc, char** argv)
{
	GameBoy* gb = GameBoy::getInstance();
	gb->LoadCartridge(argv[1]);
    gb->Run();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
callq 0x271a
movq %rax, %rbx
movq 0x8(%r14), %rsi
leaq -0x38(%rbp), %r14
leaq -0x11(%rbp), %rdx
movq %r14, %rdi
callq 0x5a1e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27ec
leaq -0x38(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2838
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/PrzemekWirkus[P]functional-workshop/src/utest.h
// Function: bool CHECK_EQUAL<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool CHECK_EQUAL(const char *str, T1 t1, T2 t2) {
    using namespace std;

    bool result = true;
    if (__NOT equal(begin(t1), end(t1), begin(t2))) {
        auto mypair = 
            mismatch(begin(t1), end(t1), begin(t2));
        cout << __FILE__ << ": Array mismatch: " << endl;
        for_each(begin(t1), end(t1), [] (typename T1::value_type i) { cout << i << " "; });
        cout << endl;
        for_each(begin(t2), end(t2), [] (typename T1::value_type i) { cout << i << " "; });
        cout << endl;
        result = false;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
addq %rdi, %rsi
movq (%rdx), %rdx
callq 0x153a
movl %eax, %ebx
testb %al, %al
je 0x141c
leaq 0xc10(%rip), %r15       # 0x202a
jmp 0x1494
movq (%r12), %rdi
movq 0x8(%r12), %rsi
addq %rdi, %rsi
movq (%r15), %rdx
callq 0x155b
movq 0x2ba1(%rip), %r13      # 0x3fd8
leaq 0xbc6(%rip), %rsi       # 0x2004
movq %r13, %rdi
callq 0x1060
leaq 0xc60(%rip), %rsi       # 0x20ad
movq %rax, %rdi
callq 0x1060
movq %rax, %rdi
callq 0x1040
movq (%r12), %rdi
movq 0x8(%r12), %rsi
addq %rdi, %rsi
callq 0x14d1
movq %r13, %rdi
callq 0x1040
movq (%r15), %rdi
movq 0x8(%r15), %rsi
addq %rdi, %rsi
callq 0x1505
movq %r13, %rdi
callq 0x1040
leaq 0xb99(%rip), %r15       # 0x202d
movq 0x2b3d(%rip), %rdi      # 0x3fd8
movq %r14, %rsi
callq 0x1060
leaq 0xb7e(%rip), %rsi       # 0x2028
movq %rax, %rdi
callq 0x1060
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %rax, %rdi
callq 0x1040
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/eschwabe[P]interview-practice/src/libds_btree.cpp
// Function: BinaryTree::Insert(int const&)
void BinaryTree::Insert(const int& value) {
  if(!root_) {
    root_.reset(new Node());
    root_->value = value;
    return;
  }
  Node* current = root_.get();
  while(current != nullptr) {
    if(current->value >= value) {
      if(!current->left) {
        current->left.reset(new Node());
        current->left->value = value;
        break;
      }
      current = current->left.get();
    } else {
      if(!current->right) {
        current->right.reset(new Node());
        current->right->value = value;
        break;
      }
      current = current->right.get();
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x122d
movl (%rbx), %eax
movq %rcx, %r14
cmpl %eax, 0x10(%rcx)
jge 0x121f
movq 0x8(%r14), %rcx
testq %rcx, %rcx
jne 0x120c
jmp 0x1229
movq (%r14), %rcx
testq %rcx, %rcx
jne 0x120c
jmp 0x122d
addq $0x8, %r14
pushq $0x18
popq %rdi
callq 0x1060
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x1762
movl (%rbx), %eax
movq (%r14), %rcx
movl %eax, 0x10(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/eschwabe[P]interview-practice/src/libds_btree.cpp
// Function: BinaryTree::Remove(int const&)
bool BinaryTree::Remove(const int& value) {
  Node* current = root_.get();
  if(current->value == value) {
    NodePtr right_tmp(std::move(current->right));
    root_ = std::move(current->left);
    InsertNode(right_tmp);
    return true;
  }
  while(current != nullptr) {
    if(current->value >= value) {
      if(current->left && current->left->value == value) {
        NodePtr right_tmp(std::move(current->left->right));
        current->left = std::move(current->left->left);
        InsertNode(right_tmp);
        return true;
      }
      current = current->left.get();
    } else {
      if(current->right && current->right->value == value) {
        NodePtr right_tmp(std::move(current->right->right));
        current->right = std::move(current->right->left);
        InsertNode(right_tmp);
        return true;
      }
      current = current->right.get();
    }
  }
  return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movq (%rdi), %rsi
movl (%rax), %eax
cmpl %eax, 0x10(%rsi)
jne 0x12e0
movq 0x8(%rsi), %rax
movq %rsp, %r14
movq %rax, (%r14)
andq $0x0, 0x8(%rsi)
movq %rbx, %rdi
callq 0x174a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x125c
movq %r14, %rdi
callq 0x1730
movb $0x1, %al
jmp 0x1330
testq %rsi, %rsi
je 0x132e
movq %rsi, %rdi
cmpl %eax, 0x10(%rsi)
jge 0x1305
movq 0x8(%rdi), %rcx
movl $0x0, %esi
testq %rcx, %rcx
je 0x12e0
movq %rcx, %rsi
cmpl %eax, 0x10(%rcx)
jne 0x12e0
jmp 0x1338
movq (%rdi), %rcx
movl $0x0, %esi
testq %rcx, %rcx
je 0x12e0
movq %rcx, %rsi
cmpl %eax, 0x10(%rcx)
jne 0x12e0
movq 0x8(%rcx), %rax
movq %rsp, %r14
movq %rax, (%r14)
andq $0x0, 0x8(%rcx)
movq (%rdi), %rsi
jmp 0x12c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rcx), %rax
movq %rsp, %r14
movq %rax, (%r14)
andq $0x0, 0x8(%rcx)
movq 0x8(%rdi), %rsi
addq $0x8, %rdi
jmp 0x12c4
// File: /workspace/github_cpp_makefile_star2_O2/eschwabe[P]interview-practice/src/libds_btree.cpp
// Function: BinaryTree::Find(int const&)
bool BinaryTree::Find(const int& value) {
  Node* current = root_.get();
  while(current != nullptr) {
    if(current->value == value) {
      return true;
    }
    else if(current->value >= value) {
      current = current->left.get();
    } else {
      current = current->right.get();
    }
  }
  return false;
}

// Assembly:
movl (%rsi), %eax
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x136f
cmpl %eax, 0x10(%rcx)
je 0x136f
setl %dl
movzbl %dl, %edx
leaq (%rcx,%rdx,8), %rdi
jmp 0x1356
testq %rcx, %rcx
setne %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/eschwabe[P]interview-practice/src/libds_btree.cpp
// Function: BinaryTree::PrintPreOrder(BinaryTree::Node*, std::ostream&)
void BinaryTree::PrintPreOrder(Node* root, std::ostream& stream) {
  if(root) {
    PrintPreOrder(root->left.get(), stream);
    stream << root->value << " ";
    PrintPreOrder(root->right.get(), stream);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xc67(%rip), %r12       # 0x200d
testq %r14, %r14
je 0x13d6
movq (%r14), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x138e
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x10a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x1050
movq 0x8(%r14), %r14
jmp 0x13a6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/kdungs[P]codecon/src/base_arithmetic.cc
// Function: main
int main() {
  auto line = std::string{};
  getline(std::cin, line);
  auto x = bestConversion(line);
  getline(std::cin, line);
  auto y = bestConversion(line);
  std::cout << x + y << '\n';
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x2cfa(%rip), %rdi      # 0x3fe0
leaq 0x8(%rsp), %rsi
callq 0x1040
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x12a8
movq %rax, %rbx
movq 0x2cd9(%rip), %rdi      # 0x3fe0
movq %r14, %rsi
callq 0x1040
leaq 0x8(%rsp), %rdi
callq 0x12a8
addq %rax, %rbx
movq 0x2cad(%rip), %rdi      # 0x3fd0
movq %rbx, %rsi
callq 0x1060
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x10b0
leaq 0x8(%rsp), %rdi
callq 0x1080
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x134e
jmp 0x134e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1080
movq %rbx, %rdi
callq 0x10e0
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/./Blob.h
// Function: std::ostream& operator<<<int>(std::ostream&, Blob<int>)
std::ostream& operator<<(std::ostream &os, const Blob<T> a)
{
	os << "< ";
	for (size_t i = 0; i < a.size(); ++i)
		os << a[i] << " ";
	os << " >";
	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2625(%rip), %rsi      # 0x50f0
callq 0x20f0
xorl %r15d, %r15d
leaq 0x2617(%rip), %r12      # 0x50f1
movq (%r14), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %rcx, %r15
jae 0x2b12
movq %r14, %rdi
movq %r15, %rsi
callq 0x3450
movl (%rax), %esi
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x20f0
incq %r15
jmp 0x2ada
leaq 0x25da(%rip), %rsi      # 0x50f3
movq %rbx, %rdi
callq 0x20f0
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/siolag161[P]louvain-original/graph_binary.cpp
// Function: Graph::display()
void
Graph::display() {
/*  for (unsigned int node=0 ; node<nb_nodes ; node++) {
    pair<vector<unsigned int>::iterator, vector<float>::iterator > p = neighbors(node);
    for (unsigned int i=0 ; i<nb_neighbors(node) ; i++) {
      if (node<=*(p.first+i)) {
	if (weights.size()!=0)
	  cout << node << " " << *(p.first+i) << " " << *(p.second+i) << endl;
	else
	  cout << node << " " << *(p.first+i) << endl;
      }
    }   
  }*/
  for (unsigned int node=0 ; node<nb_nodes ; node++) {
    pair<vector<unsigned int>::iterator, vector<float>::iterator > p = neighbors(node);
    cout << node << ":" ;
    for (unsigned int i=0 ; i<nb_neighbors(node) ; i++) {
      if (true) {
	if (weights.size()!=0)
	  cout << " (" << *(p.first+i) << " " << *(p.second+i) << ")";
	else
	  cout << " " << *(p.first+i);
      }
    }
    cout << endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x7944(%rip), %r15      # 0x9fd0
movl (%rbx), %eax
cmpq %rax, %r14
jae 0x275f
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2b7c
movq %rax, %rbp
movq %rdx, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x2100
movq %rax, %rdi
leaq 0x399b(%rip), %rsi      # 0x6058
callq 0x2180
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2bd4
movl %eax, %eax
cmpq %rax, %r13
jae 0x274f
movq 0x50(%rbx), %rax
cmpq 0x48(%rbx), %rax
je 0x272b
movq %r15, %rdi
leaq 0x396f(%rip), %rsi      # 0x605a
callq 0x2180
movl (%rbp,%r13,4), %esi
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
leaq 0x3f2f(%rip), %rsi      # 0x6636
callq 0x2180
movss (%r12,%r13,4), %xmm0
movq %rax, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x3b6e(%rip), %rsi      # 0x6292
callq 0x2180
jmp 0x2747
movq %r15, %rdi
leaq 0x3f01(%rip), %rsi      # 0x6636
callq 0x2180
movl (%rbp,%r13,4), %esi
movq %rax, %rdi
callq 0x2100
incq %r13
jmp 0x26c5
movq %r15, %rdi
callq 0x20c0
incq %r14
jmp 0x268c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/siolag161[P]louvain-original/main_community.cpp
// Function: parse_args(int, char**)
void
parse_args(int argc, char **argv) {
  if (argc<2)
    usage(argv[0], "Bad arguments number\n");

  for (int i = 1; i < argc; i++) {
    if(argv[i][0] == '-') {
      switch(argv[i][1]) {
      case 'w':
	type = WEIGHTED;
        filename_w = argv[i+1];
	i++;
	break;
      case 'p':
        filename_part = argv[i+1];
	i++;
	break;
      case 'q':
	precision = atof(argv[i+1]);
	i++;
	break;
      case 'l':
	display_level = atoi(argv[i+1]);
	i++;
	break;
      case 'k':
	k1 = atoi(argv[i+1]);
	i++;
	break;
      case 'v':
	verbose=true;
	break;
      default:
	usage(argv[0], "Unknown option\n");
      }
    } else {
      if (filename==NULL)
        filename = argv[i];
      else
        usage(argv[0], "More than one filename\n");
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpl $0x2, %edi
jl 0x5811
movl %edi, %ebp
pushq $0x1
popq %r14
movq 0x4a7a(%rip), %r12      # 0xa1a8
leaq 0xb7b(%rip), %r15       # 0x62b0
cmpl %ebp, %r14d
jge 0x57ea
movslq %r14d, %rax
movq (%rbx,%rax,8), %rcx
cmpb $0x2d, (%rcx)
jne 0x5778
movzbl 0x1(%rcx), %ecx
addl $-0x6b, %ecx
cmpl $0xc, %ecx
ja 0x5802
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
incl %r14d
movq 0x8(%rbx,%rax,8), %rdi
callq 0x2250
movl %eax, 0x4a1e(%rip)      # 0xa194
jmp 0x5787
testq %r12, %r12
jne 0x57f3
movq %rcx, 0x4a24(%rip)      # 0xa1a8
movq %rcx, %r12
incl %r14d
jmp 0x5735
movb $0x1, 0x4a31(%rip)      # 0xa1c4
jmp 0x5787
incl %r14d
movq 0x8(%rbx,%rax,8), %rdi
callq 0x2250
movl %eax, 0x49e8(%rip)      # 0xa190
jmp 0x5787
andl $0x0, 0x49cf(%rip)      # 0xa180
incl %r14d
movq 0x8(%rbx,%rax,8), %rax
movq %rax, 0x49f0(%rip)      # 0xa1b0
jmp 0x5787
incl %r14d
movq 0x8(%rbx,%rax,8), %rax
movq %rax, 0x49e7(%rip)      # 0xa1b8
jmp 0x5787
incl %r14d
movq 0x8(%rbx,%rax,8), %rdi
callq 0x21e0
movsd %xmm0, 0x49a0(%rip)     # 0xa188
jmp 0x5787
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
leaq 0xde5(%rip), %rsi       # 0x65e2
callq 0x55e8
movq (%rbx), %rdi
leaq 0xdc6(%rip), %rsi       # 0x65d2
callq 0x55e8
movq (%rbx), %rdi
leaq 0xda1(%rip), %rsi       # 0x65bc
callq 0x55e8
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: main
int main(int argc, char *argv[]) {
	std::string queueType = argv[1];
	std::string root = argv[2];
	struct archive *a;

	a = archive_write_new();

	//archive_write_set_compression_gzip(a);

	archive_write_set_compression_none(a);
	archive_write_set_format_ustar(a);
	archive_write_set_bytes_per_block(a, 128 * 1024);

	archive_write_open_file(a, "/tmp/z.tar");

	if (queueType == "CScan") {
		Traverser<CScan> t(a);

		t.walk(root);
	} else if (queueType == "Queue") {
		Traverser<Queue> t(a);

		t.walk(root);
	}
	archive_write_close(a);
	archive_write_finish(a);
}

// Assembly:
pushq %rbx
subq $0x170, %rsp            # imm = 0x170
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x273a
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x273a
callq 0x20c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x2380
movq %rbx, %rdi
callq 0x2410
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
callq 0x23b0
leaq 0x3a3b(%rip), %rsi      # 0x6004
movq %rbx, %rdi
callq 0x22d0
leaq 0x3a37(%rip), %rsi      # 0x600f
leaq 0x28(%rsp), %rdi
callq 0x2775
testb %al, %al
je 0x268c
leaq 0x60(%rsp), %rax
movq %rbx, -0x18(%rax)
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x78(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
leaq 0xb0(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movups %xmm0, 0x20(%rax)
leaq 0xe8(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x118(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2782
leaq 0x48(%rsp), %rdi
callq 0x28ec
jmp 0x26c7
leaq 0x3982(%rip), %rsi      # 0x6015
leaq 0x28(%rsp), %rdi
callq 0x2775
testb %al, %al
je 0x26c7
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x2928
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x29dc
leaq 0x48(%rsp), %rdi
callq 0x2b50
movq %rbx, %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x23c0
leaq 0x8(%rsp), %rdi
callq 0x2120
leaq 0x28(%rsp), %rdi
callq 0x2120
xorl %eax, %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbx
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x2b50
jmp 0x271e
jmp 0x271b
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x28ec
jmp 0x271e
movq %rax, %rbx
jmp 0x2728
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2120
leaq 0x28(%rsp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: Traverser<CScan>::walk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void walk(std::string& r) {
		root = r;

		struct us_dirent d;
		d.d_ino = -1;
		d.set_is_dir();
		d.parent = root;
		d.d_name = ".";
		d.stat();
		dirheap.push(d);

		while (!dirheap.empty()) {
			d = dirheap.pop();
			heapwalk(d);
		}

		while (!fileheap.empty()) {
			d = fileheap.pop();
			addfile(d);
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2170
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x28(%rsp), %rdi
movb %cl, (%rax)
movb %cl, 0xa8(%rax)
orq $-0x1, -0x38(%rax)
movb $0x4, 0x10(%rax)
movq %r14, %rsi
callq 0x2170
leaq 0x8(%rsp), %rdi
leaq 0x3875(%rip), %rsi      # 0x605e
callq 0x23f0
movq %rsp, %rdi
callq 0x2e66
leaq 0xe8(%rsp), %rdi
movq %rsp, %rsi
callq 0x2ef2
leaq 0x28(%rbx), %r14
leaq 0xe8(%rsp), %rsi
movq %r14, %rdi
callq 0x3600
leaq 0xe8(%rsp), %rdi
callq 0x2c62
leaq 0x1d0(%rsp), %r15
movq %rsp, %r12
cmpq $0x0, 0x50(%rbx)
je 0x2864
movq %r15, %rdi
movq %r14, %rsi
callq 0x2f50
movq %r12, %rdi
movq %r15, %rsi
callq 0x306a
movq %r15, %rdi
callq 0x2c62
movq %rbx, %rdi
movq %r12, %rsi
callq 0x30b4
jmp 0x2832
leaq 0x60(%rbx), %r14
leaq 0x1d0(%rsp), %r15
movq %rsp, %r12
cmpq $0x0, 0x88(%rbx)
je 0x28a8
movq %r15, %rdi
movq %r14, %rsi
callq 0x2f50
movq %r12, %rdi
movq %r15, %rsi
callq 0x306a
movq %r15, %rdi
callq 0x2c62
movq %rbx, %rdi
movq %r12, %rsi
callq 0x32f2
jmp 0x2873
movq %rsp, %rdi
callq 0x2c62
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2c62
jmp 0x28dc
jmp 0x28d9
jmp 0x28d9
jmp 0x28d9
jmp 0x28d9
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2c62
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/./linux_getdents.h
// Function: us_dirent::stat()
struct stat& stat() {
		if (! st_initialized) {
			std::string name = fq();
			st_initialized = true;
			if (lstat(name.c_str(), &st) < 0)
				err(EXIT_FAILURE, "stat %s failed", name.c_str());
			if (d_ino == 0)
				d_ino = st.st_ino;
		}

		return st;
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpb $0x0, 0xe0(%rdi)
jne 0x2eb7
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x354a
movb $0x1, 0xe0(%rbx)
movq (%r14), %rdi
leaq 0x50(%rbx), %rsi
callq 0x2400
testl %eax, %eax
js 0x2ec6
cmpq $0x0, (%rbx)
jne 0x2ead
movq 0x58(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x2120
addq $0x50, %rbx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rsp), %rdx
leaq 0x3173(%rip), %rsi      # 0x6045
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2210
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: CScan<us_dirent>::pop()
T pop() {
		typename std::set<T>::iterator it;
		T bound;
		bound.d_ino = last_position;

		it = elevator.lower_bound(bound);
		if (it == elevator.end()) {
			if (last_position == 0)
				throw new std::exception();//"pop on empty queue");
			last_position = 0;
			return pop();
		}

		T ret = *it;
		elevator.erase(it);
		last_position = ret.d_ino;
		return ret;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movb %cl, 0x10(%rax)
movb %cl, 0xa8(%rax)
movq 0x30(%rsi), %rcx
movq %rcx, -0x38(%rax)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x37b8
movq %rax, %r15
leaq 0x8(%r14), %rax
cmpq %rax, %r15
je 0x2fce
leaq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x2ef2
movq %r14, %rdi
movq %r15, %rsi
callq 0x37e8
movq (%rbx), %rax
movq %rax, 0x30(%r14)
jmp 0x2fe5
cmpq $0x0, 0x30(%r14)
je 0x2fff
andq $0x0, 0x30(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f50
leaq 0x8(%rsp), %rdi
callq 0x2c62
movq %rbx, %rax
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %r15
retq
pushq $0x8
popq %r14
movq %r14, %rdi
callq 0x2140
movq %rax, %rbx
movq %r14, %rdi
callq 0x2230
movq 0x6fb3(%rip), %rcx      # 0x9fd0
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rax, (%rbx)
leaq 0x6d52(%rip), %rsi      # 0x9d80
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2370
movq %rax, %r14
movq %rbx, %rdi
callq 0x21b0
jmp 0x3057
movq %rax, %r14
movq %rbx, %rdi
callq 0x2c62
jmp 0x3057
jmp 0x3054
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2c62
movq %r14, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: Traverser<CScan>::addpath(us_dirent&)
void addpath(struct us_dirent& file) {
		std::string fq = file.fq();
		std::string rel = fq.substr(root.length() + 1);
		std::string uname, gname;
		const struct stat& st = file.stat();
		uname = lookup_uname(st.st_uid);
		gname = lookup_gname(st.st_gid);
#if 0
		std::cout << "addPATH " << fq << "\t" << file.d_ino << "\t" << file.is_file() << std::endl;
#endif
		struct archive_entry *entry = archive_entry_new();

		archive_entry_copy_stat(entry, &file.stat());
		if (uname.size())
			archive_entry_set_uname(entry, uname.c_str());
		if (gname.size())
			archive_entry_set_gname(entry, gname.c_str());
		archive_entry_set_pathname(entry, rel.c_str());
		int r = archive_write_header(a, entry);
		if (r != ARCHIVE_OK)
			errx(EXIT_FAILURE, "archive_write_header failed: %s, %s", rel.c_str(), archive_error_string(a));
		archive_entry_free(entry);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x88(%rsp), %r15
movq %r15, %rdi
callq 0x354a
movq 0x10(%rbx), %rdx
incq %rdx
leaq 0x48(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r15, %rsi
callq 0x2250
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movq %r14, %rdi
callq 0x2e66
movq %rax, %r15
movl 0x1c(%rax), %edx
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4262
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %r12
movq %r12, %rsi
callq 0x22a0
movq %r12, %rdi
callq 0x2120
movl 0x20(%r15), %edx
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x432a
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %r15
movq %r15, %rsi
callq 0x22a0
movq %r15, %rdi
callq 0x2120
callq 0x2050
movq %rax, %r15
movq %r14, %rdi
callq 0x2e66
movq %r15, %rdi
movq %rax, %rsi
callq 0x20f0
cmpq $0x0, 0x30(%rsp)
je 0x39bb
movq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x2190
cmpq $0x0, 0x10(%rsp)
je 0x39d0
movq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x22e0
movq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x2150
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x2300
testl %eax, %eax
jne 0x3a2e
movq %r15, %rdi
callq 0x2060
leaq 0x8(%rsp), %rdi
callq 0x2120
leaq 0x28(%rsp), %rdi
callq 0x2120
leaq 0x48(%rsp), %rdi
callq 0x2120
leaq 0x88(%rsp), %rdi
callq 0x2120
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x48(%rsp), %r14
movq (%rbx), %rdi
callq 0x21e0
leaq 0x261e(%rip), %rsi      # 0x6060
pushq $0x1
popq %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x23d0
jmp 0x3a5f
jmp 0x3a5f
jmp 0x3a5f
movq %rax, %rbx
jmp 0x3a80
jmp 0x3a5f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2120
leaq 0x28(%rsp), %rdi
callq 0x2120
leaq 0x48(%rsp), %rdi
callq 0x2120
leaq 0x88(%rsp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: Traverser<CScan>::lookup_uname[abi:cxx11](unsigned int)
std::string lookup_uname(uid_t uid) {
		std::map<uid_t, std::string>::iterator it = uidcache.find(uid);
		if (it == uidcache.end()) {
			struct passwd *pwent = getpwuid(uid);
			std::string uname;
			if (pwent)
				uname = pwent->pw_name;

			uidcache.insert(std::pair<uid_t, std::string>(uid, uname));

			return uname;
		}

		return (*it).second;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movl %edx, (%rsi)
leaq 0x98(%r15), %r14
movq %r14, %rdi
callq 0x43f2
addq $0xa0, %r15
cmpq %r15, %rax
je 0x42a4
addq $0x28, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22c0
jmp 0x42fa
movl 0x4(%rsp), %edi
callq 0x2290
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
testq %rax, %rax
je 0x42cd
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x23f0
movl 0x4(%rsp), %eax
leaq 0x10(%rsp), %r15
movl %eax, -0x8(%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22c0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4444
movq %r15, %rdi
callq 0x2120
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4316
movq %rax, %r14
movq %r15, %rdi
callq 0x2120
jmp 0x4319
movq %rax, %r14
movq %rbx, %rdi
callq 0x2120
movq %r14, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: Traverser<CScan>::lookup_gname[abi:cxx11](unsigned int)
std::string lookup_gname(gid_t gid) {
		std::map<gid_t, std::string>::iterator it = gidcache.find(gid);
		if (it == gidcache.end()) {
			struct group *grent = getgrgid(gid);
			std::string gname;
			if (grent)
				gname = grent->gr_name;

			gidcache.insert(std::pair<gid_t, std::string>(gid, gname));

			return gname;
		}

		return (*it).second;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movl %edx, (%rsi)
leaq 0xc8(%r15), %r14
movq %r14, %rdi
callq 0x43f2
addq $0xd0, %r15
cmpq %r15, %rax
je 0x436c
addq $0x28, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22c0
jmp 0x43c2
movl 0x4(%rsp), %edi
callq 0x2360
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
testq %rax, %rax
je 0x4395
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x23f0
movl 0x4(%rsp), %eax
leaq 0x10(%rsp), %r15
movl %eax, -0x8(%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22c0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4444
movq %r15, %rdi
callq 0x2120
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x43de
movq %rax, %r14
movq %r15, %rdi
callq 0x2120
jmp 0x43e1
movq %rax, %r14
movq %rbx, %rdi
callq 0x2120
movq %r14, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/linux_getdents.cc
// Function: dir_read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::vector<us_dirent, std::allocator<us_dirent>>&)
int
dir_read(std::string& path, std::vector<struct us_dirent>& dest)
{
	int fd = open(path.c_str(), O_DIRECTORY | O_RDONLY);
	int written;
	int offset = 0;

#define buf_size 4096
	char buf[buf_size];

	if (fd < 0) {
		err(EXIT_FAILURE, "open %s", path.c_str());
	}

	do {
		written = linux_getdents(fd, buf, buf_size);
		if (written < 0) {
			err(EXIT_FAILURE, "getdents %s", path.c_str());
		}

		offset = 0;

		while (offset < written) {
			struct linux_dirent *s = (struct linux_dirent*)(buf + offset);
			struct us_dirent d;
			char *type = buf + offset + s->d_reclen - 1;

			d.d_ino = s->d_ino;
			d.d_name = std::string(s->d_name);
			d.d_type = *type;
			d.parent = path;

			dest.push_back(d);
#if 0
			std::push_heap(dest.begin(), dest.end());
#endif

			offset += s->d_reclen;
		}
	} while (written > 0);

	close(fd);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1138, %rsp           # imm = 0x1138
movq %rsi, 0x20(%rsp)
movq %rdi, 0x10(%rsp)
movq (%rdi), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x21c0
movl %eax, 0xc(%rsp)
testl %eax, %eax
js 0x551b
xorl %ebp, %ebp
leaq 0x110(%rsp), %r13
leaq 0x28(%rsp), %r12
pushq $0x4e
popq %rdi
movl 0xc(%rsp), %esi
leaq 0x130(%rsp), %rdx
movl $0x1000, %ecx           # imm = 0x1000
xorl %eax, %eax
callq 0x2070
movq %rax, 0x18(%rsp)
testl %eax, %eax
js 0x5502
xorl %ebx, %ebx
cmpl 0x18(%rsp), %ebx
jge 0x54da
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
movb %bpl, 0x40(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
andq $0x0, 0x58(%rsp)
movl %ebx, %r14d
movb %bpl, 0x60(%rsp)
movb %bpl, 0x70(%rsp)
movb %bpl, 0x108(%rsp)
leaq 0x142(%rsp,%r14), %rsi
movzwl -0x2(%rsi), %r15d
movq -0x12(%rsi), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rdi
leaq 0xb(%rsp), %rdx
callq 0x273a
addq %rsp, %r14
addq $0x130, %r14            # imm = 0x130
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x22a0
movq %r13, %rdi
callq 0x2120
movb -0x1(%r14,%r15), %al
movb %al, 0x70(%rsp)
leaq 0x50(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x2170
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x5544
movzwl 0x10(%r14), %eax
addl %eax, %ebx
movq %r12, %rdi
callq 0x2c62
jmp 0x541b
cmpl $0x0, 0x18(%rsp)
jne 0x53f1
movl 0xc(%rsp), %edi
callq 0x2430
xorl %eax, %eax
addq $0x1138, %rsp           # imm = 0x1138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq (%rax), %rdx
leaq 0xbc9(%rip), %rsi       # 0x60da
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2210
movq 0x10(%rsp), %rax
movq (%rax), %rdx
leaq 0xba8(%rip), %rsi       # 0x60d2
jmp 0x5511
jmp 0x552e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2c62
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/firstblock.cc
// Function: firstblock(char const*)
uint64_t firstblock(const char *fname)
{
	int ret, fd;
	struct fiemap *fiemap;
	struct fiemap_extent *extent;
	unsigned long block = 0;
	char buf[sizeof(struct fiemap) + sizeof(struct fiemap_extent)] = {0};

	fd = open(fname, O_RDONLY);
	if (fd == -1) {
		printf("Open failed: %s: %s\n", fname, strerror(errno));
		return 0;
	}

	if (use_fibmap) {
		ret = ioctl(fd, FIBMAP, &block);
		if (ret == 0) {
			close(fd);
			return block;
		}
		printf("FIBMAP failed: %s: %s\n", fname, strerror(errno));
		use_fibmap = 0;
	}

	fiemap = (struct fiemap *)buf;

	fiemap->fm_start = 0;
	fiemap->fm_length = 4096;
	fiemap->fm_flags = 0;
	fiemap->fm_extent_count = 1;

	ret = ioctl(fd, FS_IOC_FIEMAP, fiemap);
	if (ret == -1) {
		if (errno == EBADR) {
			printf("Kernel does not the flags: 0x%x\n",
				fiemap->fm_flags);
			close(fd);
			return -1;
		}
		printf("fiemap error %d: \"%s\"\n", errno,
			strerror(errno));
		close(fd);
		return 0;
	}


	close(fd);

	if (fiemap->fm_extent_count == 0 || fiemap->fm_mapped_extents == 0) {
#if 0
		printf("extent_count == 0: %s\n", fname);
#endif
		return 0;
	}
	extent = &fiemap->fm_extents[0];
	return extent->fe_physical >> 4;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
andq $0x0, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x60(%rsp)
xorl %esi, %esi
xorl %eax, %eax
callq 0x21c0
cmpl $-0x1, %eax
je 0x582a
movl %eax, %ebx
cmpb $0x0, 0x4ab1(%rip)      # 0xa23c
jne 0x57cd
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %rdx
movl %ebx, %edi
xorl %eax, %eax
callq 0x22f0
testl %eax, %eax
je 0x587a
callq 0x2030
movl (%rax), %edi
callq 0x20d0
leaq 0x95c(%rip), %rdi       # 0x6115
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2040
movb $0x1, 0x4a6f(%rip)      # 0xa23c
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
movq $0x1000, 0x8(%rdx)      # imm = 0x1000
andl $0x0, 0x10(%rdx)
movl $0x1, 0x18(%rdx)
movl $0xc020660b, %esi       # imm = 0xC020660B
movl %ebx, %edi
xorl %eax, %eax
callq 0x22f0
cmpl $-0x1, %eax
je 0x584f
movl %ebx, %edi
callq 0x2430
xorl %r15d, %r15d
cmpl $0x0, 0x28(%rsp)
je 0x58ac
cmpl $0x0, 0x24(%rsp)
je 0x58ac
movq 0x38(%rsp), %r15
shrq $0x4, %r15
jmp 0x58ac
callq 0x2030
movl (%rax), %edi
callq 0x20d0
leaq 0x8c3(%rip), %rdi       # 0x6100
xorl %r15d, %r15d
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2040
jmp 0x58ac
callq 0x2030
movl (%rax), %ebp
cmpl $0x35, %ebp
jne 0x5888
movl 0x20(%rsp), %esi
leaq 0x8c6(%rip), %rdi       # 0x612c
xorl %eax, %eax
callq 0x2040
movl %ebx, %edi
callq 0x2430
pushq $-0x1
popq %r15
jmp 0x58ac
movl %ebx, %edi
callq 0x2430
movq 0x8(%rsp), %r15
jmp 0x58ac
movl %ebp, %edi
callq 0x20d0
leaq 0x8b7(%rip), %rdi       # 0x614d
xorl %r15d, %r15d
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2040
movl %ebx, %edi
callq 0x2430
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq