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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movl   $0x0,-0x30(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0x5c(%rbp)
  movl   $0x1,-0x58(%rbp)
  movl   $0x1,-0x54(%rbp)
  movl   $0x1,-0x50(%rbp)
  movl   $0x0,-0x44(%rbp)
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L126
L348:
  movl   $0x0,-0x4c(%rbp)
  movl   $0x1,-0x48(%rbp)
  movl   $0x1,-0x50(%rbp)
  jmp    L91
L240:
  cmpl   $0x0,-0x44(%rbp)
  jne    L397
  lea    D323(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D131(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D255(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D352(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
L397:
  movl   $0x0,-0x44(%rbp)
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  jne    L148
  cmpl   $0x5,-0x5c(%rbp)
  jg     L295
  mov    -0x5c(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movl   $0x1,-0x40(%rbp,%rax,4)
  addl   $0x1,-0x5c(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L91
L295:
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2,%edi
  call   <sleep@plt>
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D347(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D112(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  jne    L41
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D351(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2,%edi
  call   <sleep@plt>
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L91
L41:
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L308
  movl   $0x1,-0x44(%rbp)
  jmp    L91
L308:
  mov    -0x60(%rbp),%eax
  cmp    $0x3,%eax
  jne    L91
  movl   $0x1,-0x44(%rbp)
  jmp    L91
L148:
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L161
  cmpl   $0x5,-0x58(%rbp)
  jg     L410
  mov    -0x58(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movl   $0x1,-0x20(%rbp,%rax,4)
  addl   $0x1,-0x58(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L91
L410:
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D153(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2,%edi
  call   <sleep@plt>
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D301(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D338(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  jne    L294
  movl   $0x1,-0x44(%rbp)
  jmp    L91
L294:
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L368
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D351(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2,%edi
  call   <sleep@plt>
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L91
L368:
  mov    -0x60(%rbp),%eax
  cmp    $0x3,%eax
  jne    L91
  movl   $0x1,-0x44(%rbp)
  jmp    L91
L161:
  mov    -0x60(%rbp),%eax
  cmp    $0x3,%eax
  jne    L91
  movl   $0x0,-0x50(%rbp)
  movl   $0x0,-0x54(%rbp)
L91:
  cmpl   $0x1,-0x50(%rbp)
  jne    L218
  cmpl   $0x5,-0x5c(%rbp)
  jle    L240
  cmpl   $0x5,-0x58(%rbp)
  jle    L240
L218:
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  je     L69
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L189
L69:
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  jne    L255
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L207
L255:
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L207
  lea    D191(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L207:
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  jne    L224
  mov    -0x5c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L189
L224:
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L189
  mov    -0x58(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  lea    D259(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L189:
  cmpl   $0x5,-0x5c(%rbp)
  jle    L420
  cmpl   $0x5,-0x58(%rbp)
  jle    L420
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2,%edi
  call   <sleep@plt>
  lea    D135(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x60(%rbp)
  movl   $0x0,-0x54(%rbp)
L420:
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2,%edi
  call   <sleep@plt>
  jmp    L426
L320:
  cmpl   $0x1,-0x48(%rbp)
  jne    L211
  mov    -0x4c(%rbp),%eax
  cltq
  mov    -0x40(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D254(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L415
L211:
  cmpl   $0x2,-0x48(%rbp)
  jne    L415
  mov    -0x4c(%rbp),%eax
  cltq
  mov    -0x20(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D254(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L415:
  addl   $0x1,-0x4c(%rbp)
L58:
  cmpl   $0x4,-0x4c(%rbp)
  jle    L320
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x48(%rbp)
  movl   $0x0,-0x4c(%rbp)
L426:
  cmpl   $0x2,-0x48(%rbp)
  jle    L58
  lea    D128(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L126:
  cmpl   $0x1,-0x54(%rbp)
  je     L348
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L70
  call   <__stack_chk_fail@plt>
L70:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D128
datatype: string
name: parse_data
arguments: label: D323
datatype: string
name: parse_data
arguments: label: D131
datatype: string
name: parse_data
arguments: label: D255
datatype: string
name: parse_data
arguments: label: D352
datatype: string
name: parse_data
arguments: label: D85
datatype: string
name: parse_data
arguments: label: D11
datatype: string
name: parse_data
arguments: label: D347
datatype: string
name: parse_data
arguments: label: D22
datatype: string
name: parse_data
arguments: label: D112
datatype: string
name: parse_data
arguments: label: D47
datatype: string
name: parse_data
arguments: label: D351
datatype: string
name: parse_data
arguments: label: D153
datatype: string
name: parse_data
arguments: label: D104
datatype: string
name: parse_data
arguments: label: D301
datatype: string
name: parse_data
arguments: label: D338
datatype: string
name: parse_data
arguments: label: D79
datatype: string
name: parse_data
arguments: label: D191
datatype: string
name: parse_data
arguments: label: D42
datatype: string
name: parse_data
arguments: label: D259
datatype: string
name: parse_data
arguments: label: D135
datatype: string
name: parse_data
arguments: label: D254
datatype: string

tool: D128: ----------

tool: D323: What class of seat would you like?

tool: D131: Enter 1 for first class.

tool: D255: Enter 2 for economy.

tool: D352: Enter 3 to end.

tool: D85: %d

tool: D11: Sorry, there are no first class seats free.

tool: D347: Would you like to take an economy class seat?

tool: D22: Enter 1 for no.

tool: D112: Enter 2 for yes.

tool: D47: Enter 3 to quit.

tool: D351: Next flight leaves in 3 hours.

tool: D153: Sorry, there are no economy seats free.

tool: D104: Would you like to take a first class seat?

tool: D301: Enter 1 for yes.

tool: D338: Enter 2 for no.

tool: D79: Class:	First class

tool: D191: Class:	Economy

tool: D42: Seat:	1, %d


tool: D259: Seat:	2, %d


tool: D135: There are no more seats availible.

tool: D254: %d 

assistant: ```c
void main() {
  int first[5] = {0}, econ[5] = {0};
  int nFirst = 1, nEcon = 1;
  int request;
  int cont = 1, still = 1;
  int i, i2;
  int skip = 0;
  printf("----------\n");
  while (cont == 1) {
    i = 0;
    i2 = 1;
    still = 1;
    while ((still == 1) && ((nFirst <= 5) || (nEcon <= 5))) {
      if (skip == 0) {
        printf("What class of seat would you like?\n");
        printf("Enter 1 for first class.\n");
        printf("Enter 2 for economy.\n");
        printf("Enter 3 to end.\n");
        scanf("%d", &request);
      }
      skip = 0;
      if (request == 1) {
        if (nFirst <= 5) {
          first[nFirst - 1] = 1;
          nFirst += 1;
          still = 0;
        } else {
          printf("----------\n");
          printf("Sorry, there are no first class seats free.\n");
          sleep((unsigned int)2);
          printf("----------\n");
          printf("Would you like to take an economy class seat?\n");
          printf("Enter 1 for no.\n");
          printf("Enter 2 for yes.\n");
          printf("Enter 3 to quit.\n");
          scanf("%d", &request);
          if (request == 1) {
            printf("----------\n");
            printf("Next flight leaves in 3 hours.\n");
            sleep((unsigned int)2);
            printf("----------\n");
          } else if (request == 2) {
            skip = 1;
          } else if (request == 3) {
            skip = 1;
          }
        }
      } else if (request == 2) {
        if (nEcon <= 5) {
          econ[nEcon - 1] = 1;
          nEcon += 1;
          still = 0;
        } else {
          printf("----------\n");
          printf("Sorry, there are no economy seats free.\n");
          sleep((unsigned int)2);
          printf("----------\n");
          printf("Would you like to take a first class seat?\n");
          printf("Enter 1 for yes.\n");
          printf("Enter 2 for no.\n");
          printf("Enter 3 to quit.\n");
          scanf("%d", &request);
          if (request == 1) {
            skip = 1;
          } else if (request == 2) {
            printf("----------\n");
            printf("Next flight leaves in 3 hours.\n");
            sleep((unsigned int)2);
            printf("----------\n");
          } else if (request == 3) {
            skip = 1;
          }
        }
      } else if (request == 3) {
        still = 0;
        cont = 0;
      }
    }
    if ((request == 1) || (request == 2)) {
      printf("----------\n");
      if (request == 1)
        printf("Class:\tFirst class\n");
      else if (request == 2)
        printf("Class:\tEconomy\n");
      if (request == 1)
        printf("Seat:\t1, %d\n", nFirst - 1);
      else if (request == 2)
        printf("Seat:\t2, %d\n", nEcon - 1);
    }
    if (!((nFirst <= 5) || (nEcon <= 5))) {
      printf("----------\n");
      sleep((unsigned int)2);
      printf("There are no more seats availible.\n");
      request = 0;
      cont = 0;
    }
    printf("----------\n");
    sleep((unsigned int)2);
    while (i2 <= 2) {
      while (i < 5) {
        if (i2 == 1)
          printf("%d ", first[i]);
        else if (i2 == 2)
          printf("%d ", econ[i]);
        i += 1;
      }
      printf("\n");
      i2 += 1;
      i = 0;
    }
    printf("----------\n");
  }
}
```