LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x825b
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r13
xorl %ecx, %ecx
movsbl (%r13,%rcx), %edx
addl $-0x30, %edx
cmpl $0x9, %edx
ja 0x817c
incq %rcx
cmpq %rcx, %rax
jne 0x8164
jmp 0x8185
cmpq %rcx, %rax
jne 0x825b
callq 0x2050
movq %rax, %r12
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%r12)
leaq 0x8(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x22b0
cmpq %r13, (%rbp)
je 0x826a
movq %rax, %r15
movslq %r15d, %rax
cmpq %r15, %rax
jne 0x8276
movl (%r12), %eax
cmpl $0x22, %eax
je 0x8276
testl %eax, %eax
jne 0x81e2
movl 0x4(%rsp), %eax
movl %eax, (%r12)
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x720a(%rip), %rdx      # 0xf3fc
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x50(%r14), %r12
addq $0x40, %r14
cmpq %r14, %r12
je 0x8244
leaq 0x8(%rsp), %r13
leaq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x2140
cmpl %r15d, 0x40(%r12)
je 0x8237
movq %r12, %rdi
callq 0x2180
movq %rax, %r12
cmpq %r14, %rax
jne 0x8211
jmp 0x8244
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2140
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x825b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7235(%rip), %rdi      # 0xf4a6
callq 0x2160
leaq 0x7229(%rip), %rdi      # 0xf4a6
callq 0x22d0
jmp 0x829d
movq %rax, %rbx
jmp 0x82b7
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x82b7
movl 0x4(%rsp), %eax
movl %eax, (%r12)
jmp 0x82b7
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x82b7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x6a38
movq %r12, %rsi
callq 0x7dc0
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x8315
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x70e0(%rip), %rsi      # 0xf3fc
movq %r15, %rdi
callq 0x20c0
testl %eax, %eax
je 0x833b
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0xcc9a(%rip), %rdi      # 0x14fd0
callq 0x2260
movq 0x8(%r15), %rdx
leaq 0x70b6(%rip), %rcx      # 0xf3fc
movq %r15, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x2320
movq 0xcc76(%rip), %rdi      # 0x14fd0
leaq 0x7078(%rip), %rsi      # 0xf3d9
movl $0x5, %edx
callq 0x2260
movq 0xcc6e(%rip), %r15      # 0x14fe0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x23b0
movq %rbx, %rsi
callq 0x809a
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
leaq 0xf(%rsp), %rdx
movb $0x20, (%rdx)
callq 0x757f
movq %rax, %rcx
subq (%rbx), %rcx
movq %rcx, 0x8(%rbx)
movb $0x0, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x813e
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x83f3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc840
movb %al, (%r14)
movq 0x10(%rbx), %rdi
callq 0xa6e6
movss %xmm0, 0x30(%rbx)
movl 0x4(%rbx), %eax
cmpl $0x2, %eax
setl %bpl
orb (%r14), %bpl
jne 0x8a85
decl %eax
movl %eax, 0x4(%rbx)
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xeaf8
movq 0x18(%rbx), %rdi
movl 0x4(%rbx), %esi
movzbl (%rbx), %edx
callq 0xcddc
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x7d1e
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x63dd(%rip), %rdx      # 0xf3fc
leaq 0x40(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
testl %ebp, %ebp
je 0x9056
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x781c
leaq 0x6aec(%rip), %rcx      # 0xfb2e
movq %rsp, %rdi
movl $0x10, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
jmp 0x907a
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x781c
leaq 0x6ad7(%rip), %rcx      # 0xfb3f
movq %rsp, %rdi
movl $0x11, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x90a2
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x90aa
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x2280
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x90e8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9103
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x6a38
leaq 0x60(%rsp), %rsi
callq 0x7dc0
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x9144
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
testb %bpl, %bpl
je 0x915c
movq %rbx, %rdi
callq 0x8a8c
movq 0x18(%rbx), %rdi
callq 0xc9de
jmp 0x9169
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xeaf8
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x9180
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9192
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x91cd
movq 0x10(%rsp), %rsi
jmp 0x91c0
jmp 0x91ca
jmp 0x91ca
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x91cd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x91cd
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x91e4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O3/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
cvtss2sd %xmm0, %xmm0
movq 0xadf0(%rip), %rsi      # 0x14fb8
leaq 0x5c67(%rip), %rcx      # 0xfe36
movq %rsp, %r15
movl $0x3a, %edx
movq %r15, %rdi
movb $0x1, %al
callq 0xb4c8
leaq 0x51ea(%rip), %rsi      # 0xf3d2
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x2380
testl %r14d, %r14d
je 0xa206
addl %r14d, %eax
incl %eax
movslq %eax, %rcx
jmp 0xa209
movslq %eax, %rcx
movq %rsp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2230
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa231
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa25c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa6ca
addl 0x40(%rax), %ebp
movq %rax, %rdi
callq 0x2180
jmp 0xa6b8
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x4cf5(%rip), %rdx      # 0xf3fc
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x50(%rbx), %r14
leaq 0x40(%rbx), %rbp
cmpq %rbp, %r14
je 0xa783
leaq 0x8(%rbx), %r15
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
leaq 0x8(%rsp), %r12
leaq 0x20(%r14), %rsi
movq %r12, %rdi
callq 0x2140
movl 0x40(%r14), %r13d
movq %r15, %rdi
movq %r12, %rsi
callq 0x67d6
xorps %xmm0, %xmm0
cvtsi2ssl (%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
mulss %xmm0, %xmm1
movss 0x4(%rsp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x4(%rsp)
movq %r14, %rdi
callq 0x2180
movq %rax, %r14
cmpq %rbp, %rax
jne 0xa733
jmp 0xa78c
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x4(%rsp), %xmm0
movss %xmm0, (%rbx)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa7b2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movss 0x4(%rsp), %xmm0
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 0xa7e6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2060
movl %eax, %ecx
leaq (%rcx,%rcx,2), %rcx
shrq $0x20, %rcx
movl %eax, %edx
subl %ecx, %edx
shrl %edx
addl %ecx, %edx
shrl $0x1e, %edx
movl %edx, %ecx
shll $0x1f, %ecx
orl %edx, %ecx
leal (%rax,%rcx), %edx
cmpl $0x1, %edx
adcl %eax, %ecx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movabsq $0x6400000001, %rax     # imm = 0x6400000001
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movq %rdi, %rdx
callq 0xd88c
cvtsi2sd %eax, %xmm0
divsd 0x3609(%rip), %xmm0     # 0xfe40
cvtsd2ss %xmm0, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2b92(%rip), %rdx      # 0xf3fc
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x50(%r14), %r15
addq $0x40, %r14
cmpq %r14, %r15
movq %rbx, 0x30(%rsp)
je 0xc918
leaq 0x90(%rbx), %r12
leaq 0x8(%rbx), %r13
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
leaq 0x10(%rsp), %rbp
leaq 0x20(%r15), %rsi
movq %rbp, %rdi
callq 0x2140
movl 0x40(%r15), %ebx
testl %ebx, %ebx
jle 0xc906
movq %r12, %rdi
movq %rbp, %rsi
callq 0xd810
movss (%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x67d6
xorps %xmm0, %xmm0
cvtsi2ssl (%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
movss 0xc(%rsp), %xmm2
mulss %xmm0, %xmm2
mulss %xmm2, %xmm1
movss 0x4(%rsp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x4(%rsp)
movq %r15, %rdi
callq 0x2180
movq %rax, %r15
cmpq %r14, %rax
jne 0xc8a6
jmp 0xc921
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x4(%rsp), %xmm1
divss 0x8(%rsp), %xmm1
movq 0x30(%rsp), %rbx
movss %xmm1, 0x8c(%rbx)
movb $0x1, %bpl
ucomiss 0x3504(%rip), %xmm1     # 0xfe48
jae 0xc987
movss 0x2932(%rip), %xmm0     # 0xf280
ucomiss %xmm1, %xmm0
jae 0xc985
movss 0x88(%rbx), %xmm0
movss %xmm0, 0x4(%rsp)
callq 0xc7dc
movss 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
addss 0x8c(%rbx), %xmm1
ucomiss 0x34c9(%rip), %xmm1     # 0xfe48
seta %bpl
jmp 0xc987
xorl %ebp, %ebp
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xc9a3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2210
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc9b6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xc9d5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xcd68
cmpl $0x1, %esi
jne 0xcdbf
leaq 0x35ae(%rip), %rsi      # 0x102e9
movq %rbx, %rdi
callq 0x23d0
leaq 0x3690(%rip), %r14      # 0x103da
leaq 0x3655(%rip), %r15      # 0x103a6
leaq 0x3626(%rip), %r12      # 0x1037e
leaq 0x35f0(%rip), %r13      # 0x1034f
leaq 0x35b5(%rip), %rsi      # 0x1031b
jmp 0xcd8b
leaq 0x355c(%rip), %r14      # 0x102cb
leaq 0x3520(%rip), %r15      # 0x10296
leaq 0x34e6(%rip), %r12      # 0x10263
leaq 0x34ae(%rip), %r13      # 0x10232
leaq 0x3472(%rip), %rsi      # 0x101fd
movq %rbx, %rdi
callq 0x23d0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x23d0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x23d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x8203(%rip), %rdi      # 0x14fd0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O3/sagardoshi[P]NegotiationsEncounter/src/PlayerCharacter.cpp
// Function: PlayerCharacter::takeBackOffer(Inventory*)
void PlayerCharacter::takeBackOffer(Inventory* table) {
    map<string, int>::iterator it;
    string item = "";
    int amount = 0;

    for (it = table->inventory.begin(); it != table->inventory.end(); it++) {
        item = it->first;
        amount = it->second;
        if (amount > 0) {
            table->inventory[item] = 0; // Take item(s) off table
            inventory[item] += amount;  // Put item(s) back into bag

        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8e0(%rip), %rdx       # 0xf3fc
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x50(%rbx), %r15
leaq 0x40(%rbx), %rbp
cmpq %rbp, %r15
je 0xeb87
addq $0x38, %rbx
addq $0x38, %r14
leaq 0x8(%rsp), %r12
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x2140
movl 0x40(%r15), %r13d
testl %r13d, %r13d
jle 0xeb77
movq %rbx, %rdi
movq %r12, %rsi
callq 0x67d6
movl $0x0, (%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x67d6
addl %r13d, (%rax)
movq %r15, %rdi
callq 0x2180
movq %rax, %r15
cmpq %rbp, %rax
jne 0xeb43
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xeba3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
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 0xebd1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/test/test_checkedvalue.cc
// Function: void test_pass<CalcError, (CalcError)0, (CalcError)2>(bool)
void test_pass(bool const success){
	constexpr int n = 5;

	const float dividor	= success ? 1 : 0;
	const auto  expected	= success ? OK : ERR;

	const auto v = test_function<T, OK, ERR>(n, dividor);

	PRINTF_TEST("bool",	v == success		);
	PRINTF_TEST("code()",	v.code() == expected	);

	if (success)
	PRINTF_TEST("get()",	v.get() == n		);

	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0xe6f(%rip), %r14       # 0x2004
leaq 0xe80(%rip), %r15       # 0x201c
leaq 0xe86(%rip), %rdx       # 0x2029
leaq 0xe84(%rip), %r12       # 0x202e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
leaq 0xe70(%rip), %rdx       # 0x2031
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
testl %ebx, %ebx
je 0x11f8
leaq 0xe28(%rip), %rdi       # 0x2004
leaq 0xe39(%rip), %rsi       # 0x201c
leaq 0xe4e(%rip), %rdx       # 0x2038
leaq 0xe3d(%rip), %rcx       # 0x202e
xorl %eax, %eax
callq 0x1030
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: expandVector(vector&)
void expandVector(vector& v) {
	int* new_keys = new int[v.size+1];
	double* new_values = new double[v.size+1];
	for(int i=0; i<v.size; i++) {
		new_keys[i] = v.keys[i];
		new_values[i] = v.values[i];
	}

	if(v.keys != 0)
		delete v.keys;
	if(v.values != 0)
		delete v.values;

	v.size++;
	v.keys = new_keys;
	v.values = new_values;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq (%rdi), %r12
movq $-0x1, %rax
cmpq %rax, %r12
leaq 0x4(,%r12,4), %rdi
cmovlq %rax, %rdi
leaq 0x8(,%r12,8), %r15
cmovlq %rax, %r15
callq 0x1030
movq %rax, %r14
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movq 0x8(%rbx), %rdi
testq %r12, %r12
jle 0x12fa
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
movl (%rdi,%rcx,4), %edx
movl %edx, (%r14,%rcx,4)
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %r12
jne 0x12de
jmp 0x12ff
testq %rdi, %rdi
je 0x1304
callq 0x10d0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1312
callq 0x10d0
incl (%rbx)
movq %r14, 0x8(%rbx)
movq %r15, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: scalar(vector const&, vector const&)
double scalar(const vector& v1, const vector& v2) {
	double result = 0;
	int i1 = 0, i2 = 0;
	while(i1 < v1.size && i2 < v2.size) {
		if(v1.keys[i1] == v2.keys[i2]) {
			result += v1.values[i1] * v2.values[i2];
			i1++;
			i2++;
		} else if (v1.keys[i1] < v2.keys[i2]) {
			i1++;
		} else {
			i2++;
		}
	}
	return result;
}

// Assembly:
movl (%rdi), %eax
movl (%rsi), %ecx
testl %eax, %eax
setg %dl
testl %ecx, %ecx
setg %r8b
andb %dl, %r8b
xorpd %xmm0, %xmm0
cmpb $0x1, %r8b
jne 0x1399
pushq %rbp
pushq %rbx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rdi
movq 0x8(%rsi), %r8
movq 0x10(%rsi), %rsi
xorpd %xmm0, %xmm0
xorl %r9d, %r9d
xorl %r10d, %r10d
movslq %r10d, %rbx
movslq %r9d, %r11
movl (%r8,%r11,4), %ebp
cmpl %ebp, (%rdx,%rbx,4)
jne 0x1383
movsd (%rdi,%rbx,8), %xmm1
mulsd (%rsi,%r11,8), %xmm1
addsd %xmm1, %xmm0
incl %r10d
jmp 0x138a
jge 0x138a
incl %r10d
jmp 0x138d
incl %r9d
cmpl %eax, %r10d
jge 0x1397
cmpl %ecx, %r9d
jl 0x1360
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: distanceSQ(vector const&, vector const&)
double distanceSQ(const vector& v1, const vector& v2) {
	double result = 0;
	int i1 = 0, i2 = 0;
	while(i1 < v1.size && i2 < v2.size) {
		double diff;
		if(v1.keys[i1] == v2.keys[i2]) {
			diff = v1.values[i1] - v2.values[i2];
			i1++;
			i2++;
		} else if (v1.keys[i1] < v2.keys[i2]) {
			diff = v1.values[i1];
			i1++;
		} else {
			diff = v2.values[i2];
			i2++;
		}
		result += diff * diff;
	}
	return result;
}

// Assembly:
movl (%rdi), %eax
movl (%rsi), %ecx
testl %eax, %eax
setg %dl
testl %ecx, %ecx
setg %r8b
andb %dl, %r8b
xorpd %xmm0, %xmm0
cmpb $0x1, %r8b
jne 0x1424
pushq %rbp
pushq %rbx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rdi
movq 0x8(%rsi), %r8
movq 0x10(%rsi), %rsi
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
xorl %r9d, %r9d
movslq %r9d, %rbx
movslq %r10d, %r11
movl (%r8,%r11,4), %ebp
cmpl %ebp, (%rdx,%rbx,4)
jne 0x13f6
movsd (%rdi,%rbx,8), %xmm1
subsd (%rsi,%r11,8), %xmm1
incl %ebx
incl %r11d
movl %ebx, %r9d
jmp 0x140d
jge 0x1404
movsd (%rdi,%rbx,8), %xmm1
incl %ebx
movl %ebx, %r9d
jmp 0x1410
movsd (%rsi,%r11,8), %xmm1
incl %r11d
movl %r11d, %r10d
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
cmpl %eax, %r9d
jge 0x1422
cmpl %ecx, %r10d
jl 0x13d2
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: clone(vector&, vector&)
void clone(vector& dest, vector& src) {
	if(dest.keys != 0)
		delete dest.keys;
	if(dest.values != 0)
		delete dest.values;
	dest.size = src.size;
	dest.keys = new int[dest.size];
	dest.values = new double[dest.size];
	for(int i=0; i<dest.size; i++) {
		dest.keys[i] = src.keys[i];
		dest.values[i] = src.values[i];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x1442
callq 0x10d0
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x1450
callq 0x10d0
movslq (%rbx), %r13
movl %r13d, (%r14)
leaq (,%r13,4), %rdi
testq %r13, %r13
movq $-0x1, %rax
cmovsq %rax, %rdi
leaq (,%r13,8), %r12
cmovsq %rax, %r12
callq 0x1030
movq %rax, %r15
movq %rax, 0x8(%r14)
movq %r12, %rdi
callq 0x1030
movq %rax, 0x10(%r14)
testq %r13, %r13
jle 0x14b8
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movl %edi, (%r15,%rsi,4)
movsd (%rdx,%rsi,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
incq %rsi
cmpq %rsi, %r13
jne 0x149f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: recomputeCentroid(cluster&)
void recomputeCentroid(cluster& cl) {
	vector &centroid = cl.centroid;
	list<vector*> vectors;
	for(int i=0; i<cl.members.size();i++)
		vectors.add(&(cl.members.get(i)->v));

	centroid.size = 0;
	computeCentroid(centroid, vectors);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, (%rsp)
movl $0x10, %edi
callq 0x1030
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x18(%rbx)
jle 0x1701
xorl %r12d, %r12d
movq %rsp, %r14
leaq 0x10(%rsp), %r15
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1cc4
incq %r12
movslq 0x18(%rbx), %rax
cmpq %rax, %r12
jl 0x16d9
movl $0x0, (%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x14c2
movq 0x8(%rsp), %rdi
callq 0x10d0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x172a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0x10d0
movq %rbx, %rdi
callq 0x1170
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: selectSeeds(cluster*, list<article_entry*>&, int)
void selectSeeds(cluster* clusters, entryList &l, int k) {
	int index = 0;
	for(int i=0; i<l.size(); i++) {
		index = i % k;
		cluster &cl = clusters[index];
		article_entry* e = l.get(i);
		cl.members.add(e);
	}
	printf("Computing centroids ");
	for(int i=0; i<k; i++) {
		printf("%d ", i);
		recomputeCentroid(clusters[i]);
	}
	printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rdi, %rbx
cmpl $0x0, (%rsi)
jle 0x1792
movq %rsi, %r14
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
movl %r15d, %eax
cltd
idivl %ebp
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rax
movq %rax, 0x8(%rsp)
leaq (%rdx,%rdx,4), %rax
leaq (%rbx,%rax,8), %rdi
addq $0x18, %rdi
movq %r12, %rsi
callq 0x1d46
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1760
leaq 0x1897(%rip), %rdi      # 0x3030
xorl %eax, %eax
callq 0x1040
testl %ebp, %ebp
jle 0x17d2
movl %ebp, %r12d
leaq 0x1897(%rip), %r14      # 0x3045
xorl %r15d, %r15d
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
callq 0x169d
incq %r15
addq $0x28, %rbx
cmpq %r15, %r12
jne 0x17b1
movl $0xa, %edi
callq 0x1100
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: findBestCluster(cluster*, int, vector&)
cluster& findBestCluster(cluster* clusters, int k, vector& v) {
	int best_cl = 0;
	double best_dist = INFINITY;
	for(int i=0; i<k; i++) {
		double dist = distanceSQ(v, clusters[i].centroid);
		if(dist < best_dist) {
			best_dist = dist;
			best_cl = i;
		}
	}
	return clusters[best_cl];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
testl %esi, %esi
jle 0x1841
movq %rdx, %r14
movl %esi, %r13d
movsd 0x17fc(%rip), %xmm0     # 0x3008
movq %rbx, %r15
xorl %ebp, %ebp
movsd %xmm0, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x139a
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
minsd %xmm1, %xmm0
cmoval %ebp, %r12d
incq %rbp
addq $0x28, %r15
cmpq %rbp, %r13
jne 0x1811
movslq %r12d, %r12
leaq (%r12,%r12,4), %rax
leaq (%rbx,%rax,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: calculateRSS(cluster&)
double calculateRSS(cluster& c) {
	double result = 0;
	for (int i=0; i<c.members.size(); i++) {
		result += distanceSQ(c.centroid, c.members.get(i)->v);
	}
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq 0x18(%rdi), %r14
testq %r14, %r14
jle 0x18a9
movq %rdi, %rbx
movq 0x20(%rdi), %r15
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
movsd %xmm0, (%rsp)
movq (%r15,%r12,8), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x139a
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r12
cmpq %r12, %r14
jne 0x1877
jmp 0x18ad
xorpd %xmm0, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: printRSS(cluster*, int)
double printRSS(cluster* clusters, int n) {
	double result = 0;
	for(int i=0; i<n; i++) {
		double rss = calculateRSS(clusters[i]);
		printf("Cluster %d: RSS = %f Members = %d\n", i, rss, clusters[i].members.size());
		result += rss;
	}
	printf("Total RSS = %f\n", result);
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
testl %esi, %esi
jle 0x191a
movq %rdi, %rbx
movl %esi, %r12d
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
leaq 0x176d(%rip), %r15      # 0x3049
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x1858
movsd %xmm0, 0x10(%rsp)
movl 0x18(%rbx), %edx
movq %r15, %rdi
movl %r14d, %esi
movb $0x1, %al
callq 0x1040
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
incq %r14
addq $0x28, %rbx
cmpq %r14, %r12
jne 0x18dc
jmp 0x191e
xorpd %xmm0, %xmm0
leaq 0x1747(%rip), %rdi      # 0x306c
movsd %xmm0, 0x8(%rsp)
movb $0x1, %al
callq 0x1040
movsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: normalize(article_entry*)
void normalize(article_entry* entry) {
	double factor = 0;
	for(int i=0; i<entry->v.size; i++) {
		double d = entry->v.values[i];
		factor += d * d;
	}
	factor = sqrt(factor);
	for (int i=0; i<entry->v.size; i++) {
		entry->v.values[i] = entry->v.values[i] / factor;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x8(%rdi), %rax
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
testq %rax, %rax
jle 0x1bc3
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x1bae
ucomisd %xmm1, %xmm0
jb 0x1bcf
sqrtsd %xmm0, %xmm0
jmp 0x1bd4
callq 0x10a0
movslq 0x8(%rbx), %rax
testq %rax, %rax
jle 0x1bf9
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x1be3
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: kmeans(list<article_entry*>&)
void kmeans(list<article_entry*> &l) {
	// Normalize vectors
	printf("Normalizing vectors\n");
	for(int i=0; i<l.size(); i++)
		normalize(l.get(i));
	clusterize(CLUSTERS, l);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x149e(%rip), %rdi      # 0x30a7
callq 0x1150
cmpl $0x0, (%rbx)
jle 0x1c2e
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1b93
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x1c16
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1944
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/list.h
// Function: list<iter*>::add(iter* const&)
void add(const T& el) {
		if(s == cap) {
			int new_c = cap << 1;
			T* new_arr = new T[new_c];
			for (int i=0; i<cap; i++)
				new_arr[i] = arr[i];
			delete arr;
			arr = new_arr;
			cap = new_c;
		}
		arr[s] = el;
		s++;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %r12d
cmpl 0x4(%rdi), %r12d
jne 0x1ca9
leal (%r12,%r12), %ebp
movslq %ebp, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x1030
movq %rax, %r15
movq 0x8(%rbx), %rdi
testl %r12d, %r12d
jle 0x1c98
xorl %eax, %eax
movq (%rdi,%rax,8), %rcx
movq %rcx, (%r15,%rax,8)
incq %rax
cmpq %rax, %r12
jne 0x1c88
callq 0x10d0
movq %r15, 0x8(%rbx)
movl %ebp, 0x4(%rbx)
movl (%rbx), %r12d
jmp 0x1cad
movq 0x8(%rbx), %r15
movq (%r14), %rax
movslq %r12d, %rcx
movq %rax, (%r15,%rcx,8)
incl %ecx
movl %ecx, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/list.h
// Function: list<article_entry*>::clear()
void clear() {
		s = 0;
		cap = 2;
		delete arr;
		arr = new T[cap];
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
callq 0x10d0
movslq 0x4(%rbx), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x1030
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/kmeans_main.cpp
// Function: main
int main(int argc, char** argv) {
	setbuf(stdout, NULL);
	if(argc < 2) {
		printf("Not enough arguments\n");
		printf("Usage: %s <input_dir> <output_file>", argv[0]);
		return 1;
	}

	const char* inputPath = argv[1];
	processDirectory(inputPath);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movq 0x2c38(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x1110
cmpl $0x1, %ebp
jg 0x23cf
leaq 0xd83(%rip), %rdi       # 0x3134
callq 0x1150
movq (%rbx), %rsi
leaq 0xd50(%rip), %rdi       # 0x3110
xorl %eax, %eax
callq 0x1040
movl $0x1, %r14d
jmp 0x23d8
movq 0x8(%rbx), %rdi
callq 0x213a
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::get(char const*)
T* ptree<T>::get(const char* str) {
	const char* s = str;
	int state = 0;
	while(*s != '\0' && state >= 0) {
		int c = getIndex(*s);
		state = table[state][c];
		s++;
	}

	if(state == -1 || !flags[state])
		return 0;

	return values + state;
}

// Assembly:
movb (%rsi), %dl
testb %dl, %dl
je 0x2413
movq (%rdi), %rcx
incq %rsi
xorl %eax, %eax
movsbq %dl, %rdx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
movl -0xc0(%rax,%rdx,4), %eax
movb (%rsi), %dl
testb %dl, %dl
je 0x240c
incq %rsi
testl %eax, %eax
jns 0x23ee
cmpl $-0x1, %eax
jne 0x2415
jmp 0x242a
xorl %eax, %eax
movq 0x10(%rdi), %rcx
cltq
cmpb $0x1, (%rcx,%rax)
jne 0x242a
shlq $0x2, %rax
addq 0x8(%rdi), %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::add(char const*, int)
void ptree<T>::add(const char* str, T i) {
	const char* s = str;
	int state = 0;
	while(*s != '\0') {
		int c = getIndex(*s);
		int n_state = table[state][c];
		if(n_state == -1) {
			break;
		}
		state = n_state;
		s++;
	}

	while(*s != '\0') {
		int c = getIndex(*s);
		int n_state = buildState();
		table[state][c] = n_state;
		state = n_state;
		s++;
	}
	values[state] = i;
	flags[state] = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rax
xorl %edx, %edx
movl %edx, %ebp
movsbq (%r15), %rcx
testq %rcx, %rcx
je 0x2490
movslq %ebp, %rdx
movq (%rax,%rdx,8), %rdx
movl -0xc0(%rdx,%rcx,4), %edx
incq %r15
cmpl $-0x1, %edx
jne 0x2443
movsbq %cl, %r12
movq %r14, %rdi
callq 0x2650
movq (%r14), %rcx
movslq %ebp, %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, -0xc0(%rcx,%r12,4)
movb (%r15), %cl
incq %r15
movl %eax, %ebp
testb %cl, %cl
jne 0x2464
jmp 0x2492
movl %ebp, %eax
movq 0x8(%r14), %rcx
cltq
movl %ebx, (%rcx,%rax,4)
movq 0x10(%r14), %rcx
movb $0x1, (%rcx,%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/hash.h
// Function: hash<double>::insert(int const&, double const&)
void hash<T>::insert(const int& key, const T& el) {
  int index = bin_search(keys, size, key);
  if(index >= 0) {
    this->data[index] = el;
  } else {
    if(size >= cap)
      expand();
    index = -index - 1;
    for (int i = size; i > index; i--) {
      keys[i] = keys[i-1];
      data[i] = data[i-1];
    }
    keys[index] = key;
    data[index] = el;
    size++;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movl 0x4(%rdi), %ecx
movl %ecx, %r12d
testl %ecx, %ecx
jle 0x24fd
movl (%r15), %edx
xorl %esi, %esi
movl %ecx, %r12d
leal (%rsi,%r12), %edi
shrl %edi
movl (%rax,%rdi,4), %r8d
cmpl %edx, %r8d
je 0x2558
leal 0x1(%rdi), %r9d
cmpl %edx, %r8d
cmovgel %esi, %r9d
cmovgl %esi, %r9d
cmovgl %edi, %r12d
movl %r9d, %esi
cmpl %r12d, %r9d
jl 0x24d3
testl %r12d, %r12d
js 0x2552
cmpl (%rbx), %ecx
jl 0x2515
movq %rbx, %rdi
callq 0x27d4
movl 0x4(%rbx), %ecx
movq 0x10(%rbx), %rax
movq 0x8(%rbx), %rdx
cmpl %r12d, %ecx
jle 0x253a
movl %ecx, %esi
leal -0x1(%rcx), %edi
movl (%rax,%rdi,4), %ecx
movl %ecx, (%rax,%rsi,4)
movsd (%rdx,%rdi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
movl %edi, %ecx
cmpl %r12d, %edi
jg 0x251e
movl (%r15), %ecx
movl %r12d, %esi
movl %ecx, (%rax,%rsi,4)
movsd (%r14), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incl 0x4(%rbx)
jmp 0x2566
notl %r12d
movq %r12, %rdi
movsd (%r14), %xmm0
movq 0x8(%rbx), %rax
movsd %xmm0, (%rax,%rdi,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::ptree()
ptree<T>::ptree() {
	cap = 1;
	size = 1;
	table = new int*[cap];
	table[0] = new int[SIZE];
	for(int i=0; i<SIZE; i++)
		table[0][i] = -1;
	values = new T[cap];
	values[0] = -1;
	flags = new bool[cap];
	flags[0] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x18(%rdi)
movl $0x8, %edi
callq 0x1030
movq %rax, %r15
movq %rax, (%rbx)
movslq 0x2b3e(%rip), %r12      # 0x50e0
leaq (,%r12,4), %r14
testq %r12, %r12
movq $-0x1, %rdi
cmovnsq %r14, %rdi
callq 0x1030
movq %rax, (%r15)
testq %r12, %r12
jle 0x25d5
movq %rax, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x1080
movl $0x4, %edi
callq 0x1030
movq %rax, 0x8(%rbx)
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x1, %edi
callq 0x1030
movq %rax, 0x10(%rbx)
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::~ptree()
ptree<T>::~ptree() {
	for(int i=0; i<size; i++)
		delete table[i];
	delete table;
	delete values;
	delete flags;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x1c(%rdi)
jle 0x262e
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x10d0
incq %r14
movslq 0x1c(%rbx), %rax
cmpq %rax, %r14
jl 0x2616
movq (%rbx), %rdi
callq 0x10d0
movq 0x8(%rbx), %rdi
callq 0x10d0
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::buildState()
int ptree<T>::buildState() {
	if(size == cap)
		expand();
	if(size == 1423)
		size = size;

	int result = size;
	size++;
	table[result] = new int[SIZE];
	for(int i=0; i<SIZE; i++)
		table[result][i] = -1;
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x1c(%rdi), %ebx
cmpl 0x18(%rdi), %ebx
jne 0x266c
movq %r14, %rdi
callq 0x26cc
movl 0x1c(%r14), %ebx
leal 0x1(%rbx), %eax
movl %eax, 0x1c(%r14)
movslq 0x2a66(%rip), %r15      # 0x50e0
leaq (,%r15,4), %rax
testq %r15, %r15
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x1030
movq (%r14), %rdx
movslq %ebx, %rcx
movq %rax, (%rdx,%rcx,8)
testq %r15, %r15
jle 0x26c3
movq (%r14), %rax
movq (%rax,%rcx,8), %rax
xorl %ecx, %ecx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
incq %rcx
movslq 0x2a22(%rip), %rdx      # 0x50e0
cmpq %rdx, %rcx
jl 0x26ad
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::expand()
void ptree<T>::expand() {
	int new_cap = cap << 1;
	int** new_table = new int*[new_cap];
	T* new_values = new T[new_cap];
	bool* new_flags = new bool[new_cap];
	for(int i=0; i<cap; i++) {
		new_table[i] = table[i];
		new_values[i] = values[i];
		new_flags[i] = flags[i];
	}
	for(int i=cap; i<new_cap; i++) {
		new_table[i] = 0;
		new_flags[i] = 0;
	}

	delete table;
	delete values;
	delete flags;

	table = new_table;
	values = new_values;
	flags = new_flags;
	cap = new_cap;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x18(%rdi), %rbp
leal (,%rbp,2), %r13d
movslq %r13d, %rax
testl %eax, %eax
movq $-0x1, %rcx
movq %rax, %r12
cmovsq %rcx, %r12
leaq (,%rax,4), %r15
testl %eax, %eax
cmovsq %rcx, %r15
movq %rax, %rdi
shlq $0x3, %rdi
testl %eax, %eax
cmovsq %rcx, %rdi
callq 0x1030
movq %rax, %r14
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movq %r12, %rdi
callq 0x1030
movq %rax, %r12
testq %rbp, %rbp
jle 0x2763
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
xorl %esi, %esi
movq (%rax,%rsi,8), %rdi
movq %rdi, (%r14,%rsi,8)
movl (%rcx,%rsi,4), %edi
movl %edi, (%r15,%rsi,4)
movb (%rdx,%rsi), %dil
movb %dil, (%r12,%rsi)
incq %rsi
cmpq %rsi, %rbp
jne 0x2744
cmpl %r13d, %ebp
jge 0x279c
leaq (%r14,%rbp,8), %rdi
movl %r13d, 0x4(%rsp)
leal -0x1(%rbp), %r13d
leaq 0x8(,%r13,8), %rdx
xorl %esi, %esi
callq 0x1080
movq %r12, %rdi
addq %rbp, %rdi
incq %r13
xorl %esi, %esi
movq %r13, %rdx
movl 0x4(%rsp), %r13d
callq 0x1080
movq (%rbx), %rdi
callq 0x10d0
movq 0x8(%rbx), %rdi
callq 0x10d0
movq 0x10(%rbx), %rdi
callq 0x10d0
movq %r14, (%rbx)
movq %r15, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movl %r13d, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/kmeans/../common/hash.h
// Function: hash<double>::expand()
void hash<T>::expand() {
  hash<T>& table = *this;
  int new_c = table.cap + 1;
  expand_array(table.keys, table.cap, new_c);
  expand_array(table.data, table.cap, new_c);
  table.cap = new_c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq (%rdi), %r12
leal 0x1(%r12), %r15d
leaq (,%r15,4), %rdi
cmpq $-0x1, %r12
movq $-0x1, %r13
cmovlq %r13, %rdi
callq 0x1030
movq %rax, %r14
movq 0x10(%rbx), %rdi
testq %r12, %r12
jle 0x2821
xorl %eax, %eax
movl (%rdi,%rax,4), %ecx
movl %ecx, (%r14,%rax,4)
incq %rax
cmpq %rax, %r12
jne 0x2812
callq 0x10d0
leaq (,%r15,8), %rdi
cmpl $-0x1, %r12d
movq %r14, 0x10(%rbx)
movslq (%rbx), %r12
cmovlq %r13, %rdi
callq 0x1030
movq %rax, %r14
movq 0x8(%rbx), %rdi
testq %r12, %r12
jle 0x2863
xorl %eax, %eax
movsd (%rdi,%rax,8), %xmm0
movsd %xmm0, (%r14,%rax,8)
incq %rax
cmpq %rax, %r12
jne 0x2850
callq 0x10d0
movq %r14, 0x8(%rbx)
movl %r15d, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/rand6.cc
// Function: main
int main()
{
	vector<unsigned> v1(bad_randVec());
	vector<unsigned> v2(bad_randVec());

	// will print equal
	cout << ((v1 == v2) ? "equal" : "not equal") << endl;

	// very unlikely to print equal
	if (good_randVec() == good_randVec())
		cout << "equal!" << endl;
	else
		cout << "not equal" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
leaq -0x60(%rbp), %rdi
callq 0x12ec
leaq -0x48(%rbp), %rdi
callq 0x12ec
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, %rdx
subq %rdi, %rdx
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
subq %rsi, %rcx
leaq 0xb68(%rip), %rbx       # 0x2004
cmpq %rcx, %rdx
jne 0x14b6
cmpq %rdi, %rax
je 0x14af
callq 0x10e0
testl %eax, %eax
jne 0x14b6
leaq 0xb52(%rip), %rbx       # 0x2008
movq %rbx, %rdi
callq 0x1050
movq 0x2b13(%rip), %r14      # 0x3fd8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x10f0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq 0x2ae7(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq -0x30(%rbp), %rdi
callq 0x139c
leaq -0x78(%rbp), %rdi
callq 0x139c
movq -0x30(%rbp), %rbx
movq -0x28(%rbp), %rax
movq %rax, %rdx
subq %rbx, %rdx
movq -0x78(%rbp), %r14
movq -0x70(%rbp), %rcx
subq %r14, %rcx
cmpq %rcx, %rdx
jne 0x1546
cmpq %rbx, %rax
je 0x154b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10e0
testl %eax, %eax
sete %r15b
jmp 0x154e
xorl %r15d, %r15d
jmp 0x154e
movb $0x1, %r15b
testq %r14, %r14
je 0x1566
movq -0x68(%rbp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x10d0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x157a
movq -0x20(%rbp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0x10d0
leaq 0xa8d(%rip), %rax       # 0x200e
leaq 0xa7c(%rip), %rsi       # 0x2004
testb %r15b, %r15b
cmovneq %rax, %rsi
xorb $0x1, %r15b
movzbl %r15b, %eax
leaq (%rax,%rax,2), %rdx
addq $0x6, %rdx
movq 0x2a32(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq 0x2a0c(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x15ee
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x1603
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x1634
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
jmp 0x1634
jmp 0x1631
movq %rax, %rbx
jmp 0x1649
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x1649
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x165e
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
movq %rbx, %rdi
callq 0x1120