user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  lea    -0x1c(%rbp),%rax
  mov    %rax,%rdi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x663d81,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  imul   $0x281,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0xffffffff883fddf1,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  imul   $0x1e1,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x663d81,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  imul   $0x281,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0xffffffff883fddf1,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  imul   $0x1e1,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L33:
  mov    $0x0,%eax
  call   <_getch@plt>
  mov    %al,-0x1d(%rbp)
  movb   $0xe0,-0x1d(%rbp)
  cmpb   $0x48,-0x1d(%rbp)
  jne    L117
  subl   $0x1,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L117
  movl   $0x1e0,-0x14(%rbp)
L117:
  cmpb   $0x50,-0x1d(%rbp)
  jne    L93
  addl   $0x1,-0x14(%rbp)
  cmpl   $0x1e0,-0x14(%rbp)
  jle    L93
  movl   $0x0,-0x14(%rbp)
L93:
  cmpb   $0x4b,-0x1d(%rbp)
  jne    L31
  subl   $0x1,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jns    L31
  movl   $0x280,-0x18(%rbp)
L31:
  cmpb   $0x4d,-0x1d(%rbp)
  jne    L153
  addl   $0x1,-0x18(%rbp)
  cmpl   $0x280,-0x18(%rbp)
  jle    L153
  movl   $0x0,-0x18(%rbp)
L153:
  cmpb   $0x1b,-0x1d(%rbp)
  jne    L5
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x1e(%rbp),%rax
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movzbl -0x1e(%rbp),%eax
  cmp    $0x79,%al
  je     L126
  movzbl -0x1e(%rbp),%eax
  cmp    $0x59,%al
  jne    L5
L126:
  mov    $0x0,%edi
  call   <exit@plt>
L5:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x18(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L41
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jne    L41
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L86
L41:
  cmpb   $0x1b,-0x1d(%rbp)
  jne    L33
  mov    $0x0,%eax
L86:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L51
  call   <__stack_chk_fail@plt>
L51:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D16
data_type: string
name: unpack_data
arguments: tag: D57
data_type: string
name: unpack_data
arguments: tag: D55
data_type: string
name: unpack_data
arguments: tag: D14
data_type: string
name: unpack_data
arguments: tag: D15
data_type: string
name: unpack_data
arguments: tag: D11
data_type: string

tool: D16: your starting location (%d,%d)


tool: D57: Please user UP DOWN LEFT and RIGHT arrow keys to move around 

tool: D55: are you sure you want to exit ? (Y/N) 

tool: D14:  %c

tool: D15: your new location is (%d,%d) 


tool: D11: your level is up ! 

assistant: ```c
int main() {
  int ux = 0, uy = 0;
  int dx = 0, dy = 0;
  char c;
  char ans;
  time_t t;
  srand((unsigned)time(&t));
  ux = rand() % 641;
  uy = rand() % 481;
  dx = rand() % 641;
  dy = rand() % 481;
  printf("your starting location (%d,%d)\n", ux, uy);
  printf("Please user UP DOWN LEFT and RIGHT arrow keys to move around \n");
  do {
    c = _getch();
    if (c = -32) {
      if (c == 72) {
        uy--;
        if (uy < 0) {
          uy = 480;
        }
      }
      if (c == 80) {
        uy++;
        if (uy > 480) {
          uy = 0;
        }
      }
      if (c == 75) {
        ux--;
        if (ux < 0) {
          ux = 640;
        }
      }
      if (c == 77) {
        ux++;
        if (ux > 640) {
          ux = 0;
        }
      }
      if (c == 27) {
        printf("are you sure you want to exit ? (Y/N) ");
        scanf(" %c", &ans);
        if (ans == 'y' || ans == 'Y') {
          exit(0);
        }
      }
    }
    printf("your new location is (%d,%d) \n", ux, uy);
    if (ux == dx && uy == dy) {
      printf("your level is up ! \n");
      return 0;
    }
  } while (c != 27);
  return 0;
}
```