user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  lea    D104(%rip),%r15
  push   %r14
  mov    $0x1,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    0x8(%rsi),%rdi
  lea    D15(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x138(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  lea    0x70(%rsp),%r13
  call   <fopen@plt>
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <assert@plt>
  jmp    L55
  nopl   0x0(%rax)
L109:
  cmp    $0xa,%r14d
  je     L65
L120:
  add    $0x1,%r14d
L55:
  mov    %r12,%rdx
  mov    $0x5a,%esi
  lea    -0x1(%r14),%ebx
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L109
  mov    %rbp,%rdi
  call   <atof@plt>
  cmp    $0x6,%ebx
  ja     L34
  cmp    $0x3,%ebx
  jg     L76
  cmp    $0x2,%ebx
  je     L13
  cmp    $0x3,%ebx
  jne    L109
  mulsd  D0(%rip),%xmm0
  mov    $0x64,%edi
  mov    $0x3e8,%ecx
  cvttsd2si %xmm0,%esi
  mov    %esi,%eax
  cltd
  idiv   %edi
  mov    %esi,%eax
  mov    %edx,%r9d
  cltd
  idiv   %ecx
  mov    $0x186a0,%ecx
  cltd
  idiv   %edi
  mov    %esi,%eax
  mov    %edx,%r8d
  cltd
  idiv   %ecx
  cltd
  idiv   %edi
  mov    %esi,%eax
  mov    $0x989680,%edi
  lea    D116(%rip),%rsi
  mov    %edx,%ecx
  cltd
  idiv   %edi
  mov    %rbp,%rdi
  mov    %eax,%edx
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  lea    D94(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  lea    D124(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  jmp    L120
  nopl   0x0(%rax)
L34:
  cmp    $0xb,%r14d
  je     L120
  mov    %r15,%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  movsd  0x8(%rsp),%xmm0
  lea    D110(%rip),%rsi
  movslq %eax,%rdi
  mov    $0x1,%eax
  add    %r13,%rdi
  call   <sprintf@plt>
  jmp    L109
  nop
L65:
  mov    %r12,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
  mov    %r13,%rsi
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    0x138(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0x148,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L13:
  cvttsd2si %xmm0,%esi
  mov    $0x64,%edi
  mov    %esi,%eax
  cltd
  idiv   %edi
  mov    %edx,%r8d
  cltd
  idiv   %edi
  mov    %esi,%eax
  mov    $0x2710,%edi
  lea    D52(%rip),%rsi
  mov    %edx,%ecx
  cltd
  idiv   %edi
  mov    %rbp,%rdi
  mov    %eax,%edx
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  lea    D136(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    D41(%rip),%rsi
  call   <sprintf@plt>
  jmp    L120
L76:
  mulsd  D0(%rip),%xmm0
  lea    D14(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  movsd  0x8(%rsp),%xmm0
  lea    D58(%rip),%rsi
  movslq %eax,%rdi
  mov    $0x1,%eax
  add    %r13,%rdi
  call   <sprintf@plt>
  jmp    L109
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D104
type_infered: string
name: extract_symbolic_data
arguments: data_label: D15
type_infered: string
name: extract_symbolic_data
arguments: data_label: D0
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D116
type_infered: string
name: extract_symbolic_data
arguments: data_label: D94
type_infered: string
name: extract_symbolic_data
arguments: data_label: D124
type_infered: string
name: extract_symbolic_data
arguments: data_label: D110
type_infered: string
name: extract_symbolic_data
arguments: data_label: D20
type_infered: string
name: extract_symbolic_data
arguments: data_label: D52
type_infered: string
name: extract_symbolic_data
arguments: data_label: D136
type_infered: string
name: extract_symbolic_data
arguments: data_label: D41
type_infered: string
name: extract_symbolic_data
arguments: data_label: D14
type_infered: string
name: extract_symbolic_data
arguments: data_label: D58
type_infered: string

tool: D104:   Vel  %f km/s


tool: D15: rb

tool: D0: 1000

tool: D116: %02d:%02d:%02d.%03d

tool: D94: Time : %s


tool: D124: -3h

tool: D110: ,%.7f

tool: D20: %s,eq,geo,km,s


tool: D52: %04d-%02d-%02d

tool: D136: Date : %s


tool: D41: find_orb -oSpektrRG -v%sT

tool: D14:   Posn %f km


tool: D58: ,%.2f

assistant: ```c
int main(const int argc, const char **argv) {
  FILE *ifile = fopen(argv[1], "rb");
  char buff[90];
  char command[200];
  int i;
  assert(ifile);
  for (i = 0; i < 10; i++)
    if (fgets(buff, sizeof(buff), ifile)) {
      const double ival = atof(buff);
      switch (i) {
      case 2: {
        const int day = (int)ival;
        sprintf(buff, "%04d-%02d-%02d", day / 10000, (day / 100) % 100, day % 100);
        printf("Date : %s\n", buff);
        sprintf(command, "find_orb -oSpektrRG -v%sT", buff);
      } break;
      case 3: {
        const int millisec = (int)(ival * 1000.);
        sprintf(buff, "%02d:%02d:%02d.%03d", millisec / 10000000, (millisec / 100000) % 100, (millisec / 1000) % 100, millisec % 100);
        printf("Time : %s\n", buff);
        strcat(command, buff);
        strcat(command, "-3h");
      } break;
      case 4:
      case 5:
      case 6:
        printf("  Posn %f km\n", ival * 1000.);
        sprintf(command + strlen(command), ",%.2f", ival * 1000.);
        break;
      case 7:
      case 8:
      case 9:
        printf("  Vel  %f km/s\n", ival);
        sprintf(command + strlen(command), ",%.7f", ival);
        break;
        break;
      }
    }
  fclose(ifile);
  printf("%s,eq,geo,km,s\n", command);
  return (0);
}
```