// File: 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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10e40
movl %eax, %edi
callq 0xf2b0
movl %eax, -0x14(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x33e0
movq -0xc8(%rbp), %rdx
leaq 0x70bb(%rip), %rsi      # 0x1805f
leaq -0x38(%rbp), %rdi
callq 0xbc40
jmp 0x10faf
leaq -0x39(%rbp), %rdi
callq 0x32c0
movl $0x0, -0x50(%rbp)
cmpl $0x4, -0x50(%rbp)
jge 0x110fd
movl $0x0, -0x54(%rbp)
cmpl $0x4, -0x54(%rbp)
jge 0x110db
movl -0x14(%rbp), %eax
movl %eax, -0xcc(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movslq -0x50(%rbp), %rsi
callq 0x7f70
movq %rax, %rdi
movslq -0x54(%rbp), %rsi
callq 0x7f90
movl (%rax), %edi
callq 0xf2b0
movl %eax, %ecx
movl -0xcc(%rbp), %eax
subl %ecx, %eax
incl %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movslq -0x50(%rbp), %rsi
callq 0x7f70
movq %rax, %rdi
movslq -0x54(%rbp), %rsi
callq 0x7f90
movl (%rax), %esi
leaq -0x78(%rbp), %rdi
callq 0x11b40
jmp 0x11040
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3310
jmp 0x1104f
leaq -0x78(%rbp), %rdi
callq 0x3458
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x110cb
leaq 0x70a3(%rip), %rsi      # 0x18111
leaq -0x38(%rbp), %rdi
callq 0x3250
jmp 0x11079
jmp 0x1107b
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1105f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x32c0
jmp 0x111f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x111ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3458
jmp 0x111ec
jmp 0x110cd
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x10fd0
leaq 0x6f7c(%rip), %rsi      # 0x1805e
leaq -0x38(%rbp), %rdi
callq 0x3250
jmp 0x110ed
jmp 0x110ef
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x10fbf
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq -0xc0(%rbp), %rdi
callq 0x11b40
jmp 0x1111c
leaq 0x736b(%rip), %rsi      # 0x1848e
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x11c60
jmp 0x11138
movq -0xd8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3210
movq %rax, -0xe0(%rbp)
jmp 0x11154
movq -0xe0(%rbp), %rdi
movq 0x11e4e(%rip), %rsi     # 0x22fb0
callq 0x32a0
movq %rax, -0xe8(%rbp)
jmp 0x11170
movq -0xe8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3210
movq %rax, -0xf0(%rbp)
jmp 0x11189
leaq -0xa0(%rbp), %rdi
callq 0x3458
leaq -0xc0(%rbp), %rdi
callq 0x3458
leaq -0x38(%rbp), %rdi
callq 0x3458
movq -0xf0(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x111e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3458
leaq -0xc0(%rbp), %rdi
callq 0x3458
leaq -0x38(%rbp), %rdi
callq 0x3458
movq -0x48(%rbp), %rdi
callq 0x33d0
nop