user: What would the C source look like for the assembly code provided here:

```asm
<bitrv1>:
  endbr64
  push   %r15
  mov    %rsi,%rcx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  sar    $0x2,%edi
  push   %rbx
  sar    %ebp
  movsd  0x8(%rsi),%xmm0
  movslq %ebp,%rax
  lea    0x0(,%rax,8),%r12
  mov    %rax,-0x20(%rsp)
  lea    (%rsi,%r12,1),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,0x8(%rsi)
  movsd  %xmm0,(%rax)
  cmp    $0x2,%edi
  jle    L118
  mov    %edi,%r14d
  mov    $0x2,%r8d
L13:
  sar    $0x2,%r14d
  add    %r8d,%r8d
  cmp    $0x2,%r14d
  jg     L13
  je     L219
  mov    %edi,%r10d
  mov    $0x2,%r12d
  lea    0x10(%rcx),%r13
  cmp    $0x2,%r8d
  jle    L173
  nopw   0x0(%rax,%rax,1)
L226:
  lea    (%r12,%r10,1),%ebx
  cmp    %r10d,%ebx
  jle    L111
  mov    -0x20(%rsp),%rax
  movslq %r10d,%rdx
  lea    (%rcx,%rdx,8),%rsi
  add    %rdx,%rax
  lea    (%rcx,%rax,8),%r9
  lea    -0x1(%r12),%eax
  shr    %eax
  lea    (%rdx,%rax,2),%rax
  mov    %r12d,%edx
  lea    0x0(%r13,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L84:
  movslq %edx,%rax
  movsd  (%rsi),%xmm0
  shl    $0x3,%rax
  lea    (%rcx,%rax,1),%r14
  lea    0x8(%rcx,%rax,1),%rax
  movsd  (%r14),%xmm1
  movsd  %xmm1,(%rsi)
  movsd  %xmm0,(%r14)
  movsd  (%rax),%xmm1
  movsd  (%r9),%xmm0
  movsd  %xmm1,(%r9)
  movsd  %xmm0,(%rax)
  lea    0x1(%rbp,%rdx,1),%eax
  movsd  0x8(%r9),%xmm0
  xor    %edi,%edx
  movslq %eax,%r14
  sub    $0x1,%eax
  lea    (%rcx,%r14,8),%r14
  cltq
  movsd  (%r14),%xmm1
  lea    (%rcx,%rax,8),%rax
  movsd  %xmm1,0x8(%r9)
  movsd  %xmm0,(%r14)
  movsd  0x8(%rsi),%xmm0
  movsd  (%rax),%xmm1
  movsd  %xmm1,0x8(%rsi)
  movsd  %xmm0,(%rax)
  cmp    %edx,%edi
  jle    L28
  mov    %edi,%eax
L178:
  sar    %eax
  xor    %eax,%edx
  cmp    %eax,%edx
  jl     L178
L28:
  add    $0x10,%rsi
  add    $0x10,%r9
  cmp    %rsi,%r11
  jne    L84
L111:
  lea    0x1(%rbx),%eax
  add    $0x2,%r12d
  cltq
  lea    (%rcx,%rax,8),%rdx
  lea    0x0(%rbp,%rbx,1),%eax
  cltq
  movsd  (%rdx),%xmm0
  lea    (%rcx,%rax,8),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
  cmp    %r8d,%r12d
  jge    L173
  xor    %edi,%r10d
  cmp    %r10d,%edi
  jle    L226
  mov    %edi,%eax
  nopl   0x0(%rax,%rax,1)
L23:
  sar    %eax
  xor    %eax,%r10d
  cmp    %eax,%r10d
  jl     L23
  jmp    L226
L118:
  je     L75
L173:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L219:
  lea    0x1(%r8),%eax
  cltq
  lea    (%rcx,%rax,8),%rdx
  lea    0x0(%rbp,%r8,1),%eax
  cltq
  movsd  (%rdx),%xmm0
  lea    (%rcx,%rax,8),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
  cmp    $0x2,%r8d
  jle    L173
  mov    -0x20(%rsp),%rsi
  mov    $0x1,%eax
  movslq %r8d,%r10
  neg    %r12
  mov    %r10,%r11
  mov    %edi,%ebx
  sub    %rsi,%rax
  sub    %rsi,%r11
  mov    %rax,-0x10(%rsp)
  lea    0x10(%rcx),%rax
  mov    %rax,-0x8(%rsp)
L165:
  lea    (%rbx,%r14,1),%eax
  mov    %eax,-0x14(%rsp)
  cmp    %ebx,%eax
  jle    L107
  lea    0x0(%rbp,%rbx,1),%eax
  movslq %ebx,%rdx
  add    -0x20(%rsp),%rdx
  cltq
  add    -0x10(%rsp),%rax
  lea    (%rcx,%rdx,8),%rsi
  lea    (%rcx,%rax,8),%r9
  lea    -0x1(%r14),%eax
  shr    %eax
  lea    (%rdx,%rax,2),%rax
  mov    -0x8(%rsp),%rdx
  lea    (%rdx,%rax,8),%r13
  mov    %r14d,%eax
  nopl   (%rax)
L135:
  movslq %eax,%rdx
  movsd  (%rsi,%r12,1),%xmm0
  lea    (%rcx,%rdx,8),%rdx
  movsd  (%rdx),%xmm1
  movsd  %xmm1,(%rsi,%r12,1)
  movsd  %xmm0,(%rdx)
  lea    (%r8,%rax,1),%edx
  movsd  (%rsi,%r11,8),%xmm0
  xor    %edi,%eax
  movslq %edx,%r15
  add    $0x1,%edx
  lea    (%rcx,%r15,8),%r15
  movsd  (%r15),%xmm1
  movsd  %xmm1,(%rsi,%r11,8)
  movsd  %xmm0,(%r15)
  movslq %edx,%r15
  movsd  (%rsi,%r10,8),%xmm0
  sub    %r8d,%edx
  lea    (%rcx,%r15,8),%r15
  movsd  (%r15),%xmm1
  movsd  %xmm1,(%rsi,%r10,8)
  movsd  %xmm0,(%r15)
  movslq %edx,%r15
  movsd  (%rsi),%xmm0
  add    %ebp,%edx
  lea    (%rcx,%r15,8),%r15
  movsd  (%r15),%xmm1
  movsd  %xmm1,(%rsi)
  movsd  %xmm0,(%r15)
  movslq %edx,%r15
  movsd  0x8(%rsi),%xmm0
  add    %r8d,%edx
  lea    (%rcx,%r15,8),%r15
  movsd  (%r15),%xmm1
  movsd  %xmm1,0x8(%rsi)
  movsd  %xmm0,(%r15)
  movslq %edx,%r15
  movsd  0x8(%rsi,%r10,8),%xmm0
  sub    $0x1,%edx
  lea    (%rcx,%r15,8),%r15
  movsd  (%r15),%xmm1
  movsd  %xmm1,0x8(%rsi,%r10,8)
  movsd  %xmm0,(%r15)
  movslq %edx,%r15
  sub    %r8d,%edx
  movsd  0x8(%rsi,%r11,8),%xmm0
  lea    (%rcx,%r15,8),%r15
  movslq %edx,%rdx
  movsd  (%r15),%xmm1
  lea    (%rcx,%rdx,8),%rdx
  movsd  %xmm1,0x8(%rsi,%r11,8)
  movsd  %xmm0,(%r15)
  movsd  (%r9),%xmm0
  movsd  (%rdx),%xmm1
  movsd  %xmm1,(%r9)
  movsd  %xmm0,(%rdx)
  cmp    %eax,%edi
  jle    L64
  mov    %edi,%edx
  nopl   (%rax)
L190:
  sar    %edx
  xor    %edx,%eax
  cmp    %edx,%eax
  jl     L190
L64:
  add    $0x10,%rsi
  add    $0x10,%r9
  cmp    %rsi,%r13
  jne    L135
L107:
  mov    -0x14(%rsp),%eax
  add    $0x2,%r14d
  lea    0x1(%rax),%edx
  add    %ebp,%eax
  movslq %edx,%rsi
  add    %r8d,%edx
  lea    (%rcx,%rsi,8),%r9
  movslq %eax,%rsi
  add    %r8d,%eax
  movslq %edx,%rdx
  lea    (%rcx,%rsi,8),%rsi
  movsd  (%r9),%xmm0
  cltq
  lea    (%rcx,%rdx,8),%rdx
  movsd  (%rsi),%xmm1
  lea    (%rcx,%rax,8),%rax
  movsd  %xmm1,(%r9)
  movsd  %xmm0,(%rsi)
  movsd  (%rdx),%xmm0
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
  cmp    %r8d,%r14d
  jge    L173
  xor    %edi,%ebx
  cmp    %ebx,%edi
  jle    L165
  mov    %edi,%eax
  xchg   %ax,%ax
L143:
  sar    %eax
  xor    %eax,%ebx
  cmp    %eax,%ebx
  jl     L143
  jmp    L165
L75:
  lea    0x10(%rsi,%r12,1),%rax
  movsd  0x18(%rsi),%xmm0
  movsd  (%rax),%xmm1
  movsd  %xmm1,0x18(%rsi)
  movsd  %xmm0,(%rax)
  jmp    L173
```

assistant: ```c
void bitrv1(int n, double *a) {
  int j0, k0, j1, k1, l, m, i, j, k, nh;
  double x;
  nh = n >> 1;
  x = a[1];
  a[1] = a[nh];
  a[nh] = x;
  m = 2;
  for (l = n >> 2; l > 2; l >>= 2) {
    m <<= 1;
  }
  if (l == 2) {
    j1 = m + 1;
    k1 = m + nh;
    x = a[j1];
    a[j1] = a[k1];
    a[k1] = x;
    j0 = 0;
    for (k0 = 2; k0 < m; k0 += 2) {
      for (i = nh >> 1; i > (j0 ^= i); i >>= 1)
        ;
      k = k0;
      for (j = j0; j < j0 + k0; j += 2) {
        x = a[j];
        a[j] = a[k];
        a[k] = x;
        j1 = j + m;
        k1 = k + m;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1 += nh;
        k1++;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1 -= m;
        k1 -= m;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1++;
        k1 += nh;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1 += m;
        k1 += m;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1 -= nh;
        k1--;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1 -= m;
        k1 -= m;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        for (i = nh >> 1; i > (k ^= i); i >>= 1)
          ;
      }
      k1 = j0 + k0;
      j1 = k1 + 1;
      k1 += nh;
      x = a[j1];
      a[j1] = a[k1];
      a[k1] = x;
      j1 += m;
      k1 += m;
      x = a[j1];
      a[j1] = a[k1];
      a[k1] = x;
    }
  } else {
    j0 = 0;
    for (k0 = 2; k0 < m; k0 += 2) {
      for (i = nh >> 1; i > (j0 ^= i); i >>= 1)
        ;
      k = k0;
      for (j = j0; j < j0 + k0; j += 2) {
        x = a[j];
        a[j] = a[k];
        a[k] = x;
        j1 = j + nh;
        k1 = k + 1;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1++;
        k1 += nh;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        j1 -= nh;
        k1--;
        x = a[j1];
        a[j1] = a[k1];
        a[k1] = x;
        for (i = nh >> 1; i > (k ^= i); i >>= 1)
          ;
      }
      k1 = j0 + k0;
      j1 = k1 + 1;
      k1 += nh;
      x = a[j1];
      a[j1] = a[k1];
      a[k1] = x;
    }
  }
}
```