// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r9d, %r13d
movl %r8d, %r15d
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %r14
leaq 0x314d(%rip), %rsi      # 0x11770
leaq 0x18(%rsp), %rdx
movq %rdi, 0x8(%rsp)
callq 0x5d02
leaq 0x38(%rsp), %rdi
movl %r12d, %esi
callq 0xea73
leaq 0x303c(%rip), %rsi      # 0x11682
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0xea4f
leaq 0x3113(%rip), %rdx      # 0x1176f
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0xea30
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x54c0
leaq 0x18(%rsp), %rdi
callq 0x5140
leaq 0x58(%rsp), %rdi
callq 0x5140
leaq 0x38(%rsp), %rdi
callq 0x5140
leaq 0x38(%rsp), %rdi
movl %ebp, %esi
callq 0xea73
leaq 0x2fe2(%rip), %rsi      # 0x1168d
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0xea4f
leaq 0x30ae(%rip), %rdx      # 0x1176f
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0xea30
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x54c0
leaq 0x18(%rsp), %rdi
callq 0x5140
leaq 0x58(%rsp), %rdi
callq 0x5140
leaq 0x38(%rsp), %rdi
callq 0x5140
xorl %ebx, %ebx
leaq 0x2f92(%rip), %r12      # 0x11698
cmpl 0x24(%r14), %ebx
jge 0xe71d
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x54a0
incl %ebx
jmp 0xe706
leaq 0x304b(%rip), %rsi      # 0x1176f
movq 0x8(%rsp), %rdi
callq 0x54a0
movl %r13d, 0x14(%rsp)
leaq 0x8(%r14), %r12
xorl %r13d, %r13d
movslq 0x20(%r14), %rax
cmpq %rax, %r13
jge 0xe7be
leal -0x2(%r13), %ebx
xorl %ebp, %ebp
movslq 0x24(%r14), %rax
cmpq %rax, %rbp
jge 0xe7a5
testb %r15b, %r15b
je 0xe77d
cmpl $0xa, %ebx
setae %al
leal -0x2(%rbp), %ecx
cmpl $0x7, %ecx
setae %cl
orb %al, %cl
jne 0xe77d
movq 0x8(%rsp), %rdi
leaq 0x2f24(%rip), %rsi      # 0x1169a
callq 0x54a0
jmp 0xe7a0
movq %r12, %rdi
movq %r13, %rsi
callq 0xeacc
movq %rax, %rdi
movq %rbp, %rsi
callq 0xeaea
movsbl (%rax), %esi
movq 0x8(%rsp), %rdi
callq 0x5270
incq %rbp
jmp 0xe749
movq 0x8(%rsp), %rdi
leaq 0x2fbe(%rip), %rsi      # 0x1176f
callq 0x54a0
incq %r13
jmp 0xe73a
xorl %ebx, %ebx
leaq 0x2ed1(%rip), %r15      # 0x11698
movl 0x14(%rsp), %ebp
cmpl 0x24(%r14), %ebx
jge 0xe7e2
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x54a0
incl %ebx
jmp 0xe7cb
leaq 0x2f86(%rip), %rsi      # 0x1176f
movq 0x8(%rsp), %rdi
callq 0x54a0
leaq 0x2ea2(%rip), %rsi      # 0x1169c
movq 0x8(%rsp), %rdi
callq 0x54a0
movsbl %bpl, %eax
leal -0x49(%rax), %ecx
cmpl $0xb, %ecx
ja 0xe829
leaq 0x2e29(%rip), %rax      # 0x11640
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2e82(%rip), %rsi      # 0x116a9
jmp 0xe870
cmpl $0x20, %eax
je 0xe869
cmpl $0x5a, %eax
jne 0xe87a
leaq 0x2eec(%rip), %rsi      # 0x11726
jmp 0xe870
leaq 0x2eb1(%rip), %rsi      # 0x116f4
jmp 0xe870
leaq 0x2e76(%rip), %rsi      # 0x116c2
jmp 0xe870
leaq 0x2eb8(%rip), %rsi      # 0x1170d
jmp 0xe870
leaq 0x2e7d(%rip), %rsi      # 0x116db
jmp 0xe870
leaq 0x2ed8(%rip), %rsi      # 0x1173f
jmp 0xe870
leaq 0x2ee8(%rip), %rsi      # 0x11758
movq 0x8(%rsp), %rdi
callq 0x54a0
movq 0x8(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe896
jmp 0xe8a5
jmp 0xe8b4
jmp 0xe8cd
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x5140
jmp 0xe8a8
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x5140
jmp 0xe8b7
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x5140
jmp 0xe8d0
jmp 0xe8cd
jmp 0xe8cd
jmp 0xe8cd
jmp 0xe8cd
jmp 0xe8cd
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x5140
movq %r14, %rdi
callq 0x5450