// File: /workspace/github_cpp_makefile_star2_O1/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 0x6061
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x6058
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x605e
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x6061
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x6025
addl $-0x3, %r14d
jmp 0x6061
addl $-0x2, %r14d
jmp 0x6061
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 0x680e
leaq 0x93af(%rip), %rsi      # 0xf44c
movq %r15, %rdi
callq 0x23d0
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x60cc
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x60d4
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%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 0x614d
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x6144
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x614a
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x614d
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x6111
addl $-0x3, %r15d
jmp 0x614d
addl $-0x2, %r15d
jmp 0x614d
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x2270
addq 0x28(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x680e
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0x30(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x61a2
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x61bd
movl $0xf, %esi
cmpq %r12, 0x28(%rsp)
je 0x61b8
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x61ce
movq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x20d0
jmp 0x61dc
leaq 0x28(%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 0x6200
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x6206
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 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x623a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x6251
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x626d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x91e5(%rip), %rax      # 0xf459
leaq 0x91e2(%rip), %rsi      # 0xf45d
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 0x687c
leaq 0x88(%rsp), %rsi
movq %rbx, %rdi
callq 0x53a0
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x62e4
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
cmpb $0x0, 0x6d(%rbx)
jne 0x62f7
cmpl $0x0, 0x68(%rbx)
jle 0x62f7
movl $0x5, 0x68(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6312
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 0x639a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x639a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x6365
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x6365
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x6381
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x6381
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x63b5
movq 0x78(%rsp), %rsi
jmp 0x63ad
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63b5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop