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

```asm
<quick_pileup_simple>:
  endbr64
  push   %r12
  lea    0x4(%rdx),%r10
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    (%rcx),%eax
  mov    %rdi,%rbx
  mov    (%rdx),%esi
  cmp    %eax,%esi
  cmovg  %eax,%esi
  lea    0x4(%rcx),%rax
  xor    %r12d,%r12d
  test   %esi,%esi
  je     L97
  pxor   %xmm2,%xmm2
  mov    %esi,(%rdi)
  add    $0x4,%rbx
  add    $0x4,%rbp
  maxss  %xmm1,%xmm2
  mov    $0x1,%r12d
  movss  %xmm2,-0x4(%rbp)
L97:
  test   %r8,%r8
  jle    L74
  xor    %edi,%edi
  xor    %r9d,%r9d
  xor    %ecx,%ecx
  jmp    L33
  nopl   (%rax)
L114:
  cmp    %esi,%edx
  je     L69
  pxor   %xmm2,%xmm2
  mov    %edx,(%rbx)
  add    $0x4,%rbp
  add    $0x4,%rbx
  cvtsi2ss %edi,%xmm2
  add    $0x1,%r12
  mulss  %xmm0,%xmm2
  maxss  %xmm1,%xmm2
  movss  %xmm2,-0x4(%rbp)
L69:
  add    $0x1,%edi
  add    $0x1,%rcx
  add    $0x4,%r10
  mov    %edx,%esi
L42:
  cmp    %rcx,%r9
  mov    %rcx,%rdx
  cmovge %r9,%rdx
  cmp    %rdx,%r8
  jle    L20
L33:
  mov    (%r10),%edx
  mov    (%rax),%r11d
  cmp    %r11d,%edx
  jl     L114
  add    $0x1,%r9
  add    $0x4,%rax
  cmp    %r11d,%edx
  jle    L111
  cmp    %esi,%r11d
  je     L56
  pxor   %xmm2,%xmm2
  mov    %r11d,(%rbx)
  add    $0x4,%rbp
  add    $0x4,%rbx
  cvtsi2ss %edi,%xmm2
  add    $0x1,%r12
  mulss  %xmm0,%xmm2
  maxss  %xmm1,%xmm2
  movss  %xmm2,-0x4(%rbp)
L56:
  sub    $0x1,%edi
  mov    %rcx,%rdx
  cmp    %rcx,%r9
  mov    %r11d,%esi
  cmovge %r9,%rdx
  cmp    %rdx,%r8
  jg     L33
L20:
  cmp    %r9,%r8
  jle    L74
  sub    %r9,%r8
  lea    (%rax,%r8,4),%rcx
  nopl   0x0(%rax)
L39:
  mov    %esi,%edx
  mov    (%rax),%esi
  cmp    %edx,%esi
  je     L64
  pxor   %xmm2,%xmm2
  mov    %esi,(%rbx)
  add    $0x4,%rbp
  add    $0x4,%rbx
  cvtsi2ss %edi,%xmm2
  add    $0x1,%r12
  mulss  %xmm0,%xmm2
  maxss  %xmm1,%xmm2
  movss  %xmm2,-0x4(%rbp)
L64:
  add    $0x4,%rax
  sub    $0x1,%edi
  cmp    %rax,%rcx
  jne    L39
L74:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L111:
  add    $0x1,%rcx
  add    $0x4,%r10
  jmp    L42
```

assistant: ```c
long quick_pileup_simple(int *ret_poss, float *ret_values, int *start_poss, int *end_poss, long length_poss, float scale_factor, float baseline_value) {
  long i_s, i_e, i, I;
  int p, pre_p, pileup;
  int *ptr_ret_poss;
  int *ptr_start_poss, *ptr_end_poss;
  float *ptr_ret_values;
  long l = length_poss;
  ptr_ret_poss = ret_poss;
  ptr_ret_values = ret_values;
  ptr_start_poss = start_poss;
  ptr_end_poss = end_poss;
  i_s = 0;
  i_e = 0;
  pileup = 0;
  pre_p = ((*ptr_start_poss) > (*ptr_end_poss) ? (*ptr_end_poss) : (*ptr_start_poss));
  ptr_start_poss++;
  ptr_end_poss++;
  I = 0;
  if (pre_p != 0) {
    *ptr_ret_poss = pre_p;
    *ptr_ret_values = ((0) > (baseline_value) ? (0) : (baseline_value));
    ptr_ret_poss++;
    ptr_ret_values++;
    I++;
  }
  while (i_s < l && i_e < l) {
    if (*ptr_start_poss < *ptr_end_poss) {
      p = *ptr_start_poss;
      if (p != pre_p) {
        *ptr_ret_poss = p;
        *ptr_ret_values = ((pileup * scale_factor) > (baseline_value) ? (pileup * scale_factor) : (baseline_value));
        ptr_ret_poss++;
        ptr_ret_values++;
        I++;
        pre_p = p;
      }
      pileup += 1;
      i_s += 1;
      ptr_start_poss++;
    } else if (*ptr_start_poss > *ptr_end_poss) {
      p = *ptr_end_poss;
      if (p != pre_p) {
        *ptr_ret_poss = p;
        *ptr_ret_values = ((pileup * scale_factor) > (baseline_value) ? (pileup * scale_factor) : (baseline_value));
        ptr_ret_poss++;
        ptr_ret_values++;
        I++;
        pre_p = p;
      }
      pileup -= 1;
      i_e += 1;
      ptr_end_poss++;
    } else {
      i_s += 1;
      i_e += 1;
      ptr_start_poss++;
      ptr_end_poss++;
    }
  }
  if (i_e < l) {
    for (i = i_e; i < l; i++) {
      p = *ptr_end_poss;
      if (p != pre_p) {
        *ptr_ret_poss = p;
        *ptr_ret_values = ((pileup * scale_factor) > (baseline_value) ? (pileup * scale_factor) : (baseline_value));
        ptr_ret_poss++;
        ptr_ret_values++;
        I++;
        pre_p = p;
      }
      pileup -= 1;
      ptr_end_poss++;
    }
  }
  return I;
}
```