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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rsi
  lea    -0x28(%rbp),%rcx
  lea    -0x30(%rbp),%rdx
  lea    -0x38(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D124(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  -0x30(%rbp),%xmm2
  movsd  D62(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x28(%rbp),%xmm2
  movsd  D103(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  D57(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  D129(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L8
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L48
L8:
  movsd  -0x10(%rbp),%xmm0
  comisd D17(%rip),%xmm0
  jb     L38
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L48
L38:
  lea    D80(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D122(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  -0x18(%rbp),%xmm1
  movsd  D57(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  -0x10(%rbp),%xmm0
  comisd D144(%rip),%xmm0
  jb     L46
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L22
L46:
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L22:
  movsd  -0x18(%rbp),%xmm1
  movsd  D57(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  D144(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L48:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D124
type_infered: string
name: retrieve_data
arguments: label: D62
type_infered: byte[8]
name: retrieve_data
arguments: label: D103
type_infered: byte[8]
name: retrieve_data
arguments: label: D57
type_infered: byte[8]
name: retrieve_data
arguments: label: D25
type_infered: string
name: retrieve_data
arguments: label: D129
type_infered: byte[8]
name: retrieve_data
arguments: label: D38
type_infered: string
name: retrieve_data
arguments: label: D17
type_infered: byte[16]
name: retrieve_data
arguments: label: D76
type_infered: string
name: retrieve_data
arguments: label: D80
type_infered: string
name: retrieve_data
arguments: label: D122
type_infered: string
name: retrieve_data
arguments: label: D6
type_infered: string
name: retrieve_data
arguments: label: D144
type_infered: f64
name: retrieve_data
arguments: label: D31
type_infered: string

tool: D124: %lf %lf %lf %lf

tool: {"D62": [0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x40]}

tool: {"D103": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: {"D57": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: D25: Media: %.1lf


tool: {"D129": [0x00,0x00,0x00,0x00,0x00,0x00,0x49,0x40]}

tool: D38: Aluno reprovado.

tool: {"D17": [0x00,0x00,0x00,0x00,0x00,0x80,0x51,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x40]}

tool: D76: Aluno aprovado.

tool: D80: Aluno em exame.

tool: D122: %lf

tool: D6: Nota do exame: %.1lf


tool: D144: 20

tool: D31: Media final: %.1lf


assistant: ```c
int main() {
  double a, b, c, d, e, f;
  scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
  f = 2 * a + 3 * b + 4 * c + d;
  printf("Media: %.1lf\n", f / 10);
  if (f < 50) {
    printf("Aluno reprovado.\n");
    return 0;
  }
  if (f >= 70) {
    printf("Aluno aprovado.\n");
    return 0;
  }
  printf("Aluno em exame.\n");
  scanf("%lf", &e);
  printf("Nota do exame: %.1lf\n", e);
  if (f + 10 * e >= 20.0)
    printf("Aluno aprovado.\n");
  else
    printf("Aluno reprovado.\n");
  printf("Media final: %.1lf\n", (f + 10 * e) / 20);
  return 0;
}
```