user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0xf8,%rsp
  mov    %edi,-0xf4(%rbp)
  mov    %rsi,-0x100(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movl   $0x4,-0xdc(%rbp)
  mov    -0xdc(%rbp),%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0xd0(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x110(%rbp)
  movq   $0x0,-0x108(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x120(%rbp)
  movq   $0x0,-0x118(%rbp)
  movslq %edx,%rax
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L108:
  cmp    %rdx,%rsp
  je     L39
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L108
L39:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L153
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L153:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0xc8(%rbp)
  mov    -0xdc(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0xc0(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L154:
  cmp    %rdx,%rsp
  je     L43
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L154
L43:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L19
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L19:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0xb8(%rbp)
  mov    -0xdc(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0xb0(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L185:
  cmp    %rdx,%rsp
  je     L38
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L185
L38:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L213
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L213:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0xa8(%rbp)
  lea    D71(%rip),%rax
  mov    %rax,%rsi
  lea    D87(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xa0(%rbp)
  cmpq   $0x0,-0xa0(%rbp)
  jne    L125
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%eax
  mov    %rbx,%rsp
  jmp    L126
L125:
  mov    -0xa0(%rbp),%rdx
  mov    -0xdc(%rbp),%ecx
  mov    -0xb8(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L97
  mov    -0xdc(%rbp),%edx
  mov    -0xb8(%rbp),%rcx
  mov    -0xa8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0xa8(%rbp),%rdx
  mov    -0xdc(%rbp),%eax
  cltq
  movb   $0x0,(%rdx,%rax,1)
L97:
  mov    -0xa0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0xa8(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  lea    D78(%rip),%rax
  mov    %rax,-0x90(%rbp)
  lea    D46(%rip),%rax
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x88(%rbp)
  cmpq   $0x0,-0x88(%rbp)
  jne    L189
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L189:
  movl   $0x0,-0xe0(%rbp)
  jmp    L131
L1:
  lea    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  lea    -0x80(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  call   <fork@plt>
  mov    %eax,-0xd8(%rbp)
  cmpl   $0xffffffff,-0xd8(%rbp)
  je     L35
  cmpl   $0x0,-0xd8(%rbp)
  jne    L190
  mov    -0xc8(%rbp),%rdi
  mov    -0x90(%rbp),%rcx
  mov    -0x98(%rbp),%rdx
  lea    -0x40(%rbp),%rsi
  lea    -0x48(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <runpipe@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L190:
  nop
L106:
  lea    -0xe4(%rbp),%rax
  mov    %rax,%rdi
  call   <wait@plt>
  mov    %eax,-0xd8(%rbp)
  cmpl   $0xffffffff,-0xd8(%rbp)
  jne    L106
  mov    -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  mov    -0xc8(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0xd4(%rbp)
  cmpl   $0x0,-0xd4(%rbp)
  js     L24
  mov    -0xc8(%rbp),%rdx
  mov    -0xd4(%rbp),%eax
  cltq
  movb   $0x0,(%rdx,%rax,1)
  fildl  -0xd4(%rbp)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x10,%rsp
  jmp    L163
L24:
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L163
L35:
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L163:
  lea    -0x70(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x68(%rbp),%rax
  mov    -0x78(%rbp),%rdx
  sub    %rdx,%rax
  mov    %rax,-0x110(%rbp)
  fildll -0x110(%rbp)
  mov    -0x70(%rbp),%rax
  mov    -0x80(%rbp),%rdx
  sub    %rdx,%rax
  mov    %rax,-0x110(%rbp)
  fildll -0x110(%rbp)
  fldt   0x88a(%rip)        # 20b0 <_fini+0x7c4>
  fdivrp %st,%st(1)
  faddp  %st,%st(1)
  fstpt  -0x60(%rbp)
  push   -0x58(%rbp)
  push   -0x60(%rbp)
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x10,%rsp
  push   -0x58(%rbp)
  push   -0x60(%rbp)
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x10,%rsp
  mov    -0x88(%rbp),%rax
  push   -0x58(%rbp)
  push   -0x60(%rbp)
  lea    D62(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  add    $0x10,%rsp
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  addl   $0x1,-0xe0(%rbp)
L131:
  cmpl   $0x63,-0xe0(%rbp)
  jle    L1
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    %rbx,%rsp
  mov    $0x0,%eax
L126:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L71
  call   <__stack_chk_fail@plt>
L71:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D71
type_infered: string
name: parse_data
arguments: data_label: D87
type_infered: string
name: parse_data
arguments: data_label: D10
type_infered: string
name: parse_data
arguments: data_label: D78
type_infered: string
name: parse_data
arguments: data_label: D46
type_infered: string
name: parse_data
arguments: data_label: D24
type_infered: string
name: parse_data
arguments: data_label: D23
type_infered: string
name: parse_data
arguments: data_label: D76
type_infered: string
name: parse_data
arguments: data_label: D107
type_infered: string
name: parse_data
arguments: data_label: D62
type_infered: string
name: parse_data
arguments: data_label: D11
type_infered: string

tool: D71: r

tool: D87: 512KB.txt

tool: D10: Error opening file

tool: D78: k

tool: D46: wt+

tool: D24: /home/george/Documents/C/pipe64K.txt

tool: D23: read %d bytes from the pipe2 


tool: D76: read

tool: D107: fork

tool: D62: %Lf


tool: D11: time spend (half of bi-direction): %Lf


assistant: ```c
int main(int argc, char **argv) {
  int pid, status;
  int fd1[2];
  int fd2[2];
  int bytes = 4;
  char buf[bytes];
  int n2;
  struct timeval start, end;
  FILE *fp;
  char str[bytes];
  char string[bytes];
  fp = fopen("512KB.txt", "r");
  if (fp == NULL) {
    perror("Error opening file");
    return (-1);
  }
  if (fgets(str, bytes, fp) != NULL) {
    memcpy(string, str, bytes);
    string[bytes] = '\0';
  }
  fclose(fp);
  char *data1 = string;
  char *data2 = "k";
  FILE *fp2;
  if ((fp2 = fopen("/home/george/Documents/C/pipe64K.txt", "wt+")) == NULL) {
    perror("/home/george/Documents/C/pipe64K.txt");
    exit(1);
  }
  int i = 0;
  for (i; i < 100; i++) {
    pipe(fd1);
    pipe(fd2);
    gettimeofday(&start, NULL);
    switch (pid = fork()) {
    case 0:
      runpipe(fd1, fd2, data1, data2, buf);
      exit(0);
    default:
      while ((pid = wait(&status)) != -1)
        ;
      close(fd2[1]);
      if ((n2 = read(fd2[0], buf, strlen(data2))) >= 0) {
        buf[n2] = 0;
        printf("read %d bytes from the pipe2 \n", n2);
      } else
        perror("read");
      break;
    case -1:
      perror("fork");
      exit(1);
    }
    gettimeofday(&end, NULL);
    long double time = ((long double)(end.tv_sec - start.tv_sec) + ((long double)(end.tv_usec - start.tv_usec) / 1000000.0));
    printf("%Lf\n", time);
    printf("time spend (half of bi-direction): %Lf\n", time);
    fprintf(fp2, "%Lf\n", time);
    fflush(fp2);
  }
  fclose(fp2);
  exit(0);
}
```