// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rcx, -0x80(%rbp)
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
addq $0x90, %rdi
callq 0xa7c0
movq %rax, %rdi
callq 0x23610
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x95c4
testb $0x1, -0xd(%rbp)
je 0x95c4
cmpl $0x1, -0x1c(%rbp)
jne 0x9510
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x28(%rbp), %rdi
callq 0x9e70
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x28(%rbp), %rsi
callq 0x9ef0
leaq -0x28(%rbp), %rdi
callq 0x9f50
jmp 0x95bf
cmpl $0x2, -0x1c(%rbp)
jne 0x9549
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x30(%rbp), %rdi
callq 0x9fb0
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x30(%rbp), %rsi
callq 0xa030
leaq -0x30(%rbp), %rdi
callq 0xa090
jmp 0x95bd
cmpl $0x3, -0x1c(%rbp)
jne 0x9582
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x38(%rbp), %rdi
callq 0xa0f0
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x38(%rbp), %rsi
callq 0xa170
leaq -0x38(%rbp), %rdi
callq 0xa1d0
jmp 0x95bb
cmpl $0x4, -0x1c(%rbp)
jne 0x95b9
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x40(%rbp), %rdi
callq 0xa230
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x40(%rbp), %rsi
callq 0xa2b0
leaq -0x40(%rbp), %rdi
callq 0xa310
jmp 0x95bb
jmp 0x95bd
jmp 0x95bf
jmp 0x976e
cmpl $0x0, -0xc(%rbp)
jne 0x961e
testb $0x1, -0xd(%rbp)
jne 0x961e
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
callq 0xa7c0
movq %rax, %rdi
callq 0x23610
movq -0x80(%rbp), %rsi
movl %eax, -0x4c(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x4c(%rbp), %rdx
callq 0xaef0
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x48(%rbp), %rsi
callq 0xa430
leaq -0x48(%rbp), %rdi
callq 0xa490
jmp 0x976c
cmpl $0x0, -0xc(%rbp)
je 0x976a
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
callq 0xa7c0
movq %rax, %rdi
callq 0x23610
addl -0xc(%rbp), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jl 0x965b
movq -0x78(%rbp), %rcx
movl -0x50(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jle 0x9660
jmp 0x976e
cmpl $0x1, -0x50(%rbp)
jne 0x969c
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x58(%rbp), %rdi
callq 0x9e70
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ef0
leaq -0x58(%rbp), %rdi
callq 0x9f50
jmp 0x974b
cmpl $0x2, -0x50(%rbp)
jne 0x96d5
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x60(%rbp), %rdi
callq 0x9fb0
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x60(%rbp), %rsi
callq 0xa030
leaq -0x60(%rbp), %rdi
callq 0xa090
jmp 0x9749
cmpl $0x3, -0x50(%rbp)
jne 0x970e
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x68(%rbp), %rdi
callq 0xa0f0
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x68(%rbp), %rsi
callq 0xa170
leaq -0x68(%rbp), %rdi
callq 0xa1d0
jmp 0x9747
cmpl $0x4, -0x50(%rbp)
jne 0x9745
movq -0x78(%rbp), %rsi
addq $0xac, %rsi
leaq -0x70(%rbp), %rdi
callq 0xa230
movq -0x78(%rbp), %rdi
addq $0x90, %rdi
leaq -0x70(%rbp), %rsi
callq 0xa2b0
leaq -0x70(%rbp), %rdi
callq 0xa310
jmp 0x9747
jmp 0x9749
jmp 0x974b
movq -0x78(%rbp), %rax
testb $0x1, 0xa8(%rax)
jne 0x9768
movq -0x78(%rbp), %rdi
addq $0x30, %rdi
movl -0x50(%rbp), %esi
callq 0x2b740
jmp 0x976a
jmp 0x976c
jmp 0x976e
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)