// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x29e8
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x5944
leaq 0x90(%rsp), %r14
leaq 0x8(%r12), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x647a
testb %al, %al
je 0x577a
leaq 0x8(%rsp), %rdi
andl $0x0, -0x8(%rdi)
leaq 0x88(%rsp), %rsi
callq 0x29e8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x698e
leaq 0x10(%rsp), %rdi
callq 0x2abc
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x29e8
leaq 0x68(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x59b8
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x647a
testb %al, %al
je 0x57d3
leaq 0x8(%rsp), %rdi
movl $0x1, -0x8(%rdi)
leaq 0x68(%rsp), %rsi
callq 0x29e8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x698e
leaq 0x10(%rsp), %rdi
callq 0x2abc
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x29e8
leaq 0x48(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x59e0
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x647a
testb %al, %al
je 0x582c
leaq 0x8(%rsp), %rdi
movl $0x2, -0x8(%rdi)
leaq 0x48(%rsp), %rsi
callq 0x29e8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x698e
leaq 0x10(%rsp), %rdi
callq 0x2abc
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x29e8
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x5a08
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x647a
testb %al, %al
je 0x5885
leaq 0x8(%rsp), %rdi
movl $0x3, -0x8(%rdi)
leaq 0x28(%rsp), %rsi
callq 0x29e8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x698e
leaq 0x10(%rsp), %rdi
callq 0x2abc
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
setne %bl
movq %r12, %rdi
callq 0x2abc
movq %rbp, %rdi
callq 0x2abc
movq %r13, %rdi
callq 0x2abc
movq %r14, %rdi
callq 0x2abc
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2abc
jmp 0x5901
jmp 0x58fe
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x5906
jmp 0x590d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x5915
jmp 0x591c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x5924
jmp 0x592b
jmp 0x590d
jmp 0x591c
jmp 0x592b
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2abc
jmp 0x5910
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2abc
jmp 0x591f
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2abc
jmp 0x592e
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2abc
movq %rbx, %rdi
callq 0x22c0
nop