// File: NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::generatePossibleMoves(std::vector<std::pair<int, Game>, std::allocator<std::pair<int, Game>>>&) const
bool Game::generatePossibleMoves(movelist &move_list) const {
    // Note: Responsibility to check if game can continue is given to other functions
    Game up_copy = *this;
    up_copy.up(true);
    if (up_copy.state != state) {
        move_list.push_back(std::pair<int, Game>(UP, up_copy));
    }

    Game down_copy = *this;
    down_copy.down(true);
    if (down_copy.state != state) {
        move_list.push_back(std::pair<int, Game>(DOWN, down_copy));
    }

    Game left_copy = *this;
    left_copy.left(true);
    if (left_copy.state != state) {
        move_list.push_back(std::pair<int, Game>(LEFT, left_copy));
    }

    Game right_copy = *this;
    right_copy.right(true);
    if (right_copy.state != state) {
        move_list.push_back(std::pair<int, Game>(RIGHT, right_copy));
    }
    return move_list.size() > 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x170(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x3f70
movq -0x168(%rbp), %rdi
movl $0x1, %esi
callq 0xfa10
jmp 0xf671
movq -0x170(%rbp), %rsi
leaq -0x28(%rbp), %rdi
addq $0x8, %rsi
callq 0x11440
movb %al, -0x171(%rbp)
jmp 0xf68d
movb -0x171(%rbp), %al
testb $0x1, %al
jne 0xf699
jmp 0xf706
movq -0x10(%rbp), %rax
movq %rax, -0x180(%rbp)
movl $0x0, -0x6c(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x114a0
jmp 0xf6be
movq -0x180(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x11470
jmp 0xf6d0
leaq -0x68(%rbp), %rdi
callq 0x8f90
jmp 0xf706
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xf9fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x8f90
jmp 0xf9fd
movq -0x170(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x3f70
jmp 0xf71b
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0xfac0
jmp 0xf72e
movq -0x170(%rbp), %rsi
leaq -0x88(%rbp), %rdi
addq $0x8, %rsi
callq 0x11440
movb %al, -0x181(%rbp)
jmp 0xf74d
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0xf75c
jmp 0xf7de
movq -0x10(%rbp), %rax
movq %rax, -0x190(%rbp)
movl $0x1, -0xbc(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x114a0
jmp 0xf78d
movq -0x190(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x11470
jmp 0xf7a2
leaq -0xb8(%rbp), %rdi
callq 0x8f90
jmp 0xf7de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xf9f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x8f90
jmp 0xf9f1
movq -0x170(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x3f70
jmp 0xf7f3
leaq -0xe0(%rbp), %rdi
movl $0x1, %esi
callq 0xfb10
jmp 0xf806
movq -0x170(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
addq $0x8, %rsi
callq 0x11440
movb %al, -0x191(%rbp)
jmp 0xf825
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0xf834
jmp 0xf8b6
movq -0x10(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movl $0x2, -0x10c(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x10c(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x114a0
jmp 0xf865
movq -0x1a0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x11470
jmp 0xf87a
leaq -0x108(%rbp), %rdi
callq 0x8f90
jmp 0xf8b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xf9e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x8f90
jmp 0xf9e5
movq -0x170(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x3f70
jmp 0xf8cb
leaq -0x130(%rbp), %rdi
movl $0x1, %esi
callq 0xfb60
jmp 0xf8de
movq -0x170(%rbp), %rsi
leaq -0x128(%rbp), %rdi
addq $0x8, %rsi
callq 0x11440
movb %al, -0x1a1(%rbp)
jmp 0xf8fd
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0xf909
jmp 0xf985
movq -0x10(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movl $0x3, -0x15c(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x114a0
jmp 0xf93a
movq -0x1b0(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x11470
jmp 0xf94f
leaq -0x158(%rbp), %rdi
callq 0x8f90
jmp 0xf985
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xf9d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x8f90
jmp 0xf9d9
movq -0x10(%rbp), %rdi
callq 0x7e50
cmpq $0x0, %rax
seta %al
movb %al, -0x1b1(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x4460
leaq -0xe0(%rbp), %rdi
callq 0x4460
leaq -0x90(%rbp), %rdi
callq 0x4460
leaq -0x30(%rbp), %rdi
callq 0x4460
movb -0x1b1(%rbp), %al
andb $0x1, %al
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
leaq -0x130(%rbp), %rdi
callq 0x4460
leaq -0xe0(%rbp), %rdi
callq 0x4460
leaq -0x90(%rbp), %rdi
callq 0x4460
leaq -0x30(%rbp), %rdi
callq 0x4460
movq -0x38(%rbp), %rdi
callq 0x33d0
nop