user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xfffffc19,-0xc(%rbp)
  jmp    L143
L146:
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xc(%rbp),%eax
  cmp    $0x64,%eax
  jle    L155
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L143
L155:
  mov    -0xc(%rbp),%eax
  test   %eax,%eax
  jns    L9
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L143
L9:
  mov    -0xc(%rbp),%eax
  cmp    $0x59,%eax
  jle    L3
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L143
L3:
  mov    -0xc(%rbp),%eax
  cmp    $0x4f,%eax
  jle    L182
  mov    -0xc(%rbp),%eax
  cmp    $0x59,%eax
  jg     L182
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L143
L182:
  mov    -0xc(%rbp),%eax
  cmp    $0x45,%eax
  jle    L92
  mov    -0xc(%rbp),%eax
  cmp    $0x4f,%eax
  jg     L92
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L143
L92:
  mov    -0xc(%rbp),%eax
  cmp    $0x3b,%eax
  jle    L104
  mov    -0xc(%rbp),%eax
  cmp    $0x45,%eax
  jg     L104
  lea    D71(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L143
L104:
  mov    -0xc(%rbp),%eax
  cmp    $0x3b,%eax
  jg     L143
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L143:
  mov    -0xc(%rbp),%eax
  cmp    $0x64,%eax
  jg     L146
  mov    -0xc(%rbp),%eax
  test   %eax,%eax
  js     L146
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L158
  call   <__stack_chk_fail@plt>
L158:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D40
type: string
name: disassemble_data
arguments: data_label: D59
type: string
name: disassemble_data
arguments: data_label: D12
type: string
name: disassemble_data
arguments: data_label: D72
type: string
name: disassemble_data
arguments: data_label: D61
type: string
name: disassemble_data
arguments: data_label: D3
type: string
name: disassemble_data
arguments: data_label: D71
type: string
name: disassemble_data
arguments: data_label: D49
type: string

tool: D40: Please input the numerical grade. 


tool: D59: %d

tool: D12: Invalid grade; Please input a valid grade.


tool: D72: Letter grade is: A


tool: D61: Letter grade is: B


tool: D3: Letter grade is: C


tool: D71: Letter grade is: D


tool: D49: Letter grade is: F


assistant: ```c
int main() {
  int grade = -999;
  while (grade > 100 || grade < 0) {
    printf("Please input the numerical grade. \n");
    scanf("%d", &grade);
    if (grade > 100) {
      printf("Invalid grade; Please input a valid grade.\n");
    } else if (grade < 0) {
      printf("Invalid grade; Please input a valid grade.\n");
    } else if (grade > 89) {
      printf("Letter grade is: A\n");
    } else if (grade > 79 && grade < 90) {
      printf("Letter grade is: B\n");
    } else if (grade > 69 && grade < 80) {
      printf("Letter grade is: C\n");
    } else if (grade > 59 && grade < 70) {
      printf("Letter grade is: D\n");
    } else if (grade < 60) {
      printf("Letter grade is: F\n");
    }
  }
  return 0;
}
```