// File: /workspace/github_cpp_makefile_star2_O3/EstherJin[P]TetrisRemake/basicboard.cc
// Function: BasicBoard::changeLevel(int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void BasicBoard::changeLevel(int direction, bool rand, string filename) {
	int level = lvl->getLevel();
	if (direction == 0 && rand) {
		if (level == 1) lvl = make_unique<Level1> (seed);
		else if (level == 2) lvl = make_unique<Level2> (seed);
		else if (level == 3) lvl = make_unique<Level3> (seed);
		else if (level == 4) lvl = make_unique<Level4> (seed);
	} else if (direction == 0 && !rand) {
		lvl = make_unique<NonRandom> (filename, lvl->getLevel());
	} else if (direction != 0) {
		int newLevel = lvl->getLevel() + direction;
		if (newLevel < 0 || newLevel > maxLevel) return;
		if (newLevel == 1) lvl = make_unique<Level1> (seed);
		else if (newLevel == 2) lvl = make_unique<Level2> (seed);
		else if (newLevel == 3) lvl = make_unique<Level3> (seed);
		else if (newLevel == 4) lvl = make_unique<Level4> (seed);
		if (!textOnly) gd.printLevel(newLevel);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0xeeee
testl %ebp, %ebp
setne %cl
movl %r14d, %edx
xorb $0x1, %dl
orb %cl, %dl
je 0x7391
testl %ebp, %ebp
setne %al
orb %r14b, %al
je 0x73cc
testl %ebp, %ebp
je 0x754a
movq 0x90(%rbx), %rdi
callq 0xeeee
movl %eax, %r14d
addl %ebp, %r14d
js 0x754a
cmpl 0xb0(%rbx), %r14d
jg 0x754a
leal -0x1(%r14), %eax
cmpl $0x3, %eax
ja 0x7532
leaq 0xbd47(%rip), %rcx      # 0x130b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x78ea
jmp 0x7500
decl %eax
cmpl $0x3, %eax
ja 0x754a
leaq 0xbd05(%rip), %rcx      # 0x130a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xeef8
jmp 0x749d
movq 0x90(%rbx), %rdi
callq 0xeeee
movl %eax, %ebp
movl $0x50, %edi
callq 0x52b0
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x6530
movq %rsp, %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0xf138
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7426
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x90(%rbx), %rdi
movq %r14, 0x90(%rbx)
testq %rdi, %rdi
je 0x754a
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x754a
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xf020
jmp 0x749d
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xf0ac
jmp 0x749d
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xef98
movq 0x90(%rbx), %rdi
movq %r14, 0x90(%rbx)
testq %rdi, %rdi
je 0x754a
movq (%rdi), %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x7978
jmp 0x7500
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x79bf
jmp 0x7500
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x7931
movq (%r15), %rax
movq $0x0, (%r15)
movq 0x90(%rbx), %rdi
movq %rax, 0x90(%rbx)
testq %rdi, %rdi
je 0x7532
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7532
movq (%rdi), %rax
callq *0x8(%rax)
cmpb $0x0, 0xa8(%rbx)
jne 0x754a
addq $0x30, %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x12118
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x755d
jmp 0x755d
jmp 0x755d
movq %rax, %rbx
movl $0x10, %esi
jmp 0x758a
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7585
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x7585
movq %rax, %rbx
movl $0x50, %esi
movq %r14, %rdi
callq 0x52c0
movq %rbx, %rdi
callq 0x5480