user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<P>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x2a8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x298(%rsp)
  xor    %eax,%eax
  mov    %rdi,0x50(%rsp)
  mov    %rsi,0x58(%rsp)
  mov    %rdx,0x60(%rsp)
  mov    %rcx,0x68(%rsp)
  mov    %r8,0x70(%rsp)
  mov    %r9,0x78(%rsp)
  mov    0x2e0(%rsp),%rax
  mov    %rax,0x80(%rsp)
  mov    0x2e8(%rsp),%rax
  mov    %rax,0x88(%rsp)
  mov    $0x0,%r13d
  mov    $0x4,%r12d
  lea    0x90(%rsp),%rax
  mov    %rax,(%rsp)
  jmp    L74
L45:
  mov    %ebx,%edi
  shr    $0x1f,%edi
  add    %ebx,%edi
  sar    %edi
  call   <floor@plt>
  cltq
  mov    0x50(%rsp,%rax,8),%rsi
  mov    $0x8,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
L17:
  add    $0x1,%ebx
  add    $0x20,%rbp
  cmp    %r12d,%ebx
  je     L19
L96:
  test   $0x1,%bl
  jne    L45
  mov    %ebx,%edi
  shr    $0x1f,%edi
  add    %ebx,%edi
  sar    %edi
  call   <floor@plt>
  cltq
  mov    0x50(%rsp,%rax,8),%rsi
  add    $0x20,%rsi
  mov    $0x8,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  jmp    L17
L19:
  add    $0x4,%r12d
  add    $0x4,%r13
  cmp    $0x10,%r13
  je     L2
L74:
  mov    %r13d,%ebx
  mov    %r13,%rbp
  shl    $0x5,%rbp
  add    (%rsp),%rbp
  jmp    L96
L2:
  lea    0x90(%rsp),%r12
  lea    0x210(%rsp),%rcx
  lea    0x190(%rsp),%rax
  lea    0x110(%rsp),%rsi
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdx
  mov    %rsi,0x10(%rsp)
  mov    %r12,%rdi
  call   <apply_G@plt>
  lea    0x230(%rsp),%rcx
  lea    0x1b0(%rsp),%rbx
  lea    0x130(%rsp),%r13
  lea    0xb0(%rsp),%rdi
  mov    %rcx,0x18(%rsp)
  mov    %rbx,0x20(%rsp)
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %rdi,0x28(%rsp)
  call   <apply_G@plt>
  lea    0x250(%rsp),%r10
  lea    0x1d0(%rsp),%r14
  lea    0x150(%rsp),%r11
  lea    0xd0(%rsp),%r8
  mov    %r10,0x30(%rsp)
  mov    %r10,%rcx
  mov    %r14,%rdx
  mov    %r11,0x38(%rsp)
  mov    %r11,%rsi
  mov    %r8,0x40(%rsp)
  mov    %r8,%rdi
  call   <apply_G@plt>
  lea    0x270(%rsp),%r15
  lea    0x1f0(%rsp),%rbp
  lea    0x170(%rsp),%r9
  lea    0xf0(%rsp),%rbx
  mov    %r15,%rcx
  mov    %rbp,%rdx
  mov    %r9,0x48(%rsp)
  mov    %r9,%rsi
  mov    %rbx,%rdi
  call   <apply_G@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <apply_G@plt>
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  mov    0x38(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  call   <apply_G@plt>
  mov    0x18(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    0x48(%rsp),%rsi
  mov    0x40(%rsp),%rdi
  call   <apply_G@plt>
  mov    0x30(%rsp),%rcx
  mov    0x20(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  call   <apply_G@plt>
  mov    $0x0,%r13d
  mov    $0x4,%r12d
  jmp    L4
L59:
  mov    %ebx,%edi
  shr    $0x1f,%edi
  add    %ebx,%edi
  sar    %edi
  call   <floor@plt>
  cltq
  mov    0x50(%rsp,%rax,8),%rdi
  mov    $0x8,%edx
  mov    %rbp,%rsi
  call   <memcpy@plt>
L77:
  add    $0x1,%ebx
  add    $0x20,%rbp
  cmp    %r12d,%ebx
  je     L22
L48:
  test   $0x1,%bl
  jne    L59
  mov    %ebx,%edi
  shr    $0x1f,%edi
  add    %ebx,%edi
  sar    %edi
  call   <floor@plt>
  cltq
  mov    0x50(%rsp,%rax,8),%rdi
  add    $0x20,%rdi
  mov    $0x8,%edx
  mov    %rbp,%rsi
  call   <memcpy@plt>
  jmp    L77
L22:
  add    $0x4,%r12d
  add    $0x4,%r13
  cmp    $0x10,%r13
  je     L122
L4:
  mov    %r13d,%ebx
  mov    %r13,%rbp
  shl    $0x5,%rbp
  add    (%rsp),%rbp
  jmp    L48
L122:
  mov    0x298(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L42
  add    $0x2a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L42:
  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);
    }
  }
}
```