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    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x108,%rsp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x20f8(%rsp)
  xor    %eax,%eax
  mov    D23(%rip),%rax
  mov    %rax,0xd8(%rsp)
  movsd  D25(%rip),%xmm0
  movsd  %xmm0,0xe0(%rsp)
  movsd  %xmm0,0xe8(%rsp)
  mov    0x8(%rsi),%rsi
  lea    0xf0(%rsp),%rax
  mov    %rax,0x50(%rsp)
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    0x10(%r12),%rsi
  lea    0x2f0(%rsp),%rbx
  mov    %rbx,0x58(%rsp)
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    0x18(%r12),%rsi
  lea    0x4f0(%rsp),%rcx
  mov    %rcx,0x60(%rsp)
  mov    %rcx,%rdi
  call   <strcpy@plt>
  mov    0x20(%r12),%rsi
  lea    0x6f0(%rsp),%rdx
  mov    %rdx,0x68(%rsp)
  mov    %rdx,%rdi
  call   <strcpy@plt>
  mov    0x28(%r12),%rsi
  lea    0x16f0(%rsp),%r10
  mov    %r10,0x70(%rsp)
  mov    %r10,%rdi
  call   <strcpy@plt>
  mov    0x30(%r12),%rsi
  lea    0x18f0(%rsp),%r11
  mov    %r11,0x78(%rsp)
  mov    %r11,%rdi
  call   <strcpy@plt>
  mov    0x38(%r12),%rsi
  lea    0x1af0(%rsp),%r14
  mov    %r14,0x80(%rsp)
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    0x40(%r12),%rsi
  lea    0x1cf0(%rsp),%r15
  mov    %r15,0x88(%rsp)
  mov    %r15,%rdi
  call   <strcpy@plt>
  mov    0x48(%r12),%rsi
  lea    0x1ef0(%rsp),%r8
  mov    %r8,0x90(%rsp)
  mov    %r8,%rdi
  call   <strcpy@plt>
  mov    0x50(%r12),%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,%ebp
  mov    0x58(%r12),%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    0x60(%r12),%rsi
  lea    0xcf0(%rsp),%r9
  mov    %r9,0x98(%rsp)
  mov    %r9,%rdi
  call   <strcpy@plt>
  mov    0x68(%r12),%rsi
  lea    0x8f0(%rsp),%r13
  mov    %r13,0xa0(%rsp)
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    0x70(%r12),%rsi
  lea    0xaf0(%rsp),%rax
  mov    %rax,0xa8(%rsp)
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    0x78(%r12),%rsi
  lea    0xef0(%rsp),%rcx
  mov    %rcx,0xb0(%rsp)
  mov    %rcx,%rdi
  call   <strcpy@plt>
  mov    0x80(%r12),%rsi
  lea    0x10f0(%rsp),%rdx
  mov    %rdx,0xb8(%rsp)
  mov    %rdx,%rdi
  call   <strcpy@plt>
  mov    0x88(%r12),%rsi
  lea    0x12f0(%rsp),%r10
  mov    %r10,0xc0(%rsp)
  mov    %r10,%rdi
  call   <strcpy@plt>
  mov    0x90(%r12),%rsi
  lea    0x14f0(%rsp),%r12
  mov    %r12,0xc8(%rsp)
  mov    %r12,%rdi
  call   <strcpy@plt>
  imul   $0x64,%ebx,%eax
  mov    %eax,0x4c(%rsp)
  movslq %eax,%r13
  shl    $0x3,%r13
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,0x30(%rsp)
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  lea    -0x1(%rbx),%ecx
  mov    %ecx,0x28(%rsp)
  mov    %ecx,%edx
  imul   %ebp,%edx
  mov    %edx,%r13d
  movslq %edx,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,0x38(%rsp)
  lea    0x0(%r13,%rbp,1),%edi
  movslq %edi,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  lea    0x0(%rbp,%rbp,1),%edi
  movslq %edi,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  mov    $0x640,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  imul   $0x64,%ebp,%r13d
  movslq %r13d,%r13
  shl    $0x2,%r13
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,0x40(%rsp)
  mov    0x30(%rsp),%r13
  mov    %r13,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0x50(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    %r15,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0x58(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    0x10(%rsp),%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0x60(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    %r12,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0x68(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    0x20(%rsp),%rcx
  mov    $0x64,%edx
  mov    $0x2,%esi
  mov    0x88(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    0x18(%rsp),%rcx
  mov    %ebp,%edx
  mov    $0x2,%esi
  mov    0x80(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    %r14,%rcx
  mov    $0x64,%edx
  mov    %ebp,%esi
  mov    0x70(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_float@plt>
  mov    0x38(%rsp),%rcx
  mov    0x28(%rsp),%edx
  mov    %ebp,%esi
  mov    0x78(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_double@plt>
  mov    0x40(%rsp),%rcx
  mov    $0x64,%edx
  mov    %ebp,%esi
  mov    0x90(%rsp),%rdi
  mov    $0x0,%eax
  call   <read_data_int@plt>
  mov    %ebx,%r9d
  mov    $0xa,%r8d
  mov    $0x64,%ecx
  mov    %r15,%rdx
  mov    %r13,%rsi
  mov    (%rsp),%rdi
  mov    $0x0,%eax
  call   <zscore_calc@plt>
  mov    $0x0,%r9d
  mov    $0x1,%r8d
  mov    0x28(%rsp),%ecx
  mov    (%rsp),%rdx
  mov    $0x64,%esi
  mov    0xa0(%rsp),%rdi
  mov    $0x0,%eax
  call   <write_zscore_double@plt>
  mov    %ebx,%r9d
  mov    $0xa,%r8d
  mov    $0x64,%ecx
  mov    %r15,%rdx
  mov    %r13,%rsi
  mov    (%rsp),%rdi
  mov    $0x0,%eax
  call   <zscore_calc@plt>
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    %ebx,%ecx
  mov    (%rsp),%rdx
  mov    $0x64,%esi
  mov    0xa8(%rsp),%rdi
  mov    $0x0,%eax
  call   <write_zscore_double@plt>
  mov    0x4c(%rsp),%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <update_sum@plt>
  mov    %r13,0x30(%rsp)
  mov    %r13,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0xb8(%rsp),%rdi
  mov    $0x0,%eax
  call   <write_data_double@plt>
  mov    0x4c(%rsp),%r13d
  mov    %r13d,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <update_sum2@plt>
  mov    %r15,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0xc0(%rsp),%rdi
  mov    $0x0,%eax
  call   <write_data_double@plt>
  mov    $0xa,%ecx
  mov    %r13d,%edx
  mov    0x10(%rsp),%r13
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <update_mean@plt>
  mov    %r13,0x10(%rsp)
  mov    %r13,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    0xc8(%rsp),%rdi
  mov    $0x0,%eax
  call   <write_data_double@plt>
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    0x8(%rsp),%r13
  mov    %r13,%rcx
  mov    0x28(%rsp),%edx
  mov    %ebp,%esi
  mov    0x38(%rsp),%rdi
  mov    $0x0,%eax
  call   <modify_C@plt>
  sub    $0x8,%rsp
  push   $0x1
  lea    0xf0(%rsp),%rax
  push   %rax
  push   %rbx
  push   $0x2
  push   $0x64
  mov    %ebp,%r9d
  mov    %r12,%r8
  mov    %r13,0x38(%rsp)
  mov    %r13,%rcx
  mov    0x50(%rsp),%rdx
  mov    0x48(%rsp),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <var_data@plt>
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  %xmm2,0x58(%rsp)
  add    $0x30,%rsp
  movsd  0xe0(%rsp),%xmm1
  movapd %xmm2,%xmm0
  lea    D0(%rip),%r13
  mov    %r13,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  sub    $0x8,%rsp
  push   $0x2
  lea    0xf8(%rsp),%rax
  push   %rax
  push   %rbx
  push   $0x2
  push   $0x64
  mov    %ebp,%r9d
  mov    %r12,%r8
  mov    0x38(%rsp),%rcx
  mov    0x50(%rsp),%rdx
  mov    0x48(%rsp),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <var_data@plt>
  add    $0x30,%rsp
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  0xe8(%rsp),%xmm1
  mov    %r13,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  lea    0xd8(%rsp),%rdi
  movsd  0xe0(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm0
  mov    $0xa,%esi
  mov    $0x2,%eax
  call   <update_deviance@plt>
  movsd  D16(%rip),%xmm1
  movsd  0xd8(%rsp),%xmm0
  mov    0x98(%rsp),%rdi
  mov    $0x2,%eax
  call   <write_DIC@plt>
  push   %rbx
  push   $0x2
  push   $0x64
  push   %rbp
  mov    0x60(%rsp),%r9
  mov    %r12,%r8
  mov    0x28(%rsp),%rcx
  mov    0x40(%rsp),%r13
  mov    %r13,%rdx
  mov    0x38(%rsp),%rbx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <inputation_lfmm@plt>
  add    $0x20,%rsp
  mov    %r14,%rcx
  mov    $0x64,%edx
  mov    %ebp,%esi
  mov    0xb0(%rsp),%rdi
  mov    $0x0,%eax
  call   <write_data_float@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    0x20f8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  mov    $0x0,%eax
  add    $0x2108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D23
data_type: f64
name: retrieve_data
arguments: data_tag: D25
data_type: f64
name: retrieve_data
arguments: data_tag: D0
data_type: string
name: retrieve_data
arguments: data_tag: D16
data_type: f64

tool: D23: 2.1

tool: D25: 10

tool: D0: %g %g


tool: D16: 1

assistant: ```c
int main(int argc, char *argv[]) {
  char input_sum[512];
  char input_sum2[512];
  char input_mean[512];
  char input_beta[512];
  char output_zscore1[512];
  char output_zscore2[512];
  char output_DIC[512];
  char output_R[512];
  char output_sum[512];
  char output_sum2[512];
  char output_mean[512];
  char input_R[512];
  char input_C[512];
  char input_U[512];
  char input_V[512];
  char input_I[512];
  double *zscore, *sum, *sum2, *beta, *mean, *C, *U, *V, *CC;
  float *R;
  int D = 3, cur = 10, *I;
  double deviance = 2.1, var1 = 0, var2 = 0;
  double thrd_m1 = 10.0, thrd_m2 = 10.0;
  int N = 10, M = 100, K = 2;
  strcpy(input_sum, argv[1]);
  strcpy(input_sum2, argv[2]);
  strcpy(input_mean, argv[3]);
  strcpy(input_beta, argv[4]);
  strcpy(input_R, argv[5]);
  strcpy(input_C, argv[6]);
  strcpy(input_U, argv[7]);
  strcpy(input_V, argv[8]);
  strcpy(input_I, argv[9]);
  N = (int)atoi(argv[10]);
  D = (int)atoi(argv[11]);
  strcpy(output_DIC, argv[12]);
  strcpy(output_zscore1, argv[13]);
  strcpy(output_zscore2, argv[14]);
  strcpy(output_R, argv[15]);
  strcpy(output_sum, argv[16]);
  strcpy(output_sum2, argv[17]);
  strcpy(output_mean, argv[18]);
  zscore = (double *)malloc(M * D * sizeof(double));
  sum = (double *)malloc(M * D * sizeof(double));
  sum2 = (double *)malloc(M * D * sizeof(double));
  beta = (double *)malloc(M * D * sizeof(double));
  mean = (double *)malloc(M * D * sizeof(double));
  C = (double *)malloc(N * (D - 1) * sizeof(double));
  CC = (double *)malloc(N * D * sizeof(double));
  U = (double *)malloc(N * K * sizeof(double));
  V = (double *)malloc(M * K * sizeof(double));
  R = (float *)malloc(N * M * sizeof(float));
  I = (int *)malloc(N * M * sizeof(int));
  read_data_double(input_sum, D, M, sum);
  read_data_double(input_sum2, D, M, sum2);
  read_data_double(input_mean, D, M, mean);
  read_data_double(input_beta, D, M, beta);
  read_data_double(input_V, K, M, V);
  read_data_double(input_U, K, N, U);
  read_data_float(input_R, N, M, R);
  read_data_double(input_C, N, D - 1, C);
  read_data_int(input_I, N, M, I);
  zscore_calc(zscore, sum, sum2, M, cur, D);
  write_zscore_double(output_zscore1, M, zscore, D - 1, 1, 0);
  zscore_calc(zscore, sum, sum2, M, cur, D);
  write_zscore_double(output_zscore2, M, zscore, D, 0, 0);
  update_sum(beta, sum, D * M);
  write_data_double(output_sum, D, M, sum);
  update_sum2(beta, sum2, D * M);
  write_data_double(output_sum2, D, M, sum2);
  update_mean(beta, mean, D * M, cur);
  write_data_double(output_mean, D, M, mean);
  modify_C(C, N, D - 1, CC, 0, 1);
  var1 = var_data(R, U, V, CC, beta, N, M, K, D, &thrd_m1, 1);
  printf("%g %g\n", var1, thrd_m1);
  var2 = var_data(R, U, V, CC, beta, N, M, K, D, &thrd_m2, 2);
  printf("%g %g\n", var2, thrd_m2);
  update_deviance(&deviance, cur, var1, thrd_m1);
  write_DIC(output_DIC, deviance, 1.0);
  inputation_lfmm(R, U, V, CC, beta, I, N, M, K, D);
  write_data_float(output_R, N, M, R);
  free(zscore);
  free(sum);
  free(sum2);
  free(beta);
  free(mean);
  free(C);
  free(CC);
  free(U);
  free(V);
  free(R);
  free(I);
  return 0;
}
```