user: 请将以下的汇编代码转换成C语言代码:

```asm
<revbin_permute>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r14
  cmp    $0x40,%rsi
  jbe    L43
  mov    %rsi,%rdi
  mov    $0x0,%eax
  call   <ld@plt>
  movslq %eax,%r15
  mov    %r14,%rax
  shr    %rax
  mov    %rax,(%rsp)
  lea    -0x1(%r14),%rcx
  mov    %rcx,0x8(%rsp)
  sub    $0x2,%rax
  mov    %rax,0x10(%rsp)
  sub    %rax,%rcx
  mov    %rcx,0x18(%rsp)
  shr    $0x2,%r14
  mov    $0x0,%ebx
  mov    $0x0,%ebp
L42:
  lea    0x1(%rbp),%r13
  xor    (%rsp),%rbx
  cmp    %rbx,%r13
  jb     L92
L3:
  lea    0x2(%rbp),%r13
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <revbin@plt>
  movslq %eax,%rbx
  cmp    %rbx,%r13
  jb     L37
L57:
  lea    0x3(%rbp),%r13
  xor    (%rsp),%rbx
  cmp    %rbx,%r13
  jb     L31
L93:
  add    $0x4,%rbp
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <revbin@plt>
  movslq %eax,%rbx
  cmp    %r14,%rbp
  jae    L59
  cmp    %rbx,%rbp
  jae    L42
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  mov    0x8(%rsp),%rax
  mov    %rax,%rdx
  xor    %rbx,%rdx
  xor    %rbp,%rax
  mov    %rax,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  mov    0x10(%rsp),%rax
  mov    %rax,%rdx
  xor    %rbx,%rdx
  xor    %rbp,%rax
  mov    %rax,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  mov    0x18(%rsp),%rax
  mov    %rax,%rdx
  xor    %rbx,%rdx
  xor    %rbp,%rax
  mov    %rax,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  jmp    L42
L43:
  mov    $0x0,%eax
  call   <revbin_permute_leq_64@plt>
L59:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L92:
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  mov    %rbx,%rdx
  mov    0x8(%rsp),%rax
  xor    %rax,%rdx
  mov    %r13,%rsi
  xor    %rax,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  jmp    L3
L37:
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  mov    0x8(%rsp),%rax
  mov    %rax,%rdx
  xor    %rbx,%rdx
  mov    %r13,%rsi
  xor    %rax,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  jmp    L57
L31:
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  mov    %rbx,%rdx
  mov    0x10(%rsp),%rax
  xor    %rax,%rdx
  mov    %r13,%rsi
  xor    %rax,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <idx_swap@plt>
  jmp    L93
```

assistant: ```c
void revbin_permute(double _Complex *f, unsigned long n) {
  if (n <= 64) {
    revbin_permute_leq_64(f, n);
    return;
  }
  const unsigned long ldn = ld(n);
  const unsigned long nh = (n >> 1);
  const unsigned long n1 = n - 1;
  const unsigned long nx1 = nh - 2;
  const unsigned long nx2 = n1 - nx1;
  unsigned long k = 0, r = 0;
  while (k < (n / 4)) {
    if (r > k) {
      idx_swap(f, k, r);
      idx_swap(f, n1 ^ k, n1 ^ r);
      idx_swap(f, nx1 ^ k, nx1 ^ r);
      idx_swap(f, nx2 ^ k, nx2 ^ r);
    }
    ++k;
    r ^= nh;
    if (r > k) {
      idx_swap(f, k, r);
      idx_swap(f, n1 ^ k, n1 ^ r);
    }
    ++k;
    r = revbin(k, ldn);
    if (r > k) {
      idx_swap(f, k, r);
      idx_swap(f, n1 ^ k, n1 ^ r);
    }
    ++k;
    r ^= nh;
    if (r > k) {
      idx_swap(f, k, r);
      idx_swap(f, nx1 ^ k, nx1 ^ r);
    }
    ++k;
    r = revbin(k, ldn);
  }
}
```