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

```asm
<motif_stats_withcounts>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %rsi,%r14
  mov    %rdx,%r15
  mov    %rcx,%rbx
  mov    %r8d,%r13d
  mov    %r8d,0x2c(%rsp)
  mov    %r8d,%esi
  mov    %r14,%rdi
  call   <meanf@plt>
  mov    %r13d,%esi
  movss  %xmm0,0x8(%rsp)
  mov    %r14,%rdi
  call   <stdf@plt>
  movss  %xmm0,0x10(%rsp)
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <minf@plt>
  movss  %xmm0,0x18(%rsp)
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <maxf@plt>
  movss  %xmm0,0x24(%rsp)
  lea    D91(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rcx
  mov    $0x19,%edx
  mov    $0x1,%esi
  lea    D105(%rip),%rdi
  call   <fwrite@plt>
  pxor   %xmm4,%xmm4
  cvtss2sd 0x8(%rsp),%xmm4
  movq   %xmm4,%rbp
  movapd %xmm4,%xmm0
  lea    D115(%rip),%r12
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movq   %rbp,%xmm0
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  pxor   %xmm4,%xmm4
  cvtss2sd 0x10(%rsp),%xmm4
  movq   %xmm4,%rbp
  movapd %xmm4,%xmm0
  lea    D123(%rip),%r12
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movq   %rbp,%xmm0
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  pxor   %xmm7,%xmm7
  cvtss2sd 0x18(%rsp),%xmm7
  movq   %xmm7,%rbp
  movapd %xmm7,%xmm0
  lea    D187(%rip),%r12
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movq   %rbp,%xmm0
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  pxor   %xmm4,%xmm4
  cvtss2sd 0x24(%rsp),%xmm4
  movq   %xmm4,%rbp
  movapd %xmm4,%xmm0
  lea    D195(%rip),%r12
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movq   %rbp,%xmm0
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  mov    0x30(%rsp),%r12
  mov    %r12,%rsi
  lea    D199(%rip),%rbp
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  test   %r13d,%r13d
  jle    L23
  lea    0x1(%r13),%ecx
  mov    $0x1,%eax
  pxor   %xmm5,%xmm5
  movss  %xmm5,0x24(%rsp)
  movss  %xmm5,0x18(%rsp)
  movss  %xmm5,0x10(%rsp)
  movss  %xmm5,0x8(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%r13d
  jmp    L14
L8:
  add    %edx,%r13d
  cmp    %edx,%ebp
  cmovl  %edx,%ebp
  add    $0x1,%r12d
  movss  (%r14,%rax,4),%xmm0
  movss  0x8(%rsp),%xmm2
  addss  %xmm0,%xmm2
  movss  %xmm2,0x8(%rsp)
  movaps %xmm0,%xmm1
  mulss  %xmm0,%xmm1
  addss  0x24(%rsp),%xmm1
  movss  %xmm1,0x24(%rsp)
  movaps %xmm0,%xmm3
  minss  0x10(%rsp),%xmm3
  movss  %xmm3,0x10(%rsp)
  maxss  0x18(%rsp),%xmm0
  movss  %xmm0,0x18(%rsp)
L15:
  add    $0x1,%rax
  cmp    %rcx,%rax
  je     L31
L14:
  mov    (%r15,%rax,4),%edx
  test   %edx,%edx
  jg     L8
  jmp    L15
L23:
  pxor   %xmm7,%xmm7
  movss  %xmm7,0x24(%rsp)
  movss  %xmm7,0x18(%rsp)
  movss  %xmm7,0x10(%rsp)
  movss  %xmm7,0x8(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%r13d
L31:
  mov    0x30(%rsp),%rsi
  lea    D122(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x2c(%rsp),%r15d
  mov    %r15d,%esi
  lea    D159(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  pxor   %xmm7,%xmm7
  cvtsi2ss %r12d,%xmm7
  movss  %xmm7,0x28(%rsp)
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm7,%xmm0
  mulsd  D244(%rip),%xmm0
  mov    %r15d,0x2c(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2ss %r15d,%xmm1
  cvtss2sd %xmm1,%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  pxor   %xmm6,%xmm6
  cvtss2sd %xmm0,%xmm6
  movsd  %xmm6,0x38(%rsp)
  movapd %xmm6,%xmm0
  mov    %r12d,%esi
  lea    D200(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %r13d,%esi
  lea    D184(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %r13d,%xmm0
  divss  0x28(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  movsd  %xmm2,0x40(%rsp)
  movapd %xmm2,%xmm0
  lea    D266(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D231(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D75(%rip),%rdi
  call   <puts@plt>
  movss  0x8(%rsp),%xmm7
  divss  0x28(%rsp),%xmm7
  movss  %xmm7,0x8(%rsp)
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm7,%xmm3
  movsd  %xmm3,0x48(%rsp)
  movapd %xmm3,%xmm0
  lea    D129(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm6,%xmm6
  cvtss2sd 0x10(%rsp),%xmm6
  movsd  %xmm6,0x10(%rsp)
  movapd %xmm6,%xmm0
  lea    D219(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm2,%xmm2
  cvtss2sd 0x18(%rsp),%xmm2
  movsd  %xmm2,0x18(%rsp)
  movapd %xmm2,%xmm0
  lea    D41(%rip),%r14
  mov    %r14,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movss  0x8(%rsp),%xmm1
  mulss  %xmm1,%xmm1
  movss  0x24(%rsp),%xmm0
  subss  %xmm1,%xmm0
  divss  0x28(%rsp),%xmm0
  pxor   %xmm7,%xmm7
  cvtss2sd %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movapd %xmm7,%xmm0
  lea    D188(%rip),%r15
  mov    %r15,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x30(%rsp),%rdx
  lea    D122(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    0x2c(%rsp),%edx
  lea    D159(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movsd  0x38(%rsp),%xmm0
  mov    %r12d,%edx
  lea    D200(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  mov    %r13d,%edx
  lea    D184(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movsd  0x40(%rsp),%xmm0
  lea    D266(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  mov    %ebp,%edx
  lea    D231(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbx,%rcx
  mov    $0xd,%edx
  mov    $0x1,%esi
  lea    D173(%rip),%rdi
  call   <fwrite@plt>
  movsd  0x48(%rsp),%xmm0
  lea    D129(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  movsd  0x10(%rsp),%xmm0
  lea    D219(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  movsd  0x18(%rsp),%xmm0
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  movsd  0x8(%rsp),%xmm0
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: label: D91
type_guessed: string
name: parse_data
arguments: label: D105
type_guessed: string
name: parse_data
arguments: label: D115
type_guessed: string
name: parse_data
arguments: label: D123
type_guessed: string
name: parse_data
arguments: label: D187
type_guessed: string
name: parse_data
arguments: label: D195
type_guessed: string
name: parse_data
arguments: label: D199
type_guessed: string
name: parse_data
arguments: label: D122
type_guessed: string
name: parse_data
arguments: label: D159
type_guessed: string
name: parse_data
arguments: label: D244
type_guessed: f64
name: parse_data
arguments: label: D200
type_guessed: string
name: parse_data
arguments: label: D184
type_guessed: string
name: parse_data
arguments: label: D266
type_guessed: string
name: parse_data
arguments: label: D231
type_guessed: string
name: parse_data
arguments: label: D75
type_guessed: string
name: parse_data
arguments: label: D129
type_guessed: string
name: parse_data
arguments: label: D219
type_guessed: string
name: parse_data
arguments: label: D41
type_guessed: string
name: parse_data
arguments: label: D188
type_guessed: string
name: parse_data
arguments: label: D173
type_guessed: string

tool: D91: Overall expression stats

tool: D105: Overall expression stats


tool: D115: 	mean expression=%.2f


tool: D123: 	s.d. expression=%.2f


tool: D187: 	min expression=%.2f


tool: D195: 	max expression=%.2f


tool: D199: 	Occurences of motif %s


tool: D122: ***** Statistics for motif = %s *****


tool: D159: 	Number of transcripts explored = %d


tool: D244: 100

tool: D200: 	Number of transcripts motif is present in = %d (%.1f)


tool: D184: 	Total number of motif occurrences = %d


tool: D266: 		Mean number of occurrences per transcript = %.2f


tool: D231: 		Max number of occurrences per transcript = %d


tool: D75: 
	Expression

tool: D129: 	Mean expression level of transcripts with motif = %.2f


tool: D219: 	Min expression level of transcripts with motif = %.2f


tool: D41: 	Max expression level of transcripts with motif = %.2f


tool: D188: 	S.D. of expression level of transcripts with motif = %.2f


tool: D173: 
	Expression


assistant: ```c
void motif_stats_withcounts(char *motif, float *expression, int *motif_count, FILE *output_file, int n_transcripts) {
  int i;
  int index;
  float curr_expression;
  int n;
  int total_occurrences = 0;
  int max_occurrences_per_transcript = 0;
  float mean_occurrences_per_transcript;
  int n_transcripts_present = 0;
  float mean_expression = 0;
  float min_expression = 0;
  float max_expression = 0;
  float expression_var = 0;
  float expression_std;
  float overall_mean_expression;
  float ptranscripts;
  float oa_std_expression;
  float oa_mean_expression;
  float oa_min_expression;
  float oa_max_expression;
  oa_mean_expression = meanf(expression, n_transcripts);
  oa_std_expression = stdf(expression, oa_mean_expression, n_transcripts);
  oa_min_expression = minf(expression, n_transcripts);
  oa_max_expression = maxf(expression, n_transcripts);
  printf("Overall expression stats\n");
  fprintf(output_file, "Overall expression stats\n");
  printf("\tmean expression=%.2f\n", oa_mean_expression);
  fprintf(output_file, "\tmean expression=%.2f\n", oa_mean_expression);
  printf("\ts.d. expression=%.2f\n", oa_std_expression);
  fprintf(output_file, "\ts.d. expression=%.2f\n", oa_std_expression);
  printf("\tmin expression=%.2f\n", oa_min_expression);
  fprintf(output_file, "\tmin expression=%.2f\n", oa_min_expression);
  printf("\tmax expression=%.2f\n", oa_max_expression);
  fprintf(output_file, "\tmax expression=%.2f\n", oa_max_expression);
  printf("\tOccurences of motif %s\n", motif);
  fprintf(output_file, "\tOccurences of motif %s\n", motif);
  for (i = 1; i <= n_transcripts; i++) {
    n = motif_count[i];
    if (n > 0) {
      total_occurrences = total_occurrences + n;
      if (n > max_occurrences_per_transcript)
        max_occurrences_per_transcript = n;
      n_transcripts_present++;
      curr_expression = expression[i];
      mean_expression = mean_expression + curr_expression;
      expression_var = expression_var + curr_expression * curr_expression;
      if (curr_expression < min_expression)
        min_expression = curr_expression;
      if (curr_expression > max_expression)
        max_expression = curr_expression;
    }
  }
  printf("***** Statistics for motif = %s *****\n", motif);
  printf("\tNumber of transcripts explored = %d\n", n_transcripts);
  ptranscripts = 100.0 * (float)n_transcripts_present / (float)n_transcripts;
  printf("\tNumber of transcripts motif is present in = %d (%.1f)\n", n_transcripts_present, ptranscripts);
  printf("\tTotal number of motif occurrences = %d\n", total_occurrences);
  mean_occurrences_per_transcript = (float)total_occurrences / (float)n_transcripts_present;
  printf("\t\tMean number of occurrences per transcript = %.2f\n", mean_occurrences_per_transcript);
  printf("\t\tMax number of occurrences per transcript = %d\n", max_occurrences_per_transcript);
  printf("\n\tExpression\n");
  mean_expression = mean_expression / (float)n_transcripts_present;
  printf("\tMean expression level of transcripts with motif = %.2f\n", mean_expression);
  printf("\tMin expression level of transcripts with motif = %.2f\n", min_expression);
  printf("\tMax expression level of transcripts with motif = %.2f\n", max_expression);
  expression_var = expression_var - mean_expression * mean_expression;
  expression_var = expression_var / (float)n_transcripts_present;
  printf("\tS.D. of expression level of transcripts with motif = %.2f\n", expression_var);
  fprintf(output_file, "***** Statistics for motif = %s *****\n", motif);
  fprintf(output_file, "\tNumber of transcripts explored = %d\n", n_transcripts);
  fprintf(output_file, "\tNumber of transcripts motif is present in = %d (%.1f)\n", n_transcripts_present, ptranscripts);
  fprintf(output_file, "\tTotal number of motif occurrences = %d\n", total_occurrences);
  fprintf(output_file, "\t\tMean number of occurrences per transcript = %.2f\n", mean_occurrences_per_transcript);
  fprintf(output_file, "\t\tMax number of occurrences per transcript = %d\n", max_occurrences_per_transcript);
  fprintf(output_file, "\n\tExpression\n");
  fprintf(output_file, "\tMean expression level of transcripts with motif = %.2f\n", mean_expression);
  fprintf(output_file, "\tMin expression level of transcripts with motif = %.2f\n", min_expression);
  fprintf(output_file, "\tMax expression level of transcripts with motif = %.2f\n", max_expression);
  fprintf(output_file, "\tS.D. of expression level of transcripts with motif = %.2f\n", expression_var);
}
```