// File: sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::setUpGameVars()
void GameMaster::setUpGameVars() {
    const float FRIENDLY = 0.8;
    const float GRUFF    = 0.2;
    const float MODERATE = 0.5;

    player    =  new PlayerCharacter("You", MODERATE);

    // Manual, but most straightforward way of allocating mem for negotiators
    opponents.resize(NUM_LEVELS);
    opponents[0] = new Negotiator("Lepha",            MODERATE);
    opponents[1] = new Negotiator("Mosta and Pepita", FRIENDLY);
    opponents[2] = new Negotiator("Toto",             MODERATE);
    opponents[3] = new Negotiator("Burro",            GRUFF);
    opponents[4] = opponents[0];

    levels       = vector<Encounter*>(NUM_LEVELS, nullptr);
    turns        = vector<int> (NUM_LEVELS, 3);
    keyPrices    = {40.0, 20.0, 30.0, 40.0, 40.0};


    bool doPrint = false;
    const int NUM_TITLES = NUM_LEVELS + 1 + 1; // For game title and "the end"
    titles.resize(NUM_TITLES);
    titleText    = {"Prologue: Caught",
                    "Level 1 / 4: Mosta and Pepita",
                    "Level 2 / 4: Toto",
                    "Level 3 / 4: Burro",
                    "Level 4 / 4: Lepha",
                    "The End",
                    "DEALING WITH THE SPIRITS"};


    char ch;
    for (int i = 0; i < NUM_TITLES; i++) {
        ((i < NUM_LEVELS) ? ch = '=' : ch = '|');
        createTitle(ch, WIDTH, titleText[i], titles[i], doPrint);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3f0, %rsp            # imm = 0x3F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movl $0x3f4ccccd, -0xc(%rbp) # imm = 0x3F4CCCCD
movl $0x3e4ccccd, -0x10(%rbp) # imm = 0x3E4CCCCD
movl $0x3f000000, -0x14(%rbp) # imm = 0x3F000000
movl $0xc0, %edi
callq 0x32f0
movq %rax, -0x2a0(%rbp)
movb $0x1, -0x4d(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x3520
movq -0x298(%rbp), %rdx
leaq 0x18100(%rip), %rsi     # 0x1c2c2
leaq -0x38(%rbp), %rdi
callq 0x3b80
jmp 0x41cd
movq -0x2a0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movss 0x180a0(%rip), %xmm0    # 0x1c280
callq 0x19360
jmp 0x41e7
movq -0x2a8(%rbp), %rax
movq -0x2a0(%rbp), %rcx
movb $0x0, -0x4d(%rbp)
movq %rcx, 0x90(%rax)
leaq -0x38(%rbp), %rdi
callq 0x3200
leaq -0x39(%rbp), %rdi
callq 0x3350
movq -0x2a8(%rbp), %rax
movq %rax, %rdi
addq $0x98, %rdi
movslq (%rax), %rsi
callq 0x7fc0
movl $0xc0, %edi
callq 0x32f0
movq %rax, -0x2b8(%rbp)
movb $0x1, -0x72(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x3520
movq -0x2b0(%rbp), %rdx
leaq 0x180c9(%rip), %rsi     # 0x1c327
leaq -0x70(%rbp), %rdi
callq 0x3b80
jmp 0x4269
movq -0x2b8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movss 0x18004(%rip), %xmm0    # 0x1c280
callq 0x14360
jmp 0x4283
movq -0x2a8(%rbp), %rdi
movb $0x0, -0x72(%rbp)
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8050
movq -0x2b8(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x70(%rbp), %rdi
callq 0x3200
leaq -0x71(%rbp), %rdi
callq 0x3350
movl $0xc0, %edi
callq 0x32f0
movq %rax, -0x2c8(%rbp)
movb $0x1, -0x9a(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x3520
movq -0x2c0(%rbp), %rdx
leaq 0x17ff1(%rip), %rsi     # 0x1c2e4
leaq -0x98(%rbp), %rdi
callq 0x3b80
jmp 0x4301
movq -0x2c8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movss 0x17f6d(%rip), %xmm0    # 0x1c284
callq 0x14360
jmp 0x431e
movq -0x2a8(%rbp), %rdi
movb $0x0, -0x9a(%rbp)
addq $0x98, %rdi
movl $0x1, %esi
callq 0x8050
movq -0x2c8(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x98(%rbp), %rdi
callq 0x3200
leaq -0x99(%rbp), %rdi
callq 0x3350
movl $0xc0, %edi
callq 0x32f0
movq %rax, -0x2d8(%rbp)
movb $0x1, -0xc2(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x3520
movq -0x2d0(%rbp), %rdx
leaq 0x17f6a(%rip), %rsi     # 0x1c302
leaq -0xc0(%rbp), %rdi
callq 0x3b80
jmp 0x43a6
movq -0x2d8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movss 0x17ec4(%rip), %xmm0    # 0x1c280
callq 0x14360
jmp 0x43c3
movq -0x2a8(%rbp), %rdi
movb $0x0, -0xc2(%rbp)
addq $0x98, %rdi
movl $0x2, %esi
callq 0x8050
movq -0x2d8(%rbp), %rcx
movq %rcx, (%rax)
leaq -0xc0(%rbp), %rdi
callq 0x3200
leaq -0xc1(%rbp), %rdi
callq 0x3350
movl $0xc0, %edi
callq 0x32f0
movq %rax, -0x2e8(%rbp)
movb $0x1, -0xea(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x3520
movq -0x2e0(%rbp), %rdx
leaq 0x17ed7(%rip), %rsi     # 0x1c314
leaq -0xe8(%rbp), %rdi
callq 0x3b80
jmp 0x444b
movq -0x2e8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movss 0x17e27(%rip), %xmm0    # 0x1c288
callq 0x14360
jmp 0x4468
movq -0x2a8(%rbp), %rdi
movb $0x0, -0xea(%rbp)
addq $0x98, %rdi
movq %rdi, -0x308(%rbp)
movl $0x3, %esi
callq 0x8050
movq -0x2e8(%rbp), %rcx
movq %rcx, (%rax)
leaq -0xe8(%rbp), %rdi
callq 0x3200
leaq -0xe9(%rbp), %rdi
callq 0x3350
movq -0x308(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8050
movq -0x308(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x300(%rbp)
movl $0x4, %esi
callq 0x8050
movq -0x300(%rbp), %rdx
movq %rax, %rcx
movq -0x2a8(%rbp), %rax
movq %rdx, (%rcx)
movslq (%rax), %rax
movq %rax, -0x2f8(%rbp)
movq $0x0, -0x110(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x8070
movq -0x2f8(%rbp), %rsi
movq -0x2f0(%rbp), %rcx
leaq -0x108(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x8090
jmp 0x453a
movq -0x2a8(%rbp), %rdi
addq $0xe0, %rdi
leaq -0x108(%rbp), %rsi
movq %rsi, -0x320(%rbp)
callq 0x8110
movq -0x320(%rbp), %rdi
callq 0x7e40
leaq -0x111(%rbp), %rdi
callq 0x8140
movq -0x2a8(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x318(%rbp)
movl $0x3, -0x134(%rbp)
leaq -0x135(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x8160
movq -0x318(%rbp), %rsi
movq -0x310(%rbp), %rcx
leaq -0x130(%rbp), %rdi
leaq -0x134(%rbp), %rdx
callq 0x8180
jmp 0x45c4
movq -0x2a8(%rbp), %rdi
addq $0xb0, %rdi
leaq -0x130(%rbp), %rsi
movq %rsi, -0x338(%rbp)
callq 0x8200
movq -0x338(%rbp), %rdi
callq 0x7f00
leaq -0x135(%rbp), %rdi
callq 0x8230
movq -0x2a8(%rbp), %rdi
movups 0x17eb9(%rip), %xmm0    # 0x1c4c4
movaps %xmm0, -0x160(%rbp)
movl $0x42200000, -0x150(%rbp) # imm = 0x42200000
leaq -0x160(%rbp), %rax
movq %rax, -0x148(%rbp)
movq $0x5, -0x140(%rbp)
addq $0xc8, %rdi
movq -0x148(%rbp), %rsi
movq -0x140(%rbp), %rdx
callq 0x8250
movq -0x2a8(%rbp), %rdi
movb $0x0, -0x161(%rbp)
movl (%rdi), %eax
addl $0x2, %eax
movl %eax, -0x168(%rbp)
addq $0xf8, %rdi
movslq -0x168(%rbp), %rsi
callq 0x82a0
movb $0x1, -0x268(%rbp)
leaq -0x258(%rbp), %rax
movq %rax, -0x330(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x261(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x3520
movq -0x330(%rbp), %rdi
movq -0x328(%rbp), %rdx
leaq 0x17c07(%rip), %rsi     # 0x1c2c6
callq 0x3b80
jmp 0x46c6
leaq -0x238(%rbp), %rax
movq %rax, -0x348(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x262(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x3520
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rdx
leaq 0x17bd4(%rip), %rsi     # 0x1c2d7
callq 0x3b80
jmp 0x470a
leaq -0x218(%rbp), %rax
movq %rax, -0x358(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x263(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x3520
movq -0x358(%rbp), %rdi
movq -0x350(%rbp), %rdx
leaq 0x17bae(%rip), %rsi     # 0x1c2f5
callq 0x3b80
jmp 0x474e
leaq -0x1f8(%rbp), %rax
movq %rax, -0x368(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x264(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x3520
movq -0x368(%rbp), %rdi
movq -0x360(%rbp), %rdx
leaq 0x17b7c(%rip), %rsi     # 0x1c307
callq 0x3b80
jmp 0x4792
leaq -0x1d8(%rbp), %rax
movq %rax, -0x378(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x265(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x3520
movq -0x378(%rbp), %rdi
movq -0x370(%rbp), %rdx
leaq 0x17b4b(%rip), %rsi     # 0x1c31a
callq 0x3b80
jmp 0x47d6
leaq -0x1b8(%rbp), %rax
movq %rax, -0x388(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x266(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x3520
movq -0x388(%rbp), %rdi
movq -0x380(%rbp), %rdx
leaq 0x17b1a(%rip), %rsi     # 0x1c32d
callq 0x3b80
jmp 0x481a
leaq -0x198(%rbp), %rax
movq %rax, -0x398(%rbp)
movq %rax, -0x260(%rbp)
leaq -0x267(%rbp), %rdi
movq %rdi, -0x390(%rbp)
callq 0x3520
movq -0x398(%rbp), %rdi
movq -0x390(%rbp), %rdx
leaq 0x17ade(%rip), %rsi     # 0x1c335
callq 0x3b80
jmp 0x485e
movq -0x2a8(%rbp), %rdi
movb $0x0, -0x268(%rbp)
leaq -0x258(%rbp), %rax
movq %rax, -0x178(%rbp)
movq $0x7, -0x170(%rbp)
addq $0x110, %rdi            # imm = 0x110
movq -0x178(%rbp), %rsi
movq -0x170(%rbp), %rdx
callq 0x8330
jmp 0x48a1
leaq -0x258(%rbp), %rax
movq %rax, -0x3a8(%rbp)
addq $0xe0, %rax
movq %rax, -0x3a0(%rbp)
movq -0x3a0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x3200
movq -0x3a8(%rbp), %rcx
movq -0x3b0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x3a0(%rbp)
jne 0x48bc
leaq -0x267(%rbp), %rdi
callq 0x3350
leaq -0x266(%rbp), %rdi
callq 0x3350
leaq -0x265(%rbp), %rdi
callq 0x3350
leaq -0x264(%rbp), %rdi
callq 0x3350
leaq -0x263(%rbp), %rdi
callq 0x3350
leaq -0x262(%rbp), %rdi
callq 0x3350
leaq -0x261(%rbp), %rdi
callq 0x3350
movl $0x0, -0x270(%rbp)
movl -0x270(%rbp), %eax
cmpl -0x168(%rbp), %eax
jge 0x4d88
movq -0x2a8(%rbp), %rcx
movl -0x270(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4977
movb $0x3d, -0x269(%rbp)
jmp 0x497e
movb $0x7c, -0x269(%rbp)
movq -0x2a8(%rbp), %rdi
movsbl -0x269(%rbp), %eax
movl %eax, -0x3c0(%rbp)
movl 0x4(%rdi), %eax
movl %eax, -0x3bc(%rbp)
addq $0x110, %rdi            # imm = 0x110
movslq -0x270(%rbp), %rsi
callq 0x8380
movq %rax, %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x3170
movq -0x2a8(%rbp), %rdi
addq $0xf8, %rdi
movslq -0x270(%rbp), %rsi
callq 0x8380
movq -0x2a8(%rbp), %rdi
movl -0x3c0(%rbp), %esi
movl -0x3bc(%rbp), %edx
movq -0x3b8(%rbp), %rcx
movq %rax, %r8
movzbl -0x161(%rbp), %r9d
andl $0x1, %r9d
callq 0x5350
jmp 0x4a0e
leaq -0x290(%rbp), %rdi
callq 0x3200
movl -0x270(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x270(%rbp)
jmp 0x494b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4a51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3200
leaq -0x39(%rbp), %rdi
callq 0x3350
testb $0x1, -0x4d(%rbp)
jne 0x4a62
jmp 0x4a73
movq -0x2a0(%rbp), %rdi
movl $0xc0, %esi
callq 0x3300
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4a9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3200
leaq -0x71(%rbp), %rdi
callq 0x3350
testb $0x1, -0x72(%rbp)
jne 0x4aac
jmp 0x4abd
movq -0x2b8(%rbp), %rdi
movl $0xc0, %esi
callq 0x3300
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ae8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3200
leaq -0x99(%rbp), %rdi
callq 0x3350
testb $0x1, -0x9a(%rbp)
jne 0x4aff
jmp 0x4b10
movq -0x2c8(%rbp), %rdi
movl $0xc0, %esi
callq 0x3300
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4b3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3200
leaq -0xc1(%rbp), %rdi
callq 0x3350
testb $0x1, -0xc2(%rbp)
jne 0x4b52
jmp 0x4b63
movq -0x2d8(%rbp), %rdi
movl $0xc0, %esi
callq 0x3300
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4b8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3200
leaq -0xe9(%rbp), %rdi
callq 0x3350
testb $0x1, -0xea(%rbp)
jne 0x4ba5
jmp 0x4bb6
movq -0x2e8(%rbp), %rdi
movl $0xc0, %esi
callq 0x3300
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x111(%rbp), %rdi
callq 0x8140
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x135(%rbp), %rdi
callq 0x8230
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4d08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4cfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4cf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ce4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4cd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ccc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4cc0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x258(%rbp), %rax
movq %rax, -0x3d0(%rbp)
addq $0xe0, %rax
movq %rax, -0x3c8(%rbp)
movq -0x3c8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x3200
movq -0x3d0(%rbp), %rcx
movq -0x3d8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x3c8(%rbp)
jne 0x4c8d
jmp 0x4cc0
leaq -0x267(%rbp), %rdi
callq 0x3350
leaq -0x266(%rbp), %rdi
callq 0x3350
leaq -0x265(%rbp), %rdi
callq 0x3350
leaq -0x264(%rbp), %rdi
callq 0x3350
leaq -0x263(%rbp), %rdi
callq 0x3350
leaq -0x262(%rbp), %rdi
callq 0x3350
leaq -0x261(%rbp), %rdi
callq 0x3350
testb $0x1, -0x268(%rbp)
jne 0x4d1f
jmp 0x4d6c
movq -0x260(%rbp), %rax
leaq -0x258(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x3e0(%rbp)
je 0x4d6a
movq -0x3e0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x3e8(%rbp)
callq 0x3200
movq -0x3e8(%rbp), %rax
leaq -0x258(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x3e0(%rbp)
jne 0x4d39
jmp 0x4d6c
jmp 0x4d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x3200
jmp 0x4d91
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3510
nopw (%rax,%rax)