LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/TimerService.cpp
// Function: TimerService::CheckTima()
void TimerService::CheckTima() {
    uint8_t control = mmu->Read(controlAddr);
    uint32_t clockSpeed;

    if (control & runningBit) {
         // divide the operation speed of the cpu clock by the speed set in the control to get the "clockSpeed" variable value
        switch (control & speedBits) {
            case 0: // 4096hz
                clockSpeed = 1024;
                break;
            case 1: // 262144hz
                clockSpeed = 16;
                break;
            case 2: // 65536hz
                clockSpeed = 64;
                break;
            case 3: // 16384hz
                clockSpeed = 256;
                break;
        }

        bool trig = false;
        while (timaClock >= clockSpeed) {
            timaClock -= clockSpeed;
            StepTima();
            trig = true;
        }

        if (trig) {
            timaClock = 0;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
movzwl 0x6(%rbx), %esi
callq 0x167f6
testb %al, 0x9(%rbx)
je 0x17190
andb 0x8(%rbx), %al
decb %al
movl $0x400, %r14d           # imm = 0x400
cmpb $0x2, %al
ja 0x1716f
movzbl %al, %eax
leaq 0x4445(%rip), %rcx      # 0x1b5b0
movl (%rcx,%rax,4), %r14d
xorl %eax, %eax
movl 0x10(%rbx), %ecx
subl %r14d, %ecx
jb 0x17188
movl %ecx, 0x10(%rbx)
movq %rbx, %rdi
callq 0x171d4
movb $0x1, %al
jmp 0x17171
testb $0x1, %al
je 0x17190
andl $0x0, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/TimerService.cpp
// Function: TimerService::CheckDiv()
void TimerService::CheckDiv() {
    if (divClock >= 0xFF) {
        uint8_t div = mmu->Read(divAddr);
        div++;
        mmu->WriteTimers(divAddr, div);
        divClock %= 256; // we want to keep ALL OF THE CLOCKS
    }
}

// Assembly:
cmpl $0xff, 0xc(%rdi)
jb 0x171d2
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
movzwl (%rbx), %esi
callq 0x167f6
incb %al
movq 0x20(%rbx), %rdi
movzwl (%rbx), %esi
movzbl %al, %edx
callq 0x16a14
movzbl 0xc(%rbx), %eax
movl %eax, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/TimerService.cpp
// Function: TimerService::StepTima()
void TimerService::StepTima() {
    uint16_t tima = mmu->Read(timaAddr);
    tima++;

    if (tima > 255) {
        tima = mmu->Read(moduloAddr);
        cpu->AddCycles(4);
        TimaInterrupt();
    }

    mmu->Write(timaAddr, (uint8_t)(tima & 0xFF));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
movzwl 0x2(%rbx), %esi
callq 0x167f6
movl %eax, %r14d
incb %r14b
jne 0x17217
movq 0x20(%rbx), %rdi
movzwl 0x4(%rbx), %esi
callq 0x167f6
movl %eax, %r14d
movq 0x18(%rbx), %rdi
pushq $0x4
popq %rsi
callq 0x14e4a
movq %rbx, %rdi
callq 0x1722c
movq 0x20(%rbx), %rdi
movzwl 0x2(%rbx), %esi
movzbl %r14b, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x16564
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/TimerService.cpp
// Function: TimerService::TimaInterrupt()
void TimerService::TimaInterrupt() {
    uint8_t flags = mmu->Read(InterruptService::IFLAGS);
    flags |= InterruptService::timerBit;
    mmu->Write(InterruptService::IFLAGS, flags);
    cpu->AddCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
orb $0x4, %al
movq 0x20(%rbx), %rdi
movzbl %al, %edx
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x16564
movq 0x18(%rbx), %rdi
pushq $0x4
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x14e4a
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::init_palette()
void XGPU::init_palette() {
    Visual* visual = DefaultVisual(display, screen);

    cmap = XCreateColormap(
        display,
        RootWindow(display, screen),
        visual,
        AllocNone
    );

    for (int ii = 0; ii < 4; ii++) {
        uint8_t mmuColor = mmu->palette[ii];
        Status rc;

        switch (mmuColor) {
            XColor xc;
            case 0:
            {
                rc = XAllocNamedColor(display, cmap, "Gray100", &palette[ii], &xc);
            }
                break;
            case 1:
            {
                rc = XAllocNamedColor(display, cmap, "Gray85", &palette[ii], &xc);
            }
                break;
            case 2:
            {
                rc = XAllocNamedColor(display, cmap, "Gray55", &palette[ii], &xc);
            }
                break;
            case 3:
            {
                rc = XAllocNamedColor(display, cmap, "Gray0", &palette[ii], &xc);
            }
                break;
        }

        if (rc == 0) {
            printf("Color Alloc [%d] failed.\n", ii);
        }
    }

    XSetWindowColormap(display, window, cmap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x5a20(%rdi), %rdi
movq 0xe8(%rdi), %rax
movslq 0x5a28(%rbx), %rcx
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rsi
movq 0x40(%rax,%rcx), %rdx
xorl %ecx, %ecx
callq 0x4250
movq %rax, 0x5a40(%rbx)
leaq 0x5a50(%rbx), %r14
leaq 0x410f(%rip), %r15      # 0x1b5d4
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x17527
movq 0x5a98(%rbx), %rax
movzbl 0xe39a(%rax,%r13), %eax
cmpq $0x3, %rax
ja 0x17508
movslq (%r15,%rax,4), %rdx
addq %r15, %rdx
movq 0x5a20(%rbx), %rdi
movq 0x5a40(%rbx), %rsi
movq %r14, %rcx
leaq -0x38(%rbp), %r8
callq 0x4440
movl %eax, %r12d
testl %r12d, %r12d
jne 0x1751e
leaq 0x416d(%rip), %rdi      # 0x1b681
movl %r13d, %esi
xorl %eax, %eax
callq 0x4060
incq %r13
addq $0x10, %r14
jmp 0x174c8
movq 0x5a20(%rbx), %rdi
movq 0x5a30(%rbx), %rsi
movq 0x5a40(%rbx), %rdx
callq 0x4520
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::XGPU(MMU*, unsigned char)
XGPU::XGPU(MMU* m, uint8_t ws = 1){
    mmu = m;
    windowScalar = ws;
    init_x();
    init_palette();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xe698(%rip), %rax      # 0x25cc8
movq %rax, (%rdi)
movq %rsi, 0x5a98(%rdi)
movb %dl, 0x5a90(%rdi)
callq 0x17268
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x17472
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::SyncMemory()
void XGPU::SyncMemory() {
    // lcdc stats
    // clear bits; conditionally clear the coincidence
    lcdStat = lcdStat & ~(Utils::BIT_1 | Utils::BIT_0) & ~(useLYC ? Utils::BIT_2 : 0x00);
    lcdStat |= mode;
    lcdStat |= (scanline == lyc) ? Utils::BIT_2 : 0x00;

    if (scanline == lyc) {
        TriggerLCDStat(Utils::BIT_6); // trigger hblank lcdc status interrupt
    }
    SetLCDStat(lcdStat);

    // LY (scanline)
    SetScanline(scanline);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x5a16(%rdi), %cl
notb %cl
shlb $0x2, %cl
orb $-0x8, %cl
andb 0x5a15(%rdi), %cl
orb 0x5a18(%rdi), %cl
movb 0x5a1e(%rdi), %dl
movb 0x5a1f(%rdi), %sil
cmpb %sil, %dl
sete %al
shlb $0x2, %al
orb %cl, %al
movb %al, 0x5a15(%rdi)
cmpb %sil, %dl
jne 0x1791d
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0x17942
movb 0x5a15(%rbx), %al
movq (%rbx), %rcx
movzbl %al, %esi
movq %rbx, %rdi
callq *0x48(%rcx)
movzbl 0x5a1e(%rbx), %esi
movq (%rbx), %rax
movq 0x60(%rax), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::TriggerLCDStat(unsigned char)
void XGPU::TriggerLCDStat(uint8_t statusBit) {
    uint8_t flags = mmu->Read(InterruptService::IFLAGS);
    flags |= InterruptService::lcdStatBit;
    mmu->Write(InterruptService::IFLAGS, flags);


    lcdStat &=~ Utils::BIT_6;
    lcdStat &=~ Utils::BIT_5;
    lcdStat &=~ Utils::BIT_4;
    lcdStat &=~ Utils::BIT_3;

    lcdStat |= statusBit;
    SetLCDStat(lcdStat);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x5a98(%rdi), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
orb $0x2, %al
movq 0x5a98(%rbx), %rdi
movzbl %al, %edx
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x16564
movb 0x5a15(%rbx), %al
andb $-0x79, %al
orb %r14b, %al
movb %al, 0x5a15(%rbx)
movq (%rbx), %rcx
movq 0x48(%rcx), %rcx
movzbl %al, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *%rcx
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::Step(unsigned int)
void XGPU::Step(uint32_t clockStep) {
    Sync();
    clocks += clockStep;

    switch (mode) {
        case GPU_MODE::OAM: // 2
        {
            if (clocks >= 80) {
                clocks = 0;
                mode = GPU_MODE::VRAM;
            }
        }
            break;
        case GPU_MODE::VRAM: // 3
        {
            if (clocks >= 172) {
                clocks = 0;
                mode = GPU_MODE::HBLANK;
                TriggerLCDStat(Utils::BIT_3); // trigger hblank lcdc status interrupt

                RenderScanline();
            }
        }
            break;
        case GPU_MODE::HBLANK: // 0
        {
            if (clocks >= 204) {
                clocks = 0;
                IncrementScanline();

                if (scanline == 143) {
                    mode = GPU_MODE::VBLANK;
                    TriggerVBlank();
                    TriggerLCDStat(Utils::BIT_4); // trigger vblank lcdc status interrupt
                    RenderFrame();
                } else {
                    mode = GPU_MODE::OAM;
                }
            }
        }
            break;
        case GPU_MODE::VBLANK: // 1
        {
            if (clocks >= 456) {
                clocks = 0;

                IncrementScanline();

                if (scanline > 153) {
                    mode = GPU_MODE::OAM;
                    TriggerLCDStat(Utils::BIT_5); // trigger oam-rams lcdc status interrupt

                    ResetScanline();
                    //XFlush(display);
                }
            }
        }
            break;
    }

    SyncMemory();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0x177d2
addl 0x8(%rbx), %r14d
movl %r14d, 0x8(%rbx)
movl 0x5a18(%rbx), %eax
cmpq $0x3, %rax
ja 0x17b04
leaq 0x3ba1(%rip), %rcx      # 0x1b5bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0xcc, %r14d
jb 0x17b04
andl $0x0, 0x8(%rbx)
movb 0x5a1e(%rbx), %al
incb %al
movb %al, 0x5a1e(%rbx)
cmpb $-0x71, %al
jne 0x17afa
movl $0x1, 0x5a18(%rbx)
movq %rbx, %rdi
callq 0x179b4
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x17942
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x70(%rax)
jmp 0x17b04
cmpl $0x50, %r14d
jb 0x17b04
andl $0x0, 0x8(%rbx)
movl $0x3, 0x5a18(%rbx)
jmp 0x17b04
cmpl $0xac, %r14d
jb 0x17b04
andl $0x0, 0x8(%rbx)
andl $0x0, 0x5a18(%rbx)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x17942
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xa0(%rax)
jmp 0x17b04
cmpl $0x1c8, %r14d           # imm = 0x1C8
jb 0x17b04
andl $0x0, 0x8(%rbx)
movb 0x5a1e(%rbx), %al
incb %al
movb %al, 0x5a1e(%rbx)
cmpb $-0x66, %al
jb 0x17b04
movl $0x2, 0x5a18(%rbx)
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x17942
movb $0x0, 0x5a1e(%rbx)
jmp 0x17b04
movl $0x2, 0x5a18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x178c6
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::RenderScanline()
void XGPU::RenderScanline() {
    // which line of tiles to use in which map
    uint16_t bgmapOffset = bgMap ? 0x1C00 : 0x1800;
    bgmapOffset += (((scanline + scrollY) & 0xFF) >> 3) << 5;
    bgmapOffset += 0x8000;

    // which tile
    uint8_t lineOffset = (scrollX >> 3);

    // which line of pixels in the tile
    uint8_t y = (scanline + scrollY) & 7;

    // which in the tileline to start
    uint8_t x = (scrollX & 7);

    // where to render on canvas
    uint8_t color;
    uint8_t tile = mmu->Read((bgmapOffset + lineOffset));
    size_t offset = MAX_X * scanline;

    // if (bgTile && tile < 128) tile += 256;

    for (int ii = 0; ii < MAX_X; ii++) {
        color = mmu->tiles[tile][y][x];
        // color = mmu->bgp[color];
        framebuffer[offset] = mmu->bgp[color];
        offset++;

        x++;
        if (x == 8) {
            x = 0;
            lineOffset = (lineOffset + 1) & 31;
            tile = mmu->Read((bgmapOffset + lineOffset));
            // if (bgTile && tile < 128) tile += 256;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movzbl 0x5a11(%rdi), %eax
movzbl 0x5a1e(%rdi), %ecx
movzbl 0x5a1c(%rdi), %esi
addl %ecx, %esi
movl %esi, %ecx
andl $0xf8, %ecx
shll $0xa, %eax
leal (%rax,%rcx,4), %edx
leal (%rax,%rcx,4), %eax
addl $0x9800, %eax           # imm = 0x9800
movl %eax, -0x2c(%rbp)
movzbl 0x5a1d(%rdi), %r13d
movl %r13d, %r12d
shrl $0x3, %r12d
andl $0x7, %esi
movq %rsi, -0x38(%rbp)
andb $0x7, %r13b
movq 0x5a98(%rdi), %rdi
leal (%r12,%rdx), %esi
addl $0x9800, %esi           # imm = 0x9800
callq 0x167f6
movzbl 0x5a1e(%rbx), %ecx
imulq $0xa0, %rcx, %r15
addq %rbx, %r15
pushq $0xc
popq %r14
cmpl $0xac, %r14d
je 0x17c03
movq 0x5a98(%rbx), %rcx
movzbl %al, %edx
shll $0x6, %edx
addq %rcx, %rdx
movzbl %r13b, %r13d
movq -0x38(%rbp), %rsi
leaq (%rdx,%rsi,8), %rdx
movzbl 0xe3aa(%r13,%rdx), %edx
movb 0xe39e(%rcx,%rdx), %cl
movb %cl, (%r15,%r14)
incb %r13b
cmpb $0x8, %r13b
jne 0x17bfe
incb %r12b
andb $0x1f, %r12b
movq 0x5a98(%rbx), %rdi
movzbl %r12b, %esi
orl -0x2c(%rbp), %esi
callq 0x167f6
xorl %r13d, %r13d
incq %r14
jmp 0x17b9f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::RenderFrame()
void XGPU::RenderFrame() {
    for (int y = 0; y < MAX_Y; y++) {
        for (int x = 0; x < MAX_X; x++) {
            size_t offset = (MAX_X * y) + x;
            uint8_t color = framebuffer[offset];
            Draw(color, y, x);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc(%rdi), %r15
xorl %r12d, %r12d
cmpq $0x90, %r12
je 0x17c69
movzbl %r12b, %r14d
xorl %r13d, %r13d
cmpq $0xa0, %r13
je 0x17c5d
movzbl (%r15,%r13), %esi
movq (%rbx), %rax
movzbl %r13b, %ecx
movq %rbx, %rdi
movl %r14d, %edx
callq *0x78(%rax)
incq %r13
jmp 0x17c3a
incq %r12
addq $0xa0, %r15
jmp 0x17c2a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::Draw(XColor, unsigned char, unsigned char)
void XGPU::Draw(XColor color, uint8_t y, uint8_t x) {
    XSetForeground(display, gc, color.pixel);
    XFillRectangle(
        display,
        window,
        gc,
        (x*windowScalar), // x
        (y*windowScalar), // y
        (1*windowScalar), // width
        (1*windowScalar) // height
    );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %r14d
movq %rsi, %rdx
movq %rdi, %r15
movq 0x5a20(%rdi), %rdi
movq 0x5a38(%r15), %rsi
callq 0x4100
movq 0x5a20(%r15), %rdi
movq 0x5a30(%r15), %rsi
movq 0x5a38(%r15), %rdx
movzbl 0x5a90(%r15), %r9d
imull %r9d, %ebx
imull %r9d, %r14d
movl %r9d, (%rsp)
movl %ebx, %ecx
movl %r14d, %r8d
callq 0x41f0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Graphics/XGPU.cpp
// Function: XGPU::DumpTiles()
void XGPU::DumpTiles() {
    uint16_t tileRow = 3;
    uint16_t tile = 0;

	for (uint16_t t = 0; t < 32; t++) {
	    if (15 < tile) {
	        tileRow++;
	        tile = 0;
	    }

	    for (uint8_t y = 0; y < 8; y++) {
    	    for (uint8_t x = 0; x < 8; x++) {
    	        uint8_t p = mmu->tiles[t][y][x];
                Draw(mmu->bgp[p], (tileRow*9)+y, (tile*10)+x);
    	    }
    	}

    	tile++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movb $0x3, %al
movl $0xe3aa, %r15d          # imm = 0xE3AA
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x20, %rcx
je 0x17dcc
movq %rcx, -0x40(%rbp)
cmpw $0x10, %dx
movl $0x0, %ecx
cmovael %ecx, %edx
sbbb $-0x1, %al
movb %al, -0x29(%rbp)
movzbl %al, %eax
leal (%rax,%rax,8), %eax
movq %rax, -0x50(%rbp)
movq %rdx, -0x38(%rbp)
imull $0xa, %edx, %eax
movzbl %al, %r13d
movq %r15, -0x48(%rbp)
xorl %ecx, %ecx
cmpq $0x8, %rcx
je 0x17daf
movq -0x50(%rbp), %rax
movq %rcx, -0x58(%rbp)
addl %ecx, %eax
movzbl %al, %r14d
xorl %r12d, %r12d
cmpq $0x8, %r12
je 0x17da2
movq 0x5a98(%rbx), %rax
leaq (%rax,%r15), %rcx
movzbl (%r12,%rcx), %ecx
movzbl 0xe39e(%rax,%rcx), %esi
leal (%r12,%r13), %eax
movq (%rbx), %r8
movzbl %al, %ecx
movq %rbx, %rdi
movl %r14d, %edx
callq *0x78(%r8)
incq %r12
jmp 0x17d6b
movq -0x58(%rbp), %rcx
incq %rcx
addq $0x8, %r15
jmp 0x17d54
movq -0x38(%rbp), %rdx
incl %edx
movq -0x40(%rbp), %rcx
incq %rcx
movq -0x48(%rbp), %r15
addq $0x40, %r15
movb -0x29(%rbp), %al
jmp 0x17d1a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/special_characters.hpp
// Function: specialChars::isPunctuation(char*)
int isPunctuation(char* str) {
    // TODO: Alex the problem is: str[1] can be ngative, so it moves the sign-bit forward and changes everything.
    // Encore un problem: str[0] is a byte. When you shift by 8...
    int hash = (str[0] << 8) ^ str[1];
    for (unsigned i = 0; i < count_punctuation_2byte; i++)
      if (hash == punctuation_2byte[i])
        return 2;
    if (strlen(str) == 2)
      return 0;
    
    hash = (hash << 8) ^ str[2];
    for (unsigned i = 0; i < count_punctuation_3byte; i++)
      if (hash == punctuation_3byte[i])
        return 3;
    return 0;
  }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movsbl (%rdi), %eax
shll $0x8, %eax
movsbl 0x1(%rdi), %ebp
xorl %eax, %ebp
movl %ebp, %eax
orl $0x10, %eax
cmpl $0x3dbb, %eax           # imm = 0x3DBB
jne 0x3751
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rdi, %rbx
callq 0x3100
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x2, %rcx
je 0x374a
shll $0x8, %ebp
movsbl 0x2(%rbx), %ecx
xorl %ebp, %ecx
xorl %eax, %eax
leaq 0x70ba(%rip), %rsi      # 0xa830
pushq $0x3
popq %rdx
xorl %edi, %edi
cmpq $0x10, %rdi
je 0x374a
leaq 0x4(%rdi), %r8
cmpl (%rdi,%rsi), %ecx
movq %r8, %rdi
jne 0x377b
movl %edx, %eax
jmp 0x374a
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::staticTrieAccess(unsigned int)
InflexEngineNode* InflexEngine::staticTrieAccess(uint32_t ptr) {
// Performs a black-box access on the modified trie, when it gets expanded
  // Included in staticTrie?
  if (ptr < size)
    return staticTrie + ptr;
  
  // No? Then use auxTrie
  int32_t index = ptr - size;
  int32_t oldSize = auxTrieSize;
  
  // Is index contained in the old auxInflexEngine?
  if (index >= oldSize) {
    // Check for the first entrance in this case (auxTrieSize == 0)
    auxTrieSize = (!auxTrieSize) ? EXPAND_TRIE_CONSTANT : (auxTrieSize * EXPAND_TRIE_CONSTANT);
    
    // Realloc the entire auxTrie
    auxTrie = (InflexEngineNode*)realloc(auxTrie, auxTrieSize * sizeof(InflexEngineNode));
    
    // Init the new allocated enInflexEngines
    for (unsigned i = oldSize; i < auxTrieSize; i++) {
      auxTrie[i].code = 0;
      auxTrie[i].parent = 0;      
      auxTrie[i].sons = new uint32_t[sigma]();
      auxTrie[i].configuration = fullBits; // 31 bits
    }
  }
  return auxTrie + index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movl %esi, %eax
subl 0x18(%rdi), %eax
jae 0x37b9
movl %esi, %eax
imulq $0x14, %rax, %rax
addq 0x8(%r14), %rax
jmp 0x3858
movl 0x1c(%r14), %r12d
cmpl %r12d, %eax
jge 0x37cb
movq 0x10(%r14), %rcx
jmp 0x384f
movl %eax, 0xc(%rsp)
movl %r12d, %eax
shll $0x4, %eax
testq %r12, %r12
pushq $0x10
popq %rcx
cmovnel %eax, %ecx
movl %ecx, 0x1c(%r14)
movq 0x10(%r14), %rdi
imulq $0x14, %rcx, %rsi
callq 0x3420
movq %rax, 0x10(%r14)
movl 0x1c(%r14), %r13d
movl 0x20(%r14), %r15d
shlq $0x2, %r15
movl 0x24(%r14), %ebx
imulq $0x14, %r12, %rcx
movq %rax, 0x10(%rsp)
leaq (%rcx,%rax), %rbp
addq $0xc, %rbp
cmpq %r13, %r12
jae 0x3846
andq $0x0, -0xc(%rbp)
movq %r15, %rdi
callq 0x3030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3160
movq %r14, (%rbp)
movl %ebx, -0x4(%rbp)
incq %r12
addq $0x14, %rbp
jmp 0x3814
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cltq
imulq $0x14, %rax, %rax
addq %rcx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::updateFreqOfPointer(int)
void InflexEngine::updateFreqOfPointer(int32_t ptr) {
  // If derivated, increase frequency for root
  // If root, increase frequency for itself
  // Reminder: the first bit of code is occupied - that's why += 2!
  if (!(staticTrieAccess(ptr)->code & 1))
    staticTrieAccess(staticTrieAccess(ptr)->code >> 1)->code += 2;
  else
    staticTrieAccess(ptr)->code += 2;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3792
movb (%rax), %r14b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movl (%rax), %esi
testb $0x1, %r14b
jne 0x3897
shrl %esi
movq %rbx, %rdi
callq 0x3792
movl (%rax), %esi
addl $0x2, %esi
movl %esi, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::tryUpdateFreq(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void InflexEngine::tryUpdateFreq(std::string word) {
// Updade frequency of word. If not found, add it as a as-is word
  int32_t lastPos, ptr = search(word, lastPos);
  if (ptr < 0) {
    int32_t finalPtr;
    insert(-ptr, word, -1, lastPos, finalPtr);
    updateFreqOfPointer(finalPtr);
  } else if (ptr > 0) {
    updateFreqOfPointer(ptr);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x3350
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3952
movl %eax, %ebp
leaq 0x28(%rsp), %rdi
callq 0x3120
testl %ebp, %ebp
js 0x38e8
je 0x3927
movq %rbx, %rdi
movl %ebp, %esi
jmp 0x3922
negl %ebp
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3350
movl 0x4(%rsp), %r8d
pushq $-0x1
popq %rcx
movq %rsp, %r9
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3a92
leaq 0x8(%rsp), %rdi
callq 0x3120
movl (%rsp), %esi
movq %rbx, %rdi
callq 0x3868
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x3944
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::search(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&)
int32_t InflexEngine::search(std::string str, int32_t& lastPos) {
// Good for tests: if str is a rootWord returns the pointer where it was saved. Otherwise, the pointer of its rootword.
  int32_t ptr, pos, encoding;
  bool toCheck;
  ptr = 0;
  for (pos = 0; pos < str.size();) {
    // Get the encoding
    encoding = (pos == str.size() - 1) ? romanian::encode(str[pos]) : romanian::diacriticEncode(str[pos], str[pos + 1]);
    
    toCheck = (staticTrieAccess(ptr)->configuration != fullBits) ? bitOp::getBit(staticTrieAccess(ptr)->configuration, encoding) : staticTrieAccess(ptr)->sons[encoding];
    if (!toCheck) {
      lastPos = pos;
      return -ptr;
    }
    ptr = staticTrieAccess(ptr)->sons[staticTrieAccess(ptr)->configuration != fullBits ? bitOp::orderOfBit(staticTrieAccess(ptr)->configuration, encoding) : encoding];
    pos += 1 + romanian::isDiacritic(str[pos]);
  }
  return (staticTrieAccess(ptr)->code & 1) ? ptr : (staticTrieAccess(ptr)->code / 2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
xorl %ecx, %ecx
xorl %ebp, %ebp
movq %rsi, 0x10(%rsp)
movl %ecx, %r14d
movq 0x8(%r15), %rax
cmpq %r14, %rax
jbe 0x3a55
movq %rcx, (%rsp)
decq %rax
movq (%r15), %rdx
movb (%rdx,%r14), %cl
cmpq %r14, %rax
jne 0x39a1
movsbl %cl, %edi
callq 0x4056
jmp 0x39af
movzbl 0x1(%rdx,%r14), %esi
movzbl %cl, %edi
callq 0x406a
movl %eax, %r12d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movl 0x8(%rax), %r13d
movl 0x24(%rbx), %r15d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
cmpl %r15d, %r13d
jne 0x39df
movq 0xc(%rax), %rax
movslq %r12d, %rcx
movl (%rax,%rcx,4), %eax
jmp 0x39eb
movl 0x8(%rax), %ecx
xorl %eax, %eax
btl %r12d, %ecx
setb %al
testl %eax, %eax
je 0x3a74
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movq 0xc(%rax), %r13
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movl 0x8(%rax), %eax
cmpl 0x24(%rbx), %eax
je 0x3a2b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movl 0x8(%rax), %edi
movl %r12d, %esi
callq 0x3ff5
movl %eax, %r12d
movl %r12d, %eax
movl (%r13,%rax,4), %ebp
movq 0x10(%rsp), %r15
movq (%r15), %rax
movzbl (%rax,%r14), %edi
callq 0x4097
movzbl %al, %eax
movq (%rsp), %rcx
addl %eax, %ecx
incl %ecx
jmp 0x3974
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
testb $0x1, (%rax)
jne 0x3a81
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movl (%rax), %ebp
shrl %ebp
jmp 0x3a81
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movl %ecx, (%rax)
negl %ebp
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/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::updateFreq(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void InflexEngine::updateFreq(std::string word, std::string latinWord = "") {
// The strategy: add the latin variant, if the normal one hasn't been found or it's not a romanian word
  // Does it contain non-romanian characters
  if (!romanian::isRomanian(word)) {
    tryUpdateFreq(latinWord);
  } else {
    int32_t lastPos, ptr = search(word, lastPos);
    
    // Romanian word found?
    if (ptr > 0)
      updateFreqOfPointer(ptr);
    else
      tryUpdateFreq(latinWord);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x3350
movq %r15, %rdi
xorl %esi, %esi
callq 0x3df2
movl %eax, %ebp
leaq 0x30(%rsp), %rdi
callq 0x3120
testb %bpl, %bpl
je 0x3d72
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x3350
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3952
movl %eax, %ebp
leaq 0x70(%rsp), %rdi
callq 0x3120
testl %ebp, %ebp
jle 0x3d94
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3868
jmp 0x3db9
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3350
movq %rbx, %rdi
movq %r15, %rsi
callq 0x38a2
leaq 0x10(%rsp), %rdi
jmp 0x3db4
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3350
movq %rbx, %rdi
movq %r15, %rsi
callq 0x38a2
leaq 0x50(%rsp), %rdi
callq 0x3120
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3dd5
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x3de5
movq %rax, %rbx
movq %r15, %rdi
jmp 0x3de5
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/language_support.hpp
// Function: romanian::isRomanian(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
static bool isRomanian(std::string str, unsigned index = 0) {
    if (index == str.size())
      return true;
    if (index == str.size() - 1)
        return encode(str.back()) != -1;
    else {
      int ret = romanian::diacriticEncode(str[index], str[index + 1]);
      if (ret == -1)
        return false;
      return isRomanian(str, index + 1 + !isEnglishAlphabetIndex(ret)); 
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %eax
movq 0x8(%rdi), %rcx
movb $0x1, %bpl
cmpq %rax, %rcx
je 0x3e74
movl %esi, %ebx
movq %rdi, %r14
leaq -0x1(%rcx), %rsi
movq (%rdi), %rdx
cmpq %rax, %rsi
jne 0x3e2e
movsbl -0x1(%rdx,%rcx), %edi
callq 0x4056
cmpl $-0x1, %eax
setne %bpl
jmp 0x3e74
movzbl (%rdx,%rax), %edi
incl %ebx
movzbl (%rdx,%rbx), %esi
callq 0x406a
cmpl $-0x1, %eax
je 0x3e72
movl %eax, %ebp
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3350
cmpl $0x1a, %ebp
sbbl $-0x1, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x3df2
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x3120
jmp 0x3e74
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::updateMihailsJmenuri(int, unsigned int, int)
void InflexEngine::updateMihailsJmenuri(int32_t ptr, uint32_t pos, int32_t goesTo) {
// Enlarge the vector of sons - the edge of "pos" points now to "goesTo" 
// The idea is to fully alloc the vector of sons
  // Get the number of sons
  size_t countOfSons = bitOp::countOfBits(staticTrieAccess(ptr)->configuration);
  
  // Create temporary copy of the sons
  uint32_t* temp = new uint32_t[countOfSons]();
  for (unsigned index = 0; index < countOfSons; index++)
    temp[index] = staticTrieAccess(ptr)->sons[index];
  delete[] staticTrieAccess(ptr)->sons;
  
  // Alloc a new vector of sons
  staticTrieAccess(ptr)->sons = new uint32_t[sigma]();
  
  // Re-establish the sons. 
  for (unsigned index = 0; index < sigma; index++) {
    if (bitOp::getBit(staticTrieAccess(ptr)->configuration, index))
      staticTrieAccess(ptr)->sons[index] = temp[bitOp::orderOfBit(staticTrieAccess(ptr)->configuration, index)];
    else
      staticTrieAccess(ptr)->sons[index] = 0;
  }
  
  // Update the configuration
  staticTrieAccess(ptr)->configuration = fullBits;
  
  // Let the edge "pos" point to "goesTo"
  staticTrieAccess(ptr)->sons[pos] = goesTo;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movl %edx, (%rsp)
movl %esi, %r14d
movq %rdi, %r15
callq 0x3792
movl 0x8(%rax), %eax
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
subl %ecx, %eax
movl $0x33333333, %ecx       # imm = 0x33333333
movl %eax, %edx
andl %ecx, %edx
shrl $0x2, %eax
andl %ecx, %eax
addl %edx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
addl %eax, %ecx
andl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
imull $0x1010101, %ecx, %ebx  # imm = 0x1010101
shrl $0x18, %ebx
leal (,%rbx,4), %r13d
movq %r13, %rdi
callq 0x3030
movq %rax, %r12
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x3160
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
movq 0xc(%rax), %rdi
cmpq %rbp, %rbx
je 0x3f2a
movl (%rdi,%rbp,4), %eax
movl %eax, (%r12,%rbp,4)
incq %rbp
jmp 0x3f0a
testq %rdi, %rdi
je 0x3f34
callq 0x3310
movl 0x20(%r15), %ebx
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x3030
movq %rax, %rbp
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3160
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
movq %rbp, 0xc(%rax)
movl 0x20(%r15), %eax
cmpq %rax, %r13
jae 0x3fbb
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
movl 0x8(%rax), %ebx
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
btl %r13d, %ebx
jae 0x3fac
movl 0x8(%rax), %edi
movl %r13d, %esi
callq 0x3ff5
movl %eax, %eax
movl (%r12,%rax,4), %ebx
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
jmp 0x3fae
xorl %ebx, %ebx
movq 0xc(%rax), %rax
movl %ebx, (%rax,%r13,4)
incq %r13
jmp 0x3f66
movl 0x24(%r15), %ebx
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
movl %ebx, 0x8(%rax)
movq %r15, %rdi
movl %r14d, %esi
callq 0x3792
movq 0xc(%rax), %rax
movl (%rsp), %ecx
movl 0x4(%rsp), %edx
movl %edx, (%rax,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/language_support.hpp
// Function: romanian::diacriticEncode(unsigned char, unsigned char)
static int32_t diacriticEncode(uint8_t byte1, uint8_t byte2) {
    for (unsigned index = 0; index < 2 * COUNT_OF_DIACRITICS; ++index)
      if ((diacritics[index][0] == byte1) && (diacritics[index][1] == byte2))
        return ENGLISH_SIGMA + (index >> 1);
    return encode(byte1);
  }

// Assembly:
xorl %eax, %eax
leaq 0x5fcd(%rip), %rcx      # 0xa040
cmpq $0xa, %rax
je 0x408b
cmpb %dil, (%rcx,%rax,2)
jne 0x4086
cmpb %sil, 0x1(%rcx,%rax,2)
je 0x4091
incq %rax
jmp 0x4073
movsbl %dil, %edi
jmp 0x4056
shrl %eax
addl $0x1a, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/language_support.hpp
// Function: romanian::isDiacritic(unsigned char)
static bool isDiacritic(uint8_t byte) {
    for (unsigned index = 0; index < 2 * COUNT_OF_DIACRITICS; ++index)
      if (diacritics[index][0] == byte)
        return true;
    return false;
  }

// Assembly:
leaq 0x5fa2(%rip), %rax      # 0xa040
xorl %edx, %edx
movq %rdx, %rcx
cmpq $0xa, %rdx
je 0x40b9
leaq 0x1(%rcx), %rdx
leaq 0x2(%rax), %rsi
cmpb %dil, (%rax)
movq %rsi, %rax
jne 0x40a0
cmpq $0xa, %rcx
setb %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineCore.cpp
// Function: InflexEngine::formWord[abi:cxx11](int)
int32_t InflexEngine::findParent(int32_t ptr, int32_t& encoding) {
// Returns the parent in InflexEngine of "ptr" and also saves the type of edge that lies between them.
  if (ptr == 0)
    return -1;
  uint32_t parent = staticTrieAccess(ptr)->parent, parentConfiguration = staticTrieAccess(parent)->configuration;
  for (unsigned index = 0; index < sigma; ++index) {
    if (bitOp::getBit(parentConfiguration, index) && (staticTrieAccess(parent)->sons[bitOp::orderOfBit(parentConfiguration, index)] == ptr))
      encoding = index;
  }
  return parent;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
testl %edx, %edx
jle 0x41e8
movq %rsi, %r14
leaq 0x4(%rsp), %rax
movq %rsi, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x40c2
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x4144
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl 0x4(%rsp), %r12d
movb $0x0, (%rax)
cmpl $0x19, %r12d
ja 0x423c
addb $0x61, %r12b
movsbl %r12b, %esi
leaq 0x8(%rsp), %rdi
callq 0x3430
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x6515
leaq 0x8(%rsp), %rdi
callq 0x3120
leaq 0x48(%rsp), %rdi
callq 0x3120
jmp 0x4220
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movb (%rax), %cl
movb %cl, 0x10(%rbx)
movq 0x1(%rax), %rcx
movq %rcx, 0x11(%rbx)
movl 0x9(%rax), %ecx
movl %ecx, 0x19(%rbx)
movzwl 0xd(%rax), %ecx
movw %cx, 0x1d(%rbx)
movb 0xf(%rax), %al
movb %al, 0x1f(%rbx)
andq $0x0, 0x8(%rbx)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3120
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x633e(%rip), %rsi      # 0xa581
leaq 0x8(%rsp), %rdi
callq 0x34c0
leal -0x1a(%r12), %eax
shlq $0x5, %rax
leaq 0xb063(%rip), %r14      # 0xf2c0
addq %rax, %r14
xorl %r13d, %r13d
pushq $0x5
popq %rbp
leaq 0x8(%rsp), %r15
subl $0x1, %ebp
jb 0x41c0
leal 0x1a(%r13), %eax
cmpl %r12d, %eax
jne 0x4288
movq %r15, %rdi
movq %r14, %rsi
callq 0x3150
incl %r13d
jmp 0x426b
jmp 0x4298
jmp 0x4298
jmp 0x4293
movq %rax, %rbx
jmp 0x42af
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3120
leaq 0x48(%rsp), %rdi
callq 0x3120
leaq 0x28(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineUtil.cpp
// Function: InflexEngine::dealloc_()
void InflexEngine::dealloc_() {
  // Dealloc staticTrie
  for (unsigned i = 0; i <= bufferLastPtr; i++) {
    if (staticTrieAccess(i)->sons != nullptr)
      delete[] staticTrieAccess(i)->sons;
  }
  if (bufferLastPtr)
    delete[] staticTrie;

  // Free auxTrie, only if it has been allocated
  if (auxTrieSize)
    free(auxTrie);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
movl 0x28(%rbx), %eax
cmpl %eax, %ebp
ja 0x4c12
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
cmpq $0x0, 0xc(%rax)
je 0x4c0e
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3792
movq 0xc(%rax), %rdi
testq %rdi, %rdi
je 0x4c0e
callq 0x3310
incl %ebp
jmp 0x4bde
testl %eax, %eax
je 0x4c24
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4c24
callq 0x3310
cmpl $0x0, 0x1c(%rbx)
je 0x4c39
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32c0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineUtil.cpp
// Function: InflexEngine::reset(char const*)
void InflexEngine::reset(const char* filename) {
// Reset the InflexEngine with a new dictionary
  // First dealloc the trie
  dealloc_();
  // Set the generation mode
  generationMode = Load;
  
  // Initialize auxTrie
  auxTrieSize = 0, auxTrie = nullptr;
  loadExternal(filename);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4bd6
movl $0x1, (%r14)
andl $0x0, 0x1c(%r14)
andq $0x0, 0x10(%r14)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x43f0
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineUtil.cpp
// Function: InflexEngine::addDerivated(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void InflexEngine::addDerivated(std::string root, std::string derivated) {
  if (derivated == root)
    return;
  int32_t dummy, root_pointer = search(root, dummy);
  insert(ROOT, derivated, root_pointer, 0, dummy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq %rdx, %rdi
callq 0x6587
testb %al, %al
jne 0x4d4c
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3952
movl %eax, %ebp
leaq 0x30(%rsp), %rdi
callq 0x3120
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3350
leaq 0xc(%rsp), %r9
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3a92
leaq 0x10(%rsp), %rdi
callq 0x3120
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d5b
movq %rax, %r14
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/special_characters.hpp
// Function: specialChars::cleanUpWord(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
static std::string cleanUpWord(std::string word) {
    if (!word.empty()) {
      // First get rid of the punctuation of 1 byte, using "ispunct"
      word.erase(std::remove_if(word.begin(), word.end(), ::ispunct), word.end());
      
      // Also get rid of digits
      word.erase(std::remove_if(word.begin(), word.end(), ::isdigit), word.end());
      
      // And the white spaces
      word.erase(std::remove_if(word.begin(), word.end(), ::isspace), word.end());
#if 0
      // TODO: fix it
      // Then look at the punctuation of many more bytes
      for (int i = 0; i < word.size(); i++) {
        int amount = isPunctuation(&word[i]) + isdigit(word[i]);
        word.erase(i, amount);
        i -= (amount > 0);
      }
#endif
    }
    return word;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
je 0x4f2d
movq (%r14), %rdi
addq %rdi, %rsi
movq 0xa122(%rip), %rdx      # 0xefe8
callq 0x7201
movq (%r14), %rdx
addq 0x8(%r14), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3090
movq (%r14), %rdi
movq 0x8(%r14), %rsi
addq %rdi, %rsi
movq 0xa0d2(%rip), %rdx      # 0xefc0
callq 0x7201
movq (%r14), %rdx
addq 0x8(%r14), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3090
movq (%r14), %rdi
movq 0x8(%r14), %rsi
addq %rdi, %rsi
movq 0xa08a(%rip), %rdx      # 0xefa0
callq 0x7201
movq (%r14), %rdx
addq 0x8(%r14), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3090
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3320
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineUtil.cpp
// Function: InflexEngine::getAllFreqs(unsigned int, std::vector<std::pair<unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void InflexEngine::getAllFreqs(uint32_t root, std::vector<std::pair<uint32_t, std::string>>& initVector) {
  // Push the frequence of from this node
  if ((staticTrieAccess(root)->code & 1) && (staticTrieAccess(root)->code >> 1))
    initVector.push_back(make_pair(staticTrieAccess(root)->code >> 1, formWord(root)));
  
  // And go further with the children
  for (unsigned i = 0; i < bitOp::countOfBits(staticTrieAccess(root)->configuration); i++)
    if (staticTrieAccess(root)->sons[i] != 0)
      getAllFreqs(staticTrieAccess(root)->sons[i], initVector);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x3792
testb $0x1, (%rax)
je 0x5263
movq %r14, %rdi
movl %ebp, %esi
callq 0x3792
cmpl $0x2, (%rax)
jb 0x5263
movq %r14, %rdi
movl %ebp, %esi
callq 0x3792
movl (%rax), %r12d
shrl %r12d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x4144
leaq 0x40(%rsp), %rcx
movl %r12d, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq (%r15), %rdx
leaq 0x18(%rsp), %rax
cmpq %rax, %rdx
je 0x5220
movq %rdx, 0x30(%rsp)
movq 0x18(%rsp), %rcx
movq %rcx, 0x40(%rsp)
jmp 0x5226
movups (%rax), %xmm0
movups %xmm0, (%rcx)
leaq 0x30(%rsp), %r15
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%r15)
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x8da0
movq %r15, %rdi
callq 0x3120
leaq 0x8(%rsp), %rdi
callq 0x3120
xorl %r15d, %r15d
movl $0x33333333, %r12d      # imm = 0x33333333
movq %r14, %rdi
movl %ebp, %esi
callq 0x3792
movl 0x8(%rax), %eax
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
subl %ecx, %eax
movl %eax, %ecx
andl %r12d, %ecx
shrl $0x2, %eax
andl %r12d, %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
addl %eax, %ecx
andl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
imull $0x1010101, %ecx, %eax  # imm = 0x1010101
shrl $0x18, %eax
cmpq %rax, %r15
jae 0x52e4
movq %r14, %rdi
movl %ebp, %esi
callq 0x3792
movq 0xc(%rax), %rax
cmpl $0x0, (%rax,%r15,4)
je 0x52df
movq %r14, %rdi
movl %ebp, %esi
callq 0x3792
movq 0xc(%rax), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x519e
incq %r15
jmp 0x526c
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x3120
leaq 0x8(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/parserOltean.hpp
// Function: text::text(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
text(std::string filename) : index(BUFF_SIZE), LIMIT_BUFFER(BUFF_SIZE), currSize(0) {
    input.open(filename, std::ios::in | std::ios::binary);
    input.seekg(0, input.end);
    fileSize = input.tellg();
    input.seekg(0, input.beg);
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x32b0
movl $0x400, 0x608(%rbx)     # imm = 0x400
movabsq $0x40000000000, %rax    # imm = 0x40000000000
movq %rax, 0x610(%rbx)
pushq $0xc
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3340
movq %rbx, %rdi
callq 0x3460
movl %eax, 0x60c(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3340
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x665d
movq %rax, %r14
movq %rbx, %rdi
callq 0x30b0
movq %r14, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/parserOltean.hpp
// Function: text::serveWord[abi:cxx11]()
std::string serveWord() {
#if 0
    // It's not possible that we receive a white-space
    if ((currSize == fileSize) && (index + 1 >= input.gcount())) {
      return " <EOF> ";
    }
    if (index == input.gcount()) {
      input.read(buffer, BUFF_SIZE);
      index = 0;
      currSize += input.gcount();
    }
    std::string word = "";
    while ((index < BUFF_SIZE) && !isSeparator(buffer[index])) {
      word.append(1, buffer[index]);
      index++;
    }
    if ((index == BUFF_SIZE) && (currSize != fileSize)) {
      input.seekg(-word.length(), input.cur);
      fileSize += word.length();
      currSize += word.length();
      return serveWord();
    }
    while ((index < BUFF_SIZE) && isSeparator(buffer[index])) {
      index++;
    }
    specialChars::cleanUpWord(word);
    if (word.empty())
      word = serveWord();
    return word;
  }
#else
    char c;
    do {
      c = getByte();
    } while ((c != 0) && isSeparator(c));
    
    if (!c)
      return " <EOF> ";
    
    std::string word = "";
    do {
      word.append(1, c);
      c = getByte();
    } while (!isSeparator(c));
    specialChars::cleanUpWord(word);
    return word;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %r14, %rdi
callq 0x7324
testb %al, %al
je 0x677f
movl %eax, %ebp
movsbl %al, %edi
callq 0x7394
testb %al, %al
jne 0x66f6
leaq 0x3ebd(%rip), %rsi      # 0xa5d4
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x64da
pushq $0x1
popq %r15
movsbl %bpl, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32a0
movq %r14, %rdi
callq 0x7324
movl %eax, %ebp
movsbl %al, %edi
callq 0x7394
testb %al, %al
je 0x6728
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3350
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4ea6
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x8(%rsp), %rdi
callq 0x3120
jmp 0x6793
leaq 0x3a4d(%rip), %rsi      # 0xa1d3
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x64da
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3120
jmp 0x67b5
jmp 0x67b2
movq %rax, %r14
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/util.hpp
// Function: LocalGiniGenerator::save()
void save() {
    std::string rCommand = "Rscript helpers/compute_local_ginis.R " + poet;
    int warning = system(rCommand.data());
    std::string pyCommand = "python3 helpers/compute_local_richness.py " + poet;
    warning = system(pyCommand.data());
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x3bcb(%rip), %rsi      # 0xa6c0
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6670
movq (%r14), %rdi
callq 0x31f0
leaq 0x3bd3(%rip), %rsi      # 0xa6e7
leaq 0x8(%rsp), %rdi
movq %rbx, %rdx
callq 0x6670
movq 0x8(%rsp), %rdi
callq 0x31f0
leaq 0x8(%rsp), %rdi
callq 0x3120
leaq 0x28(%rsp), %rdi
callq 0x3120
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3120
jmp 0x6b5b
jmp 0x6b58
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3480
nop