user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x478,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x468(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  jne    L157
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  call   <atof@plt>
  mov    0x10(%rbx),%rbp
  mov    $0x1,%eax
  lea    D63(%rip),%rdi
  movss  %xmm0,0xc(%rsp)
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
  lea    D47(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rbp,%rsi
  mov    %rax,%r12
  test   %rax,%rax
  je     L162
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    0x30(%rsp),%rsi
  call   <stat@plt>
  xor    %eax,%eax
  call   <tmpfile@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L222
  lea    0x60(%rsp),%rbx
  jmp    L129
  nop
L62:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
L129:
  mov    %rbx,%rdi
  mov    %r12,%rdx
  mov    $0x400,%esi
  call   <fgets@plt>
  mov    %r12,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L62
  mov    %rbp,%rdi
  call   <fflush@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fileno@plt>
  lea    0x38(%rsp),%rsi
  mov    %eax,%edi
  call   <fstat@plt>
  mov    0x30(%rsp),%rsi
  mov    0x38(%rsp),%rax
  cmp    %rax,%rsi
  jne    L149
L77:
  mov    %rbp,%rdi
  lea    D39(%rip),%r12
  lea    D120(%rip),%r13
  call   <rewind@plt>
  jmp    L202
  nopw   0x0(%rax,%rax,1)
L169:
  mov    %rbp,%rdx
  mov    $0x400,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  mov    $0x2,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L98
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <printf@plt>
L202:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L169
L69:
  lea    D39(%rip),%r14
  lea    D134(%rip),%r15
  jmp    L86
  nopl   0x0(%rax)
L13:
  mov    %rbx,%rsi
  lea    D120(%rip),%rdi
  call   <printf@plt>
L20:
  mov    %rbp,%rdi
  call   <ftell@plt>
  movsd  0x28(%rsp),%xmm0
  subsd  0x20(%rsp),%xmm0
  mov    %rax,%r12
  call   <fabs@plt>
  comiss 0xc(%rsp),%xmm0
  jbe    L30
  sub    %r13,%r12
  test   %r12,%r12
  jg     L97
L30:
  movsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x20(%rsp)
L86:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L41
  mov    %rbp,%rdi
  call   <ftell@plt>
  mov    %rbp,%rdx
  mov    $0x400,%esi
  mov    %rbx,%rdi
  mov    %rax,%r13
  call   <fgets@plt>
  mov    $0x2,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L13
  lea    0x28(%rsp),%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  jmp    L20
  nopl   0x0(%rax,%rax,1)
L97:
  cvttsd2si 0x20(%rsp),%eax
  lea    0x40(%rsp),%r13
  lea    0x1c(%rsp),%rdi
  mov    %r13,%rsi
  mov    %eax,0x1c(%rsp)
  call   <ctime_r@plt>
  movsd  0x20(%rsp),%xmm1
  mov    %r13,%rsi
  movsd  0x28(%rsp),%xmm0
  lea    D64(%rip),%rdi
  mov    $0x2,%eax
  subsd  %xmm1,%xmm0
  call   <printf@plt>
  movsd  0x28(%rsp),%xmm0
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <copySplitData@plt>
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <ftell@plt>
  test   %rax,%rax
  je     L41
  mov    %rbp,%rdi
  call   <rewind@plt>
  jmp    L30
  xchg   %ax,%ax
L41:
  mov    %rbp,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L60:
  mov    0x468(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L43
  add    $0x478,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L149:
  sub    %rax,%rsi
  lea    D86(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L77
L98:
  lea    0x20(%rsp),%rdx
  lea    D134(%rip),%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  jmp    L69
L157:
  lea    D69(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L60
L162:
  lea    D81(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L60
L222:
  lea    D54(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L60
L43:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D63
data_type: string
name: parse_data
arguments: data_tag: D47
data_type: string
name: parse_data
arguments: data_tag: D60
data_type: string
name: parse_data
arguments: data_tag: D39
data_type: string
name: parse_data
arguments: data_tag: D120
data_type: string
name: parse_data
arguments: data_tag: D134
data_type: string
name: parse_data
arguments: data_tag: D64
data_type: string
name: parse_data
arguments: data_tag: D86
data_type: string
name: parse_data
arguments: data_tag: D69
data_type: string
name: parse_data
arguments: data_tag: D81
data_type: string
name: parse_data
arguments: data_tag: D54
data_type: string

tool: D63: I: Minimum time difference is: %f seconds.


tool: D47: r+

tool: D60: I: Opening %s ...[success]


tool: D39: ##

tool: D120: > ignoring: %s

tool: D134: %lf

tool: D64: I: Break (%f) needed after T = %f -> %s

tool: D86: E: The temporary file differs than the original log file by %ld bytes! Aborting...

tool: D69: 
 logsplitter - split a log file into smaller chunks, based on the consecutive timestamp difference

USAGE:  logsplitter [min_time_difference_in_seconds] [FILE]


tool: D81: E: Opening %s ...[failed]


tool: D54: E: Cannot create a temporary file! Aborting...

assistant: ```c
int main(int argc, const char **argv) {
  char buf[1024];
  double t1, t2;
  FILE *fd, *tempfd;
  long before, after;
  char btime[26];
  const char *base_filename;
  float min_timedifference;
  struct stat fbuf;
  struct stat ftempbuf;
  if (argc != 3) {
    printf("\n"
           " logsplitter - split a log file into smaller chunks, based on the consecutive timestamp difference\n\n"
           "USAGE:  logsplitter [min_time_difference_in_seconds] [FILE]\n\n");
    return -1;
  }
  min_timedifference = atof(argv[1]);
  base_filename = argv[2];
  printf("I: Minimum time difference is: %f seconds.\n", min_timedifference);
  fd = fopen(base_filename, "r+");
  if (!fd) {
    printf("E: Opening %s ...[failed]\n", base_filename);
    return -1;
  } else
    printf("I: Opening %s ...[success]\n", base_filename);
  stat(base_filename, &fbuf);
  if ((tempfd = tmpfile()) == NULL) {
    printf("E: Cannot create a temporary file! Aborting...\n");
    return -1;
  }
  while (1) {
    fgets(buf, 1024, fd);
    if (feof(fd))
      break;
    fputs(buf, tempfd);
  }
  fflush(tempfd);
  fclose(fd);
  fstat(fileno(tempfd), &ftempbuf);
  if ((fbuf.st_size - ftempbuf.st_size) != 0) {
    printf("E: The temporary file differs than the original log file by %ld bytes! Aborting...", fbuf.st_size - ftempbuf.st_size);
  }
  rewind(tempfd);
  while (!feof(tempfd)) {
    fgets(buf, 1024, tempfd);
    if (strncmp(buf, "##", 2) == 0)
      printf("> ignoring: %s", buf);
    else {
      sscanf(buf, "%lf", &t1);
      break;
    }
  }
  while (!feof(tempfd)) {
    before = ftell(tempfd);
    fgets(buf, 1024, tempfd);
    if (strncmp(buf, "##", 2) == 0)
      printf("> ignoring: %s", buf);
    else
      sscanf(buf, "%lf", &t2);
    after = ftell(tempfd);
    if ((fabs(t2 - t1) > min_timedifference) && (after - before > 0)) {
      time_t t = (time_t)t1;
      ctime_r(&t, btime);
      printf("I: Break (%f) needed after T = %f -> %s", t2 - t1, t1, btime);
      tempfd = copySplitData(tempfd, t2, after - before);
      if (ftell(tempfd) == 0)
        break;
      rewind(tempfd);
    }
    t1 = t2;
  }
  fclose(tempfd);
  return 0;
}
```