// File: EstherJin[P]TetrisRemake/stringGenerator.cc
// Function: StringGenerator::print[abi:cxx11](int, int, bool, char)
string StringGenerator::print(int level, int score, bool blind, char next) { // generate a string that represents one board
	string str = "";

	str += "Level:    " + to_string(level) + "\n";
	str += "Score:    " + to_string(score) + "\n";

	for (int i = 0; i < gridCols; ++i) {
		str += "-";
	}
	str += "\n";

	// does row and col start from 0?
	for (int i = 0; i < gridRows; ++i) {
		for (int j = 0; j < gridCols; ++j) {
			if (blind) {
				if ((i >= 2 && i <= 11) && (j >= 2 && j <= 8)) {
					str += "?";
				} else {
				    str += grid.at(i).at(j);
				}
			}
			else {
				str += grid.at(i).at(j);
			}
		}
		str += "\n";
	}

	for (int i = 0; i < gridCols; ++i) {
		str += "-";
	}
	str += "\n";

	str += "Next:      \n";

	if (next != ' ') {
		switch (next) {
		case 'I':
			str += "           \nIIII       \n";
			break;
		case 'J':
			str += "J          \nJJJ        \n";
			break;
		case 'L':
			str += "  L        \nLLL        \n";
			break;
		case 'O':
			str += "OO         \nOO         \n";
			break;
		case 'S':
			str += " SS        \nSS         \n";
			break;
		case 'Z':
			str += "ZZ         \n ZZ        \n";
			break;
		case 'T':
			str += "TTT        \n T         \n";
			break;
		}
	}
	else {
		str += "           \n           \n";
	}

	return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl %r8d, -0x134(%rbp)
movl %ecx, %eax
movl -0x134(%rbp), %ecx
movl %eax, -0x130(%rbp)
movl %edx, %eax
movl -0x130(%rbp), %edx
movl %eax, -0x12c(%rbp)
movq %rsi, %rax
movl -0x12c(%rbp), %esi
movq %rax, -0x128(%rbp)
movq %rdi, %r8
movq -0x128(%rbp), %rdi
movq %r8, -0x110(%rbp)
movb %r9b, %al
movq %r8, %r9
movq %r9, -0x120(%rbp)
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
andb $0x1, %cl
movb %cl, -0x19(%rbp)
movb %al, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
movb $0x0, -0x1b(%rbp)
leaq -0x1c(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x65d0
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rdx
leaq 0x7e65(%rip), %rsi      # 0x2d6ec
callq 0x73b0
jmp 0x2588e
leaq -0x1c(%rbp), %rdi
callq 0x63e0
movl -0x14(%rbp), %esi
leaq -0x90(%rbp), %rdi
callq 0x26240
jmp 0x258a8
leaq 0x7d4f(%rip), %rsi      # 0x2d5fe
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x261f0
jmp 0x258c1
leaq 0x7e23(%rip), %rdx      # 0x2d6eb
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x261a0
jmp 0x258d7
movq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x6470
jmp 0x258e9
leaq -0x50(%rbp), %rdi
callq 0x6230
leaq -0x70(%rbp), %rdi
callq 0x6230
leaq -0x90(%rbp), %rdi
callq 0x6230
movl -0x18(%rbp), %esi
leaq -0xf0(%rbp), %rdi
callq 0x26240
jmp 0x25918
leaq 0x7cea(%rip), %rsi      # 0x2d609
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x261f0
jmp 0x25934
leaq 0x7db0(%rip), %rdx      # 0x2d6eb
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x261a0
jmp 0x25950
movq -0x110(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x6470
jmp 0x25965
leaq -0xb0(%rbp), %rdi
callq 0x6230
leaq -0xd0(%rbp), %rdi
callq 0x6230
leaq -0xf0(%rbp), %rdi
callq 0x6230
movl $0x0, -0xf4(%rbp)
movq -0x118(%rbp), %rcx
movl -0xf4(%rbp), %eax
cmpl 0x24(%rcx), %eax
jge 0x25a98
movq -0x110(%rbp), %rdi
leaq 0x7c5d(%rip), %rsi      # 0x2d614
callq 0x6340
jmp 0x259be
jmp 0x259c0
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x25993
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1c(%rbp), %rdi
callq 0x63e0
jmp 0x25dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x25daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x25a36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x25a2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6230
leaq -0x70(%rbp), %rdi
callq 0x6230
leaq -0x90(%rbp), %rdi
callq 0x6230
jmp 0x25daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x25a87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x25a7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x6230
leaq -0xd0(%rbp), %rdi
callq 0x6230
leaq -0xf0(%rbp), %rdi
callq 0x6230
jmp 0x25daf
movq -0x110(%rbp), %rdi
leaq 0x7c45(%rip), %rsi      # 0x2d6eb
callq 0x6340
jmp 0x25aad
movl $0x0, -0xf8(%rbp)
movq -0x118(%rbp), %rcx
movl -0xf8(%rbp), %eax
cmpl 0x20(%rcx), %eax
jge 0x25c21
movl $0x0, -0xfc(%rbp)
movq -0x118(%rbp), %rcx
movl -0xfc(%rbp), %eax
cmpl 0x24(%rcx), %eax
jge 0x25bf6
testb $0x1, -0x19(%rbp)
je 0x25b8a
cmpl $0x2, -0xf8(%rbp)
jl 0x25b32
cmpl $0xb, -0xf8(%rbp)
jg 0x25b32
cmpl $0x2, -0xfc(%rbp)
jl 0x25b32
cmpl $0x8, -0xfc(%rbp)
jg 0x25b32
movq -0x110(%rbp), %rdi
leaq 0x7aed(%rip), %rsi      # 0x2d616
callq 0x6340
jmp 0x25b30
jmp 0x25b88
movq -0x118(%rbp), %rdi
addq $0x8, %rdi
movslq -0xf8(%rbp), %rsi
callq 0x26360
movq %rax, -0x140(%rbp)
jmp 0x25b52
movq -0x140(%rbp), %rdi
movslq -0xfc(%rbp), %rsi
callq 0x263a0
movq %rax, -0x148(%rbp)
jmp 0x25b6e
movq -0x110(%rbp), %rdi
movq -0x148(%rbp), %rax
movsbl (%rax), %esi
callq 0x6250
jmp 0x25b86
jmp 0x25b88
jmp 0x25be0
movq -0x118(%rbp), %rdi
addq $0x8, %rdi
movslq -0xf8(%rbp), %rsi
callq 0x26360
movq %rax, -0x150(%rbp)
jmp 0x25baa
movq -0x150(%rbp), %rdi
movslq -0xfc(%rbp), %rsi
callq 0x263a0
movq %rax, -0x158(%rbp)
jmp 0x25bc6
movq -0x110(%rbp), %rdi
movq -0x158(%rbp), %rax
movsbl (%rax), %esi
callq 0x6250
jmp 0x25bde
jmp 0x25be0
jmp 0x25be2
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x25ad7
movq -0x110(%rbp), %rdi
leaq 0x7ae7(%rip), %rsi      # 0x2d6eb
callq 0x6340
jmp 0x25c0b
jmp 0x25c0d
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x25ab7
movl $0x0, -0x100(%rbp)
movq -0x118(%rbp), %rcx
movl -0x100(%rbp), %eax
cmpl 0x24(%rcx), %eax
jge 0x25c65
movq -0x110(%rbp), %rdi
leaq 0x79c9(%rip), %rsi      # 0x2d614
callq 0x6340
jmp 0x25c52
jmp 0x25c54
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x25c2b
movq -0x110(%rbp), %rdi
leaq 0x7a78(%rip), %rsi      # 0x2d6eb
callq 0x6340
jmp 0x25c7a
movq -0x110(%rbp), %rdi
leaq 0x7990(%rip), %rsi      # 0x2d618
callq 0x6340
jmp 0x25c8f
movsbl -0x1a(%rbp), %eax
cmpl $0x20, %eax
je 0x25d72
movsbl -0x1a(%rbp), %eax
addl $-0x49, %eax
movl %eax, %ecx
movq %rcx, -0x160(%rbp)
subl $0x11, %eax
ja 0x25d70
movq -0x160(%rbp), %rax
leaq 0x78e1(%rip), %rcx      # 0x2d5a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x110(%rbp), %rdi
leaq 0x794b(%rip), %rsi      # 0x2d625
callq 0x6340
jmp 0x25ce1
jmp 0x25d70
movq -0x110(%rbp), %rdi
leaq 0x794a(%rip), %rsi      # 0x2d63e
callq 0x6340
jmp 0x25cfb
jmp 0x25d70
movq -0x110(%rbp), %rdi
leaq 0x794c(%rip), %rsi      # 0x2d657
callq 0x6340
jmp 0x25d12
jmp 0x25d70
movq -0x110(%rbp), %rdi
leaq 0x794e(%rip), %rsi      # 0x2d670
callq 0x6340
jmp 0x25d29
jmp 0x25d70
movq -0x110(%rbp), %rdi
leaq 0x7950(%rip), %rsi      # 0x2d689
callq 0x6340
jmp 0x25d40
jmp 0x25d70
movq -0x110(%rbp), %rdi
leaq 0x7952(%rip), %rsi      # 0x2d6a2
callq 0x6340
jmp 0x25d57
jmp 0x25d70
movq -0x110(%rbp), %rdi
leaq 0x7954(%rip), %rsi      # 0x2d6bb
callq 0x6340
jmp 0x25d6e
jmp 0x25d70
jmp 0x25d89
movq -0x110(%rbp), %rdi
leaq 0x7954(%rip), %rsi      # 0x2d6d4
callq 0x6340
jmp 0x25d87
jmp 0x25d89
movb $0x1, -0x1b(%rbp)
testb $0x1, -0x1b(%rbp)
jne 0x25d9f
movq -0x110(%rbp), %rdi
callq 0x6230
movq -0x120(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x110(%rbp), %rdi
callq 0x6230
movq -0x28(%rbp), %rdi
callq 0x65c0
nopw %cs:(%rax,%rax)
nop