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

```asm
<main>:
  endbr64
  push   %r15
  mov    $0xa,%ecx
  lea    D39(%rip),%rsi
  lea    D23(%rip),%r15
  push   %r14
  mov    $0x1,%r14d
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    $0x15,%ebp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0xf8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rdi
  movl   $0x0,0x2c(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    $0xa,%ecx
  movl   $0x0,(%rdi)
  lea    0x90(%rsp),%rdi
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  lea    D16(%rip),%rdi
  call   <fopen@plt>
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    %rax,%r13
  movl   $0x0,0xc(%rsp)
  jmp    L45
L11:
  cmp    %ebp,%r14d
  je     L82
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  je     L75
  add    0x8(%rsp),%r14d
L152:
  addl   $0x1,0xc(%rsp)
L12:
  add    $0x5,%r12d
  mov    %ebx,%r8d
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
L45:
  mov    %r13,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L232
  cmp    %ebx,%r14d
  jle    L232
  cmp    %ebp,%r14d
  jl     L110
L232:
  mov    %r13,%rdi
  call   <feof@plt>
  movl   $0x0,0x2c(%rsp)
  test   %eax,%eax
  je     L104
L35:
  movslq %r14d,%r10
  cmpl   $0x1,0x30(%rsp,%r10,4)
  je     L193
L169:
  cmp    %ebx,%r14d
  jne    L11
  xor    %ebx,%ebx
  cmp    %ebp,%r14d
  je     L82
L75:
  cmp    %ebx,%r14d
  jl     L171
L181:
  cmp    %ebp,%r14d
  jg     L1
  movl   $0x0,0x8(%rsp)
  jmp    L12
  nopl   0x0(%rax)
L82:
  mov    $0x15,%ebp
  cmp    %ebx,%r14d
  jge    L181
L171:
  cmp    %ebp,%r14d
  jg     L1
  movl   $0x1,0x8(%rsp)
  add    $0x1,%r14d
  jmp    L152
  nopl   0x0(%rax,%rax,1)
L1:
  movl   $0xffffffff,0x8(%rsp)
  sub    $0x1,%r14d
  jmp    L152
  nopl   0x0(%rax)
L104:
  lea    D61(%rip),%rsi
  lea    0x2c(%rsp),%rdx
  mov    %r13,%rdi
  call   <fscanf@plt>
  mov    0x2c(%rsp),%esi
  cmp    %r14d,%esi
  jle    L39
  cmp    %esi,%ebx
  cmovl  %esi,%ebx
  test   %esi,%esi
  jle    L35
L54:
  movslq %esi,%rax
  mov    0x30(%rsp,%rax,4),%edx
  test   %edx,%edx
  jne    L35
  movl   $0x1,0x30(%rsp,%rax,4)
  mov    %r12d,%edx
  lea    D20(%rip),%rdi
  mov    %r12d,0x90(%rsp,%rax,4)
  xor    %eax,%eax
  call   <printf@plt>
  movslq %r14d,%r10
  cmpl   $0x1,0x30(%rsp,%r10,4)
  jne    L169
  nopl   (%rax)
L193:
  mov    0x90(%rsp,%r10,4),%ecx
  mov    %r12d,%r8d
  xor    %eax,%eax
  mov    %r12d,%edx
  mov    %r14d,%esi
  lea    D35(%rip),%rdi
  mov    %r10,0x18(%rsp)
  sub    %ecx,%r8d
  mov    %r8d,0x14(%rsp)
  call   <printf@plt>
  mov    0x10(%rsp),%eax
  mov    0x14(%rsp),%r8d
  mov    0x18(%rsp),%r10
  cmp    %r8d,%eax
  movl   $0x0,0x90(%rsp,%r10,4)
  cmovge %eax,%r8d
  movl   $0x0,0x30(%rsp,%r10,4)
  mov    %r8d,0x10(%rsp)
  jmp    L169
  nopl   0x0(%rax,%rax,1)
L39:
  test   %esi,%esi
  jle    L35
  cmp    %r14d,%esi
  jge    L54
  cmp    %esi,%ebp
  cmovg  %esi,%ebp
  jmp    L54
  nopl   0x0(%rax,%rax,1)
L110:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    0x10(%rsp),%edx
  mov    0xc(%rsp),%esi
  xor    %eax,%eax
  lea    D40(%rip),%rdi
  call   <printf@plt>
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L243
  add    $0xf8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L243:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D39
type_guessed: string
name: unpack_data
arguments: tag: D23
type_guessed: string
name: unpack_data
arguments: tag: D16
type_guessed: string
name: unpack_data
arguments: tag: D61
type_guessed: string
name: unpack_data
arguments: tag: D20
type_guessed: string
name: unpack_data
arguments: tag: D35
type_guessed: string
name: unpack_data
arguments: tag: D40
type_guessed: string

tool: D39: r

tool: D23: ---Time = %03d, Low = %02d, Current = %02d, High = %02d


tool: D16: prob08.in

tool: D61: %d

tool: D20: Request logged on floor %d at %d


tool: D35: Serviced Floor %d at %d, was called at %d, Time to service is %d seconds.


tool: D40: %d
%d


assistant: ```c
int main(int argc, char *argv[]) {
  int curr_floor = 1;
  int high_dest = 0;
  int low_dest = 20 + 1;
  int time = 0;
  int floors = 0;
  int direction = 0;
  int request = 0;
  int Requests[20 + 1] = {0};
  int ServiceTimes[20 + 1] = {0};
  int MaxTime = 0;
  int MaxFloor = 0;
  FILE *fp = NULL;
  fp = fopen("prob08.in", "r");
  while (!feof(fp) || (high_dest >= curr_floor) || (low_dest <= curr_floor)) {
    if (!feof(fp)) {
      request = 0;
      fscanf(fp, "%d", &request);
      if ((request > curr_floor) && (request > high_dest))
        high_dest = request;
      if ((request > 0) && (request < curr_floor) && (request < low_dest))
        low_dest = request;
      if ((request > 0) && (Requests[request] == 0)) {
        Requests[request] = 1;
        ServiceTimes[request] = time;
        printf("Request logged on floor %d at %d\n", request, time);
      }
    } else
      request = 0;
    if (Requests[curr_floor] == 1) {
      printf("Serviced Floor %d at %d, was called at %d, Time to service is %d seconds.\n", curr_floor, time, ServiceTimes[curr_floor], (time - ServiceTimes[curr_floor]));
      if (MaxTime < (time - ServiceTimes[curr_floor])) {
        MaxTime = (time - ServiceTimes[curr_floor]);
        MaxFloor = curr_floor;
      }
      ServiceTimes[curr_floor] = 0;
      Requests[curr_floor] = 0;
    }
    if (curr_floor == high_dest) {
      high_dest = 0;
      direction = 0;
    }
    if (curr_floor == low_dest) {
      low_dest = 20 + 1;
      direction = 0;
    }
    if (direction == 0) {
      if (high_dest > curr_floor)
        direction = 1;
      if (low_dest < curr_floor)
        direction = -1;
    }
    curr_floor += direction;
    if (direction != 0)
      floors += 1;
    time += 5;
    printf("---Time = %03d, Low = %02d, Current = %02d, High = %02d\n", time, low_dest, curr_floor, high_dest);
  }
  fclose(fp);
  printf("%d\n%d\n", floors, MaxTime);
  return 0;
}
```