LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::savePlayerInventory()
void GameMaster::savePlayerInventory() {
    map<string, int>::iterator it;
    string item = "";
    string amountText = "";

    ofstream out;
    out.open(INV_FILEPATH);

    for (it = player->inventory.begin(); it != player->inventory.end(); it++) {
        item = it->first;
        amountText = to_string(it->second);
        out << item << DIVIDER << amountText << endl; // Saves each line
    }

    out.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %rbx
leaq 0x8311(%rip), %r14      # 0xc3b8
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rdx
movq %r14, %rsi
callq 0x3860
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
movq %r14, %rsi
callq 0x3860
leaq 0x68(%rsp), %rdi
callq 0x3370
leaq 0x28(%rbx), %rsi
leaq 0x68(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x3140
movq 0x90(%rbx), %rax
movq 0x50(%rax), %r13
leaq 0x48(%rbx), %r14
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x8(%rsp), %rbp
addq $0x40, %rax
cmpq %rax, %r13
je 0x4177
leaq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x3170
movl 0x40(%r13), %esi
movq %r12, %rdi
callq 0x5b3f
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3270
movq %r12, %rdi
callq 0x3130
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x3200
movq %rax, %rdi
movq %r14, %rsi
callq 0x3200
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3150
movq %r13, %rdi
callq 0x31a0
movq %rax, %r13
movq 0x90(%rbx), %rax
jmp 0x4104
leaq 0x68(%rsp), %rdi
callq 0x32c0
leaq 0x68(%rsp), %rdi
callq 0x3300
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x28(%rsp), %rdi
callq 0x3130
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x41cc
movq %rax, %rbx
jmp 0x41d6
jmp 0x41bf
jmp 0x41bf
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3300
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::releaseMemory()
void GameMaster::releaseMemory() {
    // Delete characters
    delete player;
    delete opponents[0]; // No need to delete opponent4, as it's a duplicate
    delete opponents[1];
    delete opponents[2];
    delete opponents[3];
    // Skipping opponents[4], which was already released by opponents[0]
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x90(%rdi), %r14
testq %r14, %r14
je 0x4203
movq %r14, %rdi
callq 0x5a78
movl $0xc0, %esi
movq %r14, %rdi
callq 0x3230
movq 0x98(%rbx), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x4227
movq %r14, %rdi
callq 0x5a78
movl $0xc0, %esi
movq %r14, %rdi
callq 0x3230
movq 0x98(%rbx), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x424c
movq %r14, %rdi
callq 0x5a78
movl $0xc0, %esi
movq %r14, %rdi
callq 0x3230
movq 0x98(%rbx), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x4271
movq %r14, %rdi
callq 0x5a78
movl $0xc0, %esi
movq %r14, %rdi
callq 0x3230
movq 0x98(%rbx), %rax
movq 0x18(%rax), %rbx
testq %rbx, %rbx
je 0x4296
movq %rbx, %rdi
callq 0x5a78
movl $0xc0, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3230
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::createTitle(char, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool)
void GameMaster::createTitle(char ch, int x, string text,
                             string &toAdd, bool print) {

    toAdd += string(WIDTH, ch) + "\n";
    centerText(text, toAdd);
    toAdd += string(WIDTH, ch) + "\n\n";

    if (print) cout << toAdd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %rbx
movq %rcx, %r12
movl %esi, %r14d
movq %rdi, %r15
movslq 0x4(%rdi), %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x8(%rsp), %rdi
movl %r14d, %edx
callq 0x3260
leaq 0x80cd(%rip), %rdx      # 0xc3b7
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5a9a
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x33d0
leaq 0x28(%rsp), %rdi
callq 0x3130
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x44b6
leaq 0x48(%rsp), %rdi
callq 0x3130
movslq 0x4(%r15), %rsi
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
movsbl %r14b, %edx
callq 0x3260
leaq 0x8058(%rip), %rdx      # 0xc3b6
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5a9a
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x33d0
leaq 0x28(%rsp), %rdi
callq 0x3130
leaq 0x8(%rsp), %rdi
callq 0x3130
cmpb $0x0, 0x4(%rsp)
je 0x43a4
movq 0xec2c(%rip), %rdi      # 0x12fc8
movq %rbx, %rsi
callq 0x3200
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43c3
jmp 0x43d2
jmp 0x43e1
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x43da
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
jmp 0x43d5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
jmp 0x43e4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::clearScreen()
void GameMaster::clearScreen() {
    const int BIG_NUMBER = 100;
    string clear = "";
    for (int i = 0; i < BIG_NUMBER; i++) {
        clear += "\n";
    }
    cout << clear;

    printCurrentLevelTitle();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x7f76(%rip), %rsi      # 0xc3b8
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x3860
pushq $0x64
popq %rbp
leaq 0x7f59(%rip), %r15      # 0xc3b7
subl $0x1, %ebp
jb 0x4470
movq %r14, %rdi
movq %r15, %rsi
callq 0x33b0
jmp 0x445e
movq 0xeb51(%rip), %rdi      # 0x12fc8
leaq 0x8(%rsp), %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x43f0
leaq 0x8(%rsp), %rdi
callq 0x3130
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x44a0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::centerText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void GameMaster::centerText(string title, string &toAdd) {
    int len = title.length();
    int gap = WIDTH - len;

    if (len > WIDTH) return; // Not applicable in this case

    if (gap % 2 == 0) { // If even
        toAdd += string(gap/2, ' ') + title + string(gap/2, ' ') + "\n";
    } else { // If odd, add a space after title, and use decremented gap
        gap--;
        toAdd += string(gap/2, ' ') + title + string(gap/2, ' ') + " \n";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movl 0x4(%rdi), %eax
subl 0x8(%rsi), %eax
jl 0x461a
movq %rdx, %rbx
movq %rsi, %r14
testb $0x1, %al
jne 0x4563
sarl %eax
movslq %eax, %r15
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rdx
movq %r15, %rsi
callq 0x3260
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x5b20
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rsp, %rdi
pushq $0x20
popq %rdx
movq %r15, %rsi
callq 0x3260
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
callq 0x5ab9
leaq 0x7e7b(%rip), %rdx      # 0xc3b7
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x5a9a
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
callq 0x33d0
jmp 0x45e7
decl %eax
sarl %eax
movslq %eax, %r15
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rdx
movq %r15, %rsi
callq 0x3260
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x5b20
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rsp, %rdi
pushq $0x20
popq %rdx
movq %r15, %rsi
callq 0x3260
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
callq 0x5ab9
leaq 0x7d79(%rip), %rdx      # 0xc33e
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x5a9a
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
callq 0x33d0
leaq 0x80(%rsp), %rdi
callq 0x3130
leaq 0x60(%rsp), %rdi
callq 0x3130
movq %rsp, %rdi
callq 0x3130
leaq 0x40(%rsp), %rdi
callq 0x3130
leaq 0x20(%rsp), %rdi
callq 0x3130
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4629
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3130
jmp 0x4640
jmp 0x463d
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3130
jmp 0x4651
jmp 0x464e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3130
jmp 0x4660
jmp 0x465d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3130
jmp 0x4671
jmp 0x466e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
jmp 0x4685
movq %rax, %rbx
jmp 0x467b
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::getStartingLevel()
int GameMaster::getStartingLevel() {
    string line = "";

    ifstream in(LEVEL_FILEPATH);               // Open file
    getline(in, line);
    in.close();                                // Close file
    return stoi(line);                         // Convert to int
}

// Assembly:
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rdi, %rbx
leaq 0x7d1c(%rip), %rsi      # 0xc3b8
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x3860
addq $0x8, %rbx
leaq 0x28(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x3340
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3080
leaq 0x28(%rsp), %rdi
callq 0x3090
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x5b98
movl %eax, %ebx
leaq 0x28(%rsp), %rdi
callq 0x30c0
leaq 0x8(%rsp), %rdi
callq 0x3130
movl %ebx, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
retq
movq %rax, %rbx
jmp 0x471a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x30c0
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::loadPlayerSavedInventory()
void GameMaster::loadPlayerSavedInventory() {
    string line = "";
    string invItem = "";
    int invItemAmount = 0;
    int dividerPos = 0;
    int fromDividerToEnd = 0;

    ifstream in(INV_FILEPATH);
    while(getline(in, line)) {
        dividerPos = line.find(DIVIDER);
        fromDividerToEnd = line.length() - dividerPos;

        invItem = line.substr(0, dividerPos);
        invItemAmount = stoi(line.substr(dividerPos + 1, fromDividerToEnd));

        player->inventory[invItem] = invItemAmount;
    }
    in.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rbp
leaq 0x7c71(%rip), %r14      # 0xc3b8
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
callq 0x3860
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
callq 0x3860
leaq 0x28(%rbp), %rsi
leaq 0x70(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3340
leaq 0x48(%rbp), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %r12
leaq 0x50(%rsp), %r13
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x3080
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x484b
movq %r12, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x33f0
movq %rax, %rbx
movq 0x38(%rsp), %r14
movslq %ebx, %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3240
movq %rbx, %r15
shlq $0x20, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
subl %ebx, %r14d
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x3270
movq %r13, %rdi
callq 0x3130
sarq $0x20, %r15
movslq %r14d, %rcx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3240
movq %r13, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x5b98
movl %eax, %r15d
movq %r13, %rdi
callq 0x3130
movq 0x90(%rbp), %rdi
addq $0x38, %rdi
leaq 0x10(%rsp), %rsi
callq 0x5bb4
movl %r15d, (%rax)
jmp 0x478f
leaq 0x70(%rsp), %rdi
callq 0x3090
leaq 0x70(%rsp), %rdi
callq 0x30c0
leaq 0x10(%rsp), %rdi
callq 0x3130
leaq 0x30(%rsp), %rdi
callq 0x3130
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x48a4
movq %rax, %rbx
jmp 0x48b1
movq %rax, %rbx
jmp 0x48bb
jmp 0x48a4
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3130
jmp 0x48a7
jmp 0x48a4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x30c0
leaq 0x10(%rsp), %rdi
callq 0x3130
leaq 0x30(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::checkpoint()
void GameMaster::checkpoint() {
    string toAdd = "\n\n";
    string anyInputText  = "<RETURN>: next line | \"skip\": next negotiation";

    createTitle('=', WIDTH, anyInputText, toAdd);
    fillCleanUInput();

    if (uInput == "quit") return; // For every new entry, check for quit
    if (uInput == "skip" ) doSkip = true; // Set global flag for future

    clearScreen();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x762d(%rip), %rsi      # 0xc3b6
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x3860
leaq 0x7624(%rip), %rsi      # 0xc3c3
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3860
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x32b0
pushq $0x3d
popq %rsi
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r8
pushq $0x1
popq %r9
movq %rbx, %rdi
callq 0x42aa
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x4ed2
leaq 0x70(%rbx), %r14
leaq 0x759d(%rip), %rsi      # 0xc390
movq %r14, %rdi
callq 0x5c90
testb %al, %al
jne 0x4e1e
leaq 0x75ec(%rip), %rsi      # 0xc3f2
movq %r14, %rdi
callq 0x5c90
testb %al, %al
je 0x4e16
movb $0x1, 0x6c(%rbx)
movq %rbx, %rdi
callq 0x442e
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x48(%rsp), %rdi
callq 0x3130
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
jmp 0x4e51
movq %rax, %rbx
jmp 0x4e5b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x48(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::lower(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void GameMaster::lower(string &anyString) {
    int i = 0;
    while (anyString[i]) {
        anyString[i] = tolower(anyString[i]);
        i++;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
xorl %r14d, %r14d
movq (%rbx), %r15
movsbl (%r15,%r14), %edi
testl %edi, %edi
je 0x4e93
callq 0x32e0
movb %al, (%r15,%r14)
incq %r14
jmp 0x4e79
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::fillCleanUInput()
void GameMaster::fillCleanUInput() {
    cout << ">>>> ";
    getline(cin, uInput);

    lower(uInput);
    removeWS(uInput);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xe0eb(%rip), %rdi      # 0x12fc8
leaq 0x74b1(%rip), %rsi      # 0xc395
callq 0x3210
addq $0x70, %rbx
movq 0xe0ec(%rip), %rdi      # 0x12fe0
movq %rbx, %rsi
callq 0x3080
movq %rbx, %rsi
callq 0x4e6e
movq %rbx, %rsi
popq %rbx
jmp 0x4e9a
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::handleSpecificInput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void GameMaster::handleSpecificInput(string line, string &output) {
    cout << output << endl << endl; // Flush output thus far

    const int ASTERISKS_NEEDED = 3;
    int newLength = line.length() - ASTERISKS_NEEDED - ASTERISKS_NEEDED;

    string targetInput = line.substr(ASTERISKS_NEEDED, newLength);
    string prompt = "Type \"" + targetInput + "\"";

    setUInput(prompt, targetInput);
    if (uInput == "quit") return; // For every new entry, check for quit

    // Once inventory typed, display it
    if (targetInput == "inventory") player->printInv();

    output = ""; // Reset output
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0xe09c(%rip), %rdi      # 0x12fc8
movq %rdx, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3150
movq %rax, %rdi
callq 0x3150
movl 0x8(%r15), %eax
addl $-0x6, %eax
movslq %eax, %rcx
leaq 0x28(%rsp), %r12
pushq $0x3
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x3240
leaq 0x73fa(%rip), %rsi      # 0xc362
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0x5c1a
leaq 0x73eb(%rip), %rdx      # 0xc367
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5a9a
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x88(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x32b0
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x32b0
leaq 0x73f5(%rip), %rsi      # 0xc3b8
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x3860
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movq %r14, %rdi
callq 0x4b52
leaq 0x48(%rsp), %rdi
callq 0x3130
leaq 0x68(%rsp), %rdi
callq 0x3130
leaq 0x88(%rsp), %rdi
callq 0x3130
leaq 0x70(%r14), %rdi
leaq 0x7378(%rip), %rsi      # 0xc390
callq 0x5c90
testb %al, %al
jne 0x5053
leaq 0x7391(%rip), %rsi      # 0xc3b9
leaq 0x28(%rsp), %rdi
callq 0x5c90
testb %al, %al
je 0x5044
movq 0x90(%r14), %rdi
xorl %esi, %esi
callq 0x8c58
leaq 0x736d(%rip), %rsi      # 0xc3b8
movq %rbx, %rdi
callq 0x33c0
leaq 0xa8(%rsp), %rdi
callq 0x3130
leaq 0x28(%rsp), %rdi
callq 0x3130
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3130
jmp 0x508b
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3130
jmp 0x509a
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x3130
jmp 0x50bb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x50c3
movq %rax, %rbx
jmp 0x50c8
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x3130
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::runIntro()
void GameMaster::runIntro() {

    player->fillInventory(); // Give player an inventory before the intro
    loadScript("Gen/Intro"); // Early exposition until discovery by Lepha
    if (uInput == "quit") return; // For every new entry, check for quit

    player->initInventory(); // Clear inventory before tutorial level

    bool isPrologue = true;
    runNextLevel(isPrologue);
    if (uInput == "quit") return; // For every new entry, check for quit

    player->fillInventory(); // Refill inventory before Level 1
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0xba62
leaq 0x7013(%rip), %rsi      # 0xc400
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x3860
movq %rbx, %rdi
movq %r14, %rsi
callq 0x510e
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x70(%rbx), %r14
leaq 0x6f71(%rip), %rsi      # 0xc390
movq %r14, %rdi
callq 0x5c90
testb %al, %al
jne 0x5461
movq 0x90(%rbx), %rdi
callq 0xb49a
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x547e
leaq 0x6f47(%rip), %rsi      # 0xc390
movq %r14, %rdi
callq 0x5c90
testb %al, %al
jne 0x5461
movq 0x90(%rbx), %rdi
callq 0xba62
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::runNextLevel(bool)
void GameMaster::runNextLevel(bool isPrologue) {
    startCurrentLevel(); // Intro text for level

    // Only create level at last possible moment
    levels[currLevel] = new Encounter(player,
                                      opponents[currLevel],
                                      turns[currLevel],
                                      keyPrices[currLevel],
                                      isPrologue);


    bool didNotQuit = levels[currLevel]->runEncounter(wonLevel);
    if (!didNotQuit) { // If quit came from within encounter
        uInput = "quit";
        return; // For every new entry, check for quit
    }

    endCurrentLevel(); // Ending text for level (+ game over ending)

    wonLevel = false; // Reset, even though it will be filled later
    currLevel++; // Advance level after complete

    // Doing this AFTER advancing currLevel
    if (uInput == "quit") return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5668
pushq $0x68
popq %rdi
callq 0x3220
movq %rax, %r14
movslq 0x68(%rbx), %rax
movq 0x90(%rbx), %rsi
movq 0x98(%rbx), %rcx
movq (%rcx,%rax,8), %rdx
movq 0xb0(%rbx), %rcx
movl (%rcx,%rax,4), %ecx
movq 0xc8(%rbx), %rdi
movss (%rdi,%rax,4), %xmm0
movq %r14, %rdi
movl %ebp, %r8d
callq 0x6e5c
movslq 0x68(%rbx), %rax
movq 0xe0(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
movq 0xe0(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
leaq 0x6d(%rbx), %rsi
callq 0x7e4e
testb %al, %al
je 0x551b
movq %rbx, %rdi
callq 0x576e
movb $0x0, 0x6d(%rbx)
incl 0x68(%rbx)
addq $0x70, %rbx
leaq 0x6e81(%rip), %rsi      # 0xc390
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5c90
addq $0x70, %rbx
leaq 0x6e6a(%rip), %rsi      # 0xc390
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x33c0
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r14, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::runEnding()
void GameMaster::runEnding() {
    // Should give score at end of most recent level
    float finalScoreFloat = player->getInvValue();

    // Convert score to string for later use
    string finalScore = player->toPreciseString(finalScoreFloat);

    // Modify to output sentence
    string scoreText = "\n\nYou started with £100 in loot. You finished with £";
           scoreText += finalScore + ".\n";

    doSkip = false; // In order to print the final goodbye

    clearScreen(); // To switch to the THE END screen

    // Printouts
    cout << scoreText;
    loadScript("Gen/Ending"); // Generic text for victory or defeat
    cout << endl << endl;

}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0x8b94
movq 0x90(%rbx), %rsi
leaq 0x60(%rsp), %rdi
xorl %edx, %edx
callq 0x87f8
leaq 0x6e91(%rip), %rsi      # 0xc40a
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x3860
leaq 0x7a37(%rip), %rdx      # 0xcfc4
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x5cda
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x33d0
movq %rsp, %rdi
callq 0x3130
movb $0x0, 0x6c(%rbx)
movq %rbx, %rdi
callq 0x442e
movq 0xda06(%rip), %rdi      # 0x12fc8
leaq 0x20(%rsp), %rsi
callq 0x3200
leaq 0x6e6e(%rip), %rsi      # 0xc441
leaq 0x40(%rsp), %rdi
movq %rsp, %rdx
callq 0x3860
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x510e
leaq 0x40(%rsp), %rdi
callq 0x3130
movq 0xd9ca(%rip), %rdi      # 0x12fc8
callq 0x3150
movq %rax, %rdi
callq 0x3150
leaq 0x20(%rsp), %rdi
callq 0x3130
leaq 0x60(%rsp), %rdi
callq 0x3130
addq $0x80, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x563a
jmp 0x5648
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3130
jmp 0x564b
jmp 0x5648
movq %rax, %rbx
jmp 0x5655
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3130
leaq 0x60(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::endCurrentLevel()
void GameMaster::endCurrentLevel() {
    string outText  = to_string(currLevel) + "/Level" + to_string(currLevel);
    // Load the correct script
    (wonLevel ? (outText += "Win") : (outText += "Lose"));

    doSkip = false; // Allow scripts after encounter
    loadScript(outText); // Text for victory or loss to be run first

    // If lost encounter and not in tutorial, send to end of game
    if (!wonLevel && (currLevel > 0)) currLevel = 5; // Head straight to ending

    return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movl 0x68(%rdi), %esi
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x5b3f
leaq 0x6cb7(%rip), %rdx      # 0xc44c
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x5a9a
movl 0x68(%rbx), %esi
leaq 0x48(%rsp), %rdi
callq 0x5b3f
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x5ab9
leaq 0x48(%rsp), %rdi
callq 0x3130
leaq 0x68(%rsp), %rdi
callq 0x3130
leaq 0x88(%rsp), %rdi
callq 0x3130
leaq 0x6c6e(%rip), %rax      # 0xc459
leaq 0x6c6b(%rip), %rsi      # 0xc45d
cmpb $0x0, 0x6d(%rbx)
cmovneq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x33b0
movb $0x0, 0x6c(%rbx)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x32b0
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x510e
leaq 0x28(%rsp), %rdi
callq 0x3130
cmpb $0x0, 0x6d(%rbx)
jne 0x5841
cmpl $0x0, 0x68(%rbx)
jle 0x5841
movl $0x5, 0x68(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x3130
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
jmp 0x5893
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3130
jmp 0x5877
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3130
jmp 0x5886
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x5898
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::playGame()
void GameMaster::playGame() {
    // Ugly, but the cost of the GameMaster class are these frequent quit checks

    startScreen(); // Ask to skip intro
    if (uInput == "quit") return; // For every new entry, check for quit

    if (currLevel == 0) runIntro(); // Runs intro
    if (uInput == "quit") return; // For every new entry, check for quit

    while (currLevel < NUM_LEVELS) {
        runNextLevel();
        if (uInput == "quit") return; // For every new entry, check for quit
    }

    if (currLevel > 4) runEnding();
    if (uInput == "quit") return; // For every new entry, check for quit

    gameFinished = true;


}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x48ce
leaq 0x70(%rbx), %r14
leaq 0x6ad2(%rip), %rsi      # 0xc390
movq %r14, %rdi
callq 0x5c90
testb %al, %al
jne 0x5938
cmpl $0x0, 0x68(%rbx)
jne 0x58d8
movq %rbx, %rdi
callq 0x53d0
leaq 0x6ab1(%rip), %rsi      # 0xc390
movq %r14, %rdi
callq 0x5c90
testb %al, %al
jne 0x5938
leaq 0x6a9e(%rip), %r15      # 0xc390
movl 0x68(%rbx), %eax
cmpl (%rbx), %eax
jge 0x5914
movq %rbx, %rdi
xorl %esi, %esi
callq 0x547e
movq %r14, %rdi
movq %r15, %rsi
callq 0x5c90
testb %al, %al
je 0x58f2
jmp 0x5938
cmpl $0x5, %eax
jl 0x5921
movq %rbx, %rdi
callq 0x5548
leaq 0x6a68(%rip), %rsi      # 0xc390
movq %r14, %rdi
callq 0x5c90
testb %al, %al
jne 0x5938
movb $0x1, 0x6e(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::setInventoryForEncounter()
void Encounter::setInventoryForEncounter() {
    mapPlayerInventory(); // Order all the player's inventory for encounter
    opponent->resetGenerosity(); // Ensure no offer at start of encounter

    // Calculate open market value of inventory at start of encounter
    startInvValue = player->getInvValue();
    offerInvValue = 0.0; // init to zero
    endInvValue = 0.0; // init to zero
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x6f3c
movq 0x18(%rbx), %rdi
callq 0xa374
movq 0x10(%rbx), %rdi
callq 0x8b94
movss %xmm0, 0x28(%rbx)
andq $0x0, 0x2c(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::mapPlayerInventory()
void Encounter::mapPlayerInventory() {
    map<string, int>::iterator it;
    string item = "";
    int amount = 0;
    int itemOrder = 1;

    for (it = player->inventory.begin(); it != player->inventory.end(); it++) {
        item = it->first;
        amount = it->second;

        if (amount > 0) {
            invMap[item] = itemOrder;
            itemOrder++;
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x5466(%rip), %rsi      # 0xc3b8
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rdi
callq 0x3860
movq 0x10(%rbx), %rax
movq 0x50(%rax), %r12
leaq 0x38(%rbx), %r15
pushq $0x1
popq %rbp
addq $0x40, %rax
cmpq %rax, %r12
je 0x6fb1
leaq 0x20(%r12), %rsi
movq %r14, %rdi
callq 0x3170
cmpl $0x0, 0x40(%r12)
jle 0x6fa0
movq %r15, %rdi
movq %r14, %rsi
callq 0x5bb4
movl %ebp, (%rax)
incl %ebp
movq %r12, %rdi
callq 0x31a0
movq %rax, %r12
movq 0x10(%rbx), %rax
jmp 0x6f73
leaq 0x10(%rsp), %rdi
callq 0x3130
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::printTitle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Encounter::printTitle(string textToSay) {
    const int WIDTH = 80;

    string title  = "\n\n" + string(WIDTH, '=') + "\n";
           centerText(textToSay, title);
           title += string(WIDTH, '=') + "\n\n\n";

    cout << title;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8(%rsp), %rdi
pushq $0x50
popq %rsi
pushq $0x3d
popq %rdx
callq 0x3260
leaq 0x510d(%rip), %rsi      # 0xc3b6
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x8472
leaq 0x50f8(%rip), %rdx      # 0xc3b7
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x5a9a
leaq 0x28(%rsp), %rdi
callq 0x3130
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x32b0
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x7024
leaq 0x68(%rsp), %rdi
callq 0x3130
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
pushq $0x50
popq %rsi
pushq $0x3d
popq %rdx
callq 0x3260
leaq 0x5093(%rip), %rdx      # 0xc3b5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5a9a
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x33d0
leaq 0x28(%rsp), %rdi
callq 0x3130
leaq 0x8(%rsp), %rdi
callq 0x3130
movq 0xbc6d(%rip), %rdi      # 0x12fc8
leaq 0x48(%rsp), %rsi
callq 0x3200
leaq 0x48(%rsp), %rdi
callq 0x3130
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
jmp 0x738c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x739d
jmp 0x73c2
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3130
jmp 0x73c5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
jmp 0x73b6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x73ca
movq %rax, %rbx
jmp 0x73cf
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::remapKeyword(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void Encounter::remapKeyword(string &keyword) {
    if (!isNum(keyword)) return; // Only do this for number inputs

    // Keyword should come in as number
    int keyNumber = stoi(keyword);

    // Re-save it as the appropriate string
    map<string, int>::iterator it;
    string currentItem = "";
    int currentOrder;

    for (it = invMap.begin(); it != invMap.end(); it++) {
        currentItem = it->first;
        currentOrder = it->second;

        // If the invMap leads to the player's entry, save that string mapping
        if (currentOrder == keyNumber) {
            keyword = currentItem;
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x743c
testb %al, %al
je 0x74fe
pushq $0xa
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5b98
movl %eax, %ebp
leaq 0x4f11(%rip), %rsi      # 0xc3b8
leaq 0x10(%rsp), %r15
leaq 0xf(%rsp), %rdx
movq %r15, %rdi
callq 0x3860
movq 0x50(%r14), %r12
addq $0x40, %r14
cmpq %r14, %r12
je 0x74f4
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x3170
cmpl %ebp, 0x40(%r12)
je 0x74e7
movq %r12, %rdi
callq 0x31a0
movq %rax, %r12
jmp 0x74c1
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x3170
leaq 0x10(%rsp), %rdi
callq 0x3130
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x750d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::userEntry(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Encounter::userEntry(string &keyword, string &echo, string prompt) {
    // This creates the user prompt
    printTitle(prompt);

    // Print echo below prompt but above entry area
    if (echo != "") cout << echo;
    echo = ""; // Reset to blank either way

    // Take in and process user entry
    cout << ">>>> ";
    getline(cin, keyword);
    lower(keyword);
    removeWS(keyword);
    remapKeyword(keyword); // In case user put item num, switch to item string
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rcx, %rsi
callq 0x32b0
movq %r12, %rsi
callq 0x727c
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x4e59(%rip), %rsi      # 0xc3b8
movq %r15, %rdi
callq 0x5cc6
testb %al, %al
je 0x757a
movq 0xba56(%rip), %rdi      # 0x12fc8
movq %r15, %rsi
callq 0x3200
leaq 0x4e37(%rip), %rsi      # 0xc3b8
movq %r15, %rdi
callq 0x33c0
movq 0xba38(%rip), %rdi      # 0x12fc8
leaq 0x4dfe(%rip), %rsi      # 0xc395
callq 0x3210
movq 0xba3d(%rip), %rdi      # 0x12fe0
movq %rbx, %rsi
callq 0x3080
movq %rbx, %rsi
callq 0x73d8
movq %rbx, %rsi
callq 0x7404
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7476
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::printHelp()
void Encounter::printHelp() {
    string optText  = "";
           optText += "Add items one by one to the table with their ";
           optText += "corresponding number on the left.\n";
           optText += "When ready, type \"propose\" to finalise your offer ";
           optText += "or \"cancel\" to undo it.\n\n";

           optText += "propose:  type this to send your current offer\n";
           optText += "cancel:   take your current offer off the table\n\n";

           optText += "turns:    see how many turns you have left\n";
           optText += "strategy: see strategy hints\n";
           optText += "help:     see this menu\n";
           optText += "<RETURN>: dismiss help / go to negotiating table\n\n";

           optText += "forfeit:  admit defeat in this encounter\n";
           optText += "quit:     immediately exit the game\n";

    cout << optText;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
leaq 0x4b0e(%rip), %rsi      # 0xc3b8
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x3860
leaq 0x4f9f(%rip), %rsi      # 0xc862
movq %rbx, %rdi
callq 0x33b0
leaq 0x4fbe(%rip), %rsi      # 0xc890
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x4fd0(%rip), %rsi      # 0xc8b3
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x4ff2(%rip), %rsi      # 0xc8e6
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x4ffb(%rip), %rsi      # 0xc900
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x501a(%rip), %rsi      # 0xc930
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x503b(%rip), %rsi      # 0xc962
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x5056(%rip), %rsi      # 0xc98e
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x5063(%rip), %rsi      # 0xc9ac
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x506b(%rip), %rsi      # 0xc9c5
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x508d(%rip), %rsi      # 0xc9f8
leaq 0x10(%rsp), %rdi
callq 0x33b0
leaq 0x50a6(%rip), %rsi      # 0xca22
leaq 0x10(%rsp), %rdi
callq 0x33b0
movq 0xb63b(%rip), %rdi      # 0x12fc8
leaq 0x10(%rsp), %rsi
callq 0x3200
leaq 0x10(%rsp), %rdi
callq 0x3130
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::encounterIsOver(bool&)
bool Encounter::encounterIsOver(bool &didWin) {
    // Fill win with true or false, depending on acceptance
    didWin = opponent->reactToOffer(table, keyValue);

    // In case over, save last value into encounter history
    endInvValue = player->getInvValue();

    // If won or if didn't win and no turns left
    if (didWin || (!didWin && turns <= 1)) return true;
    else { // but turns are left, must return items to inventory and continue
        turns--; // Use one turn
        player->takeBackOffer(table);
        opponent->rejectTerms(turns, isPrologue);
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rbx), %rsi
movss 0x8(%rbx), %xmm0
callq 0xa3c8
movb %al, (%r14)
movq 0x10(%rbx), %rdi
callq 0x8b94
movss %xmm0, 0x30(%rbx)
movl 0x4(%rbx), %eax
cmpl $0x2, %eax
setl %bpl
orb (%r14), %bpl
jne 0x7a39
decl %eax
movl %eax, 0x4(%rbx)
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xbd84
movq 0x18(%rbx), %rdi
movl 0x4(%rbx), %esi
movzbl (%rbx), %edx
callq 0xa82e
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Encounter.cpp
// Function: Encounter::handleEnd(bool)
void Encounter::handleEnd(bool didWin) {
    clearScreen(); // To remove the "YOU ARE NEGOTIATING VS." title

    string textToSay = "";
    if (didWin) textToSay = "YOU WON AGAINST " + getCapsName();
    else textToSay = "YOU LOST AGAINST " + getCapsName();

    printTitle(textToSay);
    if (didWin) {
        printScore();
        opponent->acceptTerms();
    } else player->takeBackOffer(table); // Returns stuff to you if loss ≠ end
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x7204
leaq 0x4670(%rip), %rsi      # 0xc3b8
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x3860
testl %ebp, %ebp
je 0x7d7c
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x6fde
leaq 0x4d81(%rip), %rsi      # 0xcaee
leaq 0x40(%rsp), %rdi
movq %rsp, %rdx
callq 0x8472
jmp 0x7d9b
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x6fde
leaq 0x4d71(%rip), %rsi      # 0xcaff
leaq 0x40(%rsp), %rdi
movq %rsp, %rdx
callq 0x8472
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %r14
movq %r14, %rsi
callq 0x3270
movq %r14, %rdi
callq 0x3130
movq %rsp, %rdi
callq 0x3130
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x32b0
leaq 0x60(%rsp), %rsi
callq 0x727c
leaq 0x60(%rsp), %rdi
callq 0x3130
testb %bpl, %bpl
je 0x7df8
movq %rbx, %rdi
callq 0x7a40
movq 0x18(%rbx), %rdi
callq 0xa51a
jmp 0x7e05
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xbd84
leaq 0x20(%rsp), %rdi
callq 0x3130
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x7e1d
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x7e31
jmp 0x7e38
jmp 0x7e38
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3130
jmp 0x7e3b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Inventory.cpp
// Function: Inventory::toPreciseString[abi:cxx11](float, int)
string Inventory::toPreciseString(float input, int precision) {
    string asString = to_string(input);

    int decimalIndex = asString.find(".");
    int cutoff = decimalIndex + 1 + precision;

    // Don't include decimal if zero floats desired
    if (precision == 0) return asString.substr(0, decimalIndex);
    else return asString.substr(0, cutoff);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %r14d
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x92da
leaq 0x3b75(%rip), %rsi      # 0xc38e
movq %r15, %rdi
xorl %edx, %edx
callq 0x33e0
testl %r14d, %r14d
je 0x8832
addl %r14d, %eax
incl %eax
movslq %eax, %rcx
jmp 0x8835
movslq %eax, %rcx
movq %rsp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3240
movq %rsp, %rdi
callq 0x3130
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Inventory.cpp
// Function: Inventory::getInvCount()
int Inventory::getInvCount() {
    map<string, int>::iterator it;
    int total = 0, amount = 0;
    for (it = inventory.begin(); it != inventory.end(); it++) {
        amount = it->second;
        total += amount;
    }
    return total;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50(%rdi), %rax
addq $0x40, %rbx
xorl %ebp, %ebp
cmpq %rbx, %rax
je 0x8b78
addl 0x40(%rax), %ebp
movq %rax, %rdi
callq 0x31a0
jmp 0x8b66
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Inventory.cpp
// Function: Inventory::getInvValue()
float Inventory::getInvValue() {
    map<string, int>::iterator it;
    string itemName = "";
    float baseValue = 0.0, totalValue = 0.0;
    int quantity = 0;

    // Multiply each inventory item's base value by amount held and sum up
    for (it = inventory.begin(); it != inventory.end(); it++) {
        itemName = it->first;
        quantity = it->second;
        baseValue = economy[itemName];
        totalValue += (baseValue * quantity);
    }

    latestInvValue = totalValue; // Update latestInvValue;

    return latestInvValue;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x380c(%rip), %rsi      # 0xc3b8
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x3860
movq 0x50(%rbx), %r12
leaq 0x40(%rbx), %r13
leaq 0x8(%rbx), %r15
xorps %xmm0, %xmm0
movss %xmm0, (%rsp)
cmpq %r13, %r12
je 0x8c1b
leaq 0x20(%r12), %rsi
movq %r14, %rdi
callq 0x3170
movl 0x40(%r12), %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x5bb4
cvtsi2ssl (%rax), %xmm0
cvtsi2ss %ebp, %xmm1
mulss %xmm0, %xmm1
movss (%rsp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rsp)
movq %r12, %rdi
callq 0x31a0
movq %rax, %r12
jmp 0x8bd2
movss (%rsp), %xmm0
movss %xmm0, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x3130
movss (%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Negotiator.cpp
// Function: Negotiator::getRandWeight()
float Negotiator::getRandWeight() {
    unsigned seed = chrono::system_clock::now().time_since_epoch().count();
    default_random_engine generator (seed);
    uniform_int_distribution<int> distribution(1, 100);
    return distribution(generator) / 100.0;
}

// Assembly:
subq $0x18, %rsp
callq 0x3050
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %ecx
cmpl $0x1, %edx
adcl $0x0, %edx
leaq 0x8(%rsp), %rsi
movq %rdx, (%rsi)
movabsq $0x6400000001, %rax     # imm = 0x6400000001
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
callq 0xad70
cvtsi2sd %eax, %xmm0
divsd 0x2a41(%rip), %xmm0     # 0xce00
cvtsd2ss %xmm0, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Negotiator.cpp
// Function: Negotiator::reactToOffer(Inventory*, float)
bool Negotiator::reactToOffer(Inventory* table, float keyValue) {
    map<string, int>::iterator it;
    float sum = 0.0, response = 0.0;

    string item = "";
    int amount = 0;

    // Iterate through items on the table
    for (it = table->inventory.begin(); it != table->inventory.end(); it++) {
        item = it->first;
        amount = it->second;

        // Get negotiator's preferences * base market value * quantity
        if (amount > 0) sum += prefs[item] * economy[item] * amount;
    }

    // Turn that sum into a ratio of the value of free passage for this level
    generosityOfOffer = sum / keyValue;

    // If player offers more than the key's value, automatic acceptance
    if (generosityOfOffer >= 1) return true;
    // If player offers less than half the key's value, automatic rejection
    else if (generosityOfOffer <= 0.5) return false;
    // Offers 50%-100% apply randomness and negotiator's personality
    else {
        // See asterisked comment at bottom of file for method
        response = (amiability * getRandWeight()) + generosityOfOffer;

        if (response > 1) return true;
        else return false;
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movss %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1fcf(%rip), %rsi      # 0xc3b8
leaq 0x18(%rsp), %r15
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x3860
movq 0x50(%r14), %r13
addq $0x40, %r14
leaq 0x90(%rbx), %r12
movq %rbx, 0x10(%rsp)
leaq 0x8(%rbx), %rbp
xorps %xmm0, %xmm0
movss %xmm0, (%rsp)
cmpq %r14, %r13
je 0xa485
leaq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x3170
movl 0x40(%r13), %ebx
testl %ebx, %ebx
jle 0xa478
movq %r12, %rdi
movq %r15, %rsi
callq 0xadde
movss (%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
callq 0x5bb4
cvtsi2ssl (%rax), %xmm0
cvtsi2ss %ebx, %xmm1
movss 0xc(%rsp), %xmm2
mulss %xmm0, %xmm2
mulss %xmm2, %xmm1
movss (%rsp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rsp)
movq %r13, %rdi
callq 0x31a0
movq %rax, %r13
jmp 0xa41b
movss (%rsp), %xmm1
divss 0x8(%rsp), %xmm1
movq 0x10(%rsp), %rbx
movss %xmm1, 0x8c(%rbx)
movb $0x1, %bpl
ucomiss 0x2961(%rip), %xmm1     # 0xce08
jae 0xa4e8
movss 0x1dcf(%rip), %xmm0     # 0xc280
ucomiss %xmm1, %xmm0
jae 0xa4e6
movss 0x88(%rbx), %xmm0
movss %xmm0, (%rsp)
callq 0xa37c
movss (%rsp), %xmm1
mulss %xmm0, %xmm1
addss 0x8c(%rbx), %xmm1
ucomiss 0x2928(%rip), %xmm1     # 0xce08
seta %bpl
jmp 0xa4e8
xorl %ebp, %ebp
leaq 0x18(%rsp), %rdi
callq 0x3130
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa505
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/Negotiator.cpp
// Function: Negotiator::handlePrologueRejection(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void Negotiator::handlePrologueRejection(int turnsLeft, string &rejection) {
    switch (turnsLeft) {
        case 2:
            rejection += "Unfortunately, this seems inevitable. Of course she ";
            rejection += "won't accept your clothes\nfor a deal! What were ";
            rejection += "you thinking? But all you can do is keep trying.\n\n";
            rejection += "Two more attempts left to go before she runs out of ";
            rejection += "patience. You can sense it.\n\n";
            break;
        case 1:
            rejection += "You put your clothes back on, humiliated by this ";
            rejection += "ordeal. Is she amused by you?\nDisgusted? You can't ";
            rejection += "tell. There's nothing for it. One more doomed ";
            rejection += "offer to go.\n\nHopefully she won't just ";
            rejection += "squash you where you stand. The odds don't exactly ";
            rejection += "seem\ngood...\n\n";
            break;
        default:
            break;
    }

    cout << rejection;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
cmpl $0x2, %esi
je 0xa7be
cmpl $0x1, %esi
jne 0xa815
leaq 0x2b18(%rip), %rsi      # 0xd2a9
movq %rbx, %rdi
callq 0x33b0
leaq 0x2bfa(%rip), %r14      # 0xd39a
leaq 0x2bbf(%rip), %r15      # 0xd366
leaq 0x2b90(%rip), %r12      # 0xd33e
leaq 0x2b5a(%rip), %r13      # 0xd30f
leaq 0x2b1f(%rip), %rsi      # 0xd2db
jmp 0xa7e1
leaq 0x2ac6(%rip), %r14      # 0xd28b
leaq 0x2a8a(%rip), %r15      # 0xd256
leaq 0x2a50(%rip), %r12      # 0xd223
leaq 0x2a18(%rip), %r13      # 0xd1f2
leaq 0x29dc(%rip), %rsi      # 0xd1bd
movq %rbx, %rdi
callq 0x33b0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x33b0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x33b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x33b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33b0
movq 0x87ac(%rip), %rdi      # 0x12fc8
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3200
nop