user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  xor    %r15d,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    $0x4,%edi
  mov    %rax,%rbx
  call   <malloc@plt>
  movl   $0x5,(%rbx)
  mov    $0x4,%edi
  movl   $0x5,(%rax)
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    $0x4,%edi
  mov    %rax,%r12
  call   <malloc@plt>
  mov    %rax,%r13
  xor    %eax,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x2e8ba2e9,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x21,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  lea    (%rdx,%rcx,2),%edx
  sub    %edx,%eax
  mov    %eax,(%r12)
  xor    %eax,%eax
  call   <rand@plt>
  mov    $0x1,%edi
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x2e8ba2e9,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x21,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  lea    (%rdx,%rcx,2),%edx
  sub    %edx,%eax
  mov    %eax,0x0(%r13)
  call   <malloc@plt>
  lea    D15(%rip),%rdi
  mov    %rax,%r14
  call   <puts@plt>
  jmp    L30
  nopl   0x0(%rax)
L11:
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm1
  mov    $0x1,%eax
  lea    D143(%rip),%rdi
  movapd %xmm1,%xmm0
  call   <printf@plt>
  mov    (%rbx),%esi
  lea    D35(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x0(%rbp),%esi
  lea    D146(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%r12),%esi
  lea    D158(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x0(%r13),%esi
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D36(%rip),%rdi
  call   <puts@plt>
L42:
  mov    $0xa,%edi
  add    $0x1,%r15d
  call   <putchar@plt>
L30:
  mov    (%r12),%eax
  cmp    %eax,(%rbx)
  jne    L29
  mov    0x0(%r13),%eax
  cmp    %eax,0x0(%rbp)
  je     L20
L29:
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <calculateDistance@plt>
  lea    D98(%rip),%rdi
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r14,%rsi
  lea    D120(%rip),%rdi
  call   <scanf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  movsbl (%r14),%edi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  call   <moveChar@plt>
  mov    %r12,%rdi
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  mov    %r13,%rsi
  call   <calculateDistance@plt>
  movsd  0x8(%rsp),%xmm2
  mov    $0x1,%eax
  lea    D154(%rip),%rdi
  movapd %xmm0,%xmm1
  movsd  %xmm0,0x8(%rsp)
  comisd %xmm1,%xmm2
  movapd %xmm2,%xmm0
  jae    L11
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm1
  mov    $0x1,%eax
  lea    D143(%rip),%rdi
  movapd %xmm1,%xmm0
  call   <printf@plt>
  mov    (%rbx),%esi
  lea    D35(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x0(%rbp),%esi
  lea    D146(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%r12),%esi
  lea    D158(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x0(%r13),%esi
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D166(%rip),%rdi
  call   <puts@plt>
  jmp    L42
  nopw   0x0(%rax,%rax,1)
L20:
  lea    D43(%rip),%rdi
  call   <puts@plt>
  mov    %r15d,%esi
  lea    D26(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D15
type_infered: string
name: retrieve_data
arguments: data_label: D143
type_infered: string
name: retrieve_data
arguments: data_label: D35
type_infered: string
name: retrieve_data
arguments: data_label: D146
type_infered: string
name: retrieve_data
arguments: data_label: D158
type_infered: string
name: retrieve_data
arguments: data_label: D85
type_infered: string
name: retrieve_data
arguments: data_label: D36
type_infered: string
name: retrieve_data
arguments: data_label: D98
type_infered: string
name: retrieve_data
arguments: data_label: D120
type_infered: string
name: retrieve_data
arguments: data_label: D154
type_infered: string
name: retrieve_data
arguments: data_label: D166
type_infered: string
name: retrieve_data
arguments: data_label: D43
type_infered: string
name: retrieve_data
arguments: data_label: D26
type_infered: string

tool: D15: Welcome to the maze game! Your starting location is (5,5), try to find the pot of gold that is randomly placed within this 10 x 10 board!

tool: D143: new dist: %g


tool: D35: CharX: %d


tool: D146: CharY: %d


tool: D158: goldX: %d


tool: D85: goldY: %d


tool: D36: Getting warmer!

tool: D98: Please enter a direction (n, s, w, e - case-sensitive): 

tool: D120:  %c

tool: D154: Old dist: %g


tool: D166: Getting colder!

tool: D43: Hooray! you found the pot of gold!

tool: D26: moves used: %d


assistant: ```c
int main() {
  srand(time(NULL));
  int *charX, *charY;
  charX = (int *)malloc(sizeof(int));
  charY = (int *)malloc(sizeof(int));
  *charX = 5;
  *charY = 5;
  int *goldX, *goldY;
  goldX = (int *)malloc(sizeof(int));
  goldY = (int *)malloc(sizeof(int));
  *goldX = rand() % 11;
  *goldY = rand() % 11;
  char *dir;
  dir = (char *)malloc(sizeof(char));
  int n = 0;
  double oldDist, newDist;
  printf("Welcome to the maze game! Your starting location is (5,5), try to find the pot of gold that is randomly placed within this 10 x 10 board!\n");
  while ((*charX != *goldX) || (*charY != *goldY)) {
    oldDist = calculateDistance(goldX, goldY, charX, charY);
    printf("Please enter a direction (n, s, w, e - case-sensitive): ");
    scanf(" %c", dir);
    printf("\n");
    moveChar(*dir, charX, charY);
    newDist = calculateDistance(goldX, goldY, charX, charY);
    if (oldDist >= newDist) {
      printf("Old dist: %g\n", oldDist);
      printf("new dist: %g\n", newDist);
      printf("CharX: %d\n", *charX);
      printf("CharY: %d\n", *charY);
      printf("goldX: %d\n", *goldX);
      printf("goldY: %d\n", *goldY);
      printf("Getting warmer!\n");
    } else {
      printf("Old dist: %g\n", oldDist);
      printf("new dist: %g\n", newDist);
      printf("CharX: %d\n", *charX);
      printf("CharY: %d\n", *charY);
      printf("goldX: %d\n", *goldX);
      printf("goldY: %d\n", *goldY);
      printf("Getting colder!\n");
    }
    printf("\n");
    n++;
  }
  printf("Hooray! you found the pot of gold!\n");
  printf("moves used: %d\n", n);
}
```