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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jle    L91
  mov    -0x18(%rbp),%eax
  cmp    $0x4,%eax
  jle    L50
  jmp    L91
L43:
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
L91:
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jle    L43
  mov    -0x18(%rbp),%eax
  cmp    $0x4,%eax
  jg     L43
L50:
  mov    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  jne    L137
  addl   $0x1,-0x14(%rbp)
  jmp    L101
L137:
  mov    -0x18(%rbp),%eax
  cmp    $0x2,%eax
  jne    L73
  addl   $0x1,-0x10(%rbp)
  jmp    L101
L73:
  mov    -0x18(%rbp),%eax
  cmp    $0x3,%eax
  jne    L101
  addl   $0x1,-0xc(%rbp)
  jmp    L101
L145:
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jle    L127
  mov    -0x18(%rbp),%eax
  cmp    $0x4,%eax
  jle    L56
  jmp    L127
L102:
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
L127:
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jle    L102
  mov    -0x18(%rbp),%eax
  cmp    $0x4,%eax
  jg     L102
L56:
  mov    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  jne    L126
  addl   $0x1,-0x14(%rbp)
  jmp    L101
L126:
  mov    -0x18(%rbp),%eax
  cmp    $0x2,%eax
  jne    L97
  addl   $0x1,-0x10(%rbp)
  jmp    L101
L97:
  mov    -0x18(%rbp),%eax
  cmp    $0x3,%eax
  jne    L101
  addl   $0x1,-0xc(%rbp)
L101:
  mov    -0x18(%rbp),%eax
  cmp    $0x4,%eax
  jne    L145
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D17
type_guessed: string
name: parse_data
arguments: data_tag: D52
type_guessed: string
name: parse_data
arguments: data_tag: D76
type_guessed: string
name: parse_data
arguments: data_tag: D36
type_guessed: string
name: parse_data
arguments: data_tag: D21
type_guessed: string

tool: D17: %d

tool: D52: MUITO OBRIGADO

tool: D76: Alcool: %d


tool: D36: Gasolina: %d


tool: D21: Diesel: %d


assistant: ```c
int main() {
  int x, a = 0, g = 0, d = 0;
  scanf("%d", &x);
  if (x < 1 || x > 4) {
    while (x < 1 || x > 4)
      scanf("%d", &x);
  }
  if (x == 1)
    a++;
  else if (x == 2)
    g++;
  else if (x == 3)
    d++;
  while (x != 4) {
    scanf("%d", &x);
    if (x < 1 || x > 4) {
      while (x < 1 || x > 4)
        scanf("%d", &x);
    }
    if (x == 1)
      a++;
    else if (x == 2)
      g++;
    else if (x == 3)
      d++;
  }
  printf("MUITO OBRIGADO\n");
  printf("Alcool: %d\n", a);
  printf("Gasolina: %d\n", g);
  printf("Diesel: %d\n", d);
  return 0;
}
```