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

```asm
<motif_stats_withcounts>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  push   %r13
  push   %r12
  lea    D131(%rip),%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %r8d,%esi
  sub    $0x48,%rsp
  mov    %rdi,(%rsp)
  mov    %rbx,%rdi
  mov    %rdx,0x18(%rsp)
  call   <meanf@plt>
  mov    %r15d,%esi
  mov    %rbx,%rdi
  movss  %xmm0,0x8(%rsp)
  call   <stdf@plt>
  mov    %r15d,%esi
  mov    %rbx,%rdi
  movd   %xmm0,%r14d
  call   <minf@plt>
  mov    %r15d,%esi
  mov    %rbx,%rdi
  movd   %xmm0,%r13d
  call   <maxf@plt>
  lea    D62(%rip),%rdi
  movss  %xmm0,0x10(%rsp)
  call   <puts@plt>
  mov    $0x19,%edx
  mov    %rbp,%rcx
  mov    $0x1,%esi
  lea    D132(%rip),%rdi
  call   <fwrite@plt>
  movss  0x8(%rsp),%xmm1
  mov    %r12,%rdi
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtss2sd %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x8(%rsp),%xmm0
  lea    D165(%rip),%r12
  call   <fprintf@plt>
  movd   %r14d,%xmm6
  pxor   %xmm0,%xmm0
  lea    D46(%rip),%r14
  mov    %r14,%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm6,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x8(%rsp),%xmm0
  call   <fprintf@plt>
  movd   %r13d,%xmm4
  pxor   %xmm0,%xmm0
  lea    D93(%rip),%r13
  mov    %r13,%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm4,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x8(%rsp),%xmm0
  call   <fprintf@plt>
  movss  0x10(%rsp),%xmm2
  mov    %r12,%rdi
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtss2sd %xmm2,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x8(%rsp),%xmm0
  lea    D101(%rip),%r12
  call   <fprintf@plt>
  mov    (%rsp),%r14
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    %r14,%rsi
  call   <printf@plt>
  xor    %eax,%eax
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  test   %r15d,%r15d
  jle    L17
  pxor   %xmm1,%xmm1
  mov    0x18(%rsp),%r10
  lea    0x1(%r15),%ecx
  xor    %r14d,%r14d
  mov    $0x1,%eax
  movaps %xmm1,%xmm3
  movaps %xmm1,%xmm4
  xor    %r12d,%r12d
  movaps %xmm1,%xmm2
  xor    %r13d,%r13d
  cs nopw 0x0(%rax,%rax,1)
L8:
  mov    (%r10,%rax,4),%edx
  test   %edx,%edx
  jle    L31
  movss  (%rbx,%rax,4),%xmm0
  add    %edx,%r13d
  cmp    %edx,%r12d
  cmovl  %edx,%r12d
  add    $0x1,%r14d
  movaps %xmm0,%xmm5
  movaps %xmm0,%xmm7
  mulss  %xmm0,%xmm5
  addss  %xmm0,%xmm2
  minss  %xmm4,%xmm7
  maxss  %xmm3,%xmm0
  movaps %xmm7,%xmm4
  movaps %xmm0,%xmm3
  addss  %xmm5,%xmm1
L31:
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L8
L2:
  mov    (%rsp),%rbx
  lea    D33(%rip),%rcx
  xor    %eax,%eax
  movss  %xmm1,0x3c(%rsp)
  mov    %rcx,%rdi
  movss  %xmm3,0x38(%rsp)
  mov    %rbx,%rsi
  movss  %xmm4,0x10(%rsp)
  movss  %xmm2,0x8(%rsp)
  call   <printf@plt>
  lea    D23(%rip),%r11
  mov    %r15d,%esi
  xor    %eax,%eax
  mov    %r11,%rdi
  call   <printf@plt>
  pxor   %xmm6,%xmm6
  pxor   %xmm5,%xmm5
  mov    %r14d,%esi
  cvtsi2ss %r14d,%xmm6
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtsi2ss %r15d,%xmm0
  lea    D34(%rip),%rdi
  cvtss2sd %xmm6,%xmm5
  mulsd  D143(%rip),%xmm5
  movss  %xmm6,(%rsp)
  cvtss2sd %xmm0,%xmm0
  divsd  %xmm0,%xmm5
  cvtsd2ss %xmm5,%xmm5
  cvtss2sd %xmm5,%xmm5
  movapd %xmm5,%xmm0
  movsd  %xmm5,0x30(%rsp)
  call   <printf@plt>
  mov    %r13d,%esi
  lea    D226(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  pxor   %xmm6,%xmm6
  mov    $0x1,%eax
  lea    D140(%rip),%rdi
  cvtsi2ss %r13d,%xmm6
  divss  (%rsp),%xmm6
  cvtss2sd %xmm6,%xmm6
  movapd %xmm6,%xmm0
  movsd  %xmm6,0x28(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  lea    D105(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D63(%rip),%rdi
  call   <puts@plt>
  pxor   %xmm7,%xmm7
  movss  0x8(%rsp),%xmm2
  lea    D106(%rip),%rdi
  divss  (%rsp),%xmm2
  mov    $0x1,%eax
  cvtss2sd %xmm2,%xmm7
  movapd %xmm7,%xmm0
  movsd  %xmm7,0x18(%rsp)
  movss  %xmm2,0x24(%rsp)
  call   <printf@plt>
  movss  0x10(%rsp),%xmm4
  mov    $0x1,%eax
  lea    D202(%rip),%r10
  mov    %r10,%rdi
  cvtss2sd %xmm4,%xmm4
  movapd %xmm4,%xmm0
  movsd  %xmm4,0x10(%rsp)
  call   <printf@plt>
  movss  0x38(%rsp),%xmm3
  mov    $0x1,%eax
  lea    D211(%rip),%r9
  mov    %r9,%rdi
  cvtss2sd %xmm3,%xmm3
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  call   <printf@plt>
  movss  0x24(%rsp),%xmm2
  movss  0x3c(%rsp),%xmm1
  lea    D123(%rip),%r8
  mov    %r8,%rdi
  mov    $0x1,%eax
  mulss  %xmm2,%xmm2
  subss  %xmm2,%xmm1
  divss  (%rsp),%xmm1
  cvtss2sd %xmm1,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  call   <printf@plt>
  mov    %rbx,%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D33(%rip),%rcx
  mov    %rcx,%rsi
  call   <fprintf@plt>
  mov    %r15d,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D23(%rip),%r11
  mov    %r11,%rsi
  call   <fprintf@plt>
  mov    %r14d,%edx
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x30(%rsp),%xmm5
  lea    D34(%rip),%rsi
  movapd %xmm5,%xmm0
  call   <fprintf@plt>
  mov    %r13d,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D226(%rip),%rsi
  call   <fprintf@plt>
  movsd  0x28(%rsp),%xmm6
  mov    %rbp,%rdi
  lea    D140(%rip),%rsi
  mov    $0x1,%eax
  movapd %xmm6,%xmm0
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D105(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rcx
  mov    $0xd,%edx
  mov    $0x1,%esi
  lea    D291(%rip),%rdi
  call   <fwrite@plt>
  movsd  0x18(%rsp),%xmm7
  mov    %rbp,%rdi
  lea    D106(%rip),%rsi
  mov    $0x1,%eax
  movapd %xmm7,%xmm0
  call   <fprintf@plt>
  movsd  0x10(%rsp),%xmm4
  mov    %rbp,%rdi
  lea    D202(%rip),%r10
  mov    %r10,%rsi
  mov    $0x1,%eax
  movapd %xmm4,%xmm0
  call   <fprintf@plt>
  movsd  0x8(%rsp),%xmm3
  mov    %rbp,%rdi
  lea    D211(%rip),%r9
  mov    %r9,%rsi
  mov    $0x1,%eax
  movapd %xmm3,%xmm0
  call   <fprintf@plt>
  movsd  (%rsp),%xmm1
  add    $0x48,%rsp
  lea    D123(%rip),%r8
  pop    %rbx
  mov    %rbp,%rdi
  mov    %r8,%rsi
  pop    %rbp
  movapd %xmm1,%xmm0
  pop    %r12
  mov    $0x1,%eax
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <fprintf@plt>
  nopw   0x0(%rax,%rax,1)
L17:
  pxor   %xmm1,%xmm1
  xor    %r14d,%r14d
  xor    %r12d,%r12d
  xor    %r13d,%r13d
  movaps %xmm1,%xmm3
  movaps %xmm1,%xmm4
  movaps %xmm1,%xmm2
  jmp    L2
```

tool_calls: name: unpack_data
arguments: data_tag: D131
type_infered: string
name: unpack_data
arguments: data_tag: D62
type_infered: string
name: unpack_data
arguments: data_tag: D132
type_infered: string
name: unpack_data
arguments: data_tag: D165
type_infered: string
name: unpack_data
arguments: data_tag: D46
type_infered: string
name: unpack_data
arguments: data_tag: D93
type_infered: string
name: unpack_data
arguments: data_tag: D101
type_infered: string
name: unpack_data
arguments: data_tag: D33
type_infered: string
name: unpack_data
arguments: data_tag: D23
type_infered: string
name: unpack_data
arguments: data_tag: D34
type_infered: string
name: unpack_data
arguments: data_tag: D143
type_infered: f64
name: unpack_data
arguments: data_tag: D226
type_infered: string
name: unpack_data
arguments: data_tag: D140
type_infered: string
name: unpack_data
arguments: data_tag: D105
type_infered: string
name: unpack_data
arguments: data_tag: D63
type_infered: string
name: unpack_data
arguments: data_tag: D106
type_infered: string
name: unpack_data
arguments: data_tag: D202
type_infered: string
name: unpack_data
arguments: data_tag: D211
type_infered: string
name: unpack_data
arguments: data_tag: D123
type_infered: string
name: unpack_data
arguments: data_tag: D291
type_infered: string

tool: D131: 	mean expression=%.2f


tool: D62: Overall expression stats

tool: D132: Overall expression stats


tool: D165: 	max expression=%.2f


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


tool: D93: 	min expression=%.2f


tool: D101: 	Occurences of motif %s


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


tool: D23: 	Number of transcripts explored = %d


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


tool: D143: 100

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


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


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


tool: D63: 
	Expression

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


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


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


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


tool: D291: 
	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);
}
```