user: What is the c source code of the assembly code below?

```asm
<movement>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %rcx,%r12
  mov    %r8,%rbx
  mov    %r9,0x18(%rsp)
  mov    0x70(%rsp),%r13
  mov    0x78(%rsp),%r15
  mov    0x80(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0xfffffffe,0x24(%rsp)
  cmpl   $0x1,0x88(%rsp)
  jne    L346
  lea    D51(%rip),%rbp
L276:
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    0x24(%rsp),%eax
  lea    0x1(%rax),%edx
  cmp    $0xc,%edx
  ja     L276
  test   %eax,%eax
  js     L103
  mov    %eax,(%rbx)
  movl   $0x1,0x0(%r13)
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L145
  movl   $0x1,(%rax)
L145:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L213
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  mov    0x18(%rsp),%rax
  addl   $0x1,(%rax)
  movl   $0x0,(%r15)
  movl   $0x0,(%r14)
  mov    %r12,%rcx
  mov    0x10(%rsp),%rdx
  mov    (%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <genmap@plt>
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L193
  movl   $0x1,(%rax)
L193:
  movl   $0x1,0x0(%r13)
  jmp    L145
L346:
  lea    D78(%rip),%rdi
  call   <printf@plt>
  cmpl   $0x3,(%rbx)
  jg     L297
L333:
  testb  $0x3,(%rbx)
  jne    L54
L296:
  mov    (%rbx),%eax
  cltd
  shr    $0x1e,%edx
  add    %edx,%eax
  and    $0x3,%eax
  sub    %edx,%eax
  cmp    $0x3,%eax
  jne    L233
L80:
  cmpl   $0x7,(%rbx)
  jle    L205
L271:
  movslq (%rbx),%rax
  mov    (%rsp),%rsi
  cmpl   $0xffffffff,(%rsi,%rax,4)
  je     L221
L252:
  lea    0x24(%rsp),%rdi
  call   <getint@plt>
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  je     L145
  cmp    $0x1,%eax
  je     L243
  cmp    $0x4,%eax
  je     L234
  cmp    $0x6,%eax
  je     L48
  cmp    $0x8,%eax
  je     L282
  cmp    $0xffffffff,%eax
  jne    L204
  movslq (%rbx),%rax
  mov    (%rsp),%rcx
  cmpl   $0xffffffff,(%rcx,%rax,4)
  je     L83
L204:
  lea    D59(%rip),%rdi
  call   <printf@plt>
  jmp    L145
L297:
  lea    D28(%rip),%rdi
  call   <printf@plt>
  jmp    L333
L54:
  lea    D46(%rip),%rdi
  call   <printf@plt>
  jmp    L296
L233:
  lea    D41(%rip),%rdi
  call   <printf@plt>
  jmp    L80
L205:
  lea    D67(%rip),%rdi
  call   <printf@plt>
  jmp    L271
L221:
  lea    D73(%rip),%rdi
  call   <printf@plt>
  jmp    L252
L243:
  subl   $0x4,(%rbx)
  movl   $0x1,0x0(%r13)
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L145
  movl   $0x1,(%rax)
  jmp    L145
L234:
  mov    (%rbx),%eax
  test   $0x3,%al
  je     L204
  sub    $0x1,%eax
  mov    %eax,(%rbx)
  movl   $0x1,0x0(%r13)
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L145
  movl   $0x1,(%rax)
  jmp    L145
L48:
  mov    (%rbx),%ecx
  mov    %ecx,%edx
  sar    $0x1f,%edx
  shr    $0x1e,%edx
  lea    (%rcx,%rdx,1),%eax
  and    $0x3,%eax
  sub    %edx,%eax
  cmp    $0x3,%eax
  je     L204
  add    $0x1,%ecx
  mov    %ecx,(%rbx)
  movl   $0x1,0x0(%r13)
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L145
  movl   $0x1,(%rax)
  jmp    L145
L282:
  mov    (%rbx),%eax
  cmp    $0x7,%eax
  jg     L204
  add    $0x4,%eax
  mov    %eax,(%rbx)
  movl   $0x1,0x0(%r13)
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L145
  movl   $0x1,(%rax)
  jmp    L145
L83:
  mov    0x18(%rsp),%rax
  addl   $0x1,(%rax)
  movl   $0x0,(%r15)
  movl   $0x0,(%r14)
  mov    %r12,%rcx
  mov    0x10(%rsp),%rdx
  mov    (%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <genmap@plt>
  movl   $0x1,0x0(%r13)
  movslq (%rbx),%rax
  lea    (%r12,%rax,4),%rax
  cmpl   $0x0,(%rax)
  jne    L145
  movl   $0x1,(%rax)
  jmp    L145
L213:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D51
type: string
name: unpack_data
arguments: tag: D78
type: string
name: unpack_data
arguments: tag: D59
type: string
name: unpack_data
arguments: tag: D28
type: string
name: unpack_data
arguments: tag: D46
type: string
name: unpack_data
arguments: tag: D41
type: string
name: unpack_data
arguments: tag: D67
type: string
name: unpack_data
arguments: tag: D73
type: string

tool: D51: Where do you want to teleport?


tool: D78: Where do you want to go?
[0]: Nowhere


tool: D59: That's not an available direction!


tool: D28: [1]: North


tool: D46: [4]: West


tool: D41: [6]: East


tool: D67: [8]: South


tool: D73: [-1]: Down


assistant: ```c
void movement(int *future, int *map, int *loot, int *vision, int *pos, int *floor, int *start, int *antimag, int *checkcurse, int free) {
  int e = -2;
  if (free == 1) {
    do {
      printf("Where do you want to teleport?\n");
    } while ((e < -1) || (e > 11));
    if (e >= 0) {
      *pos = e;
      *start = 1;
      if (*(vision + *pos) == 0)
        *(vision + *pos) = 1;
      return;
    } else {
      *floor = *floor + 1;
      *antimag = 0;
      *checkcurse = 0;
      genmap(future, map, loot, vision);
      if (*(vision + *pos) == 0)
        *(vision + *pos) = 1;
      *start = 1;
      return;
    }
  }
  printf("Where do you want to go?\n[0]: Nowhere\n");
  if (*pos - 4 >= 0) {
    printf("[1]: North\n");
  }
  if (*pos % 4) {
    printf("[4]: West\n");
  }
  if (*pos % 4 != 3) {
    printf("[6]: East\n");
  }
  if (*pos + 4 < 12) {
    printf("[8]: South\n");
  }
  if (*(map + *pos) == -1) {
    printf("[-1]: Down\n");
  }
  getint(&e);
  if (e == 0)
    return;
  if ((e == 1) && (pos - 4 >= 0)) {
    *pos = *pos - 4;
    *start = 1;
    if (*(vision + *pos) == 0)
      *(vision + *pos) = 1;
    return;
  }
  if ((e == 4) && (*pos % 4)) {
    *pos = *pos - 1;
    *start = 1;
    if (*(vision + *pos) == 0)
      *(vision + *pos) = 1;
    return;
  }
  if ((e == 6) && (*(pos) % 4 != 3)) {
    *pos = *pos + 1;
    *start = 1;
    if (*(vision + *pos) == 0)
      *(vision + *pos) = 1;
    return;
  }
  if ((e == 8) && (*pos + 4 < 12)) {
    *pos = *pos + 4;
    *start = 1;
    if (*(vision + *pos) == 0)
      *(vision + *pos) = 1;
    return;
  }
  if ((e == -1) && (*(map + *pos) == -1)) {
    *floor = *floor + 1;
    *antimag = 0;
    *checkcurse = 0;
    genmap(future, map, loot, vision);
    *start = 1;
    if (*(vision + *pos) == 0)
      *(vision + *pos) = 1;
    return;
  }
  printf("That's not an available direction!\n");
}
```