user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D91(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0xb30(%rbp),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L88
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L88:
  lea    D81(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0xb2c(%rbp),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L97
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L97:
  movl   $0x0,-0xb14(%rbp)
  jmp    L40
L2:
  mov    -0xb14(%rbp),%eax
  mov    %eax,%esi
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x650(%rbp),%rdx
  mov    -0xb14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    (%rdx,%rax,1),%rdi
  lea    -0x970(%rbp),%rdx
  mov    -0xb14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0xb00(%rbp),%rdx
  mov    -0xb14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rsi
  lea    -0xb18(%rbp),%rdx
  lea    -0xb1c(%rbp),%rax
  mov    %rdi,%r9
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x5,%eax
  je     L52
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L52:
  mov    -0xb1c(%rbp),%edx
  mov    -0xb18(%rbp),%eax
  imul   %eax,%edx
  mov    -0xb1c(%rbp),%eax
  add    %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D109(%rip),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0xb14(%rbp),%eax
  cltq
  movsd  %xmm0,-0x330(%rbp,%rax,8)
  addl   $0x1,-0xb14(%rbp)
L40:
  mov    -0xb2c(%rbp),%eax
  cmp    %eax,-0xb14(%rbp)
  jl     L2
L117:
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0xb38(%rbp),%rax
  mov    %rax,%rdi
  call   <get_stat@plt>
  test   %eax,%eax
  je     L48
  lea    -0xb34(%rbp),%rax
  mov    %rax,%rdi
  call   <get_stat@plt>
  test   %eax,%eax
  jne    L26
L48:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L26:
  mov    -0xb38(%rbp),%eax
  test   %eax,%eax
  jne    L87
  mov    -0xb34(%rbp),%eax
  test   %eax,%eax
  je     L21
L87:
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0xb14(%rbp)
  jmp    L104
L67:
  mov    -0xb34(%rbp),%edx
  mov    -0xb38(%rbp),%esi
  mov    -0xb14(%rbp),%eax
  cltq
  mov    -0xb00(%rbp,%rax,4),%eax
  lea    -0xb20(%rbp),%r8
  lea    -0xb24(%rbp),%rdi
  lea    -0xb28(%rbp),%rcx
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <attack_blows@plt>
  mov    -0xb24(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0xb14(%rbp),%eax
  cltq
  movsd  -0x330(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0xb10(%rbp)
  mov    -0xb30(%rbp),%ecx
  mov    -0xb14(%rbp),%eax
  cltq
  mov    -0x970(%rbp,%rax,8),%rdx
  mov    -0xb14(%rbp),%eax
  cltq
  mov    -0xb00(%rbp,%rax,4),%eax
  movsd  -0xb10(%rbp),%xmm0
  mov    %ecx,%esi
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <critical_blow@plt>
  movq   %xmm0,%rax
  mov    %rax,-0xb08(%rbp)
  mov    -0xb24(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0xb14(%rbp),%eax
  cltq
  movsd  -0x650(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0xb10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xb10(%rbp)
  mov    -0xb24(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0xb14(%rbp),%eax
  cltq
  movsd  -0x650(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0xb08(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xb08(%rbp)
  mov    -0xb20(%rbp),%edi
  mov    -0xb24(%rbp),%ecx
  mov    -0xb28(%rbp),%edx
  movsd  -0xb08(%rbp),%xmm0
  mov    -0xb10(%rbp),%rsi
  mov    -0xb14(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rsi,%xmm0
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  addl   $0x1,-0xb14(%rbp)
L104:
  mov    -0xb2c(%rbp),%eax
  cmp    %eax,-0xb14(%rbp)
  jl     L67
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L117
L21:
  nop
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L105
  call   <__stack_chk_fail@plt>
L105:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D91
type_infered: string
name: parse_data
arguments: label: D12
type_infered: string
name: parse_data
arguments: label: D81
type_infered: string
name: parse_data
arguments: label: D104
type_infered: string
name: parse_data
arguments: label: D27
type_infered: string
name: parse_data
arguments: label: D109
type_infered: f64
name: parse_data
arguments: label: D70
type_infered: string
name: parse_data
arguments: label: D46
type_infered: string
name: parse_data
arguments: label: D72
type_infered: string
name: parse_data
arguments: label: D42
type_infered: string

tool: D91: Enter level of your character: 

tool: D12:  %d

tool: D81: Enter number of weapons: 

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

tool: D27:  %d %dd%d %lf %lf

tool: D109: 2

tool: D70: Enter cstr, cdex: 

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

tool: D72:  w/ critical |

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