// File: /workspace/github_cpp_makefile_star2_O3/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 0x2cc2
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x6542
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 0x62a3
callq 0x329a
testb %al, %al
jne 0x62d6
leaq 0x70(%rsp), %rbx
movl $0x0, -0x10(%rbx)
movl 0x40(%rsp), %eax
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2cc2
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7a56
movq %rbx, %rdi
callq 0x2da2
movl (%r12), %eax
leaq 0x28(%rsp), %r14
movl %eax, -0x8(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0x2cc2
leaq 0x20(%rsp), %rdi
callq 0x6d88
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x6542
leaq 0x20(%rsp), %rdi
callq 0x6d88
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 0x633c
callq 0x329a
testb %al, %al
jne 0x636f
leaq 0x70(%rsp), %rbx
movl $0x1, -0x10(%rbx)
movl 0x20(%rsp), %eax
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2cc2
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7a56
movq %rbx, %rdi
callq 0x2da2
movl (%r12), %eax
leaq 0x8(%rsp), %rbp
movl %eax, -0x8(%rbp)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2cc2
movq %rsp, %rdi
callq 0x6e6e
movq %rsp, %rdi
movl $0x1, %esi
callq 0x6542
movq %rsp, %rdi
callq 0x6e6e
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 0x63ce
callq 0x329a
testb %al, %al
jne 0x6400
leaq 0x70(%rsp), %rbx
movl $0x2, -0x10(%rbx)
movl (%rsp), %eax
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2cc2
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7a56
movq %rbx, %rdi
callq 0x2da2
movl (%r12), %eax
leaq 0x90(%rsp), %rbx
movl %eax, -0x8(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2cc2
leaq 0x88(%rsp), %rdi
movl $0x1, %esi
callq 0x6612
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 0x645d
callq 0x329a
testb %al, %al
jne 0x6497
leaq 0x70(%rsp), %r12
movl $0x3, -0x10(%r12)
movl 0x88(%rsp), %eax
movl %eax, -0x8(%r12)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2cc2
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x7a56
movq %r12, %rdi
callq 0x2da2
movq 0x8(%r15), %rax
cmpq (%r15), %rax
setne %r15b
movq %rbx, %rdi
callq 0x2da2
movq %rbp, %rdi
callq 0x2da2
movq %r14, %rdi
callq 0x2da2
leaq 0x48(%rsp), %rdi
callq 0x2da2
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 0x2da2
jmp 0x6509
jmp 0x6506
jmp 0x6506
jmp 0x6518
movq %rax, %r15
movq %rbx, %rdi
jmp 0x651e
jmp 0x6525
movq %rax, %r15
movq %rbx, %rdi
jmp 0x652b
jmp 0x6513
jmp 0x6518
jmp 0x6525
jmp 0x6513
movq %rax, %r15
movq %rbx, %rdi
callq 0x2da2
jmp 0x651b
movq %rax, %r15
jmp 0x6530
movq %rax, %r15
movq %rbp, %rdi
callq 0x2da2
jmp 0x6528
movq %rax, %r15
movq %r14, %rdi
callq 0x2da2
leaq 0x48(%rsp), %rdi
callq 0x2da2
movq %r15, %rdi
callq 0x22b0