// File: /workspace/github_cpp_makefile_star2_O3/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::endCurrentLevel()
void GameMaster::endCurrentLevel() {
    string outText  = to_string(currLevel) + "/Level" + to_string(currLevel);
    // Load the correct script
    (wonLevel ? (outText += "Win") : (outText += "Lose"));

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

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

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movl 0x68(%rdi), %r12d
movl %r12d, %ebp
negl %ebp
cmovsl %r12d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x606d
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x6064
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x606a
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x606d
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x6031
addl $-0x3, %r14d
jmp 0x606d
addl $-0x2, %r14d
jmp 0x606d
decl %r14d
shrl $0x1f, %r12d
movl %r12d, %esi
addl %r14d, %esi
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x2270
movq (%r15), %rdi
addq %r12, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x69ca
leaq 0x93e7(%rip), %rsi      # 0xf490
movq %r15, %rdi
callq 0x23d0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x60d8
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x60e0
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x68(%rbx), %r14d
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x6159
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x6150
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x6156
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x6159
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x611d
addl $-0x3, %r15d
jmp 0x6159
addl $-0x2, %r15d
jmp 0x6159
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x2270
addq 0x48(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x69ca
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x61ae
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x61cc
movl $0xf, %edi
cmpq %r12, %rsi
je 0x61c7
movq 0x58(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x61d8
leaq 0x28(%rsp), %rdi
callq 0x20d0
jmp 0x61e6
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x620a
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x6210
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x6244
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x625b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x6277
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x921f(%rip), %rax      # 0xf49d
leaq 0x921c(%rip), %rsi      # 0xf4a1
cmpb $0x0, 0x6d(%rbx)
cmovneq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x23d0
movb $0x0, 0x6c(%rbx)
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x6a38
leaq 0x88(%rsp), %rsi
movq %rbx, %rdi
callq 0x53c6
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x62ee
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
cmpb $0x0, 0x6d(%rbx)
jne 0x6301
cmpl $0x0, 0x68(%rbx)
jle 0x6301
movl $0x5, 0x68(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x631c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x63a4
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x63a4
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x636f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x636f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x638b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x638b
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x63bf
movq 0x78(%rsp), %rsi
jmp 0x63b7
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63bf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop