// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rdi, %r12
movl (%rdi), %eax
leaq 0x48(%rsp), %r14
movl %eax, -0x8(%r14)
leaq 0x8(%rdi), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x2d38
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x673c
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
subq %rdx, %rcx
cmpq %rcx, %rax
jne 0x649d
callq 0x331e
testb %al, %al
jne 0x64d0
leaq 0x70(%rsp), %rbx
movl $0x0, -0x10(%rbx)
movl 0x40(%rsp), %eax
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d38
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7ba0
movq %rbx, %rdi
callq 0x2e18
movl (%r12), %eax
leaq 0x28(%rsp), %r14
movl %eax, -0x8(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0x2d38
leaq 0x20(%rsp), %rdi
callq 0x6f92
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x673c
leaq 0x20(%rsp), %rdi
callq 0x6f92
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
subq %rdx, %rcx
cmpq %rcx, %rax
jne 0x6536
callq 0x331e
testb %al, %al
jne 0x6569
leaq 0x70(%rsp), %rbx
movl $0x1, -0x10(%rbx)
movl 0x20(%rsp), %eax
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d38
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7ba0
movq %rbx, %rdi
callq 0x2e18
movl (%r12), %eax
leaq 0x8(%rsp), %rbp
movl %eax, -0x8(%rbp)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2d38
movq %rsp, %rdi
callq 0x7078
movq %rsp, %rdi
movl $0x1, %esi
callq 0x673c
movq %rsp, %rdi
callq 0x7078
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
subq %rdx, %rcx
cmpq %rcx, %rax
jne 0x65c8
callq 0x331e
testb %al, %al
jne 0x65fa
leaq 0x70(%rsp), %rbx
movl $0x2, -0x10(%rbx)
movl (%rsp), %eax
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2d38
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7ba0
movq %rbx, %rdi
callq 0x2e18
movl (%r12), %eax
leaq 0x90(%rsp), %rbx
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2d38
leaq 0x88(%rsp), %rdi
movl $0x1, %esi
callq 0x680c
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
subq %rdx, %rcx
cmpq %rcx, %rax
jne 0x6657
callq 0x331e
testb %al, %al
jne 0x6691
leaq 0x70(%rsp), %r12
movl $0x3, -0x10(%r12)
movl 0x88(%rsp), %eax
movl %eax, -0x8(%r12)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2d38
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7ba0
movq %r12, %rdi
callq 0x2e18
movq 0x8(%r15), %rax
cmpq (%r15), %rax
setne %r15b
movq %rbx, %rdi
callq 0x2e18
movq %rbp, %rdi
callq 0x2e18
movq %r14, %rdi
callq 0x2e18
leaq 0x48(%rsp), %rdi
callq 0x2e18
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r12, %rdi
callq 0x2e18
jmp 0x6703
jmp 0x6700
jmp 0x6700
jmp 0x6712
movq %rax, %r15
movq %rbx, %rdi
jmp 0x6718
jmp 0x671f
movq %rax, %r15
movq %rbx, %rdi
jmp 0x6725
jmp 0x670d
jmp 0x6712
jmp 0x671f
jmp 0x670d
movq %rax, %r15
movq %rbx, %rdi
callq 0x2e18
jmp 0x6715
movq %rax, %r15
jmp 0x672a
movq %rax, %r15
movq %rbp, %rdi
callq 0x2e18
jmp 0x6722
movq %rax, %r15
movq %r14, %rdi
callq 0x2e18
leaq 0x48(%rsp), %rdi
callq 0x2e18
movq %r15, %rdi
callq 0x22b0