user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x18(%rbp),%rsi
  lea    -0x20(%rbp),%rcx
  lea    -0x28(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movsd  -0x10(%rbp),%xmm0
  movsd  -0x30(%rbp),%xmm1
  comisd %xmm1,%xmm0
  jb     L23
  lea    D86(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L14
L23:
  movsd  -0x10(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  comisd %xmm1,%xmm0
  jb     L77
  lea    D84(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L14
L77:
  movsd  -0x10(%rbp),%xmm0
  movsd  -0x20(%rbp),%xmm1
  comisd %xmm1,%xmm0
  jb     L71
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L14
L71:
  movsd  -0x10(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  comisd %xmm1,%xmm0
  jb     L52
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L14
L52:
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L14:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L72
  call   <__stack_chk_fail@plt>
L72:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D59
type_infered: string
name: retrieve_data
arguments: data_tag: D64
type_infered: string
name: retrieve_data
arguments: data_tag: D79
type_infered: string
name: retrieve_data
arguments: data_tag: D83
type_infered: string
name: retrieve_data
arguments: data_tag: D44
type_infered: string
name: retrieve_data
arguments: data_tag: D86
type_infered: string
name: retrieve_data
arguments: data_tag: D84
type_infered: string
name: retrieve_data
arguments: data_tag: D70
type_infered: string
name: retrieve_data
arguments: data_tag: D4
type_infered: string
name: retrieve_data
arguments: data_tag: D40
type_infered: string

tool: D59: Enter thresholds for A, B, C, D


tool: D64: in that order, decreasing percentages > 

tool: D79: %lf %lf %lf %lf

tool: D83: Thank you. Now enter student score (percent) >

tool: D44: %lf

tool: D86: Student has an A grade


tool: D84: Student has an B grade


tool: D70: Student has an C grade


tool: D4: Student has an D grade


tool: D40: Student has failed the course


assistant: ```c
int main() {
  double aval, bval, cval, dval, score;
  printf("Enter thresholds for A, B, C, D\n");
  printf("in that order, decreasing percentages > ");
  scanf("%lf %lf %lf %lf", &aval, &bval, &cval, &dval);
  printf("Thank you. Now enter student score (percent) >");
  scanf("%lf", &score);
  if (score >= aval)
    printf("Student has an A grade\n");
  else if (score >= bval)
    printf("Student has an B grade\n");
  else if (score >= cval)
    printf("Student has an C grade\n");
  else if (score >= dval)
    printf("Student has an D grade\n");
  else
    printf("Student has failed the course\n");
  return 0;
}
```