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

```asm
<P>:
  endbr64
  push   %r15
  movq   %rdi,%xmm0
  movq   %rsi,%xmm1
  movq   %rcx,%xmm2
  push   %r14
  punpcklqdq %xmm1,%xmm0
  movq   %r9,%xmm3
  xor    %r14d,%r14d
  push   %r13
  mov    $0x4,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x2a8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x298(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x50(%rsp)
  movq   %rdx,%xmm0
  lea    0x90(%rsp),%rbx
  punpcklqdq %xmm2,%xmm0
  movaps %xmm0,0x60(%rsp)
  movq   %r8,%xmm0
  punpcklqdq %xmm3,%xmm0
  movaps %xmm0,0x70(%rsp)
  movq   0x2e0(%rsp),%xmm0
  movhps 0x2e8(%rsp),%xmm0
  movaps %xmm0,0x80(%rsp)
L36:
  mov    %r14,%r12
  mov    %r14d,%ebp
  shl    $0x5,%r12
  add    %rbx,%r12
L55:
  mov    %ebp,%edi
  sar    %edi
  test   $0x1,%bpl
  jne    L28
  call   <floor@plt>
  mov    $0x8,%edx
  mov    %r12,%rdi
  cltq
  mov    0x50(%rsp,%rax,8),%rsi
  add    $0x20,%rsi
  call   <memcpy@plt>
L79:
  add    $0x1,%ebp
  add    $0x20,%r12
  cmp    %ebp,%r13d
  jne    L55
  add    $0x4,%r13d
  add    $0x4,%r14
  cmp    $0x14,%r13d
  jne    L36
  lea    0x190(%rsp),%r13
  lea    0x110(%rsp),%rax
  mov    %rbx,%rdi
  mov    %r13,%rdx
  mov    %rax,%rsi
  lea    0x210(%rsp),%rcx
  mov    %rax,0x8(%rsp)
  lea    0x230(%rsp),%r14
  lea    0xb0(%rsp),%r15
  call   <apply_G@plt>
  lea    0x130(%rsp),%r10
  lea    0x1b0(%rsp),%rcx
  mov    %r15,%rdi
  mov    %rcx,%rdx
  mov    %r10,%rsi
  mov    %r14,%rcx
  mov    %r10,0x48(%rsp)
  mov    %rdx,0x10(%rsp)
  lea    0xf0(%rsp),%rbp
  lea    0x170(%rsp),%r12
  call   <apply_G@plt>
  lea    0x1d0(%rsp),%r11
  lea    0x150(%rsp),%r8
  lea    0xd0(%rsp),%r10
  mov    %r11,%rdx
  mov    %r8,%rsi
  mov    %r11,0x40(%rsp)
  lea    0x250(%rsp),%rdi
  mov    %r8,0x38(%rsp)
  mov    %rdi,%rcx
  mov    %rdi,0x18(%rsp)
  mov    %r10,%rdi
  mov    %r10,0x20(%rsp)
  call   <apply_G@plt>
  lea    0x1f0(%rsp),%r9
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %r9,%rdx
  lea    0x270(%rsp),%rcx
  mov    %r9,0x28(%rsp)
  mov    %rcx,0x30(%rsp)
  call   <apply_G@plt>
  mov    0x30(%rsp),%rcx
  mov    0x40(%rsp),%rdx
  mov    %rbx,%rdi
  mov    0x48(%rsp),%rsi
  call   <apply_G@plt>
  mov    0x28(%rsp),%rdx
  mov    %rbp,%rcx
  mov    %r15,%rdi
  mov    0x38(%rsp),%rsi
  call   <apply_G@plt>
  mov    0x20(%rsp),%rdi
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  xor    %r14d,%r14d
  mov    $0x4,%r13d
  call   <apply_G@plt>
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rdx
  mov    %rbp,%rdi
  mov    0x8(%rsp),%rsi
  call   <apply_G@plt>
L81:
  mov    %r14,%r12
  mov    %r14d,%ebp
  shl    $0x5,%r12
  add    %rbx,%r12
L37:
  mov    %ebp,%edi
  sar    %edi
  test   $0x1,%bpl
  jne    L35
  call   <floor@plt>
  mov    $0x8,%edx
  mov    %r12,%rsi
  cltq
  mov    0x50(%rsp,%rax,8),%rdi
  add    $0x20,%rdi
  call   <memcpy@plt>
L26:
  add    $0x1,%ebp
  add    $0x20,%r12
  cmp    %ebp,%r13d
  jne    L37
  add    $0x4,%r13d
  add    $0x4,%r14
  cmp    $0x14,%r13d
  jne    L81
  mov    0x298(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x2a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  call   <floor@plt>
  mov    $0x8,%edx
  mov    %r12,%rsi
  cltq
  mov    0x50(%rsp,%rax,8),%rdi
  call   <memcpy@plt>
  jmp    L26
  nopl   0x0(%rax,%rax,1)
L28:
  call   <floor@plt>
  mov    $0x8,%edx
  mov    %r12,%rdi
  cltq
  mov    0x50(%rsp,%rax,8),%rsi
  call   <memcpy@plt>
  jmp    L79
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void P(uint8_t *S0, uint8_t *S1, uint8_t *S2, uint8_t *S3, uint8_t *S4, uint8_t *S5, uint8_t *S6, uint8_t *S7) {
  uint8_t *S[8] = {S0, S1, S2, S3, S4, S5, S6, S7};
  uint8_t V[4][4][8];
  int h;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      h = 4 * i + j;
      if (h % 2 == 0)
        memcpy(V[i][j], S[(int)floor(h / 2)] + 8, 8);
      else
        memcpy(V[i][j], S[(int)floor(h / 2)], 8);
    }
  }
  apply_G(V[0][0], V[1][0], V[2][0], V[3][0]);
  apply_G(V[0][1], V[1][1], V[2][1], V[3][1]);
  apply_G(V[0][2], V[1][2], V[2][2], V[3][2]);
  apply_G(V[0][3], V[1][3], V[2][3], V[3][3]);
  apply_G(V[0][0], V[1][1], V[2][2], V[3][3]);
  apply_G(V[0][1], V[1][2], V[2][3], V[0][3]);
  apply_G(V[0][2], V[1][3], V[2][0], V[3][1]);
  apply_G(V[0][3], V[1][0], V[2][1], V[3][2]);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      h = 4 * i + j;
      if (h % 2 == 0)
        memcpy(S[(int)floor(h / 2)] + 8, V[i][j], 8);
      else
        memcpy(S[(int)floor(h / 2)], V[i][j], 8);
    }
  }
}
```