user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r15
  lea    D77(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D2(%rip),%rbp
  push   %rbx
  sub    $0xb68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xb58(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  lea    0x44(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L108
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L108:
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  lea    0x48(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L61
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L61:
  mov    0x48(%rsp),%edx
  test   %edx,%edx
  jle    L93
  lea    0x510(%rsp),%rax
  lea    0x60(%rsp),%rbx
  xor    %r14d,%r14d
  mov    %rax,0x8(%rsp)
  lea    0x5c(%rsp),%r13
  lea    0x58(%rsp),%r12
  lea    0x1f0(%rsp),%rax
  lea    D71(%rip),%r15
  mov    %rax,0x18(%rsp)
  lea    0x830(%rsp),%rax
  lea    D79(%rip),%rbp
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L70:
  mov    %r14d,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%rdx
  mov    %r13,%rcx
  mov    %rbx,%rsi
  lea    0x0(,%r14,8),%rax
  mov    %rbp,%rdi
  lea    (%rdx,%rax,1),%r9
  mov    0x18(%rsp),%rdx
  lea    (%rdx,%rax,1),%r8
  xor    %eax,%eax
  mov    %r12,%rdx
  call   <scanf@plt>
  cmp    $0x5,%eax
  je     L72
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L72:
  mov    0x58(%rsp),%edx
  mov    0x5c(%rsp),%eax
  pxor   %xmm0,%xmm0
  add    $0x4,%rbx
  imul   %edx,%eax
  add    %edx,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  D29(%rip),%xmm0
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rax,%r14,8)
  add    $0x1,%r14
  cmp    %r14d,0x48(%rsp)
  jg     L70
L93:
  lea    0x3c(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x40(%rsp),%rax
  mov    %rax,0x28(%rsp)
  nopw   0x0(%rax,%rax,1)
L29:
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x20(%rsp),%rdi
  call   <get_stat@plt>
  test   %eax,%eax
  je     L54
  mov    0x28(%rsp),%rdi
  call   <get_stat@plt>
  test   %eax,%eax
  jne    L21
L54:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L21:
  mov    0x3c(%rsp),%eax
  or     0x40(%rsp),%eax
  je     L90
  lea    D95(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D68(%rip),%rdi
  call   <puts@plt>
  mov    0x48(%rsp),%eax
  test   %eax,%eax
  jle    L103
  lea    0x510(%rsp),%rax
  lea    0x1f0(%rsp),%r13
  xor    %r14d,%r14d
  mov    %rax,0x18(%rsp)
  lea    0x60(%rsp),%r12
  lea    0x54(%rsp),%r15
  lea    0x830(%rsp),%rax
  lea    0x50(%rsp),%rbp
  lea    0x4c(%rsp),%rbx
  mov    %rax,0x10(%rsp)
  mov    %r13,%rax
  mov    %r12,%r13
  mov    %rbp,%r12
  mov    %rbx,%rbp
  mov    %r15,%rbx
  mov    %rax,%r15
  nopl   (%rax)
L74:
  mov    0x0(%r13,%r14,4),%edi
  mov    0x40(%rsp),%edx
  mov    %rbx,%r9
  mov    %r12,%r8
  mov    0x3c(%rsp),%esi
  mov    %rbp,%rcx
  call   <attack_blows@plt>
  mov    0x10(%rsp),%rax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x50(%rsp),%xmm0
  mov    0x0(%r13,%r14,4),%edi
  mov    0x44(%rsp),%esi
  mulsd  (%rax,%r14,8),%xmm0
  cvttsd2si %xmm0,%eax
  movsd  (%r15,%r14,8),%xmm0
  cvtsi2sd %eax,%xmm1
  movsd  %xmm1,0x8(%rsp)
  call   <critical_blow@plt>
  mov    0x50(%rsp),%ecx
  pxor   %xmm2,%xmm2
  mov    %r14d,%esi
  mov    0x18(%rsp),%rax
  movsd  0x8(%rsp),%xmm1
  movapd %xmm0,%xmm3
  lea    D86(%rip),%rdi
  cvtsi2sd %ecx,%xmm2
  mov    0x54(%rsp),%r8d
  mov    0x4c(%rsp),%edx
  mulsd  (%rax,%r14,8),%xmm2
  mov    $0x2,%eax
  add    $0x1,%r14
  addsd  %xmm2,%xmm1
  addsd  %xmm3,%xmm2
  movapd %xmm1,%xmm0
  movapd %xmm2,%xmm1
  call   <printf@plt>
  cmp    %r14d,0x48(%rsp)
  jg     L74
L103:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L29
  nopw   0x0(%rax,%rax,1)
L90:
  mov    0xb58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L116
  add    $0xb68,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L116:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D77
type_guessed: string
name: parse_data
arguments: data_tag: D2
type_guessed: string
name: parse_data
arguments: data_tag: D0
type_guessed: string
name: parse_data
arguments: data_tag: D71
type_guessed: string
name: parse_data
arguments: data_tag: D79
type_guessed: string
name: parse_data
arguments: data_tag: D29
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D67
type_guessed: string
name: parse_data
arguments: data_tag: D95
type_guessed: string
name: parse_data
arguments: data_tag: D68
type_guessed: string
name: parse_data
arguments: data_tag: D86
type_guessed: string

tool: D77: Enter level of your character: 

tool: D2:  %d

tool: D0: Enter number of weapons: 

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

tool: D79:  %d %dd%d %lf %lf

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

tool: D67: Enter cstr, cdex: 

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

tool: D68:  w/ critical |

tool: D86:   %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);
}
```