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

```asm
<calc_median_limits>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%r13
  mov    %rcx,%r14
  test   %esi,%esi
  jne    L6
  movl   $0x0,(%rdx)
  movl   $0x0,(%rcx)
L17:
  mov    %r12,%rdi
  call   <ckfree@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L6:
  mov    %rdi,%rbp
  mov    %esi,%ebx
  lea    0x4(,%rsi,4),%edi
  call   <ckalloc@plt>
  mov    %rax,%r12
  test   %ebx,%ebx
  jle    L85
  mov    %ebx,%edx
  mov    $0x0,%eax
L42:
  movss  0x0(%rbp,%rax,4),%xmm0
  movss  %xmm0,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L42
L85:
  lea    -0x1(%rbx),%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <sort_scores@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  D13(%rip),%xmm0
  addsd  D36(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm0
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  subss  %xmm1,%xmm0
  ucomiss D3(%rip),%xmm0
  jp     L30
  jne    L30
  movslq %eax,%rdx
  movss  0x4(%r12,%rdx,4),%xmm1
  addss  (%r12,%rdx,4),%xmm1
  movss  D3(%rip),%xmm2
  mulss  %xmm2,%xmm1
  mov    %ebx,%edx
  sub    %eax,%edx
  movslq %edx,%rax
  movss  -0x4(%r12,%rax,4),%xmm0
  addss  (%r12,%rax,4),%xmm0
  mulss  %xmm2,%xmm0
L77:
  cmp    $0x3,%ebx
  jg     L55
  movss  (%r12),%xmm0
  movss  %xmm0,(%r14)
  movslq %ebx,%rbx
  movss  -0x4(%r12,%rbx,4),%xmm0
  movss  %xmm0,0x0(%r13)
  jmp    L17
L30:
  comiss D3(%rip),%xmm0
  jbe    L104
  movslq %eax,%rdx
  movss  0x4(%r12,%rdx,4),%xmm1
  mov    %ebx,%edx
  sub    %eax,%edx
  movslq %edx,%rax
  movss  -0x4(%r12,%rax,4),%xmm0
  jmp    L77
L104:
  movslq %eax,%rdx
  movss  (%r12,%rdx,4),%xmm1
  mov    %ebx,%edx
  sub    %eax,%edx
  movslq %edx,%rax
  movss  (%r12,%rax,4),%xmm0
  jmp    L77
L55:
  movaps %xmm1,%xmm3
  subss  %xmm0,%xmm3
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm3,%xmm2
  mulsd  D36(%rip),%xmm2
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm2,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,(%r14)
  subss  %xmm3,%xmm0
  movss  %xmm0,0x0(%r13)
  jmp    L17
```

tool_calls: name: retrieve_data
arguments: data_label: D13
data_type: byte[8]
name: retrieve_data
arguments: data_label: D36
data_type: f64
name: retrieve_data
arguments: data_label: D3
data_type: byte[4]

tool: {"D13": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

tool: D36: 0.5

tool: {"D3": [0x00,0x00,0x00,0x3f]}

assistant: ```c
void calc_median_limits(float *scores, int n, float *ll, float *ul) {
  int i;
  float t, q1, q3;
  float *sortedscores;
  if (n == 0) {
    (*ul) = (*ll) = 0;
  } else {
    sortedscores = ckalloc((n + 1) * sizeof(float));
    for (i = 0; i < n; i++)
      sortedscores[i] = scores[i];
    sort_scores(sortedscores, 0, n - 1);
    t = n / 4.0 + 0.5;
    if (t - (int)t == 0.5) {
      q3 = (sortedscores[(int)t] + sortedscores[(int)t + 1]) / 2.0;
      q1 = (sortedscores[n - (int)t] + sortedscores[n - (int)t - 1]) / 2.0;
    } else if (t - (int)t > 0.5) {
      q3 = sortedscores[(int)t + 1];
      q1 = sortedscores[n - (int)t - 1];
    } else {
      q3 = sortedscores[(int)t];
      q1 = sortedscores[n - (int)t];
    }
    if (n < 4) {
      (*ul) = sortedscores[0];
      (*ll) = sortedscores[n - 1];
    } else {
      (*ul) = q3 + (q3 - q1) / 2.0;
      (*ll) = q1 - (q3 - q1);
    }
  }
  ckfree(sortedscores);
}
```