LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Caproner[P]Naive_Compiler/Grammar/Grammar.cpp
// Function: Grammar::Analysis()
bool Grammar::Analysis()
{
	this->Grammar_Forest.forest.clear();
	for(int i=0;i<this->Handle_List.size();i++)
	{
		if(this->Handle_Analysis(i))continue;
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq %rax, 0x20(%rdi)
je 0x4b38
movq %rax, 0x20(%rbx)
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
sete %bpl
je 0x4b8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x40da
testb %al, %al
je 0x4b8d
movl $0x1, %r14d
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
imulq %r15, %rax
cmpq %r14, %rax
setbe %bpl
jbe 0x4b8d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x40da
incq %r14
testb %al, %al
jne 0x4b63
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_14_15_main.cc
// Function: main
int main(int argc, char const *argv[])
{
	Screen<5, 5> scr('c');

	scr.display(std::cout);

	// output src to the screen
	std::cout << scr;

	std::cin >> scr;

	std::cout << scr;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq -0x30(%rbp), %rdi
movq $0x0, -0x18(%rdi)
movl $0x5, %eax
movq %rax, -0x10(%rdi)
movq %rax, -0x8(%rdi)
leaq -0x20(%rbp), %r14
movq %r14, -0x10(%r14)
movl $0x19, %esi
movl $0x63, %edx
callq 0x10a0
movq -0x10(%r14), %rsi
movq -0x8(%r14), %rdx
movq 0x2d5a(%rip), %rdi      # 0x3fd0
callq 0x1090
movq 0x2d4e(%rip), %rdi      # 0x3fd0
leaq -0x48(%rbp), %rsi
callq 0x12eb
movq 0x2d4e(%rip), %rdi      # 0x3fe0
leaq -0x48(%rbp), %rsi
callq 0x13bb
movq 0x2d2e(%rip), %rdi      # 0x3fd0
leaq -0x48(%rbp), %rsi
callq 0x12eb
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x12c0
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x1070
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x12e3
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x1070
movq %rbx, %rdi
callq 0x10e0
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/./ex16_14_15.h
// Function: operator>>(std::istream&, Screen<5u, 5u>&)
std::istream& operator>>(std::istream& is, Screen<H, W>& s)
	{
		char a;
		is >> a;
		std::string temp(H*W, a);
		s.contents = std::move(temp);
		return is;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x21(%rbp), %r15
movq %r15, %rsi
callq 0x10c0
movsbl (%r15), %edx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0x48(%rbp), %r15
movl $0x19, %esi
movq %r15, %rdi
callq 0x10a0
addq $0x18, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x10b0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x141d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1070
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day02/ex00/main.cpp
// Function: main
int main(void) {
	Fixed a;
	Fixed b(a);
	Fixed c;

	c = b;
	std::cout << a.getRawBits() << std::endl;
	std::cout << b.getRawBits() << std::endl;
	std::cout << c.getRawBits() << std::endl;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
callq 0x11cc
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x11d6
leaq 0x4(%rsp), %rdi
callq 0x11cc
leaq 0x4(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x11dc
leaq 0xc(%rsp), %rdi
callq 0x11e8
movq 0x2da3(%rip), %rdi      # 0x3fd8
movl %eax, %esi
callq 0x1080
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1060
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
leaq 0x8(%rsp), %rdi
callq 0x11e8
movq 0x2d61(%rip), %rdi      # 0x3fd8
movl %eax, %esi
callq 0x1080
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1060
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
leaq 0x4(%rsp), %rdi
callq 0x11e8
movq 0x2d1f(%rip), %rdi      # 0x3fd8
movl %eax, %esi
callq 0x1080
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1060
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
leaq 0x4(%rsp), %rdi
callq 0x11d4
leaq 0x8(%rsp), %rdi
callq 0x11d4
leaq 0xc(%rsp), %rdi
callq 0x11d4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
movq %rax, %rbx
jmp 0x1327
movq %rax, %rbx
jmp 0x1331
movq %rax, %rbx
leaq 0x4(%rsp), %rdi
callq 0x11d4
leaq 0x8(%rsp), %rdi
callq 0x11d4
leaq 0xc(%rsp), %rdi
callq 0x11d4
movq %rbx, %rdi
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/optimalSolver.cc
// Function: OptimalSolver::OptimalSolver()
OptimalSolver::OptimalSolver() {
	matrix = NULL;
	defaultCells = NULL;
	readLength = 0;
	seedNum = 0;
	matrixSize = 0;
	L0Loaded = false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xa, %esi
movl $0x1e, %edx
callq 0x6708
movq $0x0, 0x35c(%rbx)
movb $0x0, 0x358(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x368(%rbx)
movups %xmm0, 0x378(%rbx)
movups %xmm0, 0x384(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/optimalSolver.cc
// Function: OptimalSolver::~OptimalSolver()
OptimalSolver::~OptimalSolver() {
	if  (matrix != NULL) {
		delete [] matrix;
		matrix = NULL;
	}
	if  (defaultCells != NULL) {
		delete [] defaultCells;
		defaultCells = NULL;
	}

	if (level.size() != 0)
		level.clear();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x368(%rdi), %rdi
testq %rdi, %rdi
je 0x4733
callq 0x3340
movq $0x0, 0x368(%rbx)
movq 0x388(%rbx), %rdi
testq %rdi, %rdi
je 0x474f
callq 0x3340
movq $0x0, 0x388(%rbx)
leaq 0x370(%rbx), %r14
movq 0x370(%rbx), %rsi
cmpq %rsi, 0x378(%rbx)
je 0x476e
movq %r14, %rdi
callq 0x606a
movq %r14, %rdi
callq 0x5fae
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6850
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/optimalSolver.cc
// Function: OptimalSolver::feedL0()
void OptimalSolver::feedL0() {
	reset();
	tree.setHashLength(10);
	int lvPosCount = readLength + 1 - tree.getHashLength();

	for (int i = 0; i < lvPosCount; i++) {
		for (int j = 0; j < lvPosCount - i; j++) {
			cin >> level[0][i][j].start;
			cin >> level[0][i][j].end;
			cin >> level[0][i][j].frequency;
			cin >> level[0][i][j].isleaf;
#ifdef DEBUG
			cout << "level[0][" << i << "][" << j << "].start=" << level[0][i][j].start << endl;
			cout.flush();
#endif
		}
	}
			L0Loaded = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x368(%rdi), %rdi
movq 0x388(%rbx), %rsi
movslq 0x390(%rbx), %rdx
callq 0x3200
movl $0xa, (%rbx)
movl 0x35c(%rbx), %ebp
movq %rbx, %rdi
callq 0x749e
subl %eax, %ebp
incl %ebp
testl %ebp, %ebp
jle 0x4cee
movl %ebp, %r13d
xorl %r12d, %r12d
movq 0xa38b(%rip), %r14      # 0xefd8
movq %r13, (%rsp)
subq %r12, %r13
jle 0x4cde
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x370(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rsi
addq %rbp, %rsi
movq %r14, %rdi
callq 0x3460
movq 0x370(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rax
leaq (%rax,%rbp), %rsi
addq $0x4, %rsi
movq %r14, %rdi
callq 0x3460
movq 0x370(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rax
leaq (%rax,%rbp), %rsi
addq $0xc, %rsi
movq %r14, %rdi
callq 0x3460
movq 0x370(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rax
leaq (%rax,%rbp), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x3220
incq %r15
addq $0x28, %rbp
cmpq %r13, %r15
jl 0x4c5f
incq %r12
movq (%rsp), %r13
cmpq %r13, %r12
jne 0x4c51
movb $0x1, 0x358(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/main.cpp
// Function: reEnableSpecialCharacters()
void reEnableSpecialCharacters() {
    system("stty eof '^d'"  ); // re-enable CTRL+D
    system("stty intr '^c'" ); // re-enable CTRL+C
    system("stty quit '^\\'" ); // re-enable CTRL+backslash
    system("stty susp '^z'" ); // re-enable CTRL+Z
    system("stty dsusp '^y'"); // re-enable CTRL+Y
}

// Assembly:
pushq %rax
leaq 0xc9a0(%rip), %rdi      # 0xf004
callq 0x21d0
leaq 0xc9a2(%rip), %rdi      # 0xf012
callq 0x21d0
leaq 0xc9a5(%rip), %rdi      # 0xf021
callq 0x21d0
leaq 0xc9a8(%rip), %rdi      # 0xf030
callq 0x21d0
leaq 0xc9ab(%rip), %rdi      # 0xf03f
popq %rax
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/main.cpp
// Function: registerSignals()
void registerSignals() {
    struct sigaction act;

    act.sa_handler = signalHandler;
    sigemptyset(&act.sa_mask);
    act.sa_flags = 0;

    sigaction(SIGINT,  &act, 0); // Ctrl-C
    sigaction(SIGQUIT, &act, 0); // Ctrl-backslash
    sigaction(SIGTSTP, &act, 0); // Ctrl-Z
    sigaction(SIGTERM, &act, 0); // Like SIGINT

}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq -0x10(%rip), %rax       # 0x269a
leaq 0x10(%rsp), %rbx
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
callq 0x2290
movl $0x0, 0x80(%rbx)
leaq 0x8(%rsp), %rbx
movl $0x2, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22a0
movl $0x3, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22a0
movl $0x14, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22a0
movl $0xf, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22a0
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/main.cpp
// Function: disableSpecialCharacters()
void disableSpecialCharacters() {
    system("stty eof undef"  ); // disable CTRL+D
    system("stty intr undef" ); // disable CTRL+C
    system("stty quit undef" ); // disable CTRL+backslash
    system("stty susp undef" ); // disable CTRL+Z
    system("stty dsusp undef"); // disable CTRL+Y
}

// Assembly:
pushq %rax
leaq 0xc938(%rip), %rdi      # 0xf04f
callq 0x21d0
leaq 0xc93b(%rip), %rdi      # 0xf05e
callq 0x21d0
leaq 0xc93f(%rip), %rdi      # 0xf06e
callq 0x21d0
leaq 0xc943(%rip), %rdi      # 0xf07e
callq 0x21d0
leaq 0xc947(%rip), %rdi      # 0xf08e
popq %rax
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/main.cpp
// Function: quitGame(GameMaster*)
void quitGame(GameMaster* gm) {
    reEnableSpecialCharacters();

    if (!gm->getGameFinished()) {
        gm->clearScreen();
        string gaveUp  = "You can't handle this anymore. This house, these ";
               gaveUp += "spirits, they are driving you\n";
               gaveUp += "mad! You've gotten this far, and that feels like an ";
               gaveUp += "achievement in itself.\n\n";
               gaveUp += "Perhaps it's the only achievement left to you. Yes, ";
               gaveUp += "perhaps it is.\n\n";
               gaveUp += "You lay back, allow the failure to fill you up, and ";
               gaveUp += "resign yourself to the\ncoming punishment.\n\n";
               gaveUp += "You have quit the game. Please come back and visit ";
               gaveUp += "the spirits again whenever\n";
               gaveUp += "you can! They'll be waiting...\n\n";

        cout << gaveUp;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x265c
movq %rbx, %rdi
callq 0x3bb6
testb %al, %al
jne 0x2879
movq %rbx, %rdi
callq 0x3c2a
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xc90f(%rip), %rsi      # 0xf09f
leaq 0xc939(%rip), %rdx      # 0xf0d0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x290e
leaq 0xc926(%rip), %rsi      # 0xf0d1
movq %rbx, %rdi
callq 0x23d0
leaq 0xc936(%rip), %rsi      # 0xf0f0
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc95a(%rip), %rsi      # 0xf125
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc962(%rip), %rsi      # 0xf13e
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc986(%rip), %rsi      # 0xf173
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc986(%rip), %rsi      # 0xf184
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc9aa(%rip), %rsi      # 0xf1b9
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc9c5(%rip), %rsi      # 0xf1e5
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc9e8(%rip), %rsi      # 0xf219
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc9f3(%rip), %rsi      # 0xf235
leaq 0x8(%rsp), %rdi
callq 0x23d0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x12773(%rip), %rdi     # 0x14fd0
callq 0x2260
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2879
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x289b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/main.cpp
// Function: main
int main() {
    GameMaster* gm = new GameMaster();

    setUpGame();
    gm->playGame();
    quitGame(gm);

    delete gm;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x128, %edi            # imm = 0x128
callq 0x2200
movq %rax, %rbx
movq %rax, %rdi
callq 0x29a0
callq 0x270f
callq 0x269b
movq %rbx, %rdi
callq 0x63be
movq %rbx, %rdi
callq 0x2759
movq %rbx, %rdi
callq 0x3254
movl $0x128, %esi            # imm = 0x128
movq %rbx, %rdi
callq 0x2210
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movl $0x128, %esi            # imm = 0x128
movq %rbx, %rdi
callq 0x2210
movq %r14, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::savePlayerLevel()
void GameMaster::savePlayerLevel() {
    if (currLevel < 0) return; // Let level stay if quit typed on start screen
    string level = to_string(currLevel);

    ofstream out;
    out.open(LEVEL_FILEPATH);
    out << level << endl; // Overwrite with the single integer-as-string
    out.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movl 0x68(%rdi), %ebp
testl %ebp, %ebp
js 0x34aa
movq %rdi, %rbx
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x33d1
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x33c8
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x33ce
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x33d1
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3395
addl $-0x3, %r14d
jmp 0x33d1
addl $-0x2, %r14d
jmp 0x33d1
decl %r14d
movl %r14d, %esi
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rsp, %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x2270
movq (%r15), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x680e
leaq 0x20(%rsp), %rdi
callq 0x2370
addq $0x8, %rbx
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl $0x10, %edx
callq 0x2120
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
leaq 0x20(%rsp), %rdi
callq 0x22c0
movq 0x11b5f(%rip), %rax     # 0x14fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x28(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x20(%rsp,%rcx)
callq 0x21c0
leaq 0x118(%rsp), %rdi
callq 0x20e0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x34aa
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x34cc
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2300
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x34e2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37ea
leaq 0x90(%r14), %rdi
callq 0x671e
movq 0x68(%r14), %rdi
leaq 0x78(%r14), %rax
cmpq %rax, %rdi
je 0x37cb
movq (%rax), %rsi
incq %rsi
callq 0x2210
leaq 0x38(%r14), %rdi
callq 0x6796
leaq 0x8(%r14), %rdi
callq 0x6796
movl $0xc0, %esi
movq %r14, %rdi
callq 0x2210
movq 0x98(%rbx), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x383c
leaq 0x90(%r14), %rdi
callq 0x671e
movq 0x68(%r14), %rdi
leaq 0x78(%r14), %rax
cmpq %rax, %rdi
je 0x381d
movq (%rax), %rsi
incq %rsi
callq 0x2210
leaq 0x38(%r14), %rdi
callq 0x6796
leaq 0x8(%r14), %rdi
callq 0x6796
movl $0xc0, %esi
movq %r14, %rdi
callq 0x2210
movq 0x98(%rbx), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x388f
leaq 0x90(%r14), %rdi
callq 0x671e
movq 0x68(%r14), %rdi
leaq 0x78(%r14), %rax
cmpq %rax, %rdi
je 0x3870
movq (%rax), %rsi
incq %rsi
callq 0x2210
leaq 0x38(%r14), %rdi
callq 0x6796
leaq 0x8(%r14), %rdi
callq 0x6796
movl $0xc0, %esi
movq %r14, %rdi
callq 0x2210
movq 0x98(%rbx), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x38e2
leaq 0x90(%r14), %rdi
callq 0x671e
movq 0x68(%r14), %rdi
leaq 0x78(%r14), %rax
cmpq %rax, %rdi
je 0x38c3
movq (%rax), %rsi
incq %rsi
callq 0x2210
leaq 0x38(%r14), %rdi
callq 0x6796
leaq 0x8(%r14), %rdi
callq 0x6796
movl $0xc0, %esi
movq %r14, %rdi
callq 0x2210
movq 0x98(%rbx), %rax
movq 0x18(%rax), %rbx
testq %rbx, %rbx
je 0x393c
leaq 0x90(%rbx), %rdi
callq 0x671e
movq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
cmpq %rax, %rdi
je 0x3916
movq (%rax), %rsi
incq %rsi
callq 0x2210
leaq 0x38(%rbx), %rdi
callq 0x6796
leaq 0x8(%rbx), %rdi
callq 0x6796
movl $0xc0, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2210
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xb76e(%rip), %rdx      # 0xf3b8
movq %rsp, %r14
movq %r14, %rdi
movq %rdx, %rsi
callq 0x290e
movl $0x64, %ebp
leaq 0xb753(%rip), %r15      # 0xf3b7
movq %r14, %rdi
movq %r15, %rsi
callq 0x23d0
decl %ebp
jne 0x3c64
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x1134d(%rip), %rdi     # 0x14fd0
callq 0x2260
movq %rbx, %rdi
callq 0x3bba
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3ca6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3cb5
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3cce
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xb202(%rip), %rdx      # 0xf3b8
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
addq $0x8, %r14
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2340
movq 0x30(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %edx
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x23b0
leaq 0x30(%rsp), %rdi
callq 0x2090
movq 0x8(%rsp), %r15
callq 0x2050
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x22b0
cmpq %r15, (%r12)
je 0x428c
movq %rax, %r14
movslq %r14d, %rax
cmpq %r14, %rax
jne 0x4298
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x4298
testl %eax, %eax
jne 0x4256
movl %ebp, (%rbx)
leaq 0x30(%rsp), %rdi
callq 0x20a0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4277
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movl %r14d, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb1cf(%rip), %rdi      # 0xf462
callq 0x2160
leaq 0xb1c3(%rip), %rdi      # 0xf462
callq 0x22d0
movq %rax, %r14
jmp 0x42c2
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x42b8
movl %ebp, (%rbx)
jmp 0x42b8
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x20a0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x42d9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xa5ee(%rip), %rsi      # 0xf3b6
leaq 0xa5e9(%rip), %rdx      # 0xf3b8
leaq 0x48(%rsp), %rdi
callq 0x290e
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xa5d9(%rip), %rsi      # 0xf3c3
leaq 0xa600(%rip), %rdx      # 0xf3f1
leaq 0x8(%rsp), %rdi
callq 0x290e
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x687c
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r8
movq %rbx, %rdi
movl $0x3d, %esi
movl $0x1, %r9d
callq 0x3944
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e4f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x4f8e
leaq 0x70(%rbx), %r14
leaq 0xa52e(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x4e8d
leaq 0xa57d(%rip), %rsi      # 0xf3f2
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
jne 0x4e85
movb $0x1, 0x6c(%rbx)
movq %rbx, %rdi
callq 0x3c2a
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ea4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ebb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x4eeb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x4eeb
movq %rax, %rbx
jmp 0x4f02
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4f02
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x4f19
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::fillCleanUInput()
void GameMaster::fillCleanUInput() {
    cout << ">>>> ";
    getline(cin, uInput);

    lower(uInput);
    removeWS(uInput);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x1002f(%rip), %rdi     # 0x14fd0
leaq 0xa3ed(%rip), %rsi      # 0xf395
movl $0x5, %edx
callq 0x2260
leaq 0x70(%rbx), %r14
movq 0x10023(%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 %r14, %rsi
callq 0x23b0
movq %r14, %rsi
callq 0x4f22
movq 0x70(%rbx), %rdi
movq 0x78(%rbx), %rsi
addq %rdi, %rsi
leaq 0xf(%rsp), %rdx
movb $0x20, (%rdx)
callq 0x7429
movq %rax, %rcx
subq 0x70(%rbx), %rcx
movq %rcx, 0x78(%rbx)
movb $0x0, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0xe59a
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9b08(%rip), %rsi      # 0xf400
leaq 0x9b0a(%rip), %rdx      # 0xf409
movq %rsp, %r14
movq %r14, %rdi
callq 0x290e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x53a0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x592b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x70(%rbx), %r14
leaq 0x9a5a(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x597a
movq 0x90(%rbx), %rdi
callq 0xddae
movq %rbx, %rdi
movl $0x1, %esi
callq 0x59a6
leaq 0x9a2e(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x597a
movq 0x90(%rbx), %rdi
callq 0xe59a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x599d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5ca6
movl $0x68, %edi
callq 0x2200
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 0x7500
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 0x90c2
testb %al, %al
je 0x5a45
movq %rbx, %rdi
callq 0x5fec
movb $0x0, 0x6d(%rbx)
incl 0x68(%rbx)
addq $0x70, %rbx
leaq 0x9957(%rip), %rsi      # 0xf390
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20c0
movq 0x78(%rbx), %rdx
addq $0x70, %rbx
leaq 0x993c(%rip), %rcx      # 0xf390
movl $0x4, %r8d
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2320
movq %rax, %rbx
movl $0x68, %esi
movq %r14, %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0xa5ba
movq 0x90(%rbx), %rsi
leaq 0x68(%rsp), %rdi
xorl %edx, %edx
callq 0xa082
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x994a(%rip), %rsi      # 0xf40a
leaq 0x9979(%rip), %rdx      # 0xf440
leaq 0x28(%rsp), %rdi
callq 0x290e
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x687c
leaq 0xa4cc(%rip), %rsi      # 0xffc4
leaq 0x8(%rsp), %rdi
callq 0x23d0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x20d0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x5b2d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movb $0x0, 0x6c(%rbx)
movq %rbx, %rdi
callq 0x3c2a
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0xf486(%rip), %r14      # 0x14fd0
movq %r14, %rdi
callq 0x2260
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x98de(%rip), %rsi      # 0xf441
leaq 0x98e1(%rip), %rdx      # 0xf44b
leaq 0x48(%rsp), %rdi
callq 0x290e
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x53a0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x5b98
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq 0xf41a(%rip), %rdi      # 0x14fd0
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x5c04
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c1f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x5c6c
movq 0x58(%rsp), %rsi
jmp 0x5c58
jmp 0x5c69
jmp 0x5c46
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x5c6c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x5c6c
jmp 0x5c69
movq %rax, %rbx
jmp 0x5c83
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x5c83
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c9e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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 0x45a0
leaq 0x70(%rbx), %r14
leaq 0x8fba(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x6450
cmpl $0x0, 0x68(%rbx)
jne 0x63f0
movq %rbx, %rdi
callq 0x58d0
leaq 0x8f99(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x6450
leaq 0x8f86(%rip), %r15      # 0xf390
movl 0x68(%rbx), %eax
cmpl (%rbx), %eax
jge 0x642c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x59a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
jne 0x640a
jmp 0x6450
cmpl $0x5, %eax
jl 0x6439
movq %rbx, %rdi
callq 0x5a80
leaq 0x8f50(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x6450
movb $0x1, 0x6e(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x75f4
movq 0x18(%rbx), %rdi
callq 0xc6a4
movq 0x10(%rbx), %rdi
callq 0xa5ba
movss %xmm0, 0x28(%rbx)
movq $0x0, 0x2c(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7da3(%rip), %rdx      # 0xf3b8
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x10(%rbx), %rax
movq 0x50(%rax), %r14
addq $0x40, %rax
cmpq %rax, %r14
je 0x767b
leaq 0x38(%rbx), %r15
movl $0x1, %ebp
leaq 0x8(%rsp), %r12
leaq 0x20(%r14), %rsi
movq %r12, %rdi
callq 0x2140
cmpl $0x0, 0x40(%r14)
jle 0x7663
movq %r15, %rdi
movq %r12, %rsi
callq 0x661a
movl %ebp, (%rax)
incl %ebp
movq %r14, %rdi
callq 0x2180
movq %rax, %r14
movq 0x10(%rbx), %rax
addq $0x40, %rax
cmpq %rax, %r14
jne 0x7641
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7692
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
cmpq %r13, %rdi
je 0x76bb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r12
movq 0x8(%rsi), %rcx
leaq (%r12,%rcx), %rax
movq %r12, %rdx
testq %rcx, %rcx
je 0x8041
movq %rcx, %rsi
movq %r12, %rdx
movsbl (%rdx), %edi
addl $-0x30, %edi
cmpl $0x9, %edi
ja 0x8041
incq %rdx
decq %rsi
jne 0x802b
movq %rax, %rdx
testq %rcx, %rcx
sete %cl
cmpq %rax, %rdx
setne %al
orb %cl, %al
jne 0x812b
callq 0x2050
movq %rax, %r13
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%r13)
leaq 0x8(%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x22b0
cmpq %r12, (%rbp)
je 0x813a
movq %rax, %r15
movslq %r15d, %rax
cmpq %r15, %rax
jne 0x8146
movl (%r13), %eax
cmpl $0x22, %eax
je 0x8146
testl %eax, %eax
jne 0x80b2
movl 0x4(%rsp), %eax
movl %eax, (%r13)
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x72f6(%rip), %rdx      # 0xf3b8
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x50(%r14), %r12
addq $0x40, %r14
cmpq %r14, %r12
je 0x8114
leaq 0x8(%rsp), %r13
leaq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x2140
cmpl %r15d, 0x40(%r12)
je 0x8107
movq %r12, %rdi
callq 0x2180
movq %rax, %r12
cmpq %r14, %rax
jne 0x80e1
jmp 0x8114
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2140
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x812b
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 0x7321(%rip), %rdi      # 0xf462
callq 0x2160
leaq 0x7315(%rip), %rdi      # 0xf462
callq 0x22d0
jmp 0x816d
movq %rax, %rbx
jmp 0x8187
movq %rax, %rbx
cmpl $0x0, (%r13)
jne 0x8187
movl 0x4(%rsp), %eax
movl %eax, (%r13)
jmp 0x8187
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x8187
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x687c
movq %r12, %rsi
callq 0x7c7a
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x81e5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x71cc(%rip), %rsi      # 0xf3b8
movq %r15, %rdi
callq 0x20c0
testl %eax, %eax
je 0x820b
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0xcdca(%rip), %rdi      # 0x14fd0
callq 0x2260
movq 0x8(%r15), %rdx
leaq 0x71a2(%rip), %rcx      # 0xf3b8
movq %r15, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x2320
movq 0xcda6(%rip), %rdi      # 0x14fd0
leaq 0x7164(%rip), %rsi      # 0xf395
movl $0x5, %edx
callq 0x2260
movq 0xcd9e(%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 0x7f5a
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
leaq 0xf(%rsp), %rdx
movb $0x20, (%rdx)
callq 0x7429
movq %rax, %rcx
subq (%rbx), %rcx
movq %rcx, 0x8(%rbx)
movb $0x0, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7ffe
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 0x82c3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc718
movb %al, (%r14)
movq 0x10(%rbx), %rdi
callq 0xa5ba
movss %xmm0, 0x30(%rbx)
movl 0x4(%rbx), %eax
cmpl $0x2, %eax
setl %bpl
orb (%r14), %bpl
jne 0x895b
decl %eax
movl %eax, 0x4(%rbx)
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xe9bc
movq 0x18(%rbx), %rdi
movl 0x4(%rbx), %esi
movzbl (%rbx), %edx
callq 0xccb4
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7bd8
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x64c3(%rip), %rdx      # 0xf3b8
leaq 0x40(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
testl %ebp, %ebp
je 0x8f2c
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x76c4
leaq 0x6bd6(%rip), %rcx      # 0xfaee
movq %rsp, %rdi
movl $0x10, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
jmp 0x8f50
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x76c4
leaq 0x6bc1(%rip), %rcx      # 0xfaff
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 0x8f78
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x8f80
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 0x8fbe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8fd9
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 0x687c
leaq 0x60(%rsp), %rsi
callq 0x7c7a
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x901a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
testb %bpl, %bpl
je 0x9032
movq %rbx, %rdi
callq 0x8962
movq 0x18(%rbx), %rdi
callq 0xc8b6
jmp 0x903f
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xe9bc
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x9056
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9068
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x90a3
movq 0x10(%rsp), %rsi
jmp 0x9096
jmp 0x90a0
jmp 0x90a0
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x90a3
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x90a3
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x90ba
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaf1c(%rip), %rsi      # 0x14fb8
leaq 0x5d53(%rip), %rcx      # 0xfdf6
movq %rsp, %r15
movl $0x3a, %edx
movq %r15, %rdi
movb $0x1, %al
callq 0xb39c
leaq 0x52d2(%rip), %rsi      # 0xf38e
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x2380
testl %r14d, %r14d
je 0xa0da
addl %r14d, %eax
incl %eax
movslq %eax, %rcx
jmp 0xa0dd
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 0xa105
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 0xa130
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa59e
addl 0x40(%rax), %ebp
movq %rax, %rdi
callq 0x2180
jmp 0xa58c
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4ddd(%rip), %rdx      # 0xf3b8
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
movq 0x50(%rbx), %r14
leaq 0x40(%rbx), %rbp
cmpq %rbp, %r14
je 0xa657
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 0x661a
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 0xa607
jmp 0xa660
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 0xa686
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 0xa6ba
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O1/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
movabsq $0x200000005, %rdx      # imm = 0x200000005
movq %rcx, %rax
mulq %rdx
movq %rdx, %rax
shlq $0x1f, %rax
subq %rax, %rdx
leaq (%rcx,%rdx), %rax
cmpq $0x1, %rax
adcq %rcx, %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, (%rsi)
movabsq $0x6400000001, %rax     # imm = 0x6400000001
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movq %rdi, %rdx
callq 0xd74e
cvtsi2sd %eax, %xmm0
divsd 0x36f2(%rip), %xmm0     # 0xfe00
cvtsd2ss %xmm0, %xmm0
addq $0x18, %rsp
retq
nop