user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_next_tle_time>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %r9,%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rdx,%r12
  mov    %rdi,%rdx
  mov    %r8,%rdi
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    $0x100,%esi
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x0,0xc(%rsp)
  call   <fgets@plt>
  test   %rax,%rax
  je     L48
L40:
  cmpb   $0x31,0x0(%r13)
  je     L20
  lea    D33(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L20:
  mov    %r15,%rdx
  mov    $0x100,%esi
  mov    %r14,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L15
L58:
  cmpb   $0x32,(%r14)
  je     L14
  lea    D33(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L14:
  lea    0xc(%rsp),%rdx
  lea    0x1a(%rsp),%rcx
  mov    %r13,%rdi
  lea    0x10(%rsp),%r9
  lea    0x21(%rsp),%r8
  lea    D51(%rip),%rsi
  call   <sscanf@plt>
  movsd  0x10(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  cvttsd2si %xmm0,%edx
  movapd %xmm0,%xmm1
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x10624dd3,%rax,%rax
  sar    $0x26,%rax
  sub    %edx,%eax
  mov    %eax,(%rbx)
  imul   $0x3e8,%eax,%eax
  cvtsi2sd %eax,%xmm2
  subsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%eax
  pxor   %xmm1,%xmm1
  mov    %eax,(%r12)
  imul   $0x3e8,(%rbx),%edx
  cvtsi2sd %edx,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  mulsd  D6(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,0x0(%rbp)
  addl   $0x76c,(%rbx)
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L15:
  lea    D33(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L48:
  lea    D33(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L40
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D33
type: string
name: unpack_data
arguments: label: D51
type: string
name: unpack_data
arguments: label: D6
type: byte[8]

tool: D33: ERROR:bad get from tle file


tool: D51: %1i %s %s %lf

tool: {"D6": [0x00,0x00,0x00,0x00,0x70,0x99,0x94,0x41]}

assistant: ```c
void get_next_tle_time(FILE *fpin, int *this_year, int *this_day, int *this_msec, char *line1, char *line2) {
  int max = 256;
  int line_no = 0;
  char tmp1[7];
  char tmp2[7];
  double full_time;
  long msec_per_day = 24 * 60 * 60 * 1000;
  if (fgets(line1, max, fpin) == NULL) {
    printf("ERROR:bad get from tle file\n");
    exit(1);
  }
  if (line1[0] != '1') {
    printf("ERROR:bad get from tle file\n");
    exit(1);
  }
  if (fgets(line2, max, fpin) == NULL) {
    printf("ERROR:bad get from tle file\n");
    exit(1);
  }
  if (line2[0] != '2') {
    printf("ERROR:bad get from tle file\n");
    exit(1);
  }
  sscanf(line1, "%1i %s %s %lf", &line_no, tmp1, tmp2, &full_time);
  *this_year = (int)full_time / 1000;
  *this_day = (int)(full_time - (*this_year * 1000));
  *this_msec = (int)((full_time - (*this_year * 1000) - *this_day) * msec_per_day);
  *this_year = *this_year + 1900;
}
```