// File: /workspace/github_cpp_makefile_star2_O2/sanket143[P]2048-Terminal-Game/./src/board.h
// Function: gb::Board::move(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void move(std::string direction) {
        flag |= shift(direction);
        if(direction == "R") {
          for(int row = 0; row < 4; row++) {
            for(int col = 3; col > 0; col--) {
              if(tiles[row][col] == 0) {
                break;
              }

              if(tiles[row][col] == tiles[row][col - 1]) {
                tiles[row][col] += tiles[row][col - 1];
                tiles[row][col - 1] = 0;
                flag |= true;
                shift(direction);
              }
            }
          }
        }
        else if(direction == "D") {
          for(int col = 0; col < 4; col++) {
            for(int row = 3; row > 0; row--) {
              if(tiles[row][col] == 0) {
                break;
              }

              if(tiles[row][col] == tiles[row - 1][col]) {
                tiles[row][col] += tiles[row - 1][col];
                tiles[row - 1][col] = 0;
                flag |= true;
                shift(direction);
              }
            }
          } 
        }
        else if(direction == "L") {
          for(int row = 0; row < 4; row++) {
            for(int col = 0; col < 3; col++) {
              if(tiles[row][col] == 0) {
                break;
              }

              if(tiles[row][col] == tiles[row][col + 1]) {
                tiles[row][col] += tiles[row][col + 1];
                tiles[row][col + 1] = 0;
                flag |= true;
                shift(direction);
              }
            }
          }
        }
        else if(direction == "U") {
          for(int col = 0; col < 4; col++) {
            for(int row = 0; row < 3; row++) {
              if(tiles[row][col] == 0) {
                break;
              }

              if(tiles[row][col] == tiles[row + 1][col]) {
                tiles[row][col] += tiles[row + 1][col];
                tiles[row + 1][col] = 0;
                flag |= true;
                shift(direction);
              }
            }
          }
        }
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movq %rdi, %r13
leaq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x2160
movq %r13, %rdi
movq %r15, %rsi
callq 0x2b14
orb %al, 0x2a5f(%rip)       # 0x5102
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq 0x9a7(%rip), %rsi       # 0x305a
movq %rbx, %rdi
callq 0x2cdd
testb %al, %al
movq %rbx, -0x30(%rbp)
je 0x2738
xorl %r14d, %r14d
leaq -0xd0(%rbp), %r15
cmpq $0x4, %r14
je 0x28c8
movq %r14, %r12
shlq $0x4, %r12
addq %r13, %r12
pushq $0x3
popq %rax
movl %eax, %ebx
testl %ebx, %ebx
je 0x2733
movl %ebx, %ecx
movl (%r12,%rcx,4), %eax
testl %eax, %eax
je 0x2733
decl %ebx
cmpl (%r12,%rbx,4), %eax
jne 0x26e6
leaq (%r12,%rcx,4), %rcx
leaq (%r12,%rbx,4), %rdx
addl %eax, %eax
movl %eax, (%rcx)
andl $0x0, (%rdx)
movb $0x1, 0x29f0(%rip)      # 0x5102
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x2160
movq %r13, %rdi
movq %r15, %rsi
callq 0x2b14
movq %r15, %rdi
callq 0x20a0
jmp 0x26e6
incq %r14
jmp 0x26cd
leaq 0x91d(%rip), %rsi       # 0x305c
movq %rbx, %rdi
callq 0x2cdd
testb %al, %al
je 0x27ca
xorl %r12d, %r12d
leaq -0xb0(%rbp), %r15
cmpq $0x4, %r12
je 0x28c8
pushq $0x3
popq %rax
movl %eax, %r14d
testl %r14d, %r14d
je 0x27c5
movl %r14d, %eax
shlq $0x4, %rax
addq %r13, %rax
movl (%rax,%r12,4), %ecx
testl %ecx, %ecx
je 0x27c5
decl %r14d
movq %r14, %rdx
shlq $0x4, %rdx
addq %r13, %rdx
cmpl (%rdx,%r12,4), %ecx
jne 0x2765
leaq (%rax,%r12,4), %rax
leaq (%rdx,%r12,4), %rdx
addl %ecx, %ecx
movl %ecx, (%rax)
andl $0x0, (%rdx)
movb $0x1, 0x295d(%rip)      # 0x5102
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2160
movq %r13, %rdi
movq %r15, %rsi
callq 0x2b14
movq %r15, %rdi
callq 0x20a0
jmp 0x2765
incq %r12
jmp 0x2755
leaq 0x88d(%rip), %rsi       # 0x305e
movq %rbx, %rdi
callq 0x2cdd
testb %al, %al
je 0x284c
xorl %r12d, %r12d
leaq -0x90(%rbp), %r15
movq %r13, %r14
cmpq $0x4, %r12
je 0x28c8
pushq $0x1
popq %rbx
cmpq $0x4, %rbx
je 0x2843
movl -0x4(%r14,%rbx,4), %eax
testl %eax, %eax
je 0x2843
cmpl (%r14,%rbx,4), %eax
jne 0x283e
addl %eax, %eax
movl %eax, -0x4(%r14,%rbx,4)
andl $0x0, (%r14,%rbx,4)
movb $0x1, 0x28e3(%rip)      # 0x5102
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x2160
movq %r13, %rdi
movq %r15, %rsi
callq 0x2b14
movq %r15, %rdi
callq 0x20a0
incq %rbx
jmp 0x27f7
incq %r12
addq $0x10, %r14
jmp 0x27ea
leaq 0x80d(%rip), %rsi       # 0x3060
movq %rbx, %rdi
callq 0x2cdd
testb %al, %al
je 0x28c8
xorl %r12d, %r12d
leaq -0x70(%rbp), %r15
movq %r13, %r14
cmpq $0x4, %r12
je 0x28c8
pushq $0x10
popq %rbx
cmpq $0x40, %rbx
je 0x28bf
movl -0x10(%r14,%rbx), %eax
testl %eax, %eax
je 0x28bf
cmpl (%r14,%rbx), %eax
jne 0x28b9
addl %eax, %eax
movl %eax, -0x10(%r14,%rbx)
andl $0x0, (%r14,%rbx)
movb $0x1, 0x2868(%rip)      # 0x5102
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x2160
movq %r13, %rdi
movq %r15, %rsi
callq 0x2b14
movq %r15, %rdi
callq 0x20a0
addq $0x10, %rbx
jmp 0x2872
incq %r12
addq $0x4, %r14
jmp 0x2869
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28e2
jmp 0x28e2
jmp 0x28e2
jmp 0x28e2
movq %rax, %rbx
movq %r15, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x21b0
nop