// File: /workspace/github_cpp_makefile_star2_O1/sanket143[P]2048-Terminal-Game/./src/2048.cpp
// Function: main
int main(){
  gb::Board board;
  while(true){
    std::cout << "\033[2J\033[1;1H";
    std::cout << "2048 Terminal Game" << std::endl;
    std::cout << "Valid Directions: [R|D|L|U]" << std::endl;
    std::string input;

    board.display();

    std::cout << "Direction: ";
    std::cin >> input;

    if(!board.valid(input)){
      continue;
    }
    std::cout << "Loading..." << std::endl;
    board.move(input);
    board.add_tile();
    board.display();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorps %xmm0, %xmm0
leaq -0xd0(%rbp), %rbx
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movl $0x0, 0x40(%rbx)
movq %rbx, %rdi
callq 0x1c24
movq %rbx, %rdi
callq 0x1c24
leaq -0x78(%rbp), %r12
movq 0x3c95(%rip), %r14      # 0x4fd0
leaq -0x88(%rbp), %r15
movl $0xa, %edx
movq %r14, %rdi
leaq 0x1cb3(%rip), %rsi      # 0x3004
callq 0x1110
movl $0x12, %edx
movq %r14, %rdi
leaq 0x1caa(%rip), %rsi      # 0x300f
callq 0x1110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movl $0x1b, %edx
movq %r14, %rdi
leaq 0x1c82(%rip), %rsi      # 0x3022
callq 0x1110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %rbx, %rdi
callq 0x155a
movl $0xb, %edx
movq %r14, %rdi
leaq 0x1c47(%rip), %rsi      # 0x303e
callq 0x1110
movq 0x3bdd(%rip), %rdi      # 0x4fe0
leaq -0x48(%rbp), %rsi
callq 0x1130
movq %r12, -0x88(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2134
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16a4
movl %eax, %r13d
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x144c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10f0
testb %r13b, %r13b
je 0x14e1
movl $0xa, %edx
movq %r14, %rdi
leaq 0x1be6(%rip), %rsi      # 0x304a
callq 0x1110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x2134
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
callq 0x1828
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x14d1
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1c24
movq %rbx, %rdi
callq 0x155a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x1342
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10f0
jmp 0x1342
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x1539
movq -0x58(%rbp), %rsi
jmp 0x152c
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x1539
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10f0
jmp 0x1539
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x1552
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1180