// File: /workspace/github_cpp_makefile_star2_O1/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, 0x68(%rsp)
movl %r8d, 0x6c(%rsp)
movl %ecx, %ebx
movl %edx, %r13d
movq %rsi, %r14
leaq 0x10(%rdi), %rax
movq %rax, 0x70(%rsp)
movq %rax, (%rdi)
leaq 0x3511(%rip), %rdx      # 0x1376c
movq %rdi, (%rsp)
movq %rdx, %rsi
callq 0x65a0
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x102c4
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x102bb
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x102c1
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x102c4
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x10288
addl $-0x3, %r12d
jmp 0x102c4
addl $-0x2, %r12d
jmp 0x102c4
decl %r12d
shrl $0x1f, %r13d
leal (%r12,%r13), %esi
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x5320
movl %r13d, %edi
leaq 0x28(%rsp), %r13
addq (%r13), %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x10a3b
leaq 0x337d(%rip), %rcx      # 0x1367e
movl $0xa, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5300
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1033a
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x10341
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3407(%rip), %rsi      # 0x1376b
callq 0x54e0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10391
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x10399
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq (%rsp), %rdi
callq 0x50d0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x103db
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x103f2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1040e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x10469
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x10460
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x10466
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x10469
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x1042d
addl $-0x3, %r12d
jmp 0x10469
addl $-0x2, %r12d
jmp 0x10469
decl %r12d
shrl $0x1f, %ebx
leal (%r12,%rbx), %esi
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x5320
movl %ebx, %edi
leaq 0x28(%rsp), %r13
addq (%r13), %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x10a3b
leaq 0x31e6(%rip), %rcx      # 0x13689
movl $0xa, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5300
movq %r15, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x18(%rsp), %rbx
je 0x104dd
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x104e4
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3264(%rip), %rsi      # 0x1376b
callq 0x54e0
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1052f
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x10535
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq (%rsp), %rdi
callq 0x50d0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10577
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x1058e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x105aa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
cmpl $0x0, 0x24(%r14)
jle 0x105ce
xorl %ebx, %ebx
leaq 0x30da(%rip), %r12      # 0x13694
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x54e0
incl %ebx
cmpl 0x24(%r14), %ebx
jl 0x105ba
leaq 0x3196(%rip), %rsi      # 0x1376b
movq (%rsp), %rdi
callq 0x54e0
cmpl $0x0, 0x20(%r14)
jle 0x106a5
xorl %ebx, %ebx
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
cmpl $0x0, 0x24(%r14)
jle 0x10685
leal -0x2(%rbx), %r13d
leaq (%rbx,%rbx,2), %r15
xorl %r12d, %r12d
cmpb $0x0, 0x6c(%rsp)
je 0x1063a
cmpl $0xa, %r13d
setae %al
leal -0x2(%r12), %ecx
cmpl $0x7, %ecx
setae %cl
orb %al, %cl
jne 0x1063a
movq (%rsp), %rdi
leaq 0x3063(%rip), %rsi      # 0x13696
callq 0x54e0
jmp 0x10679
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %rbp, %rdx
cmpq %rbx, %rdx
jbe 0x10775
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rdx
subq %rax, %rdx
cmpq %r12, %rdx
jbe 0x10772
movsbl (%rax,%r12), %esi
movq (%rsp), %rdi
callq 0x5250
incq %r12
movslq 0x24(%r14), %rax
cmpq %rax, %r12
jl 0x1060b
movq (%rsp), %rdi
leaq 0x30db(%rip), %rsi      # 0x1376b
callq 0x54e0
incq %rbx
movslq 0x20(%r14), %rax
cmpq %rax, %rbx
jl 0x105f5
cmpl $0x0, 0x24(%r14)
jle 0x106c9
xorl %ebx, %ebx
leaq 0x2fdf(%rip), %r15      # 0x13694
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x54e0
incl %ebx
cmpl 0x24(%r14), %ebx
jl 0x106b5
leaq 0x309b(%rip), %rsi      # 0x1376b
movq (%rsp), %rdi
callq 0x54e0
leaq 0x2fb8(%rip), %rsi      # 0x13698
movq (%rsp), %rdi
callq 0x54e0
movsbl 0x68(%rsp), %eax
leal -0x49(%rax), %ecx
cmpl $0xb, %ecx
ja 0x1070f
leaq 0x2f3f(%rip), %rax      # 0x1363c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2f98(%rip), %rsi      # 0x136a5
jmp 0x10756
cmpl $0x20, %eax
je 0x1074f
cmpl $0x5a, %eax
jne 0x1075f
leaq 0x3002(%rip), %rsi      # 0x13722
jmp 0x10756
leaq 0x2fc7(%rip), %rsi      # 0x136f0
jmp 0x10756
leaq 0x2f8c(%rip), %rsi      # 0x136be
jmp 0x10756
leaq 0x2fce(%rip), %rsi      # 0x13709
jmp 0x10756
leaq 0x2f93(%rip), %rsi      # 0x136d7
jmp 0x10756
leaq 0x2fee(%rip), %rsi      # 0x1373b
jmp 0x10756
leaq 0x2ffe(%rip), %rsi      # 0x13754
movq (%rsp), %rdi
callq 0x54e0
movq (%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rbx
leaq 0x29e8(%rip), %rdi      # 0x13164
movq %rbx, %rsi
xorl %eax, %eax
callq 0x53d0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x107a8
jmp 0x107ba
jmp 0x107b7
jmp 0x107d3
jmp 0x10800
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x107ba
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x107ba
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x107d6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x107d6
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x10803
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x10803
jmp 0x10800
jmp 0x10800
jmp 0x10800
jmp 0x10800
jmp 0x10800
jmp 0x10800
movq %rax, %r14
movq (%rsp), %rax
movq (%rax), %rdi
movq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1081f
movq (%rax), %rsi
incq %rsi
callq 0x52c0
movq %r14, %rdi
callq 0x5480
nop