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

```asm
<crypto_aead_encrypt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %rsi,-0xc0(%rbp)
  mov    %rdx,-0xc8(%rbp)
  mov    %rcx,-0xd0(%rbp)
  mov    %r8,-0xd8(%rbp)
  mov    %r9,-0xe0(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xe8(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0xf0(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0xf8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x90(%rbp)
  movq   $0x0,-0x7a(%rbp)
  cmpq   $0x0,-0xd0(%rbp)
  jne    L81
  movq   $0x0,-0x98(%rbp)
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0xa0(%rbp)
  mov    -0x98(%rbp),%rcx
  mov    -0xa0(%rbp),%rdx
  mov    -0xd0(%rbp),%rsi
  mov    -0xc8(%rbp),%rax
  mov    %rax,%rdi
  call   <padding@plt>
  jmp    L40
L81:
  mov    -0xd0(%rbp),%rax
  lea    0x5(%rax),%rcx
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x2,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    %rax,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  test   %rdx,%rdx
  jne    L93
  mov    -0xd0(%rbp),%rax
  add    $0x5,%rax
  mov    %rax,-0x98(%rbp)
  jmp    L83
L93:
  mov    -0xd0(%rbp),%rax
  add    $0x5,%rax
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x2,%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0x98(%rbp)
L83:
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0xa0(%rbp)
  mov    -0x98(%rbp),%rcx
  mov    -0xa0(%rbp),%rdx
  mov    -0xd0(%rbp),%rsi
  mov    -0xc8(%rbp),%rax
  mov    %rax,%rdi
  call   <padding@plt>
L40:
  cmpq   $0x0,-0xe0(%rbp)
  jne    L118
  movq   $0x0,-0x88(%rbp)
  jmp    L65
L118:
  mov    -0xe0(%rbp),%rax
  lea    0x5(%rax),%rcx
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x2,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    %rax,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  test   %rdx,%rdx
  jne    L57
  mov    -0xe0(%rbp),%rax
  add    $0x5,%rax
  mov    %rax,-0x88(%rbp)
  jmp    L161
L57:
  mov    -0xe0(%rbp),%rax
  add    $0x5,%rax
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x2,%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0x88(%rbp)
L161:
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x90(%rbp)
  mov    -0x88(%rbp),%rcx
  mov    -0x90(%rbp),%rdx
  mov    -0xe0(%rbp),%rsi
  mov    -0xd8(%rbp),%rax
  mov    %rax,%rdi
  call   <padding@plt>
L65:
  lea    -0x60(%rbp),%rdx
  mov    -0xf8(%rbp),%rcx
  mov    -0xf0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <E@plt>
  lea    -0x60(%rbp),%rax
  add    $0x8,%rax
  mov    -0xf8(%rbp),%rsi
  lea    -0x60(%rbp),%rcx
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <E@plt>
  movl   $0x0,-0xa8(%rbp)
  jmp    L5
L199:
  mov    -0xa8(%rbp),%eax
  add    $0x6,%eax
  cltq
  movzbl -0x60(%rbp,%rax,1),%edx
  mov    -0xa8(%rbp),%eax
  cltq
  mov    %dl,-0x6a(%rbp,%rax,1)
  addl   $0x1,-0xa8(%rbp)
L5:
  cmpl   $0x9,-0xa8(%rbp)
  jle    L199
  lea    -0x7a(%rbp),%rdx
  lea    -0x60(%rbp),%rcx
  lea    -0x7a(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <E@plt>
  movl   $0x0,-0xa8(%rbp)
  jmp    L207
L104:
  lea    -0x50(%rbp),%rdx
  lea    -0x6a(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <KS@plt>
  lea    -0x7a(%rbp),%rdx
  lea    -0x50(%rbp),%rcx
  lea    -0x7a(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <G@plt>
  movl   $0x0,-0xa4(%rbp)
  jmp    L219
L188:
  mov    -0xa4(%rbp),%eax
  add    $0x2,%eax
  cltq
  movzbl -0x7a(%rbp,%rax,1),%ecx
  mov    -0xa8(%rbp),%edx
  mov    -0xa4(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0xa4(%rbp),%eax
  add    $0x2,%eax
  xor    %ecx,%edx
  cltq
  mov    %dl,-0x7a(%rbp,%rax,1)
  addl   $0x1,-0xa4(%rbp)
L219:
  cmpl   $0x5,-0xa4(%rbp)
  jle    L188
  addl   $0x6,-0xa8(%rbp)
L207:
  mov    -0xa8(%rbp),%eax
  cltq
  cmp    %rax,-0x88(%rbp)
  ja     L104
  movl   $0x0,-0xa8(%rbp)
  jmp    L190
L174:
  lea    -0x50(%rbp),%rdx
  lea    -0x6a(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <KS@plt>
  lea    -0x80(%rbp),%rcx
  lea    -0x7a(%rbp),%rdx
  lea    -0x50(%rbp),%rsi
  lea    -0x7a(%rbp),%rax
  mov    %rax,%rdi
  call   <Gleak@plt>
  movl   $0x0,-0xa4(%rbp)
  jmp    L200
L214:
  mov    -0xa4(%rbp),%eax
  add    $0x2,%eax
  cltq
  movzbl -0x7a(%rbp,%rax,1),%ecx
  mov    -0xa8(%rbp),%edx
  mov    -0xa4(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0xa4(%rbp),%eax
  add    $0x2,%eax
  xor    %ecx,%edx
  cltq
  mov    %dl,-0x7a(%rbp,%rax,1)
  mov    -0xa8(%rbp),%edx
  mov    -0xa4(%rbp),%eax
  add    %edx,%eax
  cltq
  cmp    %rax,-0xd0(%rbp)
  jbe    L70
  mov    -0xa8(%rbp),%edx
  mov    -0xa4(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ecx
  mov    -0xa4(%rbp),%eax
  cltq
  movzbl -0x80(%rbp,%rax,1),%edx
  mov    -0xa8(%rbp),%esi
  mov    -0xa4(%rbp),%eax
  add    %esi,%eax
  movslq %eax,%rsi
  mov    -0xb8(%rbp),%rax
  add    %rsi,%rax
  xor    %ecx,%edx
  mov    %dl,(%rax)
L70:
  addl   $0x1,-0xa4(%rbp)
L200:
  cmpl   $0x5,-0xa4(%rbp)
  jle    L214
  addl   $0x6,-0xa8(%rbp)
L190:
  mov    -0xa8(%rbp),%eax
  cltq
  cmp    %rax,-0x98(%rbp)
  ja     L174
  lea    -0x72(%rbp),%rdx
  mov    -0xf8(%rbp),%rcx
  lea    -0x7a(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <E@plt>
  movl   $0x0,-0xa8(%rbp)
  jmp    L126
L14:
  mov    -0xa8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xd0(%rbp),%rax
  add    %rax,%rdx
  mov    -0xb8(%rbp),%rax
  add    %rax,%rdx
  mov    -0xa8(%rbp),%eax
  cltq
  movzbl -0x72(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xa8(%rbp)
L126:
  cmpl   $0x7,-0xa8(%rbp)
  jle    L14
  mov    -0xd0(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0xc0(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L29
  call   <__stack_chk_fail@plt>
L29:
  leave
  ret
```

assistant: ```c
int crypto_aead_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k) {
  unsigned char *mpad;
  unsigned long long mpadlen;
  unsigned char *adpad = NULL;
  unsigned long long adpadlen;
  unsigned char ukey[16];
  unsigned char datastate[8] = {0}, keystate[10], leak[6];
  unsigned char subkey[16 * 4];
  unsigned char tag[8];
  int i, j;
  if (mlen == 0) {
    mpadlen = 0;
    mpad = (unsigned char *)malloc(mpadlen);
    padding(m, mlen, mpad, mpadlen);
  } else {
    if ((mlen + 5) % 6 == 0) {
      mpadlen = mlen + 5;
    } else {
      mpadlen = ((mlen + 5) / 6 + 1) * 6;
    }
    mpad = (unsigned char *)malloc(mpadlen);
    padding(m, mlen, mpad, mpadlen);
  }
  if (adlen == 0) {
    adpadlen = 0;
  } else {
    if ((adlen + 5) % 6 == 0) {
      adpadlen = adlen + 5;
    } else {
      adpadlen = ((adlen + 5) / 6 + 1) * 6;
    }
    adpad = (unsigned char *)malloc(adpadlen);
    padding(ad, adlen, adpad, adpadlen);
  }
  E(npub, k, ukey);
  E(ukey, k, ukey + 8);
  for (i = 0; i < 10; i++) {
    keystate[i] = ukey[i + 6];
  }
  E(datastate, ukey, datastate);
  for (i = 0; i < adpadlen; i += 6) {
    KS(keystate, subkey);
    G(datastate, subkey, datastate);
    for (j = 0; j < 6; j++) {
      datastate[j + 2] ^= adpad[i + j];
    }
  }
  for (i = 0; i < mpadlen; i += 6) {
    KS(keystate, subkey);
    Gleak(datastate, subkey, datastate, leak);
    for (j = 0; j < 6; j++) {
      datastate[j + 2] ^= mpad[i + j];
      if ((i + j) < mlen) {
        c[i + j] = m[i + j] ^ leak[j];
      }
    }
  }
  E(datastate, k, tag);
  for (i = 0; i < 8; i++) {
    c[mlen + i] = tag[i];
  }
  *clen = mlen + 8;
  return 0;
}
```