LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawHeaderWithGuide(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void DNWindow::drawHeaderWithGuide(string guide)
{
    
    int x_pos, y_pos;
    
    getsyx(y_pos, x_pos);
    
    move(0,0);
    
    
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    for (int i = 0; i < w.ws_col; i++) {
        if (i == 0) {
            addch(ACS_ULCORNER);
            continue;
        }
        if (i == w.ws_col - 1) {
            addch(ACS_URCORNER);
            continue;
        }
        addch(ACS_HLINE);
    }
    addch(ACS_VLINE);
    printw(guide.c_str());
    move(1, w.ws_col - 1);
    addch(ACS_VLINE);
    for (int i = 0; i < w.ws_col; i++) {
        if (i == 0) {
            addch(ACS_LLCORNER);
            continue;
        }
        if (i == w.ws_col - 1) {
            addch(ACS_LRCORNER);
            continue;
        }
        addch(ACS_HLINE);
    }
    move(y_pos,x_pos);
    refreshDN();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0x5950(%rip), %rax      # 0xbfc8
movq (%rax), %rax
testq %rax, %rax
je 0x668f
cmpb $0x0, 0x1a(%rax)
je 0x6691
pushq $-0x1
popq %rbx
movl %ebx, 0xc(%rsp)
jmp 0x669c
jmp 0x669c
movswl (%rax), %ebx
movswl 0x2(%rax), %eax
movl %eax, 0xc(%rsp)
xorl %r13d, %r13d
xorl %edi, %edi
xorl %esi, %esi
callq 0x31e0
pushq $0x1
popq %rdi
leaq 0x10(%rsp), %rdx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x3400
movl $0x1b0, %ebp            # imm = 0x1B0
movq 0x5908(%rip), %r15      # 0xbfd0
movq 0x58e1(%rip), %r12      # 0xbfb0
movzwl 0x12(%rsp), %ecx
cmpl %ecx, %r13d
jae 0x6702
decl %ecx
movl $0x1ac, %eax            # imm = 0x1AC
cmpl %ecx, %r13d
je 0x66ea
movl $0x1c4, %eax            # imm = 0x1C4
testl %r13d, %r13d
cmoveq %rbp, %rax
movq (%r15), %rdi
movl (%r12,%rax), %esi
callq 0x30d0
incl %r13d
jmp 0x66cf
movq (%r15), %rdi
movl 0x1e0(%r12), %esi
callq 0x30d0
movq (%r14), %rdi
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x32e0
movzwl 0x12(%rsp), %esi
decl %esi
pushq $0x1
popq %rdi
callq 0x31e0
movq (%r15), %rdi
movl 0x1e0(%r12), %esi
callq 0x30d0
movl $0x1b4, %r13d           # imm = 0x1B4
movzwl 0x12(%rsp), %ecx
cmpl %ecx, %r14d
jae 0x6777
decl %ecx
movl $0x1a8, %eax            # imm = 0x1A8
cmpl %ecx, %r14d
je 0x675f
movl $0x1c4, %eax            # imm = 0x1C4
testl %r14d, %r14d
cmoveq %r13, %rax
movq (%r15), %rdi
movl (%r12,%rax), %esi
callq 0x30d0
incl %r14d
jmp 0x6744
movl %ebx, %edi
movl 0xc(%rsp), %esi
callq 0x31e0
callq 0x34a0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawMenu()
void DNWindow::drawMenu()
{
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    move(w.ws_row + 3, w.ws_col);
    middleString(string("Please select one of these following options:"), 3);


}

// Assembly:
pushq %rbx
subq $0x30, %rsp
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rbx
movl $0x5413, %esi           # imm = 0x5413
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3400
movzwl (%rbx), %edi
addl $0x3, %edi
movzwl 0x2(%rbx), %esi
callq 0x31e0
leaq 0x1a1f(%rip), %rsi      # 0x84bf
leaq 0x10(%rsp), %rbx
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x3c1e
pushq $0x3
popq %rdx
movq %rbx, %rsi
callq 0x6a20
leaq 0x10(%rsp), %rdi
callq 0x3170
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawCommandLine()
void DNWindow::drawCommandLine()
{
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    start_color();
    init_pair(1, COLOR_RED, COLOR_BLACK);
    attron(COLOR_PAIR(1));
    mvprintw(w.ws_row - 1, 0, "COMMAND> ");
    move(w.ws_col - 1, 10);
    attron(COLOR_PAIR(0));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %rbx
movl $0x5413, %esi           # imm = 0x5413
movl %ebp, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3400
callq 0x3080
movl %ebp, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x3050
movq 0x54b6(%rip), %r14      # 0xbfd0
movq (%r14), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3180
movzwl (%rbx), %edi
decl %edi
leaq 0x19b8(%rip), %rdx      # 0x84ed
xorl %esi, %esi
xorl %eax, %eax
callq 0x33e0
movzwl 0x2(%rbx), %edi
decl %edi
pushq $0xa
popq %rsi
callq 0x31e0
movq (%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3180
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::moveUp()
void DNWindow::moveUp()
{
    int y, x;
    getsyx(y, x);
    move(y - 1, x);
    refresh();
}

// Assembly:
movq 0x545f(%rip), %rax      # 0xbfc8
movq (%rax), %rax
cmpb $0x0, 0x1a(%rax)
je 0x6b7a
pushq $-0x1
popq %rsi
pushq $-0x2
popq %rdi
jmp 0x6b83
movswl (%rax), %edi
decl %edi
movswl 0x2(%rax), %esi
pushq %rax
callq 0x31e0
popq %rax
jmp 0x34a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::moveDown()
void DNWindow::moveDown()
{
    int y, x;
    getsyx(y, x);
    move(y + 1, x);
    refresh();
}

// Assembly:
movq 0x5431(%rip), %rax      # 0xbfc8
movq (%rax), %rax
cmpb $0x0, 0x1a(%rax)
je 0x6ba7
pushq $-0x1
popq %rsi
xorl %edi, %edi
jmp 0x6bb0
movswl (%rax), %edi
incl %edi
movswl 0x2(%rax), %esi
pushq %rax
callq 0x31e0
popq %rax
jmp 0x34a0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::moveLeft()
void DNWindow::moveLeft()
{
    int y, x;
    getsyx(y, x);
    move(y, x - 1);
    refresh();
}

// Assembly:
movq 0x5405(%rip), %rax      # 0xbfc8
movq (%rax), %rax
cmpb $0x0, 0x1a(%rax)
je 0x6bd4
pushq $-0x2
popq %rsi
pushq $-0x1
popq %rdi
jmp 0x6bdd
movswl (%rax), %edi
movswl 0x2(%rax), %esi
decl %esi
pushq %rax
callq 0x31e0
popq %rax
jmp 0x34a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::moveRight()
void DNWindow::moveRight()
{
    int y, x;
    getsyx(y, x);
    move(y, x + 1);
    refresh();

}

// Assembly:
movq 0x53d7(%rip), %rax      # 0xbfc8
movq (%rax), %rax
cmpb $0x0, 0x1a(%rax)
je 0x6c01
xorl %esi, %esi
pushq $-0x1
popq %rdi
jmp 0x6c0a
movswl (%rax), %edi
movswl 0x2(%rax), %esi
incl %esi
pushq %rax
callq 0x31e0
popq %rax
jmp 0x34a0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::inputString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void DNWindow::inputString(string& input)
{
    
    refreshDN();

    char ch;
    int key;
    allowMacDev();

    while ((key = getch())) {
        ch = key;
        DNLogService::sharedObject().log(ch);

        if (key == KEY_BACKSPACE && input.size() > 0) {
            input = input.substr(0, input.size() - 1);
            moveLeft();
            addch(' ');
            refreshDN();
            moveLeft();
            refreshDN();
            continue;
        }
        else if (key == KEY_BACKSPACE) {
            sound();
            continue;
        }
        if (key == '\n') {
            break;
        }
        input += ch;
        addch(ch);
        moveRight();
        refreshDN();

    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
callq 0x34a0
callq 0x7684
movq 0x5398(%rip), %r13      # 0xbfd0
leaq 0x8(%rsp), %r14
pushq $0x20
popq %rbp
movq (%r13), %rdi
callq 0x3120
testl %eax, %eax
je 0x6cf5
movl %eax, %r15d
callq 0x3c5a
movsbl %r15b, %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x4514
cmpl $0x107, %r15d           # imm = 0x107
je 0x6c9b
cmpl $0xa, %r15d
je 0x6cf5
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3260
movq (%r13), %rdi
movsbl %r15b, %esi
callq 0x30d0
callq 0x6bea
callq 0x34a0
jmp 0x6c40
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x6ceb
decq %rcx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3310
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33b0
movq %r14, %rdi
callq 0x3170
callq 0x6bbc
movq (%r13), %rdi
movl %ebp, %esi
callq 0x30d0
callq 0x34a0
callq 0x6bbc
callq 0x34a0
jmp 0x6c40
callq 0x3070
jmp 0x6c40
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawBoard(int, int, int)
void DNWindow::drawBoard(int start_Y, int start_X, int size)
{
    this->clearScreen();
    this->drawHeaderWithGuide(string("TicTacToe - press 'x' to trigger turn"));
    this->drawHeader();
    this->refreshDN();
    
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    

    move(start_Y, start_X);

    for (int y = 0; y < size; y++) {
        for (int x = 0; x < size * 2; x++) {
            mvaddch(start_Y + y, start_X + x, ACS_CKBOARD);
        }
    }

    this->refreshDN();
    this->moveToCenter();
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r12d
movl %edx, %ebp
movl %esi, %ebx
callq 0x7046
leaq 0x15e7(%rip), %rsi      # 0x8532
leaq 0x28(%rsp), %r15
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
callq 0x3c1e
movq %r15, %rsi
callq 0x6660
leaq 0x28(%rsp), %rdi
callq 0x3170
callq 0x657a
callq 0x34a0
xorl %r13d, %r13d
pushq $0x1
popq %rdi
leaq 0x20(%rsp), %rdx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x3400
movq %rbx, 0x10(%rsp)
movl %ebx, %edi
movl %ebp, %esi
callq 0x31e0
leal (%r12,%r12), %eax
testl %eax, %eax
cmovlel %r13d, %eax
movl %eax, 0x8(%rsp)
testl %r12d, %r12d
cmovlel %r13d, %r12d
movq 0x5016(%rip), %r14      # 0xbfd0
movq 0x4fef(%rip), %rbx      # 0xbfb0
movq %r12, 0x18(%rsp)
movl %ebp, 0xc(%rsp)
cmpl %r12d, %r13d
je 0x7018
movq 0x10(%rsp), %rax
leal (%rax,%r13), %r15d
movl %ebp, %r12d
movl 0x8(%rsp), %ebp
subl $0x1, %ebp
jb 0x700a
movq (%r14), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x7005
movq (%r14), %rdi
movl 0x184(%rbx), %esi
callq 0x30d0
incl %r12d
jmp 0x6fdf
incl %r13d
movq 0x18(%rsp), %r12
movl 0xc(%rsp), %ebp
jmp 0x6fca
callq 0x34a0
callq 0x7118
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::terminateWithErrorMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void DNWindow::terminateWithErrorMessage(string  message)
{
    DNLogService::sharedObject() << "ERROR => " << message << "\n";
    DNWindow::getInstance().clearScreen();
    DNWindow::getInstance().middleString(message, 13);
    DNWindow:: getInstance().refreshDN();
    sleep(3);
    DNWindow::getInstance().terminate();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
callq 0x3c5a
leaq 0x1037(%rip), %rsi      # 0x80af
movq %rax, %rdi
callq 0x4576
movq %rax, %r15
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33f0
movq %r15, %rdi
movq %r14, %rsi
callq 0x4646
leaq 0x1469(%rip), %rsi      # 0x850e
movq %rax, %rdi
callq 0x4576
leaq 0x20(%rsp), %rdi
callq 0x3170
callq 0x381e
callq 0x7046
callq 0x381e
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33f0
pushq $0xd
popq %rdx
movq %r14, %rsi
callq 0x6a20
movq %rsp, %rdi
callq 0x3170
callq 0x381e
callq 0x34a0
pushq $0x3
popq %rdi
callq 0x3220
callq 0x381e
callq 0x7052
jmp 0x7105
movq %rax, %rbx
movq %r14, %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::startLocalGameTwoHumans(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 DNWindow::startLocalGameTwoHumans(string & nameOfPlayerOne, string & nameOfPlayerTwo)
{
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    clearScreen();
    drawHeader();
    middleString("Please enter name of first player: ", w.ws_row / 2);
    
    while(true){
        inputString(nameOfPlayerOne);
        if(nameOfPlayerOne.size() == 0){ clearScreen();  middleString("Name cannot be empty, try again: ", w.ws_row / 2); drawHeader();}
        else{
            DNWindow::getInstance().clearScreen();
            DNWindow::getInstance().drawHeader();
            middleString("Please enter name of second player: ", w.ws_row / 2);
            while(true){    
                inputString(nameOfPlayerTwo);
                if(nameOfPlayerTwo.size() == 0) {clearScreen(); middleString("Name cannot be empty, try again: ", w.ws_row / 2); drawHeader(); }
                else break;
            }
            break;
            
        }
    }
    
   
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %rdi
leaq 0x10(%rsp), %rdx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x3400
callq 0x7046
callq 0x657a
leaq 0x13c9(%rip), %rsi      # 0x8558
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3c1e
movzwl 0x10(%rsp), %edx
shrl %edx
leaq 0x38(%rsp), %rsi
callq 0x6a20
leaq 0x38(%rsp), %rdi
callq 0x3170
leaq 0x13bc(%rip), %r12      # 0x857c
leaq 0x78(%rsp), %r13
leaq 0xf(%rsp), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x6c16
cmpq $0x0, 0x8(%r15)
jne 0x720d
callq 0x7046
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3c1e
movzwl 0x10(%rsp), %edx
shrl %edx
movq %r13, %rsi
callq 0x6a20
movq %r13, %rdi
callq 0x3170
callq 0x657a
jmp 0x71ca
callq 0x381e
callq 0x7046
callq 0x381e
callq 0x657a
leaq 0x1376(%rip), %rsi      # 0x859e
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3c1e
movzwl 0x10(%rsp), %edx
shrl %edx
leaq 0x18(%rsp), %rsi
callq 0x6a20
leaq 0x18(%rsp), %rdi
callq 0x3170
leaq 0x1323(%rip), %r15      # 0x857c
leaq 0x58(%rsp), %r12
leaq 0xf(%rsp), %r13
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6c16
cmpq $0x0, 0x8(%rbx)
jne 0x72a6
callq 0x7046
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3c1e
movzwl 0x10(%rsp), %edx
shrl %edx
movq %r12, %rsi
callq 0x6a20
movq %r12, %rdi
callq 0x3170
callq 0x657a
jmp 0x7263
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x72e6
jmp 0x72ed
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x72e6
jmp 0x72ed
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x72e6
jmp 0x72ed
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3170
jmp 0x72f0
movq %rax, %rbx
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::startLocalGameHumanVsCPU(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool DNWindow::startLocalGameHumanVsCPU(string &nameOfPlayerOne)
{
    //    noraw();a
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    clearScreen();
    drawHeader();

    middleString("Please enter name of human player: ", w.ws_row / 2);
    
    while(true){
        inputString(nameOfPlayerOne);
        if (!nameOfPlayerOne.length()) middleString("Name cannot be empty, try again: ", w.ws_row / 2);
        else break;
    }
    
    clearScreen();
    drawHeader();
    return true;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rdx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x3400
callq 0x7046
callq 0x657a
leaq 0x1293(%rip), %rsi      # 0x85c3
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3c1e
movzwl 0x8(%rsp), %edx
shrl %edx
leaq 0x10(%rsp), %rsi
callq 0x6a20
leaq 0x10(%rsp), %rdi
callq 0x3170
leaq 0x121b(%rip), %r15      # 0x857c
leaq 0x30(%rsp), %r12
leaq 0x7(%rsp), %r13
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6c16
cmpq $0x0, 0x8(%rbx)
jne 0x73a4
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3c1e
movzwl 0x8(%rsp), %edx
shrl %edx
movq %r12, %rsi
callq 0x6a20
movq %r12, %rdi
callq 0x3170
jmp 0x736b
callq 0x7046
callq 0x657a
movb $0x1, %al
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x73d2
jmp 0x73d9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3170
jmp 0x73dc
movq %rax, %rbx
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::chooseTypeOfNetworkGame(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int DNWindow::chooseTypeOfNetworkGame(string &nameOfPlayer)
{
    string input;
    clearScreen();
    drawHeader();
    drawOptionsForNetworkGame();
    refreshDN();
    return executeOptionsForNetworkgame(nameOfPlayer);
    
    
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
callq 0x7046
callq 0x657a
callq 0x7452
callq 0x34a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x75e8
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x3170
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawOptionsForNetworkGame()
void DNWindow::drawOptionsForNetworkGame()
{
    refresh();
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    start_color();
    init_pair(1, COLOR_RED, COLOR_BLACK);

    mvprintw(w.ws_row / 3, w.ws_col / 10, "( ) Connect to Game");
    mvprintw(w.ws_row / 3 + 1, w.ws_col / 10, "( ) Create a game");
    
    mvprintw(w.ws_row / 3 + 6, w.ws_col / 10, "( ) Quit");
    

    mvaddch(w.ws_row / 3, w.ws_col / 10 + 1, '1');
    mvaddch(w.ws_row / 3 + 1, w.ws_col / 10 + 1, '2');
    mvaddch(w.ws_row / 3 + 6, w.ws_col / 10 + 1, 'Q');
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
callq 0x34a0
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %rbx
movl $0x5413, %esi           # imm = 0x5413
movl %ebp, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3400
callq 0x3080
movl %ebp, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x3050
movzwl (%rbx), %eax
movzwl 0x2(%rbx), %ecx
movw $0x3, %r15w
xorl %edx, %edx
divw %r15w
movzwl %ax, %edi
movw $0xa, %bp
movl %ecx, %eax
xorl %edx, %edx
divw %bp
movzwl %ax, %esi
leaq 0x1131(%rip), %rdx      # 0x85e7
xorl %eax, %eax
callq 0x33e0
movzwl (%rbx), %eax
movzwl 0x2(%rbx), %ecx
xorl %edx, %edx
divw %r15w
leal 0x1(%rax), %edi
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %edi
movl %ecx, %eax
xorl %edx, %edx
divw %bp
movzwl %ax, %esi
leaq 0x1114(%rip), %rdx      # 0x85fb
xorl %eax, %eax
callq 0x33e0
movzwl (%rbx), %eax
movzwl 0x2(%rbx), %ecx
xorl %edx, %edx
divw %r15w
leal 0x6(%rax), %edi
andl %r12d, %edi
movl %ecx, %eax
xorl %edx, %edx
divw %bp
movzwl %ax, %esi
leaq 0xfa1(%rip), %rdx       # 0x84b3
xorl %eax, %eax
callq 0x33e0
movq 0x4ab0(%rip), %r14      # 0xbfd0
movq (%r14), %rdi
movzwl (%rbx), %eax
movzwl 0x2(%rbx), %ecx
xorl %edx, %edx
divw %r15w
movzwl %ax, %esi
movl %ecx, %eax
xorl %edx, %edx
divw %bp
leal 0x1(%rax), %edx
andl %r12d, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x7555
movq (%r14), %rdi
pushq $0x31
popq %rsi
callq 0x30d0
movq (%r14), %rdi
movzwl 0x8(%rsp), %eax
movzwl 0xa(%rsp), %ecx
xorl %edx, %edx
divw %r15w
leal 0x1(%rax), %esi
andl %r12d, %esi
movl %ecx, %eax
xorl %edx, %edx
divw %bp
leal 0x1(%rax), %edx
andl %r12d, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x7590
movq (%r14), %rdi
pushq $0x32
popq %rsi
callq 0x30d0
movq (%r14), %rdi
movzwl 0x8(%rsp), %eax
movzwl 0xa(%rsp), %ecx
movw $0x3, %si
xorl %edx, %edx
divw %si
leal 0x6(%rax), %esi
movl $0xffff, %r8d           # imm = 0xFFFF
andl %r8d, %esi
movw $0xa, %r9w
movl %ecx, %eax
xorl %edx, %edx
divw %r9w
leal 0x1(%rax), %edx
andl %r8d, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x75da
movq (%r14), %rdi
pushq $0x51
popq %rsi
callq 0x30d0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::executeOptionsForNetworkgame(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int DNWindow::executeOptionsForNetworkgame(string & input)
{
    
    
    drawCommandLine();
    refreshDN();
    inputString(input);
    
    
    if (atoi(input.c_str())  == 1 || atoi(input.c_str()) == 2) {
        return atoi(input.c_str());
    }else if (input == "Q" || input == "q") {
        terminate();
    }else{
        terminateWithErrorMessage(string("Wrong input"));
    }

    return false;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x6ae2
callq 0x34a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6c16
movq (%rbx), %rdi
callq 0x3450
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jae 0x7622
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0xef9(%rip), %rsi       # 0x8522
movq %rbx, %rdi
callq 0x5e13
testb %al, %al
jne 0x7648
leaq 0xee8(%rip), %rsi       # 0x8524
movq %rbx, %rdi
callq 0x5e13
testb %al, %al
je 0x764d
callq 0x7052
leaq 0xfb9(%rip), %rsi       # 0x860d
leaq 0x8(%rsp), %rbx
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x3c1e
movq %rbx, %rsi
callq 0x7060
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawSymbolBetter(DNCellState, int&, int&)
void DNWindow::drawSymbolBetter(DNCellState state, int& x, int& y)
{
    if (state == CROSS) {
        mvaddch(y, x, 'X');
        beep();
        moveRight();
        moveLeft();
        this->refreshDN();
    }
    else if (state == CIRCLE) {
        mvaddch(y, x, 'O');
        beep();
        moveRight();
        moveLeft();
        this->refreshDN();
    }
    else {
        terminateWithErrorMessage(string("Fatal Error"));
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpl $0x1, %esi
je 0x76e9
cmpl $0x2, %esi
jne 0x772c
movq 0x48fc(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
movl (%rcx), %esi
movl (%rdx), %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x7713
pushq $0x58
jmp 0x7703
movq 0x48e0(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
movl (%rcx), %esi
movl (%rdx), %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x7713
pushq $0x4f
popq %rsi
movq 0x48c5(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
callq 0x30d0
callq 0x3070
callq 0x6bea
callq 0x6bbc
addq $0x30, %rsp
popq %rbx
jmp 0x34a0
leaq 0xee6(%rip), %rsi       # 0x8619
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x3c1e
movq %rbx, %rsi
callq 0x7060
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::drawSymbol(DNCellState, int&, int&)
void DNWindow::drawSymbol(DNCellState state, int & x, int &y)
{
    getsyx(y, x);
    if (state == CROSS) {
        addch('X');
        beep();
        moveRight();
        moveLeft();
    }
    else if (state == CIRCLE) {
        addch('O');
        beep();
        moveRight();
        moveLeft();
    }
    else {
        terminateWithErrorMessage(string("Fatal Error"));
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq 0x485a(%rip), %rax      # 0xbfc8
movq (%rax), %rax
testq %rax, %rax
je 0x778f
cmpb $0x0, 0x1a(%rax)
je 0x7784
orl $-0x1, (%rdx)
orl $-0x1, (%rcx)
jmp 0x778f
movswl (%rax), %edi
movl %edi, (%rcx)
movswl 0x2(%rax), %eax
movl %eax, (%rdx)
cmpl $0x2, %esi
je 0x779d
cmpl $0x1, %esi
jne 0x77c3
pushq $0x4f
jmp 0x779f
pushq $0x58
popq %rsi
movq 0x4829(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
callq 0x30d0
callq 0x3070
callq 0x6bea
addq $0x30, %rsp
popq %rbx
jmp 0x6bbc
leaq 0xe4f(%rip), %rsi       # 0x8619
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x3c1e
movq %rbx, %rsi
callq 0x7060
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::enterServerIPAdress(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void DNWindow::enterServerIPAdress(string& ip_address)
{

    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    mvprintw(w.ws_row - 1, 0, "ENTER HOST IP ADDRESS> ");
    refreshDN();
    inputString(ip_address);
    

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %r15
movl $0x5413, %esi           # imm = 0x5413
movq %r15, %rdx
xorl %eax, %eax
callq 0x3400
movzwl (%r15), %edi
decl %edi
leaq 0xdf8(%rip), %rdx       # 0x8625
xorl %esi, %esi
xorl %eax, %eax
callq 0x33e0
callq 0x34a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6c16
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zengfenfei[P]codility/src/CyclicRotation.cpp
// Function: solution(std::vector<int, std::allocator<int>>&, int)
vector<int> solution(vector<int> &A, int K) {
	int n = A.size();
	vector<int> rotated(n);
	if (n == 0) {
		return rotated;
	}
	K = K % n;
	//Move the first part to end
	for (int i = K; i < n; i++) {
		rotated[i] = A[i - K];
	}

	//Move the shifted part to the beginning
	for (int i = 0; i < K; i++) {
		rotated[i] = A[i + n - K];
	}
	return rotated;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r13
subq (%rsi), %r13
shrq $0x2, %r13
movslq %r13d, %r12
leaq -0x29(%rbp), %rdx
movq %r12, %rsi
callq 0x141e
testl %r12d, %r12d
je 0x12c1
movl %r15d, %eax
cltd
idivl %r13d
movq (%r14), %rax
movq (%rbx), %rcx
movslq %edx, %rsi
movslq %r13d, %rdi
cmpq %rdi, %rsi
jge 0x129a
movl (%rax), %r8d
movl %r8d, (%rcx,%rsi,4)
incq %rsi
addq $0x4, %rax
jmp 0x1285
subl %edx, %r13d
movq (%r14), %rax
movq (%rbx), %rcx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
cmpq %rsi, %rdx
je 0x12c1
leal (%rsi,%r13), %edi
movslq %edi, %rdi
movl (%rax,%rdi,4), %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
jmp 0x12aa
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zengfenfei[P]codility/src/CyclicRotation.cpp
// Function: printVector(std::vector<int, std::allocator<int>>)
void printVector(vector<int> out) {
	cout << "[";
	for (int i = 0; i < out.size(); i++) {
		cout << out[i] << ",";
	}
	cout << "]";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x2cf0(%rip), %r14      # 0x3fd8
leaq 0xd15(%rip), %rsi       # 0x2004
movq %r14, %rdi
callq 0x1090
xorl %r12d, %r12d
leaq 0xd05(%rip), %r15       # 0x2006
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0x1330
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x10e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1090
incq %r12
jmp 0x1301
movq 0x2ca1(%rip), %rdi      # 0x3fd8
leaq 0xcca(%rip), %rsi       # 0x2008
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/zengfenfei[P]codility/src/CyclicRotation.cpp
// Function: main
int main() {
	int ints[] = { 3, 8, 9, 7, 6 };
	vector<int> a(ints, ints + sizeof(ints) / sizeof(int));
	vector<int> out = solution(a, 3);
	printVector(out);
	printVector(vector<int>());
	//9, 7, 6, 3, 8
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x78, %rsp
movaps 0xce5(%rip), %xmm0      # 0x2040
leaq -0x6c(%rbp), %rdx
movaps %xmm0, -0x14(%rdx)
movl $0x6, -0x4(%rdx)
leaq -0x68(%rbp), %rbx
leaq -0x80(%rbp), %rsi
leaq -0x20(%rbp), %rcx
movq %rbx, %rdi
callq 0x1470
leaq -0x20(%rbp), %rdi
pushq $0x3
popq %rdx
movq %rbx, %rsi
callq 0x123c
leaq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x14a2
leaq -0x38(%rbp), %rdi
callq 0x12d3
leaq -0x38(%rbp), %rdi
callq 0x1534
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x12d3
leaq -0x50(%rbp), %rdi
callq 0x1534
leaq -0x20(%rbp), %rdi
callq 0x1534
leaq -0x68(%rbp), %rdi
callq 0x1534
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0x13f4
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x1534
jmp 0x13fe
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x1534
jmp 0x140c
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x1534
movq %rbx, %rdi
callq 0x10f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/document_graph.cpp
// Function: testDocarray(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int
testDocarray(const std::string& base_name)
{
  RLCSA rlcsa(base_name);
  if(!(rlcsa.isOk())) { return 4; }
  DocArray docarray(rlcsa, base_name, true);
  if(!(docarray.isOk())) { return 5; }

  rlcsa.printInfo();
  rlcsa.reportSize(true);
  docarray.reportSize(true);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x888, %rsp            # imm = 0x888
movq %rdi, %rbx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5a90
cmpb $0x1, (%r14)
jne 0x51e2
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rcx
movq %rbx, %rdx
callq 0xf552
cmpb $0x0, 0x50(%rsp)
je 0x51e7
leaq 0x58(%rsp), %rdi
callq 0x869c
leaq 0x58(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x84d8
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x10a4c
jmp 0x51ea
pushq $0x4
popq %rbx
jmp 0x51f4
pushq $0x5
popq %rbx
leaq 0x8(%rsp), %rdi
callq 0xf7e8
leaq 0x58(%rsp), %rdi
callq 0x6d12
movl %ebx, %eax
addq $0x888, %rsp            # imm = 0x888
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x521d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xf7e8
leaq 0x58(%rsp), %rdi
callq 0x6d12
movq %rbx, %rdi
callq 0x3430
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/document_graph.cpp
// Function: buildIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int
buildIndex(const std::string& base_name, const std::string& prefix)
{
  RLCSA rlcsa(base_name);
  if(!(rlcsa.isOk())) { return 4; }
  DocArray docarray(rlcsa, base_name, false);
  if(!(docarray.isOk())) { return 5; }

  docarray.readRules(prefix, true);
  if(!(docarray.hasGrammar())) { return 6; }
  docarray.writeTo(base_name);

  rlcsa.printInfo();
  rlcsa.reportSize(true);
  docarray.reportSize(true);

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x880, %rsp            # imm = 0x880
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5a90
cmpb $0x1, (%r15)
jne 0x52b8
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xf552
cmpb $0x0, 0x48(%rsp)
je 0x52bd
movq %rsp, %rdi
pushq $0x1
popq %rdx
movq %r14, %rsi
callq 0xfc4c
cmpb $0x1, 0x49(%rsp)
jne 0x52c1
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x108f2
leaq 0x50(%rsp), %rdi
callq 0x869c
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x84d8
xorl %ebx, %ebx
movq %rsp, %rdi
pushq $0x1
popq %rsi
callq 0x10a4c
jmp 0x52c4
pushq $0x4
popq %rbx
jmp 0x52cc
pushq $0x5
jmp 0x52c3
pushq $0x6
popq %rbx
movq %rsp, %rdi
callq 0xf7e8
leaq 0x50(%rsp), %rdi
callq 0x6d12
movl %ebx, %eax
addq $0x880, %rsp            # imm = 0x880
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x52f5
movq %rax, %rbx
movq %rsp, %rdi
callq 0xf7e8
leaq 0x50(%rsp), %rdi
callq 0x6d12
movq %rbx, %rdi
callq 0x3430
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::~STNode()
STNode::~STNode()
{
  this->parent = 0;
  delete this->docs; this->docs = 0;
  delete this->child; this->child = 0;
  while(this->sibling != 0)
  {
    STNode* temp = this->sibling; this->sibling = this->sibling->sibling;
    temp->sibling = 0; delete temp;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
movq 0x40(%rdi), %r14
testq %r14, %r14
je 0xe8e2
movq %r14, %rdi
callq 0xd8ea
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x3240
andq $0x0, 0x40(%rbx)
movq 0x18(%rbx), %r15
testq %r15, %r15
je 0xe903
movq %r15, %rdi
callq 0xe8c4
pushq $0x48
popq %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x3240
andq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0xe942
movq 0x20(%r15), %rax
movq %rax, 0x20(%rbx)
andq $0x0, 0x20(%r15)
movq %r15, %rdi
callq 0xe8c4
movq %r15, %rdi
movq %r14, %rsi
callq 0x3240
jmp 0xe917
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::addLeaves()
void
STNode::addLeaves()
{
  if(this->child == 0) { return; }

  usint expect = this->range.first;
  STNode* prev = 0;
  for(STNode* temp = this->child; temp != 0; temp = temp->sibling)
  {
    while(expect < temp->range.first) { prev = this->addLeaf(prev, temp, expect); expect++; }
    temp->addLeaves();
    expect = temp->range.second + 1;
    prev = temp;
  }

  while(expect < this->range.second + 1) { prev = this->addLeaf(prev, 0, expect); expect++; }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %r14
testq %r14, %r14
je 0xea09
movq %rdi, %rbx
movl 0x4(%rdi), %ebp
xorl %eax, %eax
testq %r14, %r14
jne 0xe9d2
jmp 0xea00
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0xea0e
incl %ebp
cmpl 0x4(%r14), %ebp
jb 0xe9c0
movq %r14, %rdi
callq 0xe9a4
movl 0x8(%r14), %ebp
incl %ebp
movq %r14, %rax
movq 0x20(%r14), %r14
jmp 0xe9b9
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0xea0e
incl %ebp
movl 0x8(%rbx), %ecx
incl %ecx
cmpl %ecx, %ebp
jb 0xe9ef
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::addLeaf(CSA::STNode*, CSA::STNode*, unsigned int)
STNode*
STNode::addLeaf(STNode* left, STNode* right, usint pos)
{
  STNode* leaf = new STNode(0, pair_type(pos, pos));
  leaf->parent = this;
  if(left == 0) { this->child = leaf; }
  else          { left->sibling = leaf; }
  leaf->sibling = right;
  return leaf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0x48
popq %rdi
callq 0x3230
movl %ebx, %ecx
movabsq $0x100000001, %rdx      # imm = 0x100000001
imulq %rcx, %rdx
andl $0x0, (%rax)
movq %rdx, 0x4(%rax)
andq $0x0, 0x40(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movb $0x0, 0x38(%rax)
movq %r12, 0x10(%rax)
leaq 0x20(%r15), %rcx
addq $0x18, %r12
testq %r15, %r15
cmovneq %rcx, %r12
movq %rax, (%r12)
movq %r14, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::verifyTree()
bool
STNode::verifyTree()
{
  if(this->child == 0) { return true; }

  usint expect = this->range.first, last = 0;
  for(STNode* temp = this->child; temp != 0; temp = temp->sibling)
  {
    if(!(temp->verifyTree())) { return false; }
    if(temp->range.first != expect)
    {
      std::cerr << "Error: node " << *this << ", expected " << expect << ", got " << *temp << std::endl;
      std::cerr << "Children:";
      for(temp = this->child; temp != 0; temp = temp->sibling) { std::cerr << " " << *temp; }
      std::cerr << std::endl;
      if(this->parent) { std::cerr << "Parent: " << *(this->parent) << std::endl; }
      return false;
    }
    expect = temp->range.second + 1;
    last = temp->range.second;
  }
  if(last != this->range.second)
  {
    std::cerr << "Error: node " << *this << ", children end at " << last << std::endl;
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x18(%rdi), %r15
movb $0x1, %bpl
testq %r15, %r15
je 0xebf8
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movl 0x4(%rdi), %r13d
xorl %r12d, %r12d
testq %r15, %r15
je 0xeacf
movq %r15, %rdi
callq 0xea7c
testb %al, %al
je 0xebf6
cmpl %r13d, 0x4(%r15)
jne 0xeb1c
movl 0x8(%r15), %r12d
leal 0x1(%r12), %r13d
movq 0x20(%r15), %r15
jmp 0xeaa5
cmpl 0x8(%rbx), %r12d
je 0xebf8
movq 0x15510(%rip), %rdi     # 0x23ff0
leaq 0x9e09(%rip), %rsi      # 0x188f0
callq 0x3210
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0xec09
leaq 0x9e22(%rip), %rsi      # 0x18923
movq %r14, %rdi
callq 0x3210
movl %r12d, %esi
movq %rax, %rdi
callq 0x3160
movq %rax, %r14
jmp 0xebee
movq 0x154cd(%rip), %r12     # 0x23ff0
leaq 0x9dc6(%rip), %rsi      # 0x188f0
movq %r12, %rdi
callq 0x3210
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
callq 0xec09
leaq 0x9db6(%rip), %rsi      # 0x188fd
movq %rbp, %rdi
callq 0x3210
movl %r13d, %esi
movq %rax, %rdi
callq 0x3160
leaq 0x9da8(%rip), %rsi      # 0x18909
movq %rax, %rdi
callq 0x3210
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0xec09
movq %r13, %rdi
callq 0x3100
leaq 0x9d8a(%rip), %rsi      # 0x18910
movq %r12, %rdi
callq 0x3210
leaq 0x9d19(%rip), %r15      # 0x188ae
movq (%r14), %r14
testq %r14, %r14
je 0xebb9
movq %r12, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %r14, %rsi
callq 0xec09
addq $0x20, %r14
jmp 0xeb95
movq 0x15430(%rip), %rdi     # 0x23ff0
callq 0x3100
cmpq $0x0, 0x10(%rbx)
je 0xebf6
movq 0x1541d(%rip), %rdi     # 0x23ff0
leaq 0x9d40(%rip), %rsi      # 0x1891a
callq 0x3210
movq %rax, %r14
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0xec09
movq %r14, %rdi
callq 0x3100
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::operator<<(std::ostream&, CSA::STNode const&)
std::ostream&
operator<<(std::ostream& stream, const STNode& data)
{
  stream << "(depth = " << data.string_depth << ", range = " << data.range << ", parent = " << data.parent;

  stream << ", siblings = (";
  for(STNode* curr = data.sibling; curr != 0; curr = curr->sibling)
  {
    if(curr != data.sibling) { stream << ", "; }
    stream << curr;
  }
  stream << ")";

  stream << ", children = (";
  for(STNode* curr = data.child; curr != 0; curr = curr->sibling)
  {
    if(curr != data.child) { stream << ", "; }
    stream << curr;
  }
  stream << ")";

  stream << ")";
  return stream;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x9d17(%rip), %rsi      # 0x18936
callq 0x3210
movl (%r14), %esi
movq %rax, %rdi
callq 0x3160
leaq 0x9d0a(%rip), %rsi      # 0x18940
movq %rax, %rdi
callq 0x3210
leaq 0x4(%r14), %rsi
movq %rax, %rdi
callq 0x10ddf
leaq 0x9cfa(%rip), %rsi      # 0x1894b
movq %rax, %rdi
callq 0x3210
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x9ceb(%rip), %rsi      # 0x18957
movq %rbx, %rdi
callq 0x3210
leaq 0x20(%r14), %r13
leaq 0x9da2(%rip), %r15      # 0x18a21
movq %r13, %r12
movq (%r12), %r12
testq %r12, %r12
je 0xecad
cmpq (%r13), %r12
je 0xec9c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3210
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31b0
addq $0x20, %r12
jmp 0xec82
leaq 0x968c(%rip), %rsi      # 0x18340
movq %rbx, %rdi
callq 0x3210
leaq 0x9ca3(%rip), %rsi      # 0x18966
movq %rbx, %rdi
callq 0x3210
addq $0x18, %r14
leaq 0x9d4b(%rip), %r15      # 0x18a21
movq %r14, %r12
movq (%r12), %r12
testq %r12, %r12
je 0xed03
cmpq (%r14), %r12
je 0xecf2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3210
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31b0
addq $0x20, %r12
jmp 0xecd9
leaq 0x9636(%rip), %r14      # 0x18340
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::remove()
void
STNode::remove()
{
  if(this->child == 0 || this->parent == 0) { return; }  // Cannot remove root or leaves.

  STNode* curr;
  for(curr = this->child; curr != 0; curr = curr->sibling) { curr->parent = this->parent; }
  if(this == this->parent->child) { this->parent->child = this->child; }
  else
  {
    for(curr = this->parent->child; curr->sibling != this; curr = curr->sibling);
    curr->sibling = this->child;
  }
  for(curr = this->child; curr->sibling != 0; curr = curr->sibling);
  curr->sibling = this->sibling;

  this->parent = this->child = this->sibling = 0;
}

// Assembly:
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0xed98
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0xed98
leaq 0x10(%rdi), %rcx
movq %rax, %rsi
testq %rsi, %rsi
je 0xed56
movq %rdx, 0x10(%rsi)
movq 0x20(%rsi), %rsi
jmp 0xed47
movq 0x18(%rdx), %rsi
cmpq %rdi, %rsi
je 0xed71
movq %rsi, %rdx
movq 0x20(%rsi), %rsi
cmpq %rdi, %rsi
jne 0xed5f
movq %rax, 0x20(%rdx)
jmp 0xed79
movq %rax, 0x18(%rdx)
movq 0x18(%rdi), %rax
movq %rax, %rdx
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0xed79
movq 0x20(%rdi), %rax
movq %rax, 0x20(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::determineSize(unsigned int&, unsigned int&)
void
STNode::determineSize(uint& nodes, uint& leaves)
{
  nodes++;
  if(this->child == 0) { leaves++; }
  else { this->child->determineSize(nodes, leaves); }
  if(this->sibling != 0) { this->sibling->determineSize(nodes, leaves); }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
incl (%r14)
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0xedc1
movq %r14, %rsi
movq %rbx, %rdx
callq 0xed9a
jmp 0xedc3
incl (%rbx)
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0xeda8
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::computeStoredDocuments(unsigned int*)
void
STNode::computeStoredDocuments(usint* documents)
{
  this->stored_documents = 0;
  delete this->docs; this->docs = 0;
  if(this->child == 0)
  {
    this->docs = new std::vector<uint>(documents + this->range.first, documents + this->range.second + 1);
  }
  else
  {
    this->docs = new std::vector<uint>;
    for(STNode* curr = this->child; curr != 0; curr = curr->sibling)
    {
      this->docs->insert(this->docs->end(), curr->docs->begin(), curr->docs->end());
      this->stored_documents += curr->stored_documents;
    }
  }
  removeDuplicates(this->docs, (this->docs->size() >= 65536));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
andl $0x0, 0x30(%rdi)
movq %rsi, %r15
movq 0x40(%rdi), %r14
testq %r14, %r14
je 0xedfa
movq %r14, %rdi
callq 0xd8ea
pushq $0x18
popq %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3240
andq $0x0, 0x40(%rbx)
movq 0x18(%rbx), %r13
movq %r12, %rdi
callq 0x3230
movq %rax, %r14
testq %r13, %r13
je 0xee5f
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %r14, 0x40(%rbx)
movq 0x40(%rbx), %r14
testq %r13, %r13
je 0xee82
movq 0x8(%r14), %rsi
movq 0x40(%r13), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq %r14, %rdi
callq 0x10da2
movl 0x30(%r13), %eax
addl %eax, 0x30(%rbx)
movq 0x20(%r13), %r13
jmp 0xee32
movl 0x4(%rbx), %eax
movl 0x8(%rbx), %ecx
leaq (%r15,%rax,4), %rsi
leaq (%r15,%rcx,4), %rdx
addq $0x4, %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
callq 0x10d70
movq %r14, 0x40(%rbx)
movq 0x8(%r14), %rax
subq (%r14), %rax
xorl %esi, %esi
cmpq $0x3fffd, %rax          # imm = 0x3FFFD
setae %sil
movq %r14, %rdi
callq 0x993c
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x3240
movq %rbx, %rdi
callq 0x3430
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::containsAllDocuments()
void
STNode::containsAllDocuments()
{
  if(this->docs != 0)
  {
    this->stored_documents = this->docs->size();
    delete this->docs; this->docs = 0;
  }
  for(STNode* curr = this; curr != 0; curr = curr->parent)
  {
    curr->contains_all = true;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %r14
testq %r14, %r14
je 0xef02
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x2, %rax
movl %eax, 0x30(%rbx)
movq %r14, %rdi
callq 0xd8ea
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x3240
andq $0x0, 0x40(%rbx)
jmp 0xef02
movb $0x1, 0x38(%rbx)
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0xeefa
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::setNext()
void
STNode::setNext()
{
  std::stack<STNode*> nodestack;
  std::vector<STNode*> previous;
  for(STNode* temp = this; temp != 0; temp = temp->child) { nodestack.push(temp); }
  this->next = 0;

  while(nodestack.top() != this)
  {
    STNode* curr = nodestack.top(); nodestack.pop();
    for(STNode* temp = curr->sibling; temp != 0; temp = temp->child) { nodestack.push(temp); }

    if(curr->child == 0)
    {
      for(std::vector<STNode*>::iterator iter = previous.begin(); iter != previous.end(); ++iter)
      {
        (*iter)->next = curr;
      }
      previous.clear();
    }
    curr->next = 0; previous.push_back(curr);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x53d2
andq $0x0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rsp, %r15
movq %rbx, %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0xefc0
movq %r14, %rdi
movq %r15, %rsi
callq 0x59d4
movq (%rsp), %rax
movq 0x18(%rax), %rax
jmp 0xefa2
andq $0x0, 0x28(%rbx)
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %rsp, %r12
leaq 0x8(%rsp), %r13
movq 0x60(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0xefe9
movq -0x8(%rax), %rax
jmp 0xeff9
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movq 0x1f8(%rax), %rax
cmpq %rbx, %rax
je 0xf082
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x597e
movq (%rsp), %rax
addq $0x20, %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xf039
movq %r14, %rdi
movq %r13, %rsi
callq 0x59d4
movq 0x8(%rsp), %rax
addq $0x18, %rax
jmp 0xf016
movq (%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0xf06d
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq %rcx, %rsi
cmpq %rdx, %rsi
je 0xf063
movq (%rsi), %rdi
movq %rax, 0x28(%rdi)
addq $0x8, %rsi
jmp 0xf051
cmpq %rcx, %rdx
je 0xf06d
movq %rcx, 0x18(%rsp)
andq $0x0, 0x28(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0x10dc2
jmp 0xefd7
leaq 0x10(%rsp), %rdi
callq 0x115e0
leaq 0x30(%rsp), %rdi
callq 0x5452
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xf0ab
jmp 0xf0ab
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x115e0
leaq 0x30(%rsp), %rdi
callq 0x5452
movq %rbx, %rdi
callq 0x3430