user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xb38(%rsp)
  xor    %eax,%eax
  lea    D19(%rip),%rdi
  call   <printf@plt>
  lea    0x24(%rsp),%rsi
  lea    D62(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x1,%eax
  jne    L11
L70:
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x28(%rsp),%rsi
  lea    D62(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x1,%eax
  jne    L85
L109:
  cmpl   $0x0,0x28(%rsp)
  jle    L161
  lea    0x40(%rsp),%rbp
  mov    $0x0,%ebx
  lea    D24(%rip),%r14
  lea    0x4f0(%rsp),%r13
  lea    D91(%rip),%r12
  jmp    L138
L11:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L70
L85:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L109
L57:
  mov    0x38(%rsp),%edx
  mov    %edx,%eax
  imul   0x3c(%rsp),%eax
  add    %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D85(%rip),%xmm0
  movsd  %xmm0,0x810(%rsp,%rbx,8)
  add    $0x1,%rbx
  add    $0x4,%rbp
  cmp    %ebx,0x28(%rsp)
  jle    L161
L138:
  mov    %ebx,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x0(,%rbx,8),%rax
  lea    0x3c(%rsp),%rcx
  lea    0x38(%rsp),%rdx
  lea    0x0(%r13,%rax,1),%r9
  lea    0x1d0(%rsp,%rax,1),%r8
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x5,%eax
  je     L57
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L57
L161:
  lea    D89(%rip),%r13
  lea    D26(%rip),%r14
  lea    D70(%rip),%r15
  lea    D48(%rip),%r12
  jmp    L78
L131:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L39:
  mov    0x1c(%rsp),%eax
  or     0x20(%rsp),%eax
  je     L59
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15,%rdi
  call   <puts@plt>
  cmpl   $0x0,0x28(%rsp)
  jle    L62
  mov    $0x0,%ebx
L110:
  lea    0x2c(%rsp),%rcx
  lea    0x40(%rsp),%rbp
  mov    0x0(%rbp,%rbx,4),%edi
  lea    0x34(%rsp),%r9
  lea    0x30(%rsp),%r8
  mov    0x20(%rsp),%edx
  mov    0x1c(%rsp),%esi
  call   <attack_blows@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x30(%rsp),%xmm0
  mulsd  0x810(%rsp,%rbx,8),%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  %xmm1,0x8(%rsp)
  movsd  0x1d0(%rsp,%rbx,8),%xmm0
  mov    0x0(%rbp,%rbx,4),%edi
  mov    0x24(%rsp),%esi
  call   <critical_blow@plt>
  movapd %xmm0,%xmm2
  mov    0x30(%rsp),%ecx
  pxor   %xmm1,%xmm1
  cvtsi2sd %ecx,%xmm1
  mulsd  0x4f0(%rsp,%rbx,8),%xmm1
  movsd  0x8(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm1
  mov    0x34(%rsp),%r8d
  mov    0x2c(%rsp),%edx
  mov    %ebx,%esi
  mov    %r12,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %ebx,0x28(%rsp)
  jg     L110
L62:
  mov    $0xa,%edi
  call   <putchar@plt>
L78:
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x1c(%rsp),%rdi
  call   <get_stat@plt>
  test   %eax,%eax
  je     L131
  lea    0x20(%rsp),%rdi
  call   <get_stat@plt>
  test   %eax,%eax
  jne    L39
  jmp    L131
L59:
  mov    0xb38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L163
  mov    $0x0,%eax
  add    $0xb48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L163:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D19
type_guessed: string
name: retrieve_data
arguments: data_label: D62
type_guessed: string
name: retrieve_data
arguments: data_label: D9
type_guessed: string
name: retrieve_data
arguments: data_label: D24
type_guessed: string
name: retrieve_data
arguments: data_label: D91
type_guessed: string
name: retrieve_data
arguments: data_label: D85
type_guessed: byte[8]
name: retrieve_data
arguments: data_label: D89
type_guessed: string
name: retrieve_data
arguments: data_label: D26
type_guessed: string
name: retrieve_data
arguments: data_label: D70
type_guessed: string
name: retrieve_data
arguments: data_label: D48
type_guessed: string

tool: D19: Enter level of your character: 

tool: D62:  %d

tool: D9: Enter number of weapons: 

tool: D24: Enter weight, weapon_dam, to_hit, to_dam for weapon #%d: 

tool: D91:  %d %dd%d %lf %lf

tool: {"D85": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D89: Enter cstr, cdex: 

tool: D26:   Weapon | Max blows | Blows | weight ratio | hp of dam |

tool: D70:  w/ critical |

tool: D48:   %4d   | %6d    | %4d  | %8d     | %6g    |  %7g    |


assistant: ```c
int main() {
  int cstr, cdex, player_level;
  int weight[100];
  double to_hit[100], to_dam[100], weapon_dam[100];
  int num_weapons, i;
  int max_blows, real_blows;
  int adj_weight;
  double avg_dam, critical;
  int num_die, die_sides;
  printf("Enter level of your character: ");
  if (1 != scanf(" %d", &player_level)) {
    putchar('\n');
    exit(1);
  }
  printf("Enter number of weapons: ");
  if (1 != scanf(" %d", &num_weapons)) {
    putchar('\n');
    exit(1);
  }
  for (i = 0; i < num_weapons; i++) {
    printf("Enter weight, weapon_dam, to_hit, to_dam for weapon #%d: ", i);
    if (5 != scanf(" %d %dd%d %lf %lf", &weight[i], &num_die, &die_sides, &to_hit[i], &to_dam[i])) {
      putchar('\n');
      exit(1);
    }
    weapon_dam[i] = (num_die * die_sides + num_die) / 2.;
  }
  while (1) {
    printf("Enter cstr, cdex: ");
    if (!get_stat(&cstr) || !get_stat(&cdex)) {
      putchar('\n');
      exit(1);
    }
    if (cstr == 0 && cdex == 0)
      break;
    printf("  Weapon | Max blows | Blows | weight ratio | hp of dam |");
    printf(" w/ critical |\n");
    for (i = 0; i < num_weapons; i++) {
      attack_blows(weight[i], cstr, cdex, &max_blows, &real_blows, &adj_weight);
      avg_dam = (int)(real_blows * weapon_dam[i]);
      critical = critical_blow(weight[i], to_hit[i], avg_dam, player_level);
      avg_dam += (int)real_blows * to_dam[i];
      critical += (int)real_blows * to_dam[i];
      printf("  %4d   | %6d    | %4d  | %8d     | %6g    |  %7g    |\n", i, max_blows, real_blows, adj_weight, avg_dam, critical);
    }
    printf("\n");
  }
  return (0);
}
```