user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x2c(%rsp)
  lea    0x30(%rsp),%rdi
  mov    $0xa,%ecx
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  lea    0x90(%rsp),%rdi
  mov    $0xa,%ecx
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  lea    D64(%rip),%rsi
  lea    D31(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r15d
  mov    $0x0,%r13d
  mov    $0x15,%r12d
  mov    $0x0,%ebp
  mov    $0x1,%ebx
  jmp    L156
L169:
  movl   $0x0,0x2c(%rsp)
  lea    0x2c(%rsp),%rdx
  lea    D4(%rip),%rsi
  mov    %r14,%rdi
  call   <fscanf@plt>
  mov    0x2c(%rsp),%esi
  cmp    %ebx,%esi
  jle    L87
  cmp    %esi,%ebp
  cmovl  %esi,%ebp
  test   %esi,%esi
  jle    L249
  jmp    L5
L87:
  jge    L63
  test   %esi,%esi
  jle    L63
  cmp    %esi,%r12d
  cmovg  %esi,%r12d
L5:
  movslq %esi,%rax
  cmpl   $0x0,0x30(%rsp,%rax,4)
  jne    L249
  movl   $0x1,0x30(%rsp,%rax,4)
  mov    %r13d,0x90(%rsp,%rax,4)
  mov    %r13d,%edx
  lea    D60(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L249
L63:
  test   %esi,%esi
  jle    L249
  jmp    L5
L165:
  mov    %rax,0x18(%rsp)
  mov    0x90(%rsp,%rax,4),%ecx
  mov    %r13d,%eax
  sub    %ecx,%eax
  mov    %eax,0x14(%rsp)
  mov    %eax,%r8d
  mov    %r13d,%edx
  mov    %ebx,%esi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x10(%rsp),%ecx
  mov    0x14(%rsp),%eax
  cmp    %eax,%ecx
  cmovge %ecx,%eax
  mov    %eax,0x10(%rsp)
  mov    0x18(%rsp),%rax
  movl   $0x0,0x90(%rsp,%rax,4)
  movl   $0x0,0x30(%rsp,%rax,4)
  jmp    L198
L155:
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%ebp
  jmp    L117
L104:
  mov    $0x15,%r12d
L35:
  cmp    %ebp,%ebx
  jl     L12
  cmp    %r12d,%ebx
  jg     L189
  movl   $0x0,0xc(%rsp)
  jmp    L89
L31:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x10(%rsp),%edx
  mov    %r15d,%esi
  lea    D21(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  mov    $0x0,%eax
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L226:
  add    $0x1,%ebx
  movl   $0x1,0xc(%rsp)
  jmp    L146
L12:
  cmp    %r12d,%ebx
  jle    L226
L189:
  sub    $0x1,%ebx
  movl   $0xffffffff,0xc(%rsp)
L146:
  add    $0x1,%r15d
L89:
  add    $0x5,%r13d
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %r13d,%esi
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L156:
  mov    %r14,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L42
  cmp    %ebp,%ebx
  jle    L42
  cmp    %r12d,%ebx
  jl     L31
L42:
  mov    %r14,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L169
  movl   $0x0,0x2c(%rsp)
L249:
  movslq %ebx,%rax
  cmpl   $0x1,0x30(%rsp,%rax,4)
  je     L165
L198:
  cmp    %ebp,%ebx
  je     L155
L117:
  cmp    %r12d,%ebx
  je     L104
  cmpl   $0x0,0xc(%rsp)
  je     L35
  add    0xc(%rsp),%ebx
  jmp    L146
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D64
type: string
name: retrieve_data
arguments: tag: D31
type: string
name: retrieve_data
arguments: tag: D4
type: string
name: retrieve_data
arguments: tag: D60
type: string
name: retrieve_data
arguments: tag: D40
type: string
name: retrieve_data
arguments: tag: D21
type: string
name: retrieve_data
arguments: tag: D23
type: string

tool: D64: r

tool: D31: prob08.in

tool: D4: %d

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


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


tool: D21: %d
%d


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


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;
}
```