user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<bodyswitch>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rbp
  mov    %rdx,%r13
  mov    %rcx,%rbx
  mov    %r8,0x10(%rsp)
  mov    %r9,0x18(%rsp)
  mov    0xb0(%rsp),%r15
  mov    0xb8(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x38(%rsp)
  movl   $0x3e8,0x30(%rsp)
  lea    0x30(%rsp),%rdi
  mov    $0x0,%esi
  call   <nanosleep@plt>
  lea    0x28(%rsp),%rdi
  mov    $0x0,%esi
  call   <gettimeofday@plt>
  mov    0x28(%rsp),%edi
  imul   0x2c(%rsp),%edi
  call   <srand@plt>
  lea    0x40(%rsp),%r12
  mov    $0x1e,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  lea    D39(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rcx
  mov    $0x7,%edx
  mov    %rbp,%rsi
  mov    0x8(%rsp),%rdi
  call   <magicconsume@plt>
  test   %eax,%eax
  js     L70
  movl   $0xffffffff,0x24(%rsp)
  lea    D38(%rip),%rbp
L52:
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    0x24(%rsp),%rdi
  call   <getint@plt>
  mov    0x24(%rsp),%eax
  cmp    $0xb,%eax
  ja     L52
  cltq
  cmpl   $0x0,(%rbx,%rax,4)
  jle    L65
  mov    0x0(%r13),%ebp
  test   %ebp,%ebp
  js     L27
  mov    %r13,%rdi
  call   <shiftarray@plt>
L3:
  lea    0x40(%rsp),%r12
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <extendednameenemy@plt>
  mov    %r12,%rsi
  lea    D13(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x24(%rsp),%eax
  movslq %eax,%rdx
  mov    %ebp,(%rbx,%rdx,4)
  mov    0x10(%rsp),%rbx
  cmp    (%rbx),%eax
  je     L8
L88:
  test   %r14,%r14
  je     L70
  movl   $0x2,(%r14)
L70:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L64
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L27:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rbp
  imul   $0x4bda12f7,%rbp,%rbp
  sar    $0x24,%rbp
  cltd
  sub    %edx,%ebp
  imul   $0x36,%ebp,%edx
  sub    %edx,%eax
  mov    %eax,%ebp
  jmp    L3
L8:
  mov    0x18(%rsp),%rax
  movl   $0x1,(%rax)
  movl   $0x0,(%r15)
  jmp    L88
L65:
  lea    D7(%rip),%rdi
  call   <puts@plt>
  jmp    L88
L64:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D39
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D38
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D13
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D7
type_guessed: string

tool: D39: StealingSpirit

tool: D38: What enemy you want to transmute?

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


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