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

```asm
<get_next_tle_rev>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    $0x100,%esi
  sub    $0x268,%rsp
  mov    %rdx,(%rsp)
  lea    0x50(%rsp),%r15
  mov    %rdi,%rdx
  mov    %rcx,0x8(%rsp)
  mov    %r15,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x258(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x28(%rsp)
  call   <fgets@plt>
  test   %rax,%rax
  je     L35
L65:
  cmpb   $0x31,0x50(%rsp)
  je     L21
  lea    D66(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L21:
  lea    0x150(%rsp),%r14
  mov    %r12,%rdx
  mov    $0x100,%esi
  mov    %r14,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L67
L36:
  cmpb   $0x32,0x150(%rsp)
  je     L62
  lea    D66(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L62:
  lea    0x42(%rsp),%rcx
  lea    0x28(%rsp),%rdx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    0x30(%rsp),%r9
  lea    0x49(%rsp),%r8
  mov    %rcx,0x18(%rsp)
  lea    D34(%rip),%rsi
  mov    %rdx,0x10(%rsp)
  call   <sscanf@plt>
  lea    0x38(%rsp),%r8
  mov    %r14,%rdi
  xor    %eax,%eax
  lea    0x2c(%rsp),%r10
  sub    $0x8,%rsp
  lea    D20(%rip),%rsi
  mov    %r8,%r9
  push   %rbp
  push   %r13
  push   %r8
  push   %r8
  mov    0x40(%rsp),%rcx
  push   %rcx
  mov    0x40(%rsp),%rdx
  mov    %r10,%rcx
  call   <sscanf@plt>
  movslq 0x0(%rbp),%rax
  movsd  0x60(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  mov    0x30(%rsp),%rcx
  mov    0x38(%rsp),%rsi
  add    $0x30,%rsp
  mov    %rax,%rdx
  imul   $0x66666667,%rax,%rax
  movapd %xmm0,%xmm1
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  cvttsd2si %xmm0,%edx
  mov    %eax,0x0(%rbp)
  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,(%rcx)
  imul   $0x3e8,(%rbx),%edx
  cvtsi2sd %edx,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  mulsd  D53(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,(%rsi)
  addl   $0x76c,(%rbx)
  mov    0x258(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x268,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L67:
  lea    D66(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L35:
  lea    D66(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L65
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D66
type: string
name: retrieve_data
arguments: tag: D34
type: string
name: retrieve_data
arguments: tag: D20
type: string
name: retrieve_data
arguments: tag: D53
type: byte[8]

tool: D66: ERROR:bad get from tle file


tool: D34: %1i %s %s %lf

tool: D20: %1i %i %lf %lf %s %lf %lf %lf %i

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

assistant: ```c
void get_next_tle_rev(FILE *fpin, int *this_year, int *this_day, int *this_msec, int *this_rev, double *this_rev_per_day) {
  int max = 256;
  int line_no = 0;
  char tmp1[7];
  char tmp2[7];
  double full_time;
  long msec_per_day = 24 * 60 * 60 * 1000;
  int junk;
  double junkf;
  char line1[256];
  char line2[256];
  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);
  sscanf(line2, "%1i %i %lf %lf %s %lf %lf %lf %i", &line_no, &junk, &junkf, &junkf, tmp1, &junkf, &junkf, this_rev_per_day, this_rev);
  *this_rev /= 10;
  *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;
}
```