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

```asm
<main>:
  endbr64
  push   %rbx
  lea    D18(%rip),%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  lea    D63(%rip),%rdi
  call   <scanf@plt>
  nopl   0x0(%rax)
L61:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0x20,%al
  je     L61
  movsbl %al,%edi
  call   <toupper@plt>
  cmp    $0x50,%eax
  jne    L31
  addl   $0xc,(%rsp)
L31:
  mov    0x4(%rsp),%edx
  mov    (%rsp),%esi
  lea    D97(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  imul   $0x3c,(%rsp),%eax
  add    0x4(%rsp),%eax
  cmp    $0x1e0,%eax
  jg     L5
  mov    $0x1e0,%edx
  sub    %eax,%edx
L197:
  mov    $0x247,%ecx
  sub    %eax,%ecx
L80:
  mov    $0x2a7,%esi
  sub    %eax,%esi
L3:
  mov    $0x2ff,%edi
  sub    %eax,%edi
L227:
  mov    $0x348,%r8d
  sub    %eax,%r8d
L172:
  mov    $0x3b1,%r9d
  sub    %eax,%r9d
L105:
  mov    $0x474,%r10d
  sub    %eax,%r10d
L93:
  mov    $0x519,%r11d
  sub    %eax,%r11d
L27:
  cmp    %edx,%r11d
  mov    %edx,%eax
  mov    %r10d,%ebx
  cmovle %r11d,%eax
  cmp    %ecx,%eax
  cmovg  %ecx,%eax
  cmp    %esi,%eax
  cmovg  %esi,%eax
  cmp    %edi,%eax
  cmovg  %edi,%eax
  cmp    %r8d,%eax
  cmovg  %r8d,%eax
  cmp    %r9d,%eax
  cmovg  %r9d,%eax
  cmp    %r10d,%eax
  cmovle %eax,%ebx
  cmp    %edx,%ebx
  je     L175
  cmp    %ecx,%ebx
  je     L21
  cmp    %esi,%ebx
  je     L87
  cmp    %edi,%ebx
  je     L112
  cmp    %r8d,%ebx
  je     L128
  cmp    %r9d,%ebx
  je     L95
  cmp    %r10d,%eax
  jge    L273
  cmp    %ebx,%r11d
  je     L104
  nopw   0x0(%rax,%rax,1)
L177:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L182
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  ret
L5:
  lea    -0x1e0(%rax),%edx
  cmp    $0x247,%eax
  jle    L197
  lea    -0x247(%rax),%ecx
  cmp    $0x2a7,%eax
  jle    L80
  lea    -0x2a7(%rax),%esi
  cmp    $0x2ff,%eax
  jle    L3
  lea    -0x2ff(%rax),%edi
  cmp    $0x348,%eax
  jle    L227
  lea    -0x348(%rax),%r8d
  cmp    $0x3b1,%eax
  jle    L172
  lea    -0x3b1(%rax),%r9d
  cmp    $0x474,%eax
  jle    L105
  lea    -0x474(%rax),%r10d
  lea    -0x519(%rax),%r11d
  cmp    $0x519,%eax
  jg     L27
  jmp    L93
L175:
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L177
L112:
  lea    D17(%rip),%rdi
  call   <puts@plt>
  jmp    L177
L21:
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L177
L87:
  lea    D11(%rip),%rdi
  call   <puts@plt>
  jmp    L177
L128:
  lea    D95(%rip),%rdi
  call   <puts@plt>
  jmp    L177
L95:
  lea    D81(%rip),%rdi
  call   <puts@plt>
  jmp    L177
L273:
  lea    D8(%rip),%rdi
  call   <puts@plt>
  jmp    L177
L104:
  lea    D61(%rip),%rdi
  call   <puts@plt>
  jmp    L177
L182:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D18
type_infered: string
name: retrieve_data
arguments: label: D63
type_infered: string
name: retrieve_data
arguments: label: D97
type_infered: string
name: retrieve_data
arguments: label: D66
type_infered: string
name: retrieve_data
arguments: label: D17
type_infered: string
name: retrieve_data
arguments: label: D69
type_infered: string
name: retrieve_data
arguments: label: D11
type_infered: string
name: retrieve_data
arguments: label: D95
type_infered: string
name: retrieve_data
arguments: label: D81
type_infered: string
name: retrieve_data
arguments: label: D8
type_infered: string
name: retrieve_data
arguments: label: D61
type_infered: string

tool: D18: enter a 12-hour time:(xx:xx)

tool: D63: %d:%d

tool: D97: 24-hour time is: %d:%d


tool: D66: closest departure time is 8:00 a.m., arriving at 10:16 a.m.

tool: D17: closest departure time is 12:47 p.m., arriving at 3:00 p.m.

tool: D69: closest departure time is 9:43 a.m., arriving at 11:52 a.m.

tool: D11: closest departure time is 11:19 a.m., arriving at 1:31 p.m.

tool: D95: closest departure time is 2:00 p.m., arriving at 4:08 p.m.

tool: D81: closest departure time is 3:45 p.m., arriving at 5:55 p.m.

tool: D8: closest departure time is 7:00 p.m., arriving at 9:20 p.m.

tool: D61: closest departure time is 9:45 p.m., arriving at 11:58 p.m.

assistant: ```c
int main(void) {
  int time1 = 480, time2 = 583, time3 = 679, time4 = 767, time5 = 840, time6 = 945, time7 = 1140, time8 = 1305;
  int hour, minute;
  char ch;
  printf("enter a 12-hour time:(xx:xx)\n");
  scanf("%d:%d", &hour, &minute);
  while ((ch = getchar()) == ' ') {
    ;
  }
  switch (toupper(ch)) {
  case 'A':
    hour += 0;
    break;
  case 'P':
    hour += 12;
    break;
  }
  printf("24-hour time is: %d:%d\n", hour, minute);
  int time_now = hour * 60 + minute;
  int m1 = ((time1 >= time_now) ? (time1 - time_now) : (time_now - time1)), m2 = ((time2 >= time_now) ? (time2 - time_now) : (time_now - time2)), m3 = ((time3 >= time_now) ? (time3 - time_now) : (time_now - time3)), m4 = ((time4 >= time_now) ? (time4 - time_now) : (time_now - time4)), m5 = ((time5 >= time_now) ? (time5 - time_now) : (time_now - time5)), m6 = ((time6 >= time_now) ? (time6 - time_now) : (time_now - time6)), m7 = ((time7 >= time_now) ? (time7 - time_now) : (time_now - time7)), m8 = ((time8 >= time_now) ? (time8 - time_now) : (time_now - time8));
  int min12 = m1 < m2 ? m1 : m2, min34 = m3 < m4 ? m3 : m4, min1234 = min12 < min34 ? min12 : min34, min56 = m5 < m6 ? m5 : m6, min78 = m7 < m8 ? m7 : m8, min5678 = min56 < min78 ? min56 : min78, min = min1234 < min5678 ? min1234 : min5678;
  if (min == m1) {
    printf("closest departure time is 8:00 a.m., arriving at 10:16 a.m.");
  } else if (min == m2) {
    printf("closest departure time is 9:43 a.m., arriving at 11:52 a.m.");
  } else if (min == m3) {
    printf("closest departure time is 11:19 a.m., arriving at 1:31 p.m.\n");
  } else if (min == m4) {
    printf("closest departure time is 12:47 p.m., arriving at 3:00 p.m.\n");
  } else if (min == m5) {
    printf("closest departure time is 2:00 p.m., arriving at 4:08 p.m.\n");
  } else if (min == m6) {
    printf("closest departure time is 3:45 p.m., arriving at 5:55 p.m.\n");
  } else if (min == m7) {
    printf("closest departure time is 7:00 p.m., arriving at 9:20 p.m.\n");
  } else if (min == m8) {
    printf("closest departure time is 9:45 p.m., arriving at 11:58 p.m.\n");
  }
  return 0;
}
```