// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x18, %rsp
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0xd9ce
testl %ebp, %ebp
setne %cl
movl %r15d, %edx
xorb $0x1, %dl
orb %cl, %dl
je 0x6b67
testl %ebp, %ebp
setne %al
orb %r15b, %al
je 0x6b98
testl %ebp, %ebp
je 0x6c34
movq 0x90(%rbx), %rdi
callq 0xd9ce
movl %eax, %r14d
addl %ebp, %r14d
js 0x6c34
cmpl 0xb0(%rbx), %r14d
jg 0x6c34
leal -0x1(%r14), %eax
cmpl $0x3, %eax
ja 0x6caf
leaq 0xa573(%rip), %rcx      # 0x110b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x6fd0
jmp 0x6c7f
decl %eax
cmpl $0x3, %eax
ja 0x6c34
leaq 0xa52f(%rip), %rcx      # 0x110a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x6fd0
jmp 0x6c04
movq 0x90(%rbx), %rdi
callq 0xd9ce
leaq 0x14(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x732d
movq (%r15), %rax
andq $0x0, (%r15)
jmp 0x6c0b
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x7056
jmp 0x6c04
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x7099
jmp 0x6c04
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x7013
movq (%r14), %rax
andq $0x0, (%r14)
movq 0x90(%rbx), %rdi
movq %rax, 0x90(%rbx)
testq %rdi, %rdi
je 0x6c34
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6c34
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7056
jmp 0x6c7f
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7099
jmp 0x6c7f
leaq 0xac(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7013
movq (%r15), %rax
andq $0x0, (%r15)
movq 0x90(%rbx), %rdi
movq %rax, 0x90(%rbx)
testq %rdi, %rdi
je 0x6caf
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6caf
movq (%rdi), %rax
callq *0x8(%rax)
cmpb $0x0, 0xa8(%rbx)
jne 0x6c34
addq $0x30, %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x10236
jmp 0x6c34