// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: operator<<(std::ostream&, Game const&)
std::ostream& operator<<(std::ostream &stream, const Game &game) {
    int max_len = numDigits(game.getHighestTile());
    std::string str = "";
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            int number_of_spaces = max_len - numDigits(game.state[i][j]) + 1;
            str += std::to_string(game.state[i][j]);
            for (int k = 0; k < number_of_spaces; ++k) {
                str += " ";
            }
        }
        str += "\n";
    }
    return stream << "Score: " + std::to_string(game.score) << std::endl << str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x8(%rsi), %rax
movl $0x2, %edi
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %rdx
movq (%rax,%rdx,8), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %r8d
cmpl %edi, %r8d
cmovgl %r8d, %edi
incq %rsi
cmpq $0x4, %rsi
jne 0x72b7
incq %rcx
cmpq $0x4, %rcx
jne 0x72ad
callq 0x621c
movl %eax, %ebx
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2da0(%rip), %rdx      # 0xa08b
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x5bfc
movq %rbx, 0x68(%rsp)
leal 0x1(%rbx), %eax
movl %eax, 0x28(%rsp)
xorl %eax, %eax
leaq 0x2e31(%rip), %rbx      # 0xa141
movq %rax, 0x60(%rsp)
leaq (%rax,%rax,2), %rax
movq %rax, 0x70(%rsp)
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
movq 0x8(%rax), %r14
movq 0x70(%rsp), %r15
movq (%r14,%r15,8), %rax
movl (%rax,%rbp,4), %edi
callq 0x621c
movl %eax, 0x2c(%rsp)
movq (%r14,%r15,8), %rax
movl (%rax,%rbp,4), %r13d
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r15d
cmpl $0xa, %r14d
jb 0x73a3
movl $0x4, %r15d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x739a
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x73a0
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x73a3
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x7365
addl $-0x3, %r15d
jmp 0x73a3
addl $-0x2, %r15d
jmp 0x73a3
decl %r15d
shrl $0x1f, %r13d
leal (%r15,%r13), %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x21f0
addq 0x8(%rsp), %r13
movq %r13, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x79bd
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r13
cmpq %r13, %rdi
je 0x7405
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movl 0x2c(%rsp), %eax
cmpl %eax, 0x68(%rsp)
jb 0x7427
movl 0x28(%rsp), %r14d
subl %eax, %r14d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x22e0
decl %r14d
jne 0x7417
incq %rbp
cmpq $0x4, %rbp
jne 0x7320
movq %r12, %rdi
leaq 0x2c4c(%rip), %rsi      # 0xa08a
callq 0x22e0
movq 0x60(%rsp), %rax
incq %rax
cmpq $0x4, %rax
jne 0x7310
movq 0x30(%rsp), %rax
movl (%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x74b7
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x74ae
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x74b4
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x74b7
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x747b
addl $-0x3, %r14d
jmp 0x74b7
addl $-0x2, %r14d
jmp 0x74b7
decl %r14d
shrl $0x1f, %ebx
leal (%r14,%rbx), %esi
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x78(%rsp), %rdi
movl $0x2d, %edx
callq 0x21f0
leaq 0x78(%rsp), %r15
addq (%r15), %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x79bd
leaq 0x304a(%rip), %rcx      # 0xa540
movl $0x7, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21d0
movq %r13, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x752b
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x7533
movups (%rcx), %xmm0
movups %xmm0, (%r13)
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 0x58(%rsp), %rdi
callq 0x21e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %rax, %rdi
callq 0x21e0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x75b5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x75cf
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x75eb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x7621
jmp 0x765a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7621
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x765d
movq 0x88(%rsp), %rsi
jmp 0x7650
jmp 0x765a
jmp 0x765a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x765d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x765d
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x7679
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop