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

```asm
<bodyswitch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x38(%rbp)
  movl   $0x3e8,-0x40(%rbp)
  lea    -0x40(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <nanosleep@plt>
  lea    -0x48(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x48(%rbp),%edx
  mov    -0x44(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,%edi
  call   <srand@plt>
  lea    -0x30(%rbp),%rax
  mov    $0x1e,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x30(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x30(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x7,%edx
  mov    %rax,%rdi
  call   <magicconsume@plt>
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  test   %eax,%eax
  js     L47
  movl   $0xffffffff,-0x50(%rbp)
L66:
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <getint@plt>
  mov    -0x50(%rbp),%eax
  test   %eax,%eax
  js     L66
  mov    -0x50(%rbp),%eax
  cmp    $0xb,%eax
  jg     L66
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L92
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  js     L104
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <shiftarray@plt>
  jmp    L69
L104:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x4bda12f7,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x4,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x4c(%rbp)
  mov    -0x4c(%rbp),%edx
  imul   $0x36,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x4c(%rbp)
L69:
  mov    -0x4c(%rbp),%edx
  lea    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <extendednameenemy@plt>
  lea    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x78(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x50(%rbp),%eax
  cmp    %eax,%edx
  jne    L87
  mov    -0x80(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0x88(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L87
L92:
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L87:
  cmpq   $0x0,-0x90(%rbp)
  je     L77
  mov    -0x90(%rbp),%rax
  movl   $0x2,(%rax)
  jmp    L77
L47:
  nop
L77:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L83
  call   <__stack_chk_fail@plt>
L83:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D1
type: string
name: unpack_data
arguments: tag: D10
type: string
name: unpack_data
arguments: tag: D2
type: string
name: unpack_data
arguments: tag: D3
type: string

tool: D1: StealingSpirit

tool: D10: What enemy you want to transmute?

tool: D2: The enemy is transmuted into a %s!


tool: D3: Nothing here...

assistant: ```c
void bodyswitch(int *aces, int *inv, int *future, int *map, int *pos, int *start, int *control, int *nomag) {
  struct timespec a;
  a.tv_sec = 0;
  a.tv_nsec = 1000;
  nanosleep(&a, NULL);
  struct timeval t1;
  gettimeofday(&t1, NULL);
  srand(t1.tv_usec * t1.tv_sec);
  char s[30];
  memset(s, 0, sizeof(s));
  sprintf(s, "StealingSpirit");
  int v = magicconsume(aces, inv, 7, s);
  if (v < 0)
    return;
  v = -1;
  do {
    printf("What enemy you want to transmute?\n");
    getint(&v);
  } while ((v < 0) || (v > 11));
  if (*(map + v) > 0) {
    int c;
    if (*future >= 0) {
      c = *future;
      shiftarray(future);
    } else
      c = rand() % 54;
    extendednameenemy(s, c);
    printf("The enemy is transmuted into a %s!\n", s);
    *(map + v) = c;
    if (v == *pos) {
      *start = 1;
      *control = 0;
    }
  } else
    printf("Nothing here...\n");
  if (nomag)
    *nomag = 2;
}
```