// File: /workspace/github_cpp_makefile_star2_O3/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 0x3825(%rip), %rdx      # 0x137b4
movq %rdi, (%rsp)
movq %rdx, %rsi
callq 0x65c6
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0xfff8
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0xffef
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xfff5
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xfff8
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xffbc
addl $-0x3, %r12d
jmp 0xfff8
addl $-0x2, %r12d
jmp 0xfff8
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 0x107a3
leaq 0x3691(%rip), %rcx      # 0x136c6
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 0x1006e
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x10075
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 0x371b(%rip), %rsi      # 0x137b3
callq 0x54e0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x100c5
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x100cd
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 0x1010f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x10126
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x10142
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x1019d
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x10194
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x1019a
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x1019d
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x10161
addl $-0x3, %r12d
jmp 0x1019d
addl $-0x2, %r12d
jmp 0x1019d
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 0x107a3
leaq 0x34fa(%rip), %rcx      # 0x136d1
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 0x10211
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x10218
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 0x3578(%rip), %rsi      # 0x137b3
callq 0x54e0
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10263
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x10269
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 0x102ab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x102c2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x102de
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
cmpl $0x0, 0x24(%r14)
jle 0x10302
xorl %ebx, %ebx
leaq 0x33ee(%rip), %r12      # 0x136dc
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x54e0
incl %ebx
cmpl 0x24(%r14), %ebx
jl 0x102ee
leaq 0x34aa(%rip), %rsi      # 0x137b3
movq (%rsp), %rdi
callq 0x54e0
cmpl $0x0, 0x20(%r14)
jle 0x103d9
xorl %ebx, %ebx
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
cmpl $0x0, 0x24(%r14)
jle 0x103b9
leal -0x2(%rbx), %r13d
leaq (%rbx,%rbx,2), %r15
xorl %r12d, %r12d
cmpb $0x0, 0x6c(%rsp)
je 0x1036e
cmpl $0xa, %r13d
setae %al
leal -0x2(%r12), %ecx
cmpl $0x7, %ecx
setae %cl
orb %al, %cl
jne 0x1036e
movq (%rsp), %rdi
leaq 0x3377(%rip), %rsi      # 0x136de
callq 0x54e0
jmp 0x103ad
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %rbp, %rdx
cmpq %rbx, %rdx
jbe 0x104a9
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rdx
subq %rax, %rdx
cmpq %r12, %rdx
jbe 0x104a6
movsbl (%rax,%r12), %esi
movq (%rsp), %rdi
callq 0x5250
incq %r12
movslq 0x24(%r14), %rax
cmpq %rax, %r12
jl 0x1033f
movq (%rsp), %rdi
leaq 0x33ef(%rip), %rsi      # 0x137b3
callq 0x54e0
incq %rbx
movslq 0x20(%r14), %rax
cmpq %rax, %rbx
jl 0x10329
cmpl $0x0, 0x24(%r14)
jle 0x103fd
xorl %ebx, %ebx
leaq 0x32f3(%rip), %r15      # 0x136dc
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x54e0
incl %ebx
cmpl 0x24(%r14), %ebx
jl 0x103e9
leaq 0x33af(%rip), %rsi      # 0x137b3
movq (%rsp), %rdi
callq 0x54e0
leaq 0x32cc(%rip), %rsi      # 0x136e0
movq (%rsp), %rdi
callq 0x54e0
movsbl 0x68(%rsp), %eax
leal -0x49(%rax), %ecx
cmpl $0xb, %ecx
ja 0x10443
leaq 0x3253(%rip), %rax      # 0x13684
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x32ac(%rip), %rsi      # 0x136ed
jmp 0x1048a
cmpl $0x20, %eax
je 0x10483
cmpl $0x5a, %eax
jne 0x10493
leaq 0x3316(%rip), %rsi      # 0x1376a
jmp 0x1048a
leaq 0x32db(%rip), %rsi      # 0x13738
jmp 0x1048a
leaq 0x32a0(%rip), %rsi      # 0x13706
jmp 0x1048a
leaq 0x32e2(%rip), %rsi      # 0x13751
jmp 0x1048a
leaq 0x32a7(%rip), %rsi      # 0x1371f
jmp 0x1048a
leaq 0x3302(%rip), %rsi      # 0x13783
jmp 0x1048a
leaq 0x3312(%rip), %rsi      # 0x1379c
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 0x2cb4(%rip), %rdi      # 0x13164
movq %rbx, %rsi
xorl %eax, %eax
callq 0x53d0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x104dc
jmp 0x104ee
jmp 0x104eb
jmp 0x10507
jmp 0x10534
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x104ee
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x104ee
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x1050a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x1050a
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x10537
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x10537
jmp 0x10534
jmp 0x10534
jmp 0x10534
jmp 0x10534
jmp 0x10534
jmp 0x10534
movq %rax, %r14
movq (%rsp), %rax
movq (%rax), %rdi
movq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x10553
movq (%rax), %rsi
incq %rsi
callq 0x52c0
movq %r14, %rdi
callq 0x5480
nop