user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<gsw_turner_rsubrho>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %r8,0x30(%rsp)
  mov    0x80(%rsp),%rbp
  cmp    $0x1,%ecx
  jle    L27
  lea    -0x2(%rcx),%eax
  movsd  D7(%rip),%xmm4
  mov    %rdi,%r15
  xor    %ebx,%ebx
  mov    %rax,0x38(%rsp)
  mov    %rsi,%r14
  mov    %rdx,%r12
  mov    %r9,%r13
  jmp    L26
  nopl   0x0(%rax,%rax,1)
L4:
  mov    %rax,%rbx
L26:
  movsd  0x8(%r15,%rbx,8),%xmm1
  movsd  (%r15,%rbx,8),%xmm0
  movsd  (%r12,%rbx,8),%xmm2
  addsd  0x8(%r12,%rbx,8),%xmm2
  movapd %xmm0,%xmm5
  addsd  %xmm1,%xmm0
  subsd  %xmm1,%xmm5
  movsd  (%r14,%rbx,8),%xmm1
  mulsd  %xmm4,%xmm2
  movapd %xmm0,%xmm3
  movsd  0x8(%r14,%rbx,8),%xmm0
  movapd %xmm1,%xmm6
  mulsd  %xmm4,%xmm3
  movsd  %xmm5,0x8(%rsp)
  addsd  %xmm0,%xmm1
  subsd  %xmm0,%xmm6
  movsd  %xmm2,0x0(%rbp,%rbx,8)
  mulsd  %xmm4,%xmm1
  movsd  %xmm6,0x10(%rsp)
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm1,0x28(%rsp)
  call   <gsw_alpha@plt>
  movsd  0x20(%rsp),%xmm3
  movsd  0x0(%rbp,%rbx,8),%xmm2
  movsd  0x28(%rsp),%xmm1
  movsd  %xmm0,0x18(%rsp)
  movapd %xmm3,%xmm0
  call   <gsw_beta@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  mulsd  0x18(%rsp),%xmm3
  mulsd  %xmm0,%xmm2
  movapd %xmm3,%xmm1
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x18(%rsp)
  addsd  %xmm2,%xmm0
  subsd  %xmm2,%xmm1
  movsd  %xmm2,0x10(%rsp)
  call   <atan2@plt>
  movsd  0x8(%rsp),%xmm5
  pxor   %xmm7,%xmm7
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  0x10(%rsp),%xmm2
  mov    D7(%rip),%rax
  ucomisd %xmm7,%xmm5
  movsd  0x18(%rsp),%xmm3
  mulsd  D2(%rip),%xmm0
  movq   %rax,%xmm4
  jp     L34
  mov    D10(%rip),%rax
  movq   %rax,%xmm1
  je     L41
L34:
  divsd  %xmm2,%xmm3
  movapd %xmm3,%xmm1
L41:
  mov    0x30(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,8)
  lea    0x1(%rbx),%rax
  movsd  %xmm1,0x0(%r13,%rbx,8)
  cmp    %rbx,0x38(%rsp)
  jne    L4
L27:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D7
data_type: f64
name: unpack_data
arguments: data_label: D2
data_type: byte[8]
name: unpack_data
arguments: data_label: D10
data_type: f64

tool: D7: 0.5

tool: {"D2": [0xf8,0xc1,0x63,0x1a,0xdc,0xa5,0x4c,0x40]}

tool: D10: 9000000000000000.0

assistant: ```c
void gsw_turner_rsubrho(double *sa, double *ct, double *p, int nz, double *tu, double *rsubrho, double *p_mid) {
  int k;
  double pi = 3.141592653589793e0;
  double dsa, sa_mid, dct, ct_mid, dp;
  double alpha_mid, beta_mid;
  for (k = 0; k < nz - 1; k++) {
    dsa = (sa[k] - sa[k + 1]);
    sa_mid = 0.5e0 * (sa[k] + sa[k + 1]);
    dct = (ct[k] - ct[k + 1]);
    ct_mid = 0.5e0 * (ct[k] + ct[k + 1]);
    dp = (p[k] - p[k + 1]);
    p_mid[k] = 0.5e0 * (p[k] + p[k + 1]);
    alpha_mid = gsw_alpha(sa_mid, ct_mid, p_mid[k]);
    beta_mid = gsw_beta(sa_mid, ct_mid, p_mid[k]);
    tu[k] = (180e0 / pi) * atan2((alpha_mid * dct + beta_mid * dsa), (alpha_mid * dct - beta_mid * dsa));
    if (dsa == 0e0)
      rsubrho[k] = 9e15;
    else
      rsubrho[k] = (alpha_mid * dct) / (beta_mid * dsa);
  }
}
```