user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<comp128>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x2c0,%rsp
  mov    %rdi,-0x2a8(%rbp)
  mov    %rsi,-0x2b0(%rbp)
  mov    %rdx,-0x2b8(%rbp)
  mov    %rcx,-0x2c0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x2b0(%rbp),%rax
  lea    -0x290(%rbp),%rdx
  lea    0x40(%rdx),%rcx
  mov    $0x10,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  movl   $0x0,-0x294(%rbp)
  jmp    L52
L16:
  mov    -0x2a8(%rbp),%rcx
  lea    -0x290(%rbp),%rax
  mov    $0x10,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x290(%rbp),%rax
  mov    %rax,%rdi
  call   <_comp128_compression@plt>
  lea    -0x210(%rbp),%rdx
  lea    -0x290(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_comp128_bitsfrombytes@plt>
  lea    -0x210(%rbp),%rdx
  lea    -0x290(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_comp128_permutation@plt>
  addl   $0x1,-0x294(%rbp)
L52:
  cmpl   $0x6,-0x294(%rbp)
  jle    L16
  mov    -0x2a8(%rbp),%rcx
  lea    -0x290(%rbp),%rax
  mov    $0x10,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x290(%rbp),%rax
  mov    %rax,%rdi
  call   <_comp128_compression@plt>
  movl   $0x0,-0x294(%rbp)
  jmp    L37
L5:
  mov    -0x294(%rbp),%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  mov    -0x294(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%edx
  mov    -0x294(%rbp),%eax
  sar    %eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x2b8(%rbp),%rax
  add    %rsi,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x2,-0x294(%rbp)
L37:
  cmpl   $0x7,-0x294(%rbp)
  jle    L5
  movl   $0x0,-0x294(%rbp)
  jmp    L30
L62:
  mov    -0x294(%rbp),%eax
  add    $0x12,%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%eax
  shl    $0x6,%eax
  mov    %eax,%edx
  mov    -0x294(%rbp),%eax
  add    $0x13,%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%eax
  shl    $0x2,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x294(%rbp),%eax
  add    $0x14,%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%eax
  sar    $0x2,%eax
  mov    %eax,%edx
  mov    -0x294(%rbp),%eax
  sar    %eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x2c0(%rbp),%rax
  add    %rsi,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x2,-0x294(%rbp)
L30:
  cmpl   $0xb,-0x294(%rbp)
  jle    L62
  mov    -0x218(%rbp),%eax
  shl    $0x6,%eax
  mov    %eax,%ecx
  mov    -0x214(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  mov    -0x2c0(%rbp),%rax
  add    $0x18,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x2c0(%rbp),%rax
  add    $0x1c,%rax
  movl   $0x0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L50
  call   <__stack_chk_fail@plt>
L50:
  leave
  ret
```

assistant: ```c
void comp128(uint8_t *ki, uint8_t *rand, uint8_t *sres, uint8_t *kc) {
  int i;
  uint8_t x[32], bits[128];
  memcpy(&x[16], rand, 16);
  for (i = 0; i < 7; i++) {
    memcpy(x, ki, 16);
    _comp128_compression(x);
    _comp128_bitsfrombytes(x, bits);
    _comp128_permutation(x, bits);
  }
  memcpy(x, ki, 16);
  _comp128_compression(x);
  for (i = 0; i < 8; i += 2)
    sres[i >> 1] = x[i] << 4 | x[i + 1];
  for (i = 0; i < 12; i += 2)
    kc[i >> 1] = (x[i + 18] << 6) | (x[i + 19] << 2) | (x[i + 20] >> 2);
  kc[6] = (x[30] << 6) | (x[31] << 2);
  kc[7] = 0;
}
```