// File: /workspace/github_cpp_makefile_star2_O1/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 0xf176
testl %ebp, %ebp
setne %cl
movl %r14d, %edx
xorb $0x1, %dl
orb %cl, %dl
je 0x7395
testl %ebp, %ebp
setne %al
orb %r14b, %al
je 0x73d0
testl %ebp, %ebp
je 0x754e
movq 0x90(%rbx), %rdi
callq 0xf176
movl %eax, %r14d
addl %ebp, %r14d
js 0x754e
cmpl 0xb0(%rbx), %r14d
jg 0x754e
leal -0x1(%r14), %eax
cmpl $0x3, %eax
ja 0x7536
leaq 0xbd43(%rip), %rcx      # 0x130b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x78e7
jmp 0x7504
decl %eax
cmpl $0x3, %eax
ja 0x754e
leaq 0xbd01(%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 0xf180
jmp 0x74a1
movq 0x90(%rbx), %rdi
callq 0xf176
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 0x6510
movq %rsp, %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0xf3c0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x742a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x90(%rbx), %rdi
movq %r14, 0x90(%rbx)
testq %rdi, %rdi
je 0x754e
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x754e
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xf2a8
jmp 0x74a1
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xf334
jmp 0x74a1
movl $0x10, %edi
callq 0x52b0
movq %rax, %r14
movl 0xac(%rbx), %esi
movq %rax, %rdi
callq 0xf220
movq 0x90(%rbx), %rdi
movq %r14, 0x90(%rbx)
testq %rdi, %rdi
je 0x754e
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 0x7975
jmp 0x7504
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x79bc
jmp 0x7504
leaq 0xac(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x792e
movq (%r15), %rax
movq $0x0, (%r15)
movq 0x90(%rbx), %rdi
movq %rax, 0x90(%rbx)
testq %rdi, %rdi
je 0x7527
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7536
movq (%rdi), %rax
callq *0x8(%rax)
cmpb $0x0, 0xa8(%rbx)
jne 0x754e
addq $0x30, %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x124a0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7561
jmp 0x7561
jmp 0x7561
movq %rax, %rbx
movl $0x10, %esi
jmp 0x758e
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7589
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x7589
movq %rax, %rbx
movl $0x50, %esi
movq %r14, %rdi
callq 0x52c0
movq %rbx, %rdi
callq 0x5480