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

```asm
<bn_sqr_recursive>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  cmp    $0x4,%edx
  je     L94
  mov    %edx,%ebx
  mov    %rcx,%r12
  cmp    $0x8,%edx
  je     L9
  cmp    $0xf,%edx
  jle    L18
  mov    %edx,%ebp
  shr    $0x1f,%ebp
  add    %edx,%ebp
  sar    %ebp
  movslq %ebp,%rax
  shl    $0x2,%rax
  mov    %rax,0x10(%rsp)
  lea    (%rsi,%rax,1),%r15
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <bn_cmp_words@plt>
  test   %eax,%eax
  jg     L48
  js     L105
  lea    (%rbx,%rbx,1),%eax
  cltq
  lea    (%r12,%rax,4),%rax
  mov    %rax,0x8(%rsp)
  movslq %ebx,%rax
  lea    0x0(,%rbx,4),%edx
  lea    (%r12,%rax,4),%rdi
  mov    $0x0,%esi
  call   <memset@plt>
L126:
  mov    0x8(%rsp),%rcx
  mov    %ebp,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <bn_sqr_recursive>
  movslq %ebx,%rax
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  lea    0x0(%r13,%rax,1),%r14
  mov    0x8(%rsp),%rcx
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <bn_sqr_recursive>
  mov    %ebx,%ecx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <bn_add_words@plt>
  mov    %rax,%r15
  mov    0x18(%rsp),%rax
  lea    (%r12,%rax,1),%r14
  mov    %ebx,%ecx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <bn_sub_words@plt>
  sub    %eax,%r15d
  mov    0x10(%rsp),%rdi
  add    %r13,%rdi
  mov    %ebx,%ecx
  mov    %r14,%rdx
  mov    %rdi,%rsi
  call   <bn_add_words@plt>
  add    %eax,%r15d
  je     L28
  add    %ebx,%ebp
  movslq %ebp,%rbp
  lea    0x0(%r13,%rbp,4),%rdx
  mov    %r15d,%eax
  add    (%rdx),%eax
  mov    %eax,(%rdx)
  cmp    %eax,%r15d
  jbe    L28
L100:
  add    $0x4,%rdx
  mov    (%rdx),%eax
  add    $0x1,%eax
  mov    %eax,(%rdx)
  je     L100
  jmp    L28
L94:
  call   <bn_sqr_comba4@plt>
  jmp    L28
L9:
  call   <bn_sqr_comba8@plt>
  jmp    L28
L18:
  call   <bn_sqr_normal@plt>
L28:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L48:
  mov    %ebp,%ecx
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <bn_sub_words@plt>
L70:
  lea    (%rbx,%rbx,1),%eax
  cltq
  lea    (%r12,%rax,4),%rcx
  mov    %rcx,0x8(%rsp)
  movslq %ebx,%rax
  lea    (%r12,%rax,4),%rdi
  mov    %ebp,%edx
  mov    %r12,%rsi
  call   <bn_sqr_recursive>
  jmp    L126
L105:
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <bn_sub_words@plt>
  jmp    L70
```

assistant: ```c
void bn_sqr_recursive(unsigned int *r, const unsigned int *a, int n2, unsigned int *t) {
  int n = n2 / 2;
  int zero, c1;
  unsigned int ln, lo, *p;
  if (n2 == 4) {
    bn_sqr_comba4(r, a);
    return;
  } else if (n2 == 8) {
    bn_sqr_comba8(r, a);
    return;
  }
  if (n2 < (16)) {
    bn_sqr_normal(r, a, n2, t);
    return;
  }
  c1 = bn_cmp_words(a, &(a[n]), n);
  zero = 0;
  if (c1 > 0)
    bn_sub_words(t, a, &(a[n]), n);
  else if (c1 < 0)
    bn_sub_words(t, &(a[n]), a, n);
  else
    zero = 1;
  p = &(t[n2 * 2]);
  if (!zero)
    bn_sqr_recursive(&(t[n2]), t, n, p);
  else
    memset(&(t[n2]), 0, n2 * sizeof(unsigned int));
  bn_sqr_recursive(r, a, n, p);
  bn_sqr_recursive(&(r[n2]), &(a[n]), n, p);
  c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  if (c1) {
    p = &(r[n + n2]);
    lo = *p;
    ln = (lo + c1) & (0xffffffffL);
    *p = ln;
    if (ln < (unsigned int)c1) {
      do {
        p++;
        lo = *p;
        ln = (lo + 1) & (0xffffffffL);
        *p = ln;
      } while (ln == 0);
    }
  }
}
```