// File: /workspace/github_cpp_makefile_star2_O3/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
movq (%rax,%rcx), %rdx
movd %edi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqu (%rdx), %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm0, %xmm2
por %xmm1, %xmm2
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
movdqa %xmm2, %xmm1
pcmpgtd %xmm0, %xmm1
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm0, %xmm2
por %xmm1, %xmm2
movd %xmm2, %edi
addq $0x18, %rcx
cmpq $0x60, %rcx
jne 0x70f0
callq 0x6043
movl %eax, %ebx
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1f4f(%rip), %rdx      # 0x90bb
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x5a1a
movq %rbx, 0x68(%rsp)
leal 0x1(%rbx), %eax
movl %eax, 0x28(%rsp)
xorl %eax, %eax
leaq 0x1fe0(%rip), %rbx      # 0x9171
movq %rax, 0x60(%rsp)
leaq (%rax,%rax,2), %rax
movq %rax, 0x70(%rsp)
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax,%rbp,4), %r13d
movl %r13d, %edi
callq 0x6043
movl %eax, 0x2c(%rsp)
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r15d
cmpl $0xa, %r14d
jb 0x7220
movl $0x4, %r15d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x7217
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x721d
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x7220
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 0x71e2
addl $-0x3, %r15d
jmp 0x7220
addl $-0x2, %r15d
jmp 0x7220
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 0x786b
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 0x7282
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movl 0x2c(%rsp), %eax
cmpl %eax, 0x68(%rsp)
jb 0x72a4
movl 0x28(%rsp), %r14d
subl %eax, %r14d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x22e0
decl %r14d
jne 0x7294
incq %rbp
cmpq $0x4, %rbp
jne 0x71a1
movq %r12, %rdi
leaq 0x1dff(%rip), %rsi      # 0x90ba
callq 0x22e0
movq 0x60(%rsp), %rax
incq %rax
cmpq $0x4, %rax
jne 0x7191
movq 0x30(%rsp), %rax
movl (%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x7334
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x732b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x7331
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x7334
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x72f8
addl $-0x3, %r14d
jmp 0x7334
addl $-0x2, %r14d
jmp 0x7334
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 0x786b
leaq 0x21fd(%rip), %rcx      # 0x9570
movl $0x7, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21d0
movq %r13, 0x8(%rsp)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x73a8
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x73b5
movdqu (%rcx), %xmm0
movdqu %xmm0, (%r13)
movq %r13, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
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 0x742d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x7447
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x7463
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 0x7499
jmp 0x74d2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7499
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x74d5
movq 0x88(%rsp), %rsi
jmp 0x74c8
jmp 0x74d2
jmp 0x74d2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x74d5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x74d5
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x74f1
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop