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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  lea    D24(%rip),%rsi
  lea    D51(%rip),%rdi
  call   <popen@plt>
  mov    %rax,%rbp
  mov    %rax,%rcx
  mov    $0x15,%edx
  mov    $0x1,%esi
  lea    D74(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x12,%edx
  mov    $0x1,%esi
  lea    D29(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x4,%r13d
  lea    D90(%rip),%r12
  lea    D7(%rip),%r15
  jmp    L54
L31:
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  call   <fflush@plt>
  mov    $0x989680,%eax
L59:
  sub    $0x1,%eax
  jne    L59
  add    $0x4,%r13d
  cmp    $0x194,%r13d
  je     L25
L54:
  mov    %rbp,%rcx
  mov    $0x1e,%edx
  mov    $0x1,%esi
  lea    D12(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x0,%ebx
  lea    0x8(%rsp),%r14
L37:
  mov    %rsp,%rsi
  lea    0x0(%r13,%rbx,1),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  divsd  D79(%rip),%xmm0
  mov    %r14,%rdi
  call   <sincos@plt>
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp,%rbx,8)
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  addsd  D84(%rip),%xmm0
  cvttsd2si %xmm0,%edx
  movapd %xmm1,%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x1,%rbx
  cmp    $0x1e,%rbx
  jne    L37
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  mov    $0x0,%ebx
L9:
  movsd  0x10(%rsp,%rbx,8),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  addsd  D59(%rip),%xmm1
  cvttsd2si %xmm1,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x1,%rbx
  cmp    $0x1e,%rbx
  jne    L9
  jmp    L31
L25:
  mov    %rbp,%rdi
  call   <pclose@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  mov    $0x0,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D24
datatype: string
name: read_data
arguments: tag: D51
datatype: string
name: read_data
arguments: tag: D74
datatype: string
name: read_data
arguments: tag: D29
datatype: string
name: read_data
arguments: tag: D90
datatype: string
name: read_data
arguments: tag: D7
datatype: string
name: read_data
arguments: tag: D12
datatype: string
name: read_data
arguments: tag: D79
datatype: f64
name: read_data
arguments: tag: D84
datatype: f64
name: read_data
arguments: tag: D59
datatype: f64

tool: D24: w

tool: D51: gnuplot --persist

tool: D74: load 'startup_2ch.p'


tool: D29: set yrange [-1:1]


tool: D90: %f %f


tool: D7: e


tool: D12: plot '-' w boxes, '-' w boxes


tool: D79: 100

tool: D84: 0.25

tool: D59: 0.75

assistant: ```c
int main() {
  double xarray[30];
  double yarray[30];
  FILE *pipe_gp;
  pipe_gp = popen("gnuplot --persist", "w");
  int i;
  int j;
  fputs("load 'startup_2ch.p'\n", pipe_gp);
  fputs("set yrange [-1:1]\n", pipe_gp);
  for (j = 1; j <= 100; j++) {
    fputs("plot '-' w boxes, '-' w boxes\n", pipe_gp);
    for (i = 0; i < 30; ++i) {
      double x = (i + 4 * j) / 100.0;
      xarray[i] = sin(x);
      yarray[i] = cos(x);
      fprintf(pipe_gp, "%f %f\n", i + 0.25, yarray[i]);
    }
    fputs("e\n", pipe_gp);
    for (i = 0; i < 30; i++) {
      fprintf(pipe_gp, "%f %f\n", i + 0.75, xarray[i]);
    }
    fputs("e\n", pipe_gp);
    fflush(pipe_gp);
    for (i = 0; i < 10000000; i++) {
    }
  }
  pclose(pipe_gp);
  return 0;
}
```