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

```asm
<wave_up>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r8,%r13
  mov    %ecx,%r8d
  push   %r12
  shr    $0x1f,%r8d
  push   %rbp
  add    %ecx,%r8d
  mov    %rsi,%rbp
  push   %rbx
  sar    %r8d
  mov    %rdi,%rbx
  mov    %ecx,-0x14(%rsp)
  cmp    $0x1,%r8d
  je     L236
  movslq 0x0(%r13),%rax
  mov    %rdx,-0x10(%rsp)
  lea    (%rax,%rax,4),%r9
  lea    -0x1(%rax),%r11d
  mov    %r9,%rax
  movslq %r11d,%r11
  add    %r9,%r9
  shl    $0x4,%rax
  lea    (%rsi,%rax,1),%rcx
  lea    -0x50(%rdi,%rax,1),%rax
  mov    $0xffffffffffffffb0,%rdi
  mov    $0x1,%esi
  sub    %rbp,%rdi
  mov    %rdi,%r12
  nopl   0x0(%rax,%rax,1)
L124:
  test   %esi,%esi
  jle    L209
  movslq %esi,%rdx
  lea    (%r12,%rcx,1),%r14
  lea    0x50(%rax),%rdi
  add    %r9,%rdx
  lea    -0x50(,%rdx,8),%r10
  add    %r9,%rdx
  shl    $0x2,%rdx
  cmp    %r14,%rdx
  lea    0x0(,%r9,8),%r14
  setle  %r15b
  cmp    %r14,%r10
  setle  %r14b
  add    %rbx,%r10
  or     %r15d,%r14d
  cmp    %r10,%rcx
  setae  %r10b
  add    %rbp,%rdx
  cmp    %rdx,%rax
  setae  %dl
  or     %edx,%r10d
  test   %r10b,%r14b
  je     L217
  lea    -0x1(%rsi),%edx
  cmp    $0x2,%edx
  jbe    L217
  movups (%rcx),%xmm3
  movups 0x50(%rax),%xmm1
  mov    %esi,%r10d
  movups 0x50(%rax),%xmm0
  shr    $0x2,%r10d
  addps  %xmm3,%xmm1
  subps  %xmm3,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,(%rax)
  movups %xmm1,0x10(%rax)
  cmp    $0x1,%r10d
  je     L98
  movups 0x10(%rcx),%xmm5
  movups 0x60(%rax),%xmm1
  movups 0x60(%rax),%xmm0
  addps  %xmm5,%xmm1
  subps  %xmm5,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,0x20(%rax)
  movups %xmm1,0x30(%rax)
  cmp    $0x2,%r10d
  je     L98
  mov    $0x20,%edx
  mov    $0x2,%r14d
L259:
  movups (%rcx,%rdx,1),%xmm7
  movups (%rdi,%rdx,1),%xmm1
  add    $0x1,%r14d
  movups (%rdi,%rdx,1),%xmm0
  addps  %xmm7,%xmm1
  subps  %xmm7,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,(%rax,%rdx,2)
  movups %xmm1,0x10(%rax,%rdx,2)
  add    $0x10,%rdx
  cmp    %r10d,%r14d
  jne    L259
L98:
  mov    %esi,%r14d
  and    $0xfffffffc,%r14d
  test   $0x3,%sil
  je     L209
  mov    %r14d,%edx
  lea    (%r14,%r14,1),%r10d
  shl    $0x2,%rdx
  movslq %r10d,%r15
  add    %rdx,%rdi
  add    %rcx,%rdx
  movss  (%rdi),%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%rax,%r15,4)
  movss  (%rdi),%xmm0
  subss  (%rdx),%xmm0
  lea    0x1(%r10),%r15d
  movslq %r15d,%r15
  movss  %xmm0,(%rax,%r15,4)
  lea    0x1(%r14),%r15d
  cmp    %r15d,%esi
  jle    L209
  movss  0x4(%rdi),%xmm0
  addss  0x4(%rdx),%xmm0
  lea    0x2(%r10),%r15d
  add    $0x2,%r14d
  movslq %r15d,%r15
  movss  %xmm0,(%rax,%r15,4)
  movss  0x4(%rdi),%xmm0
  subss  0x4(%rdx),%xmm0
  lea    0x3(%r10),%r15d
  movslq %r15d,%r15
  movss  %xmm0,(%rax,%r15,4)
  cmp    %r14d,%esi
  jle    L209
  movss  0x8(%rdi),%xmm0
  addss  0x8(%rdx),%xmm0
  lea    0x4(%r10),%r14d
  add    $0x5,%r10d
  movslq %r14d,%r14
  movslq %r10d,%r10
  movss  %xmm0,(%rax,%r14,4)
  movss  0x8(%rdi),%xmm0
  subss  0x8(%rdx),%xmm0
  movss  %xmm0,(%rax,%r10,4)
L209:
  add    %esi,%esi
  mov    %r11d,0x0(%r13)
  sub    $0x50,%rcx
  sub    $0x1,%r11
  sub    $0x50,%rax
  sub    $0xa,%r9
  cmp    %r8d,%esi
  jne    L124
  mov    -0x14(%rsp),%edi
  mov    -0x10(%rsp),%r12
  cmp    $0x1,%edi
  jle    L219
  mov    %r8d,%edx
  lea    0x0(,%rdx,4),%rax
  lea    (%r12,%rdx,8),%rcx
  lea    0x0(%rbp,%rax,1),%rdx
  cmp    %rdx,%r12
  setae  %dl
  cmp    %rcx,%rbp
  setae  %sil
  add    %rbx,%rax
  or     %esi,%edx
  cmp    %rax,%r12
  setae  %al
  cmp    %rcx,%rbx
  setae  %cl
  or     %ecx,%eax
  test   %al,%dl
  je     L187
  cmp    $0x7,%edi
  jle    L187
  movups 0x0(%rbp),%xmm5
  movups (%rbx),%xmm1
  mov    %r8d,%eax
  movups (%rbx),%xmm0
  shr    $0x2,%eax
  addps  %xmm5,%xmm1
  subps  %xmm5,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,(%r12)
  movups %xmm1,0x10(%r12)
  cmp    $0x1,%eax
  je     L72
  movups 0x10(%rbp),%xmm5
  movups 0x10(%rbx),%xmm1
  movups 0x10(%rbx),%xmm0
  addps  %xmm5,%xmm1
  subps  %xmm5,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,0x20(%r12)
  movups %xmm1,0x30(%r12)
  cmp    $0x2,%eax
  je     L72
  movups 0x20(%rbp),%xmm3
  movups 0x20(%rbx),%xmm1
  movups 0x20(%rbx),%xmm0
  addps  %xmm3,%xmm1
  subps  %xmm3,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,0x40(%r12)
  movups %xmm1,0x50(%r12)
  cmp    $0x3,%eax
  je     L72
  movups 0x30(%rbp),%xmm5
  movups 0x30(%rbx),%xmm1
  movups 0x30(%rbx),%xmm0
  addps  %xmm5,%xmm1
  subps  %xmm5,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,0x60(%r12)
  movups %xmm1,0x70(%r12)
  cmp    $0x4,%eax
  je     L72
  movups 0x40(%rbp),%xmm3
  movups 0x40(%rbx),%xmm1
  movups 0x40(%rbx),%xmm0
  addps  %xmm3,%xmm1
  subps  %xmm3,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,0x80(%r12)
  movups %xmm1,0x90(%r12)
  cmp    $0x5,%eax
  je     L72
  mov    $0x50,%edx
  mov    $0x5,%ecx
L74:
  movups 0x0(%rbp,%rdx,1),%xmm5
  movups (%rbx,%rdx,1),%xmm1
  add    $0x1,%ecx
  movups (%rbx,%rdx,1),%xmm0
  addps  %xmm5,%xmm1
  subps  %xmm5,%xmm0
  movaps %xmm1,%xmm2
  unpcklps %xmm0,%xmm2
  unpckhps %xmm0,%xmm1
  movups %xmm2,(%r12,%rdx,2)
  movups %xmm1,0x10(%r12,%rdx,2)
  add    $0x10,%rdx
  cmp    %ecx,%eax
  jne    L74
L72:
  mov    %r8d,%edx
  and    $0xfffffffc,%edx
  test   $0x3,%r8b
  je     L219
  movslq %edx,%rax
  lea    (%rdx,%rdx,1),%ecx
  lea    0x1(%rdx),%r9d
  shl    $0x2,%rax
  movslq %ecx,%rsi
  add    %rax,%rbx
  add    %rbp,%rax
  lea    0x0(,%rsi,4),%rdi
  movss  (%rbx),%xmm0
  addss  (%rax),%xmm0
  movss  %xmm0,(%r12,%rsi,4)
  movss  (%rbx),%xmm0
  subss  (%rax),%xmm0
  movss  %xmm0,0x4(%r12,%rsi,4)
  cmp    %r8d,%r9d
  jge    L219
  movss  0x4(%rbx),%xmm0
  addss  0x4(%rax),%xmm0
  add    $0x3,%ecx
  add    $0x2,%edx
  movslq %ecx,%rcx
  movss  %xmm0,0x8(%r12,%rdi,1)
  movss  0x4(%rbx),%xmm0
  subss  0x4(%rax),%xmm0
  movss  %xmm0,(%r12,%rcx,4)
  cmp    %edx,%r8d
  jle    L219
  movss  0x8(%rbx),%xmm0
  addss  0x8(%rax),%xmm0
  movss  %xmm0,0x10(%r12,%rdi,1)
  movss  0x8(%rbx),%xmm0
  subss  0x8(%rax),%xmm0
  movss  %xmm0,0x14(%r12,%rsi,4)
L219:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L217:
  mov    %esi,%r10d
  xor    %edx,%edx
  nopl   (%rax)
L211:
  movss  (%rdi,%rdx,4),%xmm0
  addss  (%rcx,%rdx,4),%xmm0
  movss  %xmm0,(%rax,%rdx,8)
  movss  (%rdi,%rdx,4),%xmm0
  subss  (%rcx,%rdx,4),%xmm0
  movss  %xmm0,0x4(%rax,%rdx,8)
  add    $0x1,%rdx
  cmp    %r10,%rdx
  jne    L211
  jmp    L209
L236:
  movss  (%rdi),%xmm0
  addss  (%rsi),%xmm0
  movss  %xmm0,(%rdx)
  movss  (%rdi),%xmm0
  subss  (%rsi),%xmm0
  movss  %xmm0,0x4(%rdx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L187:
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L220:
  movss  0x0(%rbp,%rax,4),%xmm0
  addss  (%rbx,%rax,4),%xmm0
  movss  %xmm0,(%r12,%rax,8)
  movss  (%rbx,%rax,4),%xmm0
  subss  0x0(%rbp,%rax,4),%xmm0
  movss  %xmm0,0x4(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r8d
  jg     L220
  jmp    L219
```

assistant: ```c
void wave_up(float S[40][20], float d[40][20], float *S_out, int old_size, int *index) {
  int new_size = 1;
  int i;
  while (new_size != old_size / 2) {
    for (i = 0; i < new_size; ++i) {
      S[*index - 1][2 * i] = S[*index][i] + d[*index][i];
      S[*index - 1][(2 * i) + 1] = S[*index][i] - d[*index][i];
    }
    new_size = new_size * 2;
    *index = *index - 1;
  }
  for (i = 0; i < (old_size / 2); ++i) {
    S_out[2 * i] = S[0][i] + d[0][i];
    S_out[(2 * i) + 1] = S[0][i] - d[0][i];
  }
}
```