LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/main.cpp
// Function: PrintSummary(std::vector<Process*, std::allocator<Process*>>)
void PrintSummary(vector<Process *> processes) {
    for (Process * p : processes) {
        p->PrintStatistics();
        cost += p->ComputeCost();
    }
    
    cost += (long long)(inst_count - ctx_switches - process_exits) + (long long)(ctx_switches) * 121 + (long long)(process_exits) * 175;
    
    printf("TOTALCOST %lu %lu %lu %llu\n", inst_count, ctx_switches, process_exits, cost);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x8(%rdi), %r15
cmpq %r15, %r14
je 0x35af
movq (%r14), %rbx
movq %rbx, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4336
addq %rax, 0x5c17(%rip)      # 0x91c0
addq $0x8, %r14
jmp 0x358a
movq 0x5bf2(%rip), %rsi      # 0x91a8
movq 0x5bf3(%rip), %rdx      # 0x91b0
movq 0x5bf4(%rip), %rcx      # 0x91b8
imulq $0x79, %rdx, %rax
imulq $0xaf, %rcx, %rdi
movq %rsi, %r8
subq %rdx, %r8
subq %rcx, %r8
addq %rax, %r8
addq %rdi, %r8
addq 0x5bdb(%rip), %r8       # 0x91c0
movq %r8, 0x5bd4(%rip)       # 0x91c0
leaq 0x2ac9(%rip), %rdi      # 0x60bc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/main.cpp
// Function: GetNextInstruction(std::basic_ifstream<char, std::char_traits<char>>&, char&, int&)
bool GetNextInstruction(ifstream &input_file, char &operation, int &vpage) {
    string line;
    SkipComments(input_file, line);
    
    if (input_file.eof() || line[0] == '#') {
        return false;
    }
    
    istringstream input(line);
    input >> operation >> vpage;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x40(%rbp), %rsi
callq 0x3909
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r15,%rax)
jne 0x3657
movq -0x40(%rbp), %rax
cmpb $0x23, (%rax)
jne 0x365b
xorl %ebx, %ebx
jmp 0x36ab
leaq -0x1c0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x8, %edx
callq 0x2220
leaq -0x1c0(%rbp), %rdi
movq %r14, %rsi
callq 0x2180
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20e0
movq 0x5937(%rip), %rsi      # 0x8fc8
leaq -0x1c0(%rbp), %rdi
callq 0x21a0
leaq -0x148(%rbp), %rdi
callq 0x20a0
movb $0x1, %bl
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x36c0
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2150
movl %ebx, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x36f8
movq %rax, %rbx
movq 0x58ea(%rip), %rsi      # 0x8fc8
leaq -0x1c0(%rbp), %rdi
callq 0x21a0
leaq -0x148(%rbp), %rdi
callq 0x20a0
jmp 0x36fb
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x3710
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/main.cpp
// Function: ExitProcess(Process*, Pager*)
void ExitProcess(Process * curr_process, Pager * pager) {
    printf("EXIT current process %d\n", curr_process->pid);
    for (Pte * pte : curr_process->page_table) {
        if (pte->present) {
            // Unmap the page (UNMAP)
            Frame * curr_frame = frame_table[pte->physical_frame];
            curr_process->unmap_count++;
            if (O_option) {
                printf(" UNMAP %d:%d\n", curr_frame->pid, curr_frame->vpage);
            }
                        
            // Save frame to disk (FOUT): FOUT modified filemapped pages
            // Note that dirty non-fmapped (anonymous) pages are not written back (OUT) as the process exits.
            if (pte->modified && pte->file_mapped) {
                curr_process->fout_count++;
                if (O_option) {
                    printf(" FOUT\n");
                }
            }
            // Reset the used frame and Returned it to the free pool
            curr_frame->ResetFrame();
            pager->ResetPager(pte->physical_frame);
            free_frames.push_back(curr_frame);
        }
        pte->ResetPte();
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %esi
leaq 0x28f6(%rip), %rdi      # 0x602b
xorl %eax, %eax
callq 0x2030
movq 0x20(%r14), %r12
movq %r14, -0x30(%rbp)
movq 0x28(%r14), %r14
cmpq %r14, %r12
je 0x380f
movq (%r12), %r15
movl (%r15), %eax
testb $0x1, %al
je 0x37fe
movq 0x5a11(%rip), %rcx      # 0x9178
shrl $0x3, %eax
andl $0x3f8, %eax            # imm = 0x3F8
movq (%rcx,%rax), %r13
movq -0x30(%rbp), %rax
incq 0x48(%rax)
cmpl $0x0, 0x59d2(%rip)      # 0x9154
je 0x379a
movl 0x4(%r13), %esi
movl 0x8(%r13), %edx
leaq 0x2881(%rip), %rdi      # 0x6014
xorl %eax, %eax
callq 0x2030
movl (%r15), %eax
notl %eax
testb $0x14, %al
jne 0x37c0
movq -0x30(%rbp), %rax
incq 0x70(%rax)
cmpl $0x0, 0x59a2(%rip)      # 0x9154
je 0x37c0
leaq 0x29e6(%rip), %rdi      # 0x61a1
callq 0x21c0
movq %r13, %rdi
callq 0x4750
movl (%r15), %esi
shrl $0x6, %esi
andl $0x7f, %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl $0x18, %edi
callq 0x2140
movq %r13, 0x10(%rax)
movq %rax, %rdi
leaq 0x599e(%rip), %rsi      # 0x9190
callq 0x2040
incq 0x59a2(%rip)            # 0x91a0
movq %r15, %rdi
callq 0x472c
addq $0x8, %r12
jmp 0x3748
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/main.cpp
// Function: GetFrame(Pager*, std::vector<Process*, std::allocator<Process*>>)
Frame * GetFrame(Pager * pager, vector<Process *> processes) {
    if (free_frames.empty()) {
        return pager->SelectVictimFrame(frame_table, processes, inst_count);
    }
    Frame * frame = free_frames.front();
    free_frames.pop_front();
    return frame;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq 0x595e(%rip), %r15      # 0x9190
leaq 0x5957(%rip), %rax      # 0x9190
cmpq %rax, %r15
je 0x385b
movq 0x10(%r15), %rbx
decq 0x5957(%rip)            # 0x91a0
movq %r15, %rdi
callq 0x2210
movl $0x18, %esi
movq %r15, %rdi
jmp 0x38bc
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5910(%rip), %rsi      # 0x9178
leaq -0x48(%rbp), %rdi
callq 0x3b54
leaq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x3ad4
movq 0x5924(%rip), %rcx      # 0x91a8
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq *(%rax)
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x38ac
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x38c1
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x38ec
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
jmp 0x38ec
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x3901
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/main.cpp
// Function: ParseOptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void ParseOptions(string options) {
    for (int i = 0; options[i]; i++) {
        switch (options[i]) {
            case 'O':
              O_option = 1;
              break;
            case 'P':
              P_option = 1;
              break;
            case 'F':
              F_option = 1;
              break;
            case 'S':
              S_option = 1;
              break;
            case 'x':
              x_option = 1;
              break;
            case 'y':
              y_option = 1;
              break;
            case 'f':
              f_option = 1;
              break;
            case 'a':
              a_option = 1;
              break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rax
leaq 0x57f0(%rip), %rcx      # 0x9154
leaq 0x57f1(%rip), %rdx      # 0x915c
leaq 0x57e6(%rip), %rsi      # 0x9158
leaq 0x57e7(%rip), %rdi      # 0x9160
leaq 0x57f0(%rip), %r8       # 0x9170
leaq 0x57e5(%rip), %r9       # 0x916c
leaq 0x57d6(%rip), %r10      # 0x9164
leaq 0x57d3(%rip), %r11      # 0x9168
movzbl (%rax), %ebx
cmpl $0x60, %ebx
jg 0x39b5
cmpl $0x4f, %ebx
jg 0x39c9
cmpl $0x46, %ebx
je 0x39f6
movq %rcx, %r14
cmpl $0x4f, %ebx
je 0x39f9
testl %ebx, %ebx
jne 0x3a00
jmp 0x3a05
cmpl $0x77, %ebx
jg 0x39d8
cmpl $0x61, %ebx
je 0x39ec
cmpl $0x66, %ebx
jne 0x3a00
movq %r9, %r14
jmp 0x39f9
cmpl $0x50, %ebx
je 0x39e7
cmpl $0x53, %ebx
jne 0x3a00
movq %rdi, %r14
jmp 0x39f9
cmpl $0x78, %ebx
je 0x39f1
cmpl $0x79, %ebx
jne 0x3a00
movq %r11, %r14
jmp 0x39f9
movq %rsi, %r14
jmp 0x39f9
movq %r8, %r14
jmp 0x39f9
movq %r10, %r14
jmp 0x39f9
movq %rdx, %r14
movl $0x1, (%r14)
incq %rax
jmp 0x3995
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/process.cpp
// Function: Process::PrintPagetable()
void Process::PrintPagetable() {
    printf("PT[%d]:", pid);
    for(int i = 0; i < kVpageSize; i++) {
        if (!page_table[i]->present) {
            if (page_table[i]->pagedout) {
                printf(" #");
            } else {
                printf(" *");
            }
            continue;
        }
        printf(" %d:%c%c%c", i, page_table[i]->referenced ? 'R' : '-', page_table[i]->modified ? 'M' : '-', page_table[i]->pagedout ? 'S' : '-');
    }
    printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %esi
leaq 0x1e42(%rip), %rdi      # 0x61ec
xorl %eax, %eax
callq 0x2030
leaq 0x1e3c(%rip), %r15      # 0x61f4
movl $0x2d, %r14d
leaq 0x1e32(%rip), %r12      # 0x61f7
xorl %r13d, %r13d
movq 0x20(%rbx), %rax
movq (%rax,%r13,8), %rax
movl (%rax), %eax
testb $0x1, %al
jne 0x43e3
testb $0x20, %al
jne 0x4415
leaq 0x1d02(%rip), %rdi      # 0x60e3
jmp 0x4418
testb $0x2, %al
movl $0x52, %edx
cmovel %r14d, %edx
movl %eax, %ecx
andl $0x4, %ecx
leal 0x2d(,%rcx,8), %ecx
testb $0x20, %al
movl $0x53, %r8d
cmovel %r14d, %r8d
movq %r12, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x2030
jmp 0x441f
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
incq %r13
cmpq $0x40, %r13
jne 0x43c8
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/pager.cpp
// Function: FifoPager::SelectVictimFrame(std::vector<Frame*, std::allocator<Frame*>>, std::vector<Process*, std::allocator<Process*>>, unsigned long)
Frame * FifoPager::SelectVictimFrame(vector<Frame *> frame_table, vector<Process *> processes, unsigned long timestamp) {
    hand++;
    if (hand >= frame_table.size()) {
        hand = 0;
    }
    return frame_table[hand];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x8(%rdi), %rcx
incq %rcx
movl %ecx, 0x8(%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rcx, %rdx
ja 0x47a8
movl $0x0, 0x8(%rdi)
movslq 0x8(%rdi), %rcx
movq (%rax,%rcx,8), %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/pager.cpp
// Function: RandomPager::SelectVictimFrame(std::vector<Frame*, std::allocator<Frame*>>, std::vector<Process*, std::allocator<Process*>>, unsigned long)
Frame * RandomPager::SelectVictimFrame(vector<Frame *> frame_table, vector<Process *> processes, unsigned long timestamp) {
    ofs++;
    
    if (ofs >= randoms.size()) {
        ofs = 0;
    }
    
    hand = randoms[ofs] % frame_table.size();
    return frame_table[hand];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
incq %rcx
movl %ecx, 0xc(%rdi)
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rcx, %rdx
ja 0x4819
movl $0x0, 0xc(%rdi)
movslq 0xc(%rdi), %rcx
movslq (%rax,%rcx,4), %rax
movq (%rsi), %rcx
movq 0x8(%rsi), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
xorl %edx, %edx
divq %rsi
movl %edx, 0x8(%rdi)
movslq %edx, %rax
movq (%rcx,%rax,8), %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eva23511[P]OS-Virtual-Memory-Management/pager.cpp
// Function: ClockPager::SelectVictimFrame(std::vector<Frame*, std::allocator<Frame*>>, std::vector<Process*, std::allocator<Process*>>, unsigned long)
Frame * ClockPager::SelectVictimFrame(vector<Frame *> frame_table, vector<Process *> processes, unsigned long timestamp) {
    hand++;
    if (hand >= frame_table.size()) {
        hand = 0;
    }
    
    while (processes[frame_table[hand]->pid]->page_table[frame_table[hand]->vpage]->referenced) {
        processes[frame_table[hand]->pid]->page_table[frame_table[hand]->vpage]->referenced = 0;

        hand++;
        if (hand >= frame_table.size()) {
            hand = 0;
        }
    }
    return frame_table[hand];
}

// Assembly:
movslq 0x8(%rdi), %rax
incq %rax
movl %eax, 0x8(%rdi)
movq 0x8(%rsi), %rcx
subq (%rsi), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
ja 0x487f
movl $0x0, 0x8(%rdi)
pushq %rbp
movq %rsp, %rbp
movslq 0x8(%rdi), %rax
movq (%rsi), %rcx
movq (%rcx,%rax,8), %rax
movslq 0x4(%rax), %rcx
movq (%rdx), %r8
movq (%r8,%rcx,8), %rcx
movslq 0x8(%rax), %r8
movq 0x20(%rcx), %rcx
movq (%rcx,%r8,8), %rcx
movl (%rcx), %r8d
testb $0x2, %r8b
je 0x48d8
andl $-0x3, %r8d
movl %r8d, (%rcx)
movslq 0x8(%rdi), %rax
incq %rax
movl %eax, 0x8(%rdi)
movq 0x8(%rsi), %rcx
subq (%rsi), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
ja 0x4883
movl $0x0, 0x8(%rdi)
jmp 0x4883
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/macfergus[P]baduk/cppsrc/apps/randomplay.cpp
// Function: main
int main() {
    auto game = baduk::newGame(19, 7.5);
    baduk::RandomBot black_bot;
    baduk::RandomBot white_bot;

    while (!game->isOver()) {
        std::cout << game->board() << "\n";
        auto next_agent =
            game->nextPlayer() == baduk::Stone::black ?
                &black_bot :
                &white_bot;
        const auto next_move = next_agent->selectMove(*game);

        game = game->applyMove(next_move);
    }
    std::cout << game->board() << "\n";

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsp, %rdi
movss 0x1277(%rip), %xmm0     # 0x12604
movl $0x13, %esi
callq 0x3ba5
leaq 0x596a(%rip), %rbx      # 0x16d08
addq $0x10, %rbx
leaq 0x48(%rsp), %r13
movq %rbx, (%r13)
callq 0x3040
movabsq $0x20c49ba5e353f7cf, %r14 # imm = 0x20C49BA5E353F7CF
imulq %r14
movq %rdx, %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rcx
addq %rax, %rcx
movabsq $0x200000005, %r15      # imm = 0x200000005
movq %rcx, %rax
mulq %r15
movq %rcx, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0x1e, %rax
movq %rax, %rdx
shlq $0x1f, %rdx
subq %rdx, %rax
leaq (%rcx,%rax), %rdx
cmpq $0x1, %rdx
adcq %rcx, %rax
movq %rax, 0x8(%r13)
leaq 0x38(%rsp), %rbp
movq %rbx, (%rbp)
callq 0x3040
imulq %r14
movq %rdx, %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rcx
addq %rax, %rcx
movq %rcx, %rax
mulq %r15
movq %rcx, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0x1e, %rax
movq %rax, %rdx
shlq $0x1f, %rdx
subq %rdx, %rax
leaq (%rcx,%rax), %rdx
cmpq $0x1, %rdx
adcq %rcx, %rax
movq %rax, 0x8(%rbp)
movq 0x5b59(%rip), %rbx      # 0x16fb8
leaq 0x1138(%rip), %r14      # 0x1259e
leaq 0x10(%rsp), %r15
leaq 0x28(%rsp), %r12
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq (%rsp), %rdi
movq (%rdi), %rcx
movq 0x10(%rcx), %rcx
testb %al, %al
jne 0x11518
callq *%rcx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x10ddf
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x31b0
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %r13, %rdi
testl %eax, %eax
je 0x114be
movq %rbp, %rdi
movq (%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movq %rax, 0x28(%rsp)
movb %dl, 0x30(%rsp)
movq (%rsp), %rsi
movq (%rsi), %rax
movq %r15, %rdi
movq %r12, %rdx
callq *0x28(%rax)
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movups %xmm0, (%rsp)
testq %rdi, %rdi
je 0x11500
callq 0x3cea
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x11470
callq 0x3cea
jmp 0x11470
callq *%rcx
movq 0x5a97(%rip), %rdi      # 0x16fb8
movq %rax, %rsi
callq 0x10ddf
leaq 0x106e(%rip), %rsi      # 0x1259e
movl $0x1, %edx
movq %rax, %rdi
callq 0x31b0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1154c
callq 0x3cea
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11565
jmp 0x11565
jmp 0x11565
jmp 0x11565
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11577
callq 0x3cea
movq %rbx, %rdi
callq 0x3290
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/BOBWrapper.cpp
// Function: BOBSim::getPageWalkLogicOp(unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>*)
void *getPageWalkLogicOp(uint64_t baseAddr, vector<uint64_t> *args)
{
	if (!args)
	{
		ERROR(" == Got a logic op without an arguments vector");
	}

	LogicOperation *lo = new LogicOperation(LogicOperation::PAGE_TABLE_WALK, *args);
	return (void*)(lo);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rsi, %rsi
jne 0x9fb8
movq 0xf0d3(%rip), %r14      # 0x18ff0
leaq 0x9254(%rip), %rsi      # 0x13178
movl $0x8, %edx
movq %r14, %rdi
callq 0x3200
leaq 0x9c65(%rip), %rsi      # 0x13b9d
movl $0xe, %edx
movq %r14, %rdi
callq 0x3200
leaq 0x91d5(%rip), %rsi      # 0x13121
movl $0x1, %edx
movq %r14, %rdi
callq 0x3200
movq %r14, %rdi
movl $0xc7, %esi
callq 0x3330
movq %rax, %r14
leaq 0x9219(%rip), %rsi      # 0x13189
movl $0x4, %edx
movq %rax, %rdi
callq 0x3200
leaq 0x9c28(%rip), %rsi      # 0x13bac
movl $0x2e, %edx
movq %r14, %rdi
callq 0x3200
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movl $0x20, %edi
callq 0x31d0
movq %rax, %r14
movq %rax, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0xed44
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movl $0x20, %esi
movq %r14, %rdi
callq 0x31f0
movq %rbx, %rdi
callq 0x3340
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/BOBWrapper.cpp
// Function: BOBSim::BOBWrapper::AddTransaction(unsigned long, bool, int, void*)
bool BOBWrapper::AddTransaction(uint64_t addr, bool isWrite, int coreID, void *logicOperation)
{
	int openPort;
	bool isLogicOp = logicOperation != NULL;
	TransactionType type = isLogicOp ? LOGIC_OPERATION : (isWrite ? DATA_WRITE : DATA_READ) ;
	Transaction *trans;

	if ((openPort = FindOpenPort(coreID)) > -1)
	{
		trans = new Transaction(type, TRANSACTION_SIZE, addr);
		trans->portID = openPort;
		trans->coreID=coreID;
		if (isLogicOp)
		{
			trans->logicOpContents = logicOperation;
		}
		if(currentClockCycle<5000)
		{
			DEBUG("!! "<<*trans<<" to port "<<openPort);
		}
		if (isWrite)
			writesPerCycle++;
		else
			readsPerCycle++;

		AddTransaction(trans, openPort);
	}
	else 
	{
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rsi, %r15
movq %rdi, %rbx
testq %r8, %r8
movl $0x3, %r13d
cmovel %edx, %r13d
leaq 0xf1b0(%rip), %rax      # 0x191d0
movl (%rax), %eax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xa068
movq 0x10(%rbx), %r11
movq 0x30(%rbx), %rsi
movl $0x6, %edi
xorl %r10d, %r10d
cmpl $0x0, (%rsi,%r10,4)
jne 0xa057
movq 0x10(%r11), %r8
movq (%r8,%rdi,4), %r9
subq -0x8(%r8,%rdi,4), %r9
cmpq $0x40, %r9
jb 0xa065
incq %r10
addq $0x10, %rdi
cmpq %r10, %rax
jne 0xa03d
jmp 0xa068
movl %r10d, %r14d
testl %r14d, %r14d
js 0xa14b
movl %ecx, %ebp
movl %edx, 0x4(%rsp)
movl $0x90, %edi
callq 0x31d0
movq %r15, %rcx
movq %rax, %r15
movq %rax, %rdi
movl %r13d, %esi
movl $0x40, %edx
callq 0x123f0
movl %r14d, 0x1c(%r15)
movl %ebp, 0x20(%r15)
testq %r12, %r12
je 0xa0a8
movq %r12, 0x28(%r15)
cmpq $0x1387, 0x8(%rbx)      # imm = 0x1387
ja 0xa130
leaq 0xf11b(%rip), %rax      # 0x191d4
cmpl $0x0, (%rax)
je 0xa130
movq 0xef03(%rip), %r12      # 0x18fc8
leaq 0x9b0f(%rip), %rsi      # 0x13bdb
movl $0x3, %edx
movq %r12, %rdi
callq 0x3200
movq %r12, %rdi
movq %r15, %rsi
callq 0x1243b
movq %rax, %r12
leaq 0x9af1(%rip), %rsi      # 0x13bdf
movl $0x9, %edx
movq %rax, %rdi
callq 0x3200
movq %r12, %rdi
movl %r14d, %esi
callq 0x3330
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movzbl 0x4(%rsp), %eax
incq 0xb8(%rbx,%rax,8)
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xa178
testl %r14d, %r14d
setns %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
callq 0x31f0
movq %rbx, %rdi
callq 0x3340
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/BankState.cpp
// Function: BOBSim::BankState::UpdateStateChange()
void BankState::UpdateStateChange()
{
	if(stateChangeCountdown>0)
	{
		stateChangeCountdown--;

		if(stateChangeCountdown==0)
		{
			switch(lastCommand)
			{
			case REFRESH:
				currentBankState = IDLE;
				break;
			case WRITE_P:
			case READ_P:
				currentBankState = PRECHARGING;
				stateChangeCountdown = tRP;
				lastCommand = PRECHARGE;
				break;
			case PRECHARGE:
				currentBankState = IDLE;
				break;
			default:
				ERROR("== WTF STATE? : "<<lastCommand);
				exit(0);
			}
		}
	}
}

// Assembly:
pushq %rbx
movl 0x3c(%rdi), %eax
testl %eax, %eax
je 0xc5c2
movq %rdi, %rbx
decl %eax
movl %eax, 0x3c(%rdi)
jne 0xc5c2
movl 0x38(%rbx), %eax
decl %eax
cmpl $0x5, %eax
ja 0xc5c4
leaq 0x7a73(%rip), %rcx      # 0x14010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, (%rbx)
movabsq $0x900000006, %rax      # imm = 0x900000006
movq %rax, 0x38(%rbx)
jmp 0xc5c2
movl $0x0, (%rbx)
popq %rbx
retq
movq 0xca25(%rip), %rdi      # 0x18ff0
leaq 0x6ba6(%rip), %rsi      # 0x13178
callq 0x31c0
leaq 0x7a5a(%rip), %rsi      # 0x14038
movq %rax, %rdi
callq 0x31c0
leaq 0x6b34(%rip), %rsi      # 0x13121
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl $0x4a, %esi
callq 0x3330
leaq 0x6b80(%rip), %rsi      # 0x13189
movq %rax, %rdi
callq 0x31c0
leaq 0x7a2e(%rip), %rsi      # 0x14046
movq %rax, %rdi
callq 0x31c0
movl 0x38(%rbx), %esi
movq %rax, %rdi
callq 0x3330
movq %rax, %rdi
callq 0x30d0
xorl %edi, %edi
callq 0x3220
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/BankState.cpp
// Function: BOBSim::operator<<(std::ostream&, BOBSim::BankState const&)
ostream &operator<<(ostream &out, const BankState &bs)
{
	//out << dec <<" == Bank State " <<endl;
	switch(bs.currentBankState)
	{
	case IDLE:
		out<<"    State : Idle" <<endl;
		break;
	case ROW_ACTIVE:
		out<<"    State : Active" <<endl;
		break;
	case PRECHARGING:
		out<<"    State : Precharging" <<endl;
		break;
	case REFRESHING:
		out<<"    State : Refreshing" <<endl;
		break;
	}
	/*
	out<<"    StateChange    : " << bs.stateChangeCountdown<<endl;
	out<<"    OpenRowAddress : " << bs.openRowAddress <<endl;
	out<<"    nextRead       : " << bs.nextRead <<endl;
	out<<"    nextWrite      : " << bs.nextWrite <<endl;
	out<<"    nextActivate   : " << bs.nextActivate <<endl;
	out<<"    nextStrobeMin  : " << bs.nextStrobeMin << endl;
	out<<"    nextStrobeMax  : " << bs.nextStrobeMax << endl;
	*/
	return out;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
cmpq $0x3, %rax
ja 0xc6bb
leaq 0x79db(%rip), %rcx      # 0x14028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x79fa(%rip), %rsi      # 0x14057
movl $0x10, %edx
jmp 0xc68c
leaq 0x7a10(%rip), %rsi      # 0x1407b
movl $0x17, %edx
jmp 0xc68c
leaq 0x7a1a(%rip), %rsi      # 0x14093
movl $0x16, %edx
jmp 0xc68c
leaq 0x79e1(%rip), %rsi      # 0x14068
movl $0x12, %edx
movq %rbx, %rdi
callq 0x3200
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/DRAMChannel.cpp
// Function: BOBSim::DRAMChannel::ReceiveOnCmdBus(BOBSim::BusPacket*, unsigned int)
void DRAMChannel::ReceiveOnCmdBus(BusPacket *busPacket, unsigned id)
{
	if(inFlightCommandPacket!=NULL)
	{
		ERROR("== Error - Bus collision while trying to receive from controller");
		ERROR("   Existing : "<<*inFlightCommandPacket);
		ERROR("   Incoming : "<<*busPacket);
		exit(0);
	}

	if(DEBUG_CHANNEL) DEBUG("     == Putting command on bus : " << *busPacket);

	//Report the time we waited in the queue
	if(busPacket->busPacketType==ACTIVATE)
	{
		(*ReportCallback)(busPacket, 0);
	}
	//Report the WRITE is finally going
	else if(busPacket->busPacketType==WRITE_P)
	{
		(*ReportCallback)(busPacket, 0);
	}

	inFlightCommandPacket = busPacket;
	inFlightCommandCountdown = tCMDS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x260(%rdi)
jne 0xd2c9
movl 0x4(%rbx), %eax
addl $-0x3, %eax
cmpl $0x1, %eax
ja 0xd2a8
movq 0x250(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
xorl %edx, %edx
callq *0x10(%rax)
movq %rbx, 0x260(%r14)
movl $0x1, 0x268(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xbd20(%rip), %r12      # 0x18ff0
leaq 0x5ea1(%rip), %rsi      # 0x13178
movq %r12, %rdi
callq 0x31c0
leaq 0x6f55(%rip), %r13      # 0x1423b
movq %rax, %rdi
movq %r13, %rsi
callq 0x31c0
leaq 0x5e29(%rip), %rbp      # 0x13121
movq %rax, %rdi
movq %rbp, %rsi
callq 0x31c0
movq %rax, %rdi
movl $0xd8, %esi
callq 0x3330
leaq 0x5e72(%rip), %r15      # 0x13189
movq %rax, %rdi
movq %r15, %rsi
callq 0x31c0
leaq 0x6f9f(%rip), %rsi      # 0x142c8
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
callq 0x30d0
movq %r12, %rdi
leaq 0x5e35(%rip), %rsi      # 0x13178
callq 0x31c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x31c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x31c0
movq %rax, %rdi
movl $0xd9, %esi
callq 0x3330
movq %rax, %rdi
movq %r15, %rsi
callq 0x31c0
leaq 0x6f8c(%rip), %rsi      # 0x14309
movq %rax, %rdi
callq 0x31c0
movq 0x260(%r14), %rsi
movq %rax, %rdi
callq 0xc9a7
movq %rax, %rdi
callq 0x30d0
movq %r12, %rdi
leaq 0x5dd2(%rip), %rsi      # 0x13178
callq 0x31c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x31c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x31c0
movq %rax, %rdi
movl $0xda, %esi
callq 0x3330
movq %rax, %rdi
movq %r15, %rsi
callq 0x31c0
leaq 0x6f38(%rip), %rsi      # 0x14318
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0xc9a7
movq %rax, %rdi
callq 0x30d0
xorl %edi, %edi
callq 0x3220
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/DRAMChannel.cpp
// Function: BOBSim::DRAMChannel::AddTransaction(BOBSim::Transaction*, unsigned int)
bool DRAMChannel::AddTransaction(Transaction *trans, unsigned notused)
{
	if(DEBUG_CHANNEL)DEBUG("    In AddTransaction - got : "<<*trans);

	if(trans->transactionType==LOGIC_OPERATION)
	{
		if(SendToLogicLayer!=NULL)
		{
			(*SendToLogicLayer)(trans,0);
		}
		else
		{
			ERROR("== Logic Layers are not registered, yet receiving a logic operation.  Please register");
			exit(0);
		}
	}
	else if(trans->transactionType==LOGIC_RESPONSE)
	{
		if(pendingLogicResponse==NULL)
		{
			if (DEBUG_LOGIC) DEBUG("== Made it back to channel on cycle "<<currentClockCycle<<" : "<<*trans);
			pendingLogicResponse = trans;
		}
		else return false;
	}
	else
	{
		if(simpleController.waitingACTS<CHANNEL_WORK_Q_MAX)
		{
			simpleController.AddTransaction(trans);
		}
		else return false;
	}

	return true;
}

// Assembly:
pushq %rax
movl (%rsi), %eax
cmpl $0x4, %eax
je 0xd425
cmpl $0x3, %eax
jne 0xd438
movq 0x258(%rdi), %rdi
testq %rdi, %rdi
je 0xd452
movq (%rdi), %rax
xorl %edx, %edx
callq *0x10(%rax)
jmp 0xd44a
cmpq $0x0, 0x1f0(%rdi)
jne 0xd44e
movq %rsi, 0x1f0(%rdi)
jmp 0xd44a
cmpl $0xf, 0x104(%rdi)
ja 0xd44e
addq $0x10, %rdi
callq 0x11a0e
movb $0x1, %al
jmp 0xd450
xorl %eax, %eax
popq %rcx
retq
movq 0xbb97(%rip), %rdi      # 0x18ff0
leaq 0x5d18(%rip), %rsi      # 0x13178
callq 0x31c0
leaq 0x6dcf(%rip), %rsi      # 0x1423b
movq %rax, %rdi
callq 0x31c0
leaq 0x5ca6(%rip), %rsi      # 0x13121
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl $0xbb, %esi
callq 0x3330
leaq 0x5cf2(%rip), %rsi      # 0x13189
movq %rax, %rdi
callq 0x31c0
leaq 0x6dcc(%rip), %rsi      # 0x14272
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
callq 0x30d0
xorl %edi, %edi
callq 0x3220
nop
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/LogicLayerInterface.cpp
// Function: BOBSim::LogicLayerInterface::ReceiveLogicOperation(BOBSim::Transaction*, unsigned int)
void LogicLayerInterface::ReceiveLogicOperation(Transaction *trans, unsigned i)
{
	if (DEBUG_LOGIC) DEBUG("== Received in logic layer "<<simpleControllerID<<" on cycle "<<currentClockCycle<<" : "<<*trans);
	if (trans->transactionType == LOGIC_OPERATION)
	{
		pendingLogicOpsQueue.push_back(trans);
	}
	else
	{
		newOperationQueue.push_back(trans);
	}
}

// Assembly:
pushq %rax
movq %rsi, (%rsp)
cmpl $0x3, (%rsi)
jne 0xe173
movq 0x58(%rdi), %rax
movq 0x68(%rdi), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0xe190
movq %rsi, (%rax)
addq $0x8, 0x58(%rdi)
jmp 0xe1ad
movq 0x80(%rdi), %rax
cmpq 0x88(%rdi), %rax
je 0xe19e
movq %rsi, (%rax)
addq $0x8, 0x80(%rdi)
jmp 0xe1ad
addq $0x28, %rdi
movq %rsp, %rsi
callq 0xeb30
jmp 0xe1ad
addq $0x78, %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq 0x7e56
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/Rank.cpp
// Function: BOBSim::Rank::Update()
void Rank::Update()
{
	for(unsigned i=0; i<NUM_BANKS; i++)
	{
		bankStates[i].UpdateStateChange();
	}

	for(unsigned i=0; i<readReturnCountdown.size(); i++)
	{
		readReturnCountdown[i]--;
	}
	if(readReturnCountdown.size()>0 && readReturnCountdown[0]==0)
	{
		(*ReadReturnCallback)(readReturnQueue[0],id);
		readReturnCountdown.erase(readReturnCountdown.begin());
		readReturnQueue.erase(readReturnQueue.begin());
	}

	//increment clock cycle
	currentClockCycle++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x50(%rbx), %rdi
addq %r14, %rdi
callq 0xc57a
addq $0x40, %r14
cmpq $0x200, %r14            # imm = 0x200
jne 0xfb4c
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
je 0xfb88
sarq $0x2, %rdx
xorl %esi, %esi
decl (%rax,%rsi,4)
incq %rsi
movl %esi, %edi
cmpq %rdi, %rdx
ja 0xfb7b
cmpq %rax, %rcx
je 0xfbe2
cmpl $0x0, (%rax)
jne 0xfbe2
movq 0x48(%rbx), %rdi
movq 0x30(%rbx), %rax
movq (%rax), %rsi
movl 0x10(%rbx), %edx
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rdx
leaq 0x4(%rdi), %rsi
cmpq %rdx, %rsi
je 0xfbbf
subq %rsi, %rdx
callq 0x32f0
addq $-0x4, 0x20(%rbx)
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0xfbdd
subq %rsi, %rdx
callq 0x32f0
addq $-0x8, 0x38(%rbx)
incq 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH10_GenericAlgorithms/examples/rev-iters.cc
// Function: main
int main()
{
    vector<int> vec = {0,1,2,3,4,5,6,7,8,9};
    // reverse iterator of vector from back to front
    for (auto r_iter = vec.crbegin(); // binds r_iter to the last element
              r_iter != vec.crend();  // one before first element
              ++r_iter)          // decrements the iterator one element
        cout << *r_iter << endl; // prints 9, 8, 7, . . . 0
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movups 0xdb4(%rip), %xmm0      # 0x2014
leaq -0x60(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0xd95(%rip), %xmm0      # 0x2004
movaps %xmm0, (%rsi)
movabsq $0x900000008, %rax      # imm = 0x900000008
movq %rax, 0x20(%rsi)
leaq -0x38(%rbp), %rbx
leaq -0x19(%rbp), %rcx
movl $0xa, %edx
movq %rbx, %rdi
callq 0x1324
movq 0x8(%rbx), %r15
movq 0x2d38(%rip), %rbx      # 0x3fd8
movq -0x38(%rbp), %rdi
cmpq %rdi, %r15
je 0x12e5
movl -0x4(%r15), %esi
movq %rbx, %rdi
callq 0x10e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
addq $-0x4, %r15
movq %rax, %rdi
callq 0x1060
jmp 0x12a0
testq %rdi, %rdi
je 0x12f6
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x10b0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x131b
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x10f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDNode::KDNode(std::vector<int, std::allocator<int>> const&, unsigned long const&, std::shared_ptr<KDNode> const&, std::shared_ptr<KDNode> const&)
KDNode::KDNode(const point_t &pt, const size_t &idx_, const KDNodePtr &left_,
               const KDNodePtr &right_) {
    x = pt;
    index = idx_;
    left = left_;
    right = right_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x38(%rdi)
movq %r15, %rdi
callq 0x4d98
movq (%r13), %rax
movq %rax, (%rbx)
movq (%r12), %rax
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %rdi
addq $0x8, %r12
movq %r12, %rsi
callq 0x503a
movq (%r14), %rax
movq %rax, 0x30(%rbx)
addq $0x38, %rbx
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x503a
movq %rax, %r14
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x37df
callq 0x508e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3446
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDNode::KDNode(std::pair<std::vector<int, std::allocator<int>>, unsigned long> const&, std::shared_ptr<KDNode> const&, std::shared_ptr<KDNode> const&)
KDNode::KDNode(const pointIndex &pi, const KDNodePtr &left_,
               const KDNodePtr &right_) {
    x = pi.first;
    index = pi.second;
    left = left_;
    right = right_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x38(%rdi)
movq %r15, %rdi
callq 0x4d98
movq 0x18(%r13), %rax
movq %rax, (%rbx)
movq (%r12), %rax
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %rdi
addq $0x8, %r12
movq %r12, %rsi
callq 0x503a
movq (%r14), %rax
movq %rax, 0x30(%rbx)
addq $0x38, %rbx
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x503a
movq %rax, %r14
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x3887
callq 0x508e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3473
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::KDTree(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>)
KDTree::KDTree(pointVec point_array) {
    leaf = std::make_shared< KDNode >();
    // iterators
    pointIndexArr arr;
    for (size_t i = 0; i < point_array.size(); i++) {
        arr.push_back(pointIndex(point_array.at(i), i));
    }

    auto begin = arr.begin();
    auto end = arr.end();

    size_t length = arr.size();
    size_t level = 0;  // starting

    root = KDTree::make_tree(begin, end, length, level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movl $0x50, %edi
movq %rbx, -0x30(%rbp)
callq 0x3250
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x14f80(%rip), %rcx     # 0x18ce0
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
movq $0x0, 0x48(%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movq %rax, 0x18(%rbx)
testq %rdi, %rdi
je 0x3d97
callq 0x508e
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq (%r14), %rsi
cmpq %rsi, 0x8(%r14)
je 0x3e0a
xorl %r13d, %r13d
leaq -0x70(%rbp), %r15
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
xorl %r12d, %r12d
addq %r13, %rsi
movq %r15, %rdi
callq 0x4e70
movq %r12, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x5db4
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3dec
callq 0x3230
incq %r12
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %rbx, %rax
addq $0x18, %r13
cmpq %rax, %r12
jb 0x3dc3
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x88(%rbp), %rcx
movq %rsi, (%rcx)
subq %rax, %rsi
sarq $0x5, %rsi
leaq -0x80(%rbp), %r8
movq %rsi, (%r8)
leaq -0x78(%rbp), %r9
movq $0x0, (%r9)
leaq -0x70(%rbp), %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x39c4
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x3e6b
callq 0x508e
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x3e79
callq 0x508e
leaq -0x50(%rbp), %rdi
callq 0x4ef0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3e98
movq %rax, %r14
jmp 0x3eb7
movq %rax, %r14
jmp 0x3eae
movq %rax, %r14
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3eae
callq 0x3230
leaq -0x50(%rbp), %rdi
callq 0x4ef0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
testq %rdi, %rdi
je 0x3ec9
callq 0x508e
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x3edb
callq 0x508e
movq %r14, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::nearest_(std::vector<int, std::allocator<int>> const&)
KDNodePtr KDTree::nearest_(const point_t &pt) {
    size_t level = 0;
    // KDNodePtr best = branch;
    int branch_dist = dist2(point_t(*root), pt);
    return nearest_(root,          // beginning of tree
                    pt,            // point we are querying
                    level,         // start from level 0
                    root,          // best is the root
                    branch_dist);  // best_dist = branch_dist
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq $0x0, -0x28(%rbp)
movq (%rsi), %rsi
addq $0x8, %rsi
leaq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x4e70
movq (%r12), %rdi
movq 0x8(%r12), %rax
subq %rdi, %rax
je 0x43c2
sarq $0x2, %rax
movq (%r15), %rcx
movq 0x8(%r15), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq $0x1, %rax
adcq $0x0, %rax
xorl %r12d, %r12d
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x4402
movl (%rdi,%rsi,4), %r8d
subl (%rcx,%rsi,4), %r8d
imull %r8d, %r8d
addl %r8d, %r12d
incq %rsi
cmpq %rsi, %rax
jne 0x43a4
jmp 0x43c5
xorl %r12d, %r12d
testq %rdi, %rdi
je 0x43cf
callq 0x3230
leaq -0x2c(%rbp), %rax
movl %r12d, (%rax)
movq %rax, (%rsp)
leaq -0x28(%rbp), %r8
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %r14, %r9
callq 0x3ee4
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xec17(%rip), %rdi      # 0x13020
xorl %eax, %eax
callq 0x3330
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4421
callq 0x3230
movq %rbx, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::neighborhood_points(std::vector<int, std::allocator<int>> const&, int const&)
pointVec KDTree::neighborhood_points(  //
    const point_t &pt,                 //
    const int &rad) {
    size_t level = 0;
    pointIndexArr nbh = neighborhood_(root, pt, rad, level);
    pointVec nbhp;
    nbhp.resize(nbh.size());
    std::transform(nbh.begin(), nbh.end(), nbhp.begin(),
                   [](pointIndex x) { return x.first; });
    return nbhp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rdi, %r15
xorl %ebx, %ebx
leaq -0x70(%rbp), %r9
movq %rbx, (%r9)
leaq -0x68(%rbp), %r14
movq %r14, %rdi
movq %rsi, %rdx
callq 0x454e
movq %rbx, 0x10(%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq %r15, -0x30(%rbp)
movq %r15, %rdi
callq 0x4f3a
movq -0x68(%rbp), %r14
movq -0x60(%rbp), %r13
cmpq %r13, %r14
je 0x4c72
movq -0x30(%rbp), %rax
movq (%rax), %rbx
leaq -0x90(%rbp), %r15
leaq -0x50(%rbp), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x4e70
movq 0x18(%r14), %rax
movq %rax, -0x78(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4e70
movq (%rbx), %rdi
movq -0x50(%rbp), %rax
movq %rax, (%rbx)
movq -0x48(%rbp), %rax
movq %rax, 0x8(%rbx)
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %rdi, %rdi
je 0x4c46
callq 0x3230
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4c54
callq 0x3230
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x4c65
callq 0x3230
addq $0x20, %r14
addq $0x18, %rbx
cmpq %r13, %r14
jne 0x4bf5
leaq -0x68(%rbp), %rdi
callq 0x4ef0
movq -0x30(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4c90
movq %rax, %r14
jmp 0x4ca9
movq %rax, %r14
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x4ca9
callq 0x3230
movq -0x30(%rbp), %rdi
callq 0x4fb8
leaq -0x68(%rbp), %rdi
callq 0x4ef0
movq %r14, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::neighborhood_indices(std::vector<int, std::allocator<int>> const&, int const&)
indexArr KDTree::neighborhood_indices(  //
    const point_t &pt,                  //
    const int &rad) {
    size_t level = 0;
    pointIndexArr nbh = neighborhood_(root, pt, rad, level);
    indexArr nbhi;
    nbhi.resize(nbh.size());
    std::transform(nbh.begin(), nbh.end(), nbhi.begin(),
                   [](pointIndex x) { return x.second; });
    return nbhi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq -0x48(%rbp), %r9
movq %r15, (%r9)
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %rsi, %rdx
callq 0x454e
movq %r15, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq %rbx, %rdi
callq 0x5002
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r12
cmpq %r12, %r14
je 0x4d5a
movq (%rbx), %r13
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x4e70
movq 0x18(%r14), %rax
movq %rax, -0x50(%rbp)
movq %rax, (%r13)
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x4d4d
callq 0x3230
addq $0x20, %r14
addq $0x8, %r13
cmpq %r12, %r14
jne 0x4d28
leaq -0x40(%rbp), %rdi
callq 0x4ef0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d77
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4d87
callq 0x3230
leaq -0x40(%rbp), %rdi
callq 0x4ef0
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: kthSmallest(int*, int, int, int)
int kthSmallest(int arr[], int l, int r, int k)
{
    // If k is smaller than number of elements in array
    if (k > 0 && k <= r - l + 1) {
        // Partition the array around last element and get
        // position of pivot element in sorted array
        int pos = partition(arr, l, r);

        // If position is same as k
        if (pos - l == k - 1)
            return arr[pos];
        if (pos - l > k - 1) // If position is more, recur for left subarray
            return kthSmallest(arr, l, pos - 1, k);

        // Else recur for right subarray
        return kthSmallest(arr, pos + 1, r, k - pos + l - 1);
    }

    // If k is more than number of elements in array
    return INT_MAX;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
leal -0x1(%r12), %r13d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %r12d, %r12d
jle 0x6776
movl %r15d, %ecx
subl %r14d, %ecx
incl %ecx
cmpl %r12d, %ecx
jl 0x6776
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x6785
movl %eax, %ecx
subl %r14d, %ecx
cmpl %r13d, %ecx
je 0x6771
cmpl %r12d, %ecx
jl 0x675e
decl %eax
movl %eax, %r15d
jmp 0x6723
leal 0x1(%rax), %ecx
addl %r12d, %r14d
notl %eax
addl %r14d, %eax
movl %ecx, %r14d
movl %eax, %r12d
jmp 0x671e
cltq
movl (%rbx,%rax,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: partition(int*, int, int)
int partition(int arr[], int l, int r)
{
    int x = arr[r], i = l;
    for (int j = l; j <= r - 1; j++) {
        if (arr[j] <= x) {
            swap(&arr[i], &arr[j]);
            i++;
        }
    }
    swap(&arr[i], &arr[r]);
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edx, %rcx
cmpl %ecx, %esi
jge 0x67b8
movl (%rdi,%rcx,4), %eax
movslq %esi, %rdx
movl (%rdi,%rdx,4), %r8d
cmpl %eax, %r8d
jg 0x67b0
movslq %esi, %rsi
movl (%rdi,%rsi,4), %r9d
movl %r8d, (%rdi,%rsi,4)
movl %r9d, (%rdi,%rdx,4)
incl %esi
incq %rdx
cmpq %rdx, %rcx
jne 0x6796
movslq %esi, %rax
movl (%rdi,%rax,4), %edx
movl (%rdi,%rcx,4), %esi
movl %esi, (%rdi,%rax,4)
movl %edx, (%rdi,%rcx,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: uncover_frags(int, int, int, std::vector<int, std::allocator<int>>&)
point_t uncover_frags(int kmer_size, int i_rmap, int q_rmap,vector<int>& rmap){

    point_t retvar((kmer_size)*2);
    int i;
    for(i=0;i<kmer_size;i++){

        retvar[i]=rmap[i_rmap++];
    }

    for(int j=q_rmap+kmer_size;j>q_rmap+kmer_size-(kmer_size);j--){
        retvar[i++]=rmap[j];
    }

    return(retvar);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movl %ecx, %r14d
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbx
leal (%r12,%r12), %eax
movslq %eax, %rsi
leaq -0x29(%rbp), %rdx
callq 0xe542
testl %r12d, %r12d
jle 0x682b
movq (%rbx), %rcx
movslq %r13d, %rdx
movl %r12d, %esi
shlq $0x2, %rdx
addq (%r15), %rdx
xorl %eax, %eax
movl (%rdx,%rax,4), %edi
movl %edi, (%rcx,%rax,4)
incq %rax
cmpq %rax, %rsi
jne 0x681b
jmp 0x682d
xorl %eax, %eax
testl %r12d, %r12d
jle 0x6856
addl %r14d, %r12d
movq (%r15), %rcx
movslq %r12d, %rdx
movslq %r14d, %rsi
shlq $0x2, %rax
addq (%rbx), %rax
movl (%rcx,%rdx,4), %edi
movl %edi, (%rax)
decq %rdx
addq $0x4, %rax
cmpq %rsi, %rdx
jg 0x6845
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq