LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Battle.cpp
// Function: Battle::selectEnemyTarget()
int Battle::selectEnemyTarget()
{
    int choice = -1;
    Monster * the_enemy = nullptr;

    while (choice < 1 || choice > num_enemies)
    {
        std::cout << "Your opponents are:\n";
        for (int i=0; i<num_enemies; i++)
        {
            // Get the current monster
            the_enemy = static_cast<Monster*> (enemy_party.getMember(i));
            // Print it's identifier name
            std::cout << "\t" << i+1 << ". " << the_enemy->getName() << std::endl;
        }
        std::cout << "Select one: ";
        std::cin >> choice;
    }
    return choice-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x4(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x10(%rdi), %r15
movq 0x427b(%rip), %r12      # 0x7fc8
movl $0x14, %edx
movq %r12, %rdi
leaq 0x1704(%rip), %rsi      # 0x5460
callq 0x2180
cmpl $0x0, 0x28(%rbx)
jle 0x3e1f
xorl %ebp, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x352e
movq %rax, %r13
movl $0x1, %edx
movq %r12, %rdi
leaq 0x1512(%rip), %rsi      # 0x529b
callq 0x2180
incl %ebp
movq %r12, %rdi
movl %ebp, %esi
callq 0x2220
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x14f1(%rip), %rsi      # 0x529d
callq 0x2180
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x334a
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x2180
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3e16
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
cmpl 0x28(%rbx), %ebp
jl 0x3d6d
movl $0xc, %edx
movq %r12, %rdi
leaq 0x1647(%rip), %rsi      # 0x5475
callq 0x2180
movq 0x419e(%rip), %rdi      # 0x7fd8
leaq 0x4(%rsp), %rsi
callq 0x20a0
movl 0x4(%rsp), %eax
testl %eax, %eax
jle 0x3d4d
cmpl 0x28(%rbx), %eax
jg 0x3d4d
decl %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3e89
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Game.cpp
// Function: Game::Game()
Game::Game()
{
    // Create the Party objects for the opposing teams
    the_heros = new Party(hero_party_size, HERO);
    the_monsters = new Party(monster_party_size);
    // Create the Battle object
    the_battle = new Battle(*the_heros, *the_monsters);

    // Load the data in the files
    num_heroes = FileIOTemplate<Hero>::readData(hero_database, MAX_HEROS, "heros.bin");
    num_monsters = FileIOTemplate<Monster>::readData(monster_database, MAX_MONSTERS, "monsters.bin");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movaps 0x15a7(%rip), %xmm0     # 0x5490
movups %xmm0, (%rdi)
movl $0x10, %r14d
xorl %r15d, %r15d
leaq (%rbx,%r14), %rdi
movl $0x64, %esi
movl $0x14, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
movsd 0x125f(%rip), %xmm0     # 0x5178
movsd 0x125f(%rip), %xmm1     # 0x5180
movaps %xmm1, %xmm2
movsd 0x125c(%rip), %xmm3     # 0x5188
pushq %r15
pushq %r15
callq 0x259c
addq $0x10, %rsp
addq $0x60, %r14
cmpq $0x130, %r14            # imm = 0x130
jne 0x3ef5
leaq 0x10(%rbx), %r14
movl $0x130, %r15d           # imm = 0x130
xorl %r12d, %r12d
leaq (%rbx,%r15), %rdi
movl $0x64, %esi
movl $0x14, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
movsd 0x1201(%rip), %xmm0     # 0x5178
movsd 0x1201(%rip), %xmm1     # 0x5180
movaps %xmm1, %xmm2
movsd 0x11fe(%rip), %xmm3     # 0x5188
pushq %r12
pushq %r12
callq 0x259c
addq $0x10, %rsp
addq $0x68, %r15
cmpq $0x2d0, %r15            # imm = 0x2D0
jne 0x3f53
xorps %xmm0, %xmm0
movups %xmm0, 0x2d8(%rbx)
movl $0x10, %edi
callq 0x2160
movq %rax, %r15
movl 0x8(%rbx), %esi
movq %rax, %rdi
xorl %edx, %edx
callq 0x34f0
movq %r15, 0x2d8(%rbx)
movl $0x10, %edi
callq 0x2160
movq %rax, %r15
movl 0xc(%rbx), %esi
movq %rax, %rdi
movl $0x1, %edx
callq 0x34f0
movq %r15, 0x2e0(%rbx)
movl $0x30, %edi
callq 0x2160
movq %rax, %r12
movq 0x2d8(%rbx), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3688
movq %r12, 0x2d0(%rbx)
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1476(%rip), %rsi      # 0x54a0
leaq 0x1478(%rip), %rdx      # 0x54a9
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x2dbc
movl $0x3, %esi
movq %r14, %rdi
movq %r15, %rdx
callq 0x47fe
leaq 0x130(%rbx), %r14
movl %eax, (%rbx)
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x406e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x142b(%rip), %rsi      # 0x54aa
leaq 0x1430(%rip), %rdx      # 0x54b6
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2dbc
movl $0x4, %esi
movq %r14, %rdi
movq %r15, %rdx
callq 0x484a
movl %eax, 0x4(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40bd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4113
movq 0x18(%rsp), %rsi
jmp 0x40ef
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4113
movq 0x38(%rsp), %rsi
incq %rsi
jmp 0x410e
movq %rax, %rbx
movl $0x30, %esi
movq %r12, %rdi
jmp 0x410e
jmp 0x4103
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Game.cpp
// Function: Game::printHeroArray()
void Game::printHeroArray()
{
    std::cout << "\nThe heros:\n";
    for (int i=0; i<num_heroes; i++)
    {
        std::cout << "INDEX #" << i << std::endl;
        hero_database[i].print();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x3b61(%rip), %rdi      # 0x7fc8
leaq 0x11a4(%rip), %rsi      # 0x5612
movl $0xc, %edx
callq 0x2180
cmpl $0x0, (%rbx)
jle 0x44ee
leaq 0x10(%rbx), %r14
xorl %r15d, %r15d
movq 0x3b3d(%rip), %r12      # 0x7fc8
leaq 0x118d(%rip), %r13      # 0x561f
movl $0x7, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq %r12, %rdi
movl %r15d, %esi
callq 0x2220
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2e8c
incq %r15
movslq (%rbx), %rax
addq $0x60, %r14
cmpq %rax, %r15
jl 0x4492
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Game.cpp
// Function: Game::printMonsterArray()
void Game::printMonsterArray()
{
    std::cout << "\nThe monsters:\n";
    for (int i=0; i<num_monsters; i++)
    {
        std::cout << "INDEX #" << i << std::endl;
        monster_database[i].print();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x3ab5(%rip), %rdi      # 0x7fc8
leaq 0x110d(%rip), %rsi      # 0x5627
movl $0xf, %edx
callq 0x2180
cmpl $0x0, 0x4(%rbx)
jle 0x459f
leaq 0x130(%rbx), %r14
xorl %r15d, %r15d
movq 0x3a8d(%rip), %r12      # 0x7fc8
leaq 0x10dd(%rip), %r13      # 0x561f
movl $0x7, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq %r12, %rdi
movl %r15d, %esi
callq 0x2220
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x3256
incq %r15
movslq 0x4(%rbx), %rax
addq $0x68, %r14
cmpq %rax, %r15
jl 0x4542
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Game.cpp
// Function: Game::createHeroParty()
void Game::createHeroParty()
{
    int index;

    for (int i=0; i<hero_party_size; i++)
    {
        std::cout << "Enter index of hero (from the database): ";
        std::cin >> index;

        the_heros->setMember(i, &hero_database[index]);
    }
}

// Assembly:
cmpl $0x0, 0x8(%rdi)
jle 0x4761
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
xorl %ebp, %ebp
leaq 0xf34(%rip), %r15       # 0x5637
movq 0x38ce(%rip), %r12      # 0x7fd8
leaq 0x4(%rsp), %r13
movl $0x29, %edx
movq 0x38ad(%rip), %rdi      # 0x7fc8
movq %r15, %rsi
callq 0x2180
movq %r12, %rdi
movq %r13, %rsi
callq 0x20a0
movq 0x2d8(%rbx), %rdi
movslq 0x4(%rsp), %rax
leaq (%rax,%rax,2), %rdx
shlq $0x5, %rdx
addq %r14, %rdx
movl %ebp, %esi
callq 0x3592
incl %ebp
cmpl 0x8(%rbx), %ebp
jl 0x470f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Game.cpp
// Function: Game::createMonsterParty()
void Game::createMonsterParty()
{
    int index;

    for (int i=0; i<monster_party_size; i++)
    {
        std::cout << "Enter index of the monster (from the database): ";
        std::cin >> index;

        //the_monsters->setMember(i, &monster_database[index]);
        the_monsters->setMember(i, new Monster(monster_database[index]));
    }
}

// Assembly:
cmpl $0x0, 0xc(%rdi)
jle 0x47fc
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x130(%rdi), %r15
xorl %ebp, %ebp
movq 0x384e(%rip), %r12      # 0x7fd8
leaq 0x4(%rsp), %r13
movl $0x30, %edx
movq 0x382d(%rip), %rdi      # 0x7fc8
leaq 0xebf(%rip), %rsi       # 0x5661
callq 0x2180
movq %r12, %rdi
movq %r13, %rsi
callq 0x20a0
movq 0x2e0(%rbx), %r14
movl $0x68, %edi
callq 0x2160
movslq 0x4(%rsp), %rcx
imulq $0x68, %rcx, %rsi
addq %r15, %rsi
movl $0xd, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x3592
incl %ebp
cmpl 0xc(%rbx), %ebp
jl 0x478f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/./FileIOTemplate.hpp
// Function: FileIOTemplate<Hero>::readData(Hero*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int FileIOTemplate<T>::readData(T data_array[], size_t items, std::string file_name)
{
    FILE * file_ptr = fopen(file_name.c_str(), "rb");
    size_t items_read = 0;

    if (file_ptr)
    {
        // Read up to the maximum size of the array of elements
        items_read = fread(data_array, sizeof (T), items, file_ptr);
        fclose(file_ptr);
    }
    return items_read;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdx), %rdi
leaq 0xe7f(%rip), %rsi       # 0x5692
callq 0x2190
testq %rax, %rax
je 0x4840
movq %rax, %r15
movl $0x60, %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x21e0
movq %rax, %rbx
movq %r15, %rdi
callq 0x2150
jmp 0x4842
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/./FileIOTemplate.hpp
// Function: FileIOTemplate<Hero>::writeNewData(Hero&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void FileIOTemplate<T>::writeNewData(T & data_object, std::string file_name)
{
    FILE * file_ptr = nullptr;

    data_object.inputData();
    file_ptr = openAndCheck(file_name, "ab");
    fwrite(&data_object, sizeof (T), 1, file_ptr);
    fclose(file_ptr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2f8c
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x345a
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xdbb(%rip), %rsi       # 0x5695
leaq 0xdb6(%rip), %rdx       # 0x5697
leaq 0x8(%rsp), %rdi
callq 0x2dbc
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4a8e
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4914
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x492b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2170
movl $0x60, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x2250
movq %r14, %rdi
callq 0x2150
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4973
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x4973
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x498a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/./FileIOTemplate.hpp
// Function: FileIOTemplate<Hero>::openAndCheck(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
FILE * FileIOTemplate<T>::openAndCheck(std::string file_name, std::string mode)
{
    FILE * file_ptr = nullptr;

    // Open the file. Convert C++ strings to C arrays of characters for the parameters
    file_ptr = fopen(file_name.c_str(), mode.c_str());
    if (file_ptr == nullptr)
    {
        std::cout << "Error: Unable to open file '" << file_name << "'!\n";
        exit(1);
    }
    return file_ptr;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq (%rsi), %rsi
callq 0x2190
testq %rax, %rax
je 0x4aa4
popq %rbx
retq
movq 0x351d(%rip), %rdi      # 0x7fc8
leaq 0xbe6(%rip), %rsi       # 0x5698
callq 0x2140
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2100
leaq 0xbec(%rip), %rsi       # 0x56b5
movq %rax, %rdi
callq 0x2140
movl $0x1, %edi
callq 0x21a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/battle_game.cpp
// Function: main
int main()
{
    Game test_game;

    std::cout << "=== RPG BATTLE GAME PROGRAM ===" << std::endl;
    test_game.gameMenu();

    return 0;
}

// Assembly:
pushq %rbx
subq $0x2f0, %rsp            # imm = 0x2F0
leaq 0x8(%rsp), %rdi
callq 0x3ed4
movq 0x3483(%rip), %rbx      # 0x7fc8
leaq 0xb6d(%rip), %rsi       # 0x56b9
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3451(%rip), %rdi      # 0x7fc8
callq 0x2040
movq %rax, %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
callq 0x4196
leaq 0x8(%rsp), %rdi
callq 0x411c
xorl %eax, %eax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x411c
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/benchmark.cpp
// Function: low_contention_benchmark()
void skiplist_remove(size_t start, size_t end){
    if(end >= numbers_delete.size()) end = numbers_delete.size();
    if(start == end) skiplist.remove(numbers_delete[start]);
    for(size_t i = start; i < end; i++){
        skiplist.remove(numbers_delete[i]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x7b2a(%rip), %rax      # 0xb1c8
testq %rax, %rax
je 0x36f1
movl $0x1, %r15d
leaq 0x7bf0(%rip), %rbx      # 0xb2a0
movq %rsp, %r14
movl %r15d, (%rsp)
movq 0x7bea(%rip), %rsi      # 0xb2a8
cmpq 0x7beb(%rip), %rsi      # 0xb2b0
je 0x36d7
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x7bd3(%rip)      # 0xb2a8
jmp 0x36e9
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4778
movq 0x7adf(%rip), %rax      # 0xb1c8
incq %r15
cmpq %rax, %r15
jbe 0x36b3
movq 0x7bb0(%rip), %rsi      # 0xb2a8
subq 0x7ba1(%rip), %rsi      # 0xb2a0
shrq $0x2, %rsi
movq %rsp, %rdi
movss 0x393a(%rip), %xmm0     # 0x7048
callq 0x4e24
movq %rsp, %rbx
movups (%rbx), %xmm0
movups %xmm0, 0x7b50(%rip)     # 0xb270
movq %rbx, %rdi
callq 0x5dde
movq 0x7b79(%rip), %rcx      # 0xb2a8
movq 0x7b6a(%rip), %rdx      # 0xb2a0
movq 0x7a83(%rip), %rax      # 0xb1c0
movq $0x0, (%rbx)
subq %rdx, %rcx
je 0x3813
sarq $0x2, %rcx
js 0x375d
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0x3775
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x3781
cvtsi2ss %rax, %xmm1
jmp 0x3796
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
callq 0x2120
cvttss2si %xmm0, %eax
movslq %eax, %rbp
xorl %eax, %eax
leaq -0xecd(%rip), %rbx      # 0x28e2
leaq 0x28(%rsp), %r14
movq %rsp, %r15
leaq 0x30(%rsp), %r12
leaq 0x10(%rsp), %r13
addq %rbp, %rax
movq %rax, 0x30(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x3f4a
movq %r13, %rdi
movq %r14, %rsi
callq 0x4506
cmpq $0x0, 0x28(%rsp)
jne 0x3880
movq (%rsp), %rax
addq %rbp, %rax
movq %rax, (%rsp)
movq 0x7aa5(%rip), %rcx      # 0xb2a8
subq 0x7a96(%rip), %rcx      # 0xb2a0
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x37c1
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x3859
movq %rbx, %rdi
callq 0x2310
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0x3822
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rax, %rcx
je 0x3859
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3880
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x3845
movq %rax, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x3fd0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3885
jmp 0x3885
jmp 0x3885
cmpq $0x0, 0x28(%rsp)
je 0x3885
callq 0x2080
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3fd0
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/benchmark.cpp
// Function: skiplist_combined_operations()
void skiplist_combined_operations(){

    int start = (rand() % static_cast<int>(numbers_insert.size() + 1));
    int end = start + (rand() % static_cast<int>(numbers_insert.size() - start + 1));
    skiplist_add(start, end);

    start = (rand() % static_cast<int>(numbers_delete.size() + 1));
    end = start + (rand() % static_cast<int>(numbers_delete.size() - start + 1));
    skiplist_remove(start, end);

    start = (rand() % static_cast<int>(numbers_get.size() + 1));
    end = start + (rand() % static_cast<int>(numbers_get.size() - start + 1));
    skiplist_search(start, end);

    start = (rand() % static_cast<int>(numbers_insert.size() + 1));
    end = start + (rand() % static_cast<int>(numbers_insert.size() - start + 1));
    skiplist_range(start, end);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
callq 0x2070
movq 0x80a1(%rip), %rcx      # 0xb2a8
subq 0x8092(%rip), %rcx      # 0xb2a0
shrq $0x2, %rcx
incl %ecx
cltd
idivl %ecx
movl %edx, %ebx
callq 0x2070
movq 0x8083(%rip), %rcx      # 0xb2a8
subq 0x8074(%rip), %rcx      # 0xb2a0
shrq $0x2, %rcx
movslq %ebx, %rdi
subl %edi, %ecx
incl %ecx
cltd
idivl %ecx
addl %edi, %edx
movslq %edx, %rsi
callq 0x28e2
callq 0x2070
movq 0x8070(%rip), %rcx      # 0xb2c0
subq 0x8061(%rip), %rcx      # 0xb2b8
shrq $0x2, %rcx
incl %ecx
cltd
idivl %ecx
movl %edx, %ebx
callq 0x2070
movq 0x8052(%rip), %rcx      # 0xb2c0
subq 0x8043(%rip), %rcx      # 0xb2b8
shrq $0x2, %rcx
movslq %ebx, %rdi
subl %edi, %ecx
incl %ecx
cltd
idivl %ecx
addl %edi, %edx
movslq %edx, %rsi
callq 0x2b2a
callq 0x2070
movq 0x803f(%rip), %rcx      # 0xb2d8
subq 0x8030(%rip), %rcx      # 0xb2d0
shrq $0x2, %rcx
incl %ecx
cltd
idivl %ecx
movl %edx, %ebx
callq 0x2070
movq 0x8021(%rip), %rcx      # 0xb2d8
subq 0x8012(%rip), %rcx      # 0xb2d0
shrq $0x2, %rcx
movslq %ebx, %rdi
subl %edi, %ecx
incl %ecx
cltd
idivl %ecx
addl %edi, %edx
movslq %edx, %rsi
callq 0x2b8e
callq 0x2070
movq 0x7fc6(%rip), %rcx      # 0xb2a8
subq 0x7fb7(%rip), %rcx      # 0xb2a0
shrq $0x2, %rcx
incl %ecx
cltd
idivl %ecx
movl %edx, %ebx
callq 0x2070
movq 0x7fa8(%rip), %rcx      # 0xb2a8
subq 0x7f99(%rip), %rcx      # 0xb2a0
shrq $0x2, %rcx
subl %ebx, %ecx
incl %ecx
cltd
idivl %ecx
leal (%rdx,%rbx), %ecx
leaq 0x7f54(%rip), %rsi      # 0xb270
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebx, %edx
callq 0x5a14
movq %r14, %rdi
callq 0x41a4
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/benchmark.cpp
// Function: high_contention_benchmark()
void high_contention_benchmark(){   
    skiplist = SkipList(3, 0.5);

    skiplist.add(1, "1");
    skiplist.add(2, "2");

    vector<thread> threads;

    for(size_t i = 0; i < num_threads; i++){
        threads.push_back(thread(high_contention_benchmark_thread));
    }
    for (auto &th : threads) {
        th.join();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x10(%rsp), %rbx
movss 0x3b76(%rip), %xmm0     # 0x7048
movq %rbx, %rdi
movl $0x3, %esi
callq 0x4e24
movups (%rbx), %xmm0
movups %xmm0, 0x7d87(%rip)     # 0xb270
leaq 0x7d80(%rip), %r14      # 0xb270
movq %rbx, %rdi
callq 0x5dde
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3f99(%rip), %rsi      # 0x74a1
leaq 0x3f93(%rip), %rdx      # 0x74a2
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x46e2
movq %r14, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x4fd8
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x3543
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3f50(%rip), %rsi      # 0x74a3
leaq 0x3f4a(%rip), %rdx      # 0x74a4
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x46e2
leaq 0x7d02(%rip), %rdi      # 0xb270
movl $0x2, %esi
movq %rbx, %rdx
callq 0x4fd8
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x3592
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
cmpq $0x0, 0x7c15(%rip)      # 0xb1c0
je 0x360c
xorl %r12d, %r12d
leaq -0x1ba(%rip), %rbx      # 0x33fd
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4090
movq %r15, %rdi
movq %r14, %rsi
callq 0x4506
cmpq $0x0, 0x8(%rsp)
jne 0x3673
incq %r12
cmpq 0x7bd3(%rip), %r12      # 0xb1c0
jb 0x35c1
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x360c
movq %rbx, %rdi
callq 0x2310
addq $0x8, %rbx
jmp 0x35f9
leaq 0x10(%rsp), %rdi
callq 0x3fd0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x366b
movq 0x38(%rsp), %rsi
jmp 0x3648
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x366b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x366b
jmp 0x365e
jmp 0x365e
cmpq $0x0, 0x8(%rsp)
jne 0x3673
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3fd0
movq %rbx, %rdi
callq 0x2320
callq 0x2080
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/node.cpp
// Function: Node::Node(int, int)
Node::Node(int key, int level){
    key_value_pair = KeyValuePair(key, "");
    next.resize(level + 1);
    for (size_t i = 0; i < next.size(); i++){
        next[i] = NULL;
    }
    top_level = level;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4854
leaq 0x28(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x28(%rbx)
movw $0x0, 0x68(%rbx)
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2656(%rip), %rdx      # 0x7055
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x46e2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl %ebp, %esi
callq 0x486a
leaq 0x30(%rsp), %rsi
movl -0x8(%rsi), %eax
movl %eax, (%rbx)
leaq 0x8(%rbx), %rdi
callq 0x2100
leaq 0x28(%rsp), %rdi
callq 0x48e0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4a51
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
leal 0x1(%r15), %eax
movslq %eax, %rsi
movq %r14, %rdi
callq 0x4c82
movq 0x28(%rbx), %rax
cmpq %rax, 0x30(%rbx)
je 0x4a8b
xorl %ecx, %ecx
movq $0x0, (%rax,%rcx,8)
incq %rcx
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jb 0x4a6c
movl %r15d, 0x6c(%rbx)
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ac9
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x48e0
jmp 0x4ab0
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4acc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4acc
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x4ae0
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x48e0
movq %r15, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/node.cpp
// Function: Node::Node(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
Node::Node(int key, string value, int level){
    key_value_pair = KeyValuePair(key, value);
    next.resize(level + 1);
    for (size_t i = 0; i < next.size(); i++){
        next[i] = NULL;
    }
    top_level = level;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r15d
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4854
leaq 0x28(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x28(%rbx)
movw $0x0, 0x68(%rbx)
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x48fc
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
movl %ebp, %esi
callq 0x486a
leaq 0x28(%rsp), %rsi
movl -0x8(%rsi), %eax
movl %eax, (%rbx)
leaq 0x8(%rbx), %rdi
callq 0x2100
leaq 0x20(%rsp), %rdi
callq 0x48e0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4b8a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2220
leal 0x1(%r15), %eax
movslq %eax, %rsi
movq %r14, %rdi
callq 0x4c82
movq 0x28(%rbx), %rax
cmpq %rax, 0x30(%rbx)
je 0x4bc4
xorl %ecx, %ecx
movq $0x0, (%rax,%rcx,8)
incq %rcx
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jb 0x4ba5
movl %r15d, 0x6c(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4c03
movq %rax, %r15
leaq 0x20(%rsp), %rdi
callq 0x48e0
jmp 0x4beb
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4c06
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4c06
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x4c1a
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x48e0
movq %r15, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/skip_list.cpp
// Function: SkipList::SkipList(int, float)
SkipList::SkipList(int max_elements, float prob){
    max_level = (int) round(log(max_elements) / log(1/prob)) - 1;
    head = new Node(INT_MINI, max_level);
    tail = new Node(INT_MAXI, max_level);

    for (size_t i = 0; i < head->next.size(); i++) {
        head->next[i] = tail;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss %xmm0, 0x4(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
callq 0x21a0
movsd %xmm0, 0x8(%rsp)
movss 0x28cd(%rip), %xmm0     # 0x771c
divss 0x4(%rsp), %xmm0
callq 0x2340
cvtss2sd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x20c0
cvttsd2si %xmm0, %ebp
decl %ebp
movl %ebp, 0x648b(%rip)      # 0xb304
movl $0x70, %edi
callq 0x2210
movq %rax, %r14
movq %rax, %rdi
movl $0x80000000, %esi       # imm = 0x80000000
movl %ebp, %edx
callq 0x49b8
movq %r14, (%rbx)
movl $0x70, %edi
callq 0x2210
movq %rax, %r14
movl 0x6459(%rip), %edx      # 0xb304
movq %rax, %rdi
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
callq 0x49b8
movq %r14, 0x8(%rbx)
movq (%rbx), %rcx
movq 0x28(%rcx), %rax
cmpq %rax, 0x30(%rcx)
je 0x4ee9
xorl %ecx, %ecx
movq %r14, (%rax,%rcx,8)
incq %rcx
movq (%rbx), %rdx
movq 0x28(%rdx), %rax
movq 0x30(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jb 0x4ecb
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x4ef4
movq %rax, %rbx
movl $0x70, %esi
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/skip_list.cpp
// Function: SkipList::find(int, std::vector<Node*, std::allocator<Node*>>&, std::vector<Node*, std::allocator<Node*>>&)
int SkipList::find(int key, vector<Node*> &predecessors, vector<Node*> &successors) {
    int found = -1;
    Node *prev = head; 

    for (int level = max_level; level >= 0; level--){
        Node *curr = prev->next[level];

        while (key > curr->get_key()){
            prev = curr;
            curr = prev->next[level];
        }
        
        if(found == -1 && key == curr->get_key()){
            found = level;
        }

        predecessors[level] = prev;
        successors[level] = curr;
    }
    return found;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movslq 0x63e2(%rip), %r13      # 0xb304
testq %r13, %r13
js 0x4f8a
movq %rdx, %r14
movl %esi, %ebp
movq (%rdi), %rbx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %rbx, %r12
movq %r12, %rbx
movq 0x28(%r12), %rax
movq (%rax,%r13,8), %r12
movq %r12, %rdi
callq 0x4c2a
cmpl %ebp, %eax
jl 0x4f38
cmpl $-0x1, %r15d
jne 0x4f6a
movq %r12, %rdi
callq 0x4c2a
cmpl %ebp, %eax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmovel %r13d, %r15d
movq (%r14), %rax
movq %rbx, (%rax,%r13,8)
movq (%rsp), %rax
movq (%rax), %rax
movq %r12, (%rax,%r13,8)
leaq -0x1(%r13), %rax
testq %r13, %r13
movq %rax, %r13
jg 0x4f35
jmp 0x4f90
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/skip_list.cpp
// Function: SkipList::display()
void SkipList::display(){
    for (int i = 0; i <= max_level; i++) {
        Node *temp = head;
        int count = 0;
        if(!(temp->get_key() == INT_MINI && temp->next[i]->get_key() == INT_MAXI)){
            printf("Level %d  ", i);
            while (temp != NULL){
                printf("%d -> ", temp->get_key());
                temp = temp->next[i];
                count++;
            }
            cout<<endl;
        }
        if(count == 3) break;
    }
    printf("---------- Display done! ----------\n\n");
}

// Assembly:
cmpl $0x0, 0x5609(%rip)      # 0xb304
js 0x5dd0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1a19(%rip), %r15      # 0x772f
movq 0x52b3(%rip), %r12      # 0xafd0
xorl %r13d, %r13d
movq (%rbx), %rbp
movq %rbp, %rdi
callq 0x4c2a
negl %eax
jno 0x5d43
movq 0x28(%rbp), %rax
movq (%rax,%r13,8), %rdi
callq 0x4c2a
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0x5dab
leaq 0x19da(%rip), %rdi      # 0x7724
movl %r13d, %esi
xorl %eax, %eax
callq 0x2050
movl $0x3, %r14d
movq %rbp, %rdi
callq 0x4c2a
movq %r15, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq 0x28(%rbp), %rax
movq (%rax,%r13,8), %rbp
decl %r14d
testq %rbp, %rbp
jne 0x5d5a
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
testl %r14d, %r14d
je 0x5dc2
leaq 0x1(%r13), %rax
movslq 0x554e(%rip), %rcx      # 0xb304
cmpq %rcx, %r13
movq %rax, %r13
jl 0x5d20
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
leaq 0x1990(%rip), %rdi      # 0x7767
jmp 0x22d0
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::Simulator(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int const&, int const&, int const&, int const&, int const&)
Simulator::Simulator(const std::string& replacementAlgorithm, const int& frames, const int& frameSize,
		const int& quantum, const int& workingSetSize, const int& maxReferences) : invertedPageTable(frames) {
	this->replacementAlgorithm = replacementAlgorithm;
	this->frames = frames;
	this->frameSize = frameSize;
	this->quantum = quantum;
	this->workingSetSize = workingSetSize;
	this->maxReferences = maxReferences;
	if (! replacementAlgorithm.compare("lru")) {
		lru = new LRU();
	}
	else if (! replacementAlgorithm.compare("ws")) {
		workingSetManager = new WorkingSetManager(workingSetSize);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, -0x30(%rbp)
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, -0x40(%rbp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
addq $0x38, %rdi
movq %rdi, -0x38(%rbp)
movq %rdx, %rsi
callq 0x3b70
movq $0x0, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x20e0
movq 0x10(%rbp), %rax
movl (%r15), %ecx
movl %ecx, 0x20(%rbx)
movl (%r14), %ecx
movl %ecx, 0x24(%rbx)
movl (%r13), %ecx
movl %ecx, 0x28(%rbx)
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x2c(%rbx)
movl (%rax), %eax
movl %eax, 0x30(%rbx)
leaq 0x2677(%rip), %rsi      # 0x503c
movq %r12, %rdi
callq 0x2080
testl %eax, %eax
je 0x2a05
leaq 0x2693(%rip), %rsi      # 0x506b
movq %r12, %rdi
callq 0x2080
testl %eax, %eax
jne 0x2a2b
movl $0x8, %edi
callq 0x2190
movq %rax, %r12
movl $0x50, %r14d
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x4024
jmp 0x2a27
movl $0x18, %edi
callq 0x2190
movq %rax, %r12
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movl $0x48, %r14d
movq %r12, (%rbx,%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r12, %rdi
callq 0x2160
jmp 0x2a4f
movq %rax, %r15
jmp 0x2a58
movq %rax, %r15
movq -0x38(%rbp), %rdi
callq 0x3bbe
movq (%rbx), %rdi
cmpq -0x40(%rbp), %rdi
je 0x2a66
callq 0x2160
movq %r15, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::~Simulator()
Simulator::~Simulator() {
	if (! replacementAlgorithm.compare("lru")) {
		delete lru;
	}
	else if (! replacementAlgorithm.compare("ws")) {
		delete workingSetManager;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x25ba(%rip), %rsi      # 0x503c
callq 0x2080
testl %eax, %eax
je 0x2ab1
leaq 0x25d9(%rip), %rsi      # 0x506b
movq %rbx, %rdi
callq 0x2080
testl %eax, %eax
jne 0x2ada
movq 0x50(%rbx), %r14
testq %r14, %r14
je 0x2ad2
movq %r14, %rdi
callq 0x4098
jmp 0x2ad2
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0x2ad2
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x2ad2
movq (%rdi), %r15
callq 0x2160
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2ac2
movq %r14, %rdi
callq 0x2160
leaq 0x38(%rbx), %rdi
callq 0x3bbe
movq (%rbx), %rdi
addq $0x10, %rbx
addq $0x8, %rsp
cmpq %rbx, %rdi
je 0x2afe
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2160
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::run()
void Simulator::run() {
	ifstream trace1;
	ifstream trace2;
	trace1.open("bzip.trace", ios::in);
	trace2.open("gcc.trace", ios::in);

	bool processSwitch = false;

	/* Receive page requests */
	Address *address;
	while ((address = this->getTrace(trace1, trace2, processSwitch)) != NULL) {
		statistics.pageRequests++;
		//invertedPageTable.print();
		//cout << "Trace: " << address->toString() << endl;
		address->print();
		if (! replacementAlgorithm.compare("lru")) {
			this->runLRU(address);
		}
		else if (! replacementAlgorithm.compare("ws")) {
			this->runWorkingSet(address, processSwitch);
		}
	}
	cout << "\nFrames: " << frames << statistics.toString() << endl;
	trace1.close();
	trace2.close();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rdi, %rbx
leaq -0x460(%rbp), %rdi
callq 0x21b0
leaq -0x258(%rbp), %rdi
callq 0x21b0
leaq 0x25e1(%rip), %rsi      # 0x511d
leaq -0x460(%rbp), %rdi
movl $0x8, %edx
callq 0x20f0
leaq 0x25d4(%rip), %rsi      # 0x5128
leaq -0x258(%rbp), %rdi
movl $0x8, %edx
callq 0x20f0
leaq -0x29(%rbp), %r15
movb $0x0, (%r15)
leaq 0x58(%rbx), %r14
leaq -0x258(%rbp), %r13
movq %rbx, %rdi
leaq -0x460(%rbp), %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x2cec
movq %rax, %r12
testq %rax, %rax
je 0x2be3
incl (%r14)
movq %r12, %rdi
callq 0x3a44
movq %rbx, %rdi
leaq 0x2492(%rip), %rsi      # 0x503c
callq 0x2080
testl %eax, %eax
je 0x2bd6
movq %rbx, %rdi
leaq 0x24ae(%rip), %rsi      # 0x506b
callq 0x2080
testl %eax, %eax
jne 0x2b78
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x304a
jmp 0x2b78
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2ee6
jmp 0x2b78
movq 0x53ee(%rip), %rdi      # 0x7fd8
leaq 0x2541(%rip), %rsi      # 0x5132
movl $0x9, %edx
callq 0x21c0
movl 0x20(%rbx), %esi
movq 0x53d3(%rip), %rdi      # 0x7fd8
callq 0x2250
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x4540
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x21c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c65
callq 0x2160
leaq -0x460(%rbp), %rdi
callq 0x2060
leaq -0x258(%rbp), %rdi
callq 0x2060
leaq -0x258(%rbp), %rdi
callq 0x2070
leaq -0x460(%rbp), %rdi
callq 0x2070
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2cc9
movq %rax, %rbx
jmp 0x2cd8
jmp 0x2cc9
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ccc
callq 0x2160
jmp 0x2ccc
jmp 0x2cc9
movq %rax, %rbx
leaq -0x258(%rbp), %rdi
callq 0x2070
leaq -0x460(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::runLRU(Address*)
void Simulator::runLRU(Address *address) {
	//lru->print();
	Address **mappingFrame = invertedPageTable.getFrameByAddress(*address);
	if (mappingFrame != NULL) {
		/* Page already in memory */
		lru->prioritize(*mappingFrame);
		this->checkWrite(address, *mappingFrame);
		delete address;
	}
	else {
		/* Page not in memory */
		statistics.pageFaults++;
		Address **freeFrame = invertedPageTable.getFreeFrame();
		if (freeFrame != NULL) {
			invertedPageTable.occupyFrame(freeFrame, address);
			lru->getRecentList().push_front(address);
			printPageFault(NULL, address);
		}
		else {
			Address *victim;
			victim = lru->getVictim();
			Address **victimFrame = invertedPageTable.getFrameByAddress(*victim);
			invertedPageTable.occupyFrame(victimFrame, address);
			lru->getRecentList().push_front(address);
			printPageFault(victim, address);
			if (victim->getDirty()) {
				cout << " Saving victim to disk.";
				statistics.diskWrites++;
			}
			delete victim;
		}
		cout << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x38(%rdi), %r12
movq %r12, %rdi
callq 0x3c08
testq %rax, %rax
je 0x2f3b
movq %rax, %r15
movq 0x48(%r14), %rdi
movq (%rax), %rsi
callq 0x3e24
movq (%r15), %rdx
movq %rbx, %rsi
callq 0x3274
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2160
incl 0x5c(%r14)
movq %r12, %rdi
callq 0x3c64
testq %rax, %rax
je 0x2f8d
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3c8a
movq 0x48(%r14), %r15
movq (%r15), %r14
movl $0x18, %edi
callq 0x2190
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
incq 0x10(%r15)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x3318
jmp 0x300d
movq 0x48(%r14), %rdi
callq 0x3e6e
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
callq 0x3c08
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3c8a
movq 0x48(%r14), %r13
movq (%r13), %r12
movl $0x18, %edi
callq 0x2190
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2050
incq 0x10(%r13)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3318
cmpb $0x1, 0x8(%r15)
jne 0x3005
movq 0x4fe8(%rip), %rdi      # 0x7fd8
leaq 0x2145(%rip), %rsi      # 0x513c
movl $0x17, %edx
callq 0x21c0
incl 0x60(%r14)
movq %r15, %rdi
callq 0x2160
movq 0x4fc4(%rip), %rbx      # 0x7fd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110
nop
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::checkWrite(Address*, Address*)
void Simulator::checkWrite(Address *address, Address *mappingAddress) {
	if (address->getDirty() == true && mappingAddress->getDirty() == false) {
		mappingAddress->setDirty(true);
		cout << "Page " << address->getPageNumber() << " from process " << address->getProcessId()
		     << " changed to dirty" << endl;
	}
}

// Assembly:
cmpb $0x1, 0x8(%rsi)
jne 0x3280
cmpb $0x0, 0x8(%rdx)
je 0x3281
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movb $0x1, 0x8(%rdx)
movq 0x4d42(%rip), %r14      # 0x7fd8
leaq 0x1efa(%rip), %rsi      # 0x5197
movl $0x5, %edx
movq %r14, %rdi
callq 0x21c0
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0x2250
movq %rax, %r14
leaq 0x1ede(%rip), %rsi      # 0x519d
movl $0xe, %edx
movq %rax, %rdi
callq 0x21c0
movl (%rbx), %esi
movq %r14, %rdi
callq 0x2250
movq %rax, %rbx
leaq 0x1ecc(%rip), %rsi      # 0x51ac
movl $0x11, %edx
movq %rax, %rdi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::printPageFault(Address*, Address*)
void Simulator::printPageFault(Address *victim, Address *address) {
	cout << "Page fault on requesting page " << address->getPageNumber() << " from process "
			<< address->getProcessId() << ".";
	if (victim != NULL) {
		cout << " Memory full, replacing page " << victim->getPageNumber() << " from process "
				<< victim->getProcessId() << ".";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x4ca9(%rip), %r15      # 0x7fd8
leaq 0x1e8a(%rip), %rsi      # 0x51c0
movl $0x1e, %edx
movq %r15, %rdi
callq 0x21c0
movl 0x4(%r14), %esi
movq %r15, %rdi
callq 0x2250
movq %rax, %r15
leaq 0x1e44(%rip), %rsi      # 0x519d
movl $0xe, %edx
movq %rax, %rdi
callq 0x21c0
movl (%r14), %esi
movq %r15, %rdi
callq 0x2250
leaq 0x1eab(%rip), %rsi      # 0x5223
movl $0x1, %edx
movq %rax, %rdi
callq 0x21c0
testq %rbx, %rbx
je 0x33ef
movq 0x4c47(%rip), %r14      # 0x7fd8
leaq 0x1e47(%rip), %rsi      # 0x51df
movl $0x1d, %edx
movq %r14, %rdi
callq 0x21c0
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0x2250
movq %rax, %r14
leaq 0x1de3(%rip), %rsi      # 0x519d
movl $0xe, %edx
movq %rax, %rdi
callq 0x21c0
movl (%rbx), %esi
movq %r14, %rdi
callq 0x2250
leaq 0x1e4b(%rip), %rsi      # 0x5223
movl $0x1, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21c0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/Simulator.cpp
// Function: Simulator::restoreWorkingSetMemory(std::__cxx11::list<Address, std::allocator<Address>>&, bool&)
void Simulator::restoreWorkingSetMemory(std::list<Address>& workingSet, bool& change) {
	for (list<Address>::iterator it = workingSet.begin() ; it != workingSet.end() ; it++) {
		Address **mappingFrame = invertedPageTable.getFrameByAddress(*it);
		if (mappingFrame == NULL) {
			statistics.pageFaults++;
			if (! change) {
				change = true;
			}
			Address **victimFrame = invertedPageTable.getVictimFrameNotInSet(workingSet);
			Address *toDelete = *victimFrame;
			*victimFrame = new Address(*it);
			cout << "\t";
			printPageFault(toDelete, &(*it));
			if (toDelete->getDirty()) {
				cout << " Saving victim to disk.";
				statistics.diskWrites++;
			}
			cout << endl;
			delete toDelete;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movq (%rsi), %r12
movq %rsi, -0x40(%rbp)
cmpq %rsi, %r12
je 0x3514
movq -0x30(%rbp), %rax
leaq 0x38(%rax), %rbx
movq 0x4ba6(%rip), %r14      # 0x7fd8
movq %rbx, -0x48(%rbp)
leaq 0x10(%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3c08
testq %rax, %rax
jne 0x3506
movq -0x30(%rbp), %rax
incl 0x5c(%rax)
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x3466
movq -0x38(%rbp), %rax
movb $0x1, (%rax)
movq %rbx, %rdi
movq -0x40(%rbp), %rsi
callq 0x3c94
movq %rax, %r13
movq (%rax), %rbx
movl $0xc, %edi
callq 0x2190
movq (%r15), %rcx
movq %rcx, (%rax)
movl 0x8(%r15), %ecx
movl %ecx, 0x8(%rax)
movq %rax, (%r13)
movl $0x1, %edx
movq %r14, %rdi
leaq 0x1d1c(%rip), %rsi      # 0x51be
callq 0x21c0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3318
cmpb $0x1, 0x8(%rbx)
jne 0x34d3
movl $0x17, %edx
movq %r14, %rdi
leaq 0x1c75(%rip), %rsi      # 0x513c
callq 0x21c0
movq -0x30(%rbp), %rax
incl 0x60(%rax)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2160
movq -0x48(%rbp), %rbx
movq (%r12), %r12
cmpq -0x40(%rbp), %r12
jne 0x3436
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/InvertedPageTable.cpp
// Function: InvertedPageTable::InvertedPageTable(int const&)
InvertedPageTable::InvertedPageTable(const int& frames) {
	invertedPageTableSize = frames;
	invertedPageTable = new Address *[frames];
	for (int frame = 0 ; frame < frames ; frame++) {
		invertedPageTable[frame] = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq (%rsi), %r14
leaq (,%r14,8), %rax
testq %r14, %r14
movl %r14d, 0x8(%rdi)
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, (%rbx)
testq %r14, %r14
jle 0x3bb9
xorl %eax, %eax
movq (%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x3ba6
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/InvertedPageTable.cpp
// Function: InvertedPageTable::~InvertedPageTable()
InvertedPageTable::~InvertedPageTable() {
	for (int frame = 0 ; frame < invertedPageTableSize ; frame++ ) {
		if (invertedPageTable[frame] != NULL) {
			delete invertedPageTable[frame];
		}
	}
	delete[] invertedPageTable;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x3bf1
xorl %r14d, %r14d
movq (%rbx), %rcx
movq (%rcx,%r14,8), %rdi
testq %rdi, %rdi
je 0x3be6
callq 0x2160
movl 0x8(%rbx), %eax
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0x3bd2
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3c02
popq %rbx
popq %r14
popq %rbp
jmp 0x21f0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/InvertedPageTable.cpp
// Function: InvertedPageTable::getFrameByAddress(Address const&)
Address **InvertedPageTable::getFrameByAddress(const Address& address) {
	for (int frame = 0 ; frame < invertedPageTableSize ; frame++ ) {
		if (invertedPageTable[frame] != NULL && invertedPageTable[frame]->equals(address)) {
			return &invertedPageTable[frame];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x3c50
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
xorl %r12d, %r12d
movq (%r14), %rcx
movq (%rcx,%rbx), %rdi
testq %rdi, %rdi
je 0x3c41
movq %r15, %rsi
callq 0x355c
testb %al, %al
jne 0x3c54
movl 0x8(%r14), %eax
incq %r12
movslq %eax, %rcx
addq $0x8, %rbx
cmpq %rcx, %r12
jl 0x3c25
xorl %ebx, %ebx
jmp 0x3c57
addq (%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Paging-Simulator/InvertedPageTable.cpp
// Function: InvertedPageTable::getFreeFrame()
Address **InvertedPageTable::getFreeFrame() {
	for (int frame = 0 ; frame < invertedPageTableSize ; frame++ ) {
		if (invertedPageTable[frame] == NULL) {
			return &invertedPageTable[frame];
		}
	}
	return NULL;
}

// Assembly:
movslq 0x8(%rdi), %rcx
testq %rcx, %rcx
jle 0x3c87
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
cmpq $0x0, (%rax)
je 0x3c85
addq $0x8, %rax
decq %rcx
jne 0x3c74
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq