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

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <rand@plt>
  movslq %eax,%rbp
  cltd
  imul   $0x663d81,%rbp,%rbp
  shr    $0x20,%rbp
  sub    %edx,%ebp
  imul   $0x281,%ebp,%edx
  sub    %edx,%eax
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <rand@plt>
  movslq %eax,%rbx
  cltd
  imul   $0xffffffff883fddf1,%rbx,%rbx
  shr    $0x20,%rbx
  add    %eax,%ebx
  sar    $0x8,%ebx
  sub    %edx,%ebx
  imul   $0x1e1,%ebx,%edx
  sub    %edx,%eax
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <rand@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <rand@plt>
  mov    %ebx,%edx
  mov    %ebp,%esi
  lea    D36(%rip),%rdi
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <printf@plt>
  lea    D13(%rip),%rdi
  call   <puts@plt>
  movslq %r12d,%rax
  mov    %r12d,%edx
  imul   $0x663d81,%rax,%rax
  sar    $0x1f,%edx
  shr    $0x20,%rax
  sub    %edx,%eax
  mov    %r13d,%edx
  imul   $0x281,%eax,%eax
  sub    %eax,%r12d
  movslq %r13d,%rax
  cmp    %ebp,%r12d
  sete   %r12b
  imul   $0xffffffff883fddf1,%rax,%rax
  sar    $0x1f,%edx
  shr    $0x20,%rax
  add    %r13d,%eax
  sar    $0x8,%eax
  sub    %edx,%eax
  imul   $0x1e1,%eax,%eax
  sub    %eax,%r13d
  cmp    %ebx,%r13d
  lea    D3(%rip),%r13
  sete   %al
  and    %eax,%r12d
  nopl   (%rax)
L1:
  xor    %eax,%eax
  call   <_getch@plt>
  xor    %eax,%eax
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <printf@plt>
  test   %r12b,%r12b
  je     L1
  lea    D8(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D36
type: string
name: read_data
arguments: label: D13
type: string
name: read_data
arguments: label: D3
type: string
name: read_data
arguments: label: D8
type: string

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


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

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


tool: D8: 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;
}
```