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

```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    D96(%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  D7(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x28(%rbp),%xmm2
  movsd  D34(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D158(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  -0x10(%rbp),%xmm0
  comisd D117(%rip),%xmm0
  jb     L19
  lea    D146(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L23
L19:
  movsd  -0x10(%rbp),%xmm0
  comisd D57(%rip),%xmm0
  jb     L57
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  lea    D178(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  -0x10(%rbp),%xmm0
  movsd  D94(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x18(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  comisd D57(%rip),%xmm0
  jbe    L2
  lea    D146(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L63
L2:
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L63:
  movsd  -0x18(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  D94(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L23
L57:
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L23:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L37
  call   <__stack_chk_fail@plt>
L37:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D96
type: string
name: disassemble_data
arguments: tag: D7
type: byte[8]
name: disassemble_data
arguments: tag: D34
type: byte[8]
name: disassemble_data
arguments: tag: D158
type: byte[8]
name: disassemble_data
arguments: tag: D114
type: string
name: disassemble_data
arguments: tag: D117
type: f64[2]
name: disassemble_data
arguments: tag: D146
type: string
name: disassemble_data
arguments: tag: D57
type: f64[2]
name: disassemble_data
arguments: tag: D36
type: string
name: disassemble_data
arguments: tag: D62
type: string
name: disassemble_data
arguments: tag: D178
type: string
name: disassemble_data
arguments: tag: D94
type: f64
name: disassemble_data
arguments: tag: D93
type: string
name: disassemble_data
arguments: tag: D27
type: string

tool: D96: %lf %lf %lf %lf

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

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

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

tool: D114: Media: %.1f


tool: {"D117": [7.0,5.0]}

tool: D146: Aluno aprovado.

tool: {"D57": [5.0,2.0]}

tool: D36: Aluno em exame.

tool: D62: %lf

tool: D178: Nota do exame: %.1f


tool: D94: 2

tool: D93: Aluno reprovado.

tool: D27: Media final: %.1f


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