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

```asm
<aesEncrypt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1c8,%rsp
  mov    %rdi,%r15
  mov    %esi,%r14d
  mov    %esi,0x1c(%rsp)
  mov    %rdx,%r12
  mov    %ecx,%ebp
  mov    %r8,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x1b8(%rsp)
  xor    %eax,%eax
  lea    0x180(%rsp),%rbx
  mov    $0x10,%edx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  lea    0x20(%rsp),%rdi
  mov    $0x80,%edx
  mov    %rbx,%rsi
  call   <aesSetupEncrypt@plt>
  mov    %eax,0x18(%rsp)
  add    $0x10,%r15
  lea    0x18f(%rsp),%r13
  test   %ebp,%ebp
  jne    L146
  mov    0x1c(%rsp),%eax
  mov    %eax,0x8(%rsp)
  jmp    L117
L121:
  mov    $0x10,%edx
  sub    %ecx,%edx
  cmp    $0xf,%ebx
  ja     L140
L40:
  mov    %ebx,%eax
  mov    %dl,0x190(%rsp,%rax,1)
  add    $0x1,%ebx
  cmp    $0xf,%ebx
  jbe    L40
  lea    0x1a0(%rsp),%rcx
  lea    0x190(%rsp),%rdx
  lea    0x20(%rsp),%rdi
  mov    0x18(%rsp),%esi
  call   <aesDoEncrypt@plt>
  cmpl   $0xf,0x4(%rsp)
  jle    L158
  lea    0x1a0(%rsp),%rsi
  mov    $0x10,%edx
  mov    0x8(%rsp),%rdi
  call   <memcpy@plt>
  lea    -0x10(%r14),%eax
  mov    %eax,0x8(%rsp)
L115:
  add    $0x10,%r15
  sub    $0x10,%r14d
  test   %ebp,%ebp
  je     L117
L146:
  mov    %r14d,0x4(%rsp)
  lea    -0x10(%r15),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x1,%eax
  mov    $0x10,%edx
  mov    $0x0,%ebx
  test   %ebp,%ebp
  je     L40
L102:
  add    $0x1,%r12
  movzbl -0x1(%r12),%edx
  mov    %dl,0x0(%r13,%rax,1)
  mov    %eax,%ebx
  mov    %rax,%rcx
  add    $0x1,%rax
  sub    $0x1,%ebp
  je     L121
  cmp    $0xf,%ebx
  jbe    L102
  jmp    L121
L140:
  lea    0x1a0(%rsp),%rcx
  lea    0x190(%rsp),%rdx
  lea    0x20(%rsp),%rdi
  mov    0x18(%rsp),%esi
  call   <aesDoEncrypt@plt>
  cmpl   $0xf,0x4(%rsp)
  jle    L158
  lea    0x1a0(%rsp),%rsi
  mov    $0x10,%edx
  mov    0x8(%rsp),%rdi
  call   <memcpy@plt>
  mov    %r15,0x10(%rsp)
  lea    -0x10(%r14),%eax
  mov    %eax,0x8(%rsp)
  cmp    $0x10,%ebx
  jne    L115
  test   %ebp,%ebp
  jne    L115
  lea    0x190(%rsp),%rbx
  mov    $0x10,%edx
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  lea    0x1a0(%rsp),%rcx
  lea    0x20(%rsp),%rdi
  mov    %rbx,%rdx
  mov    0x18(%rsp),%esi
  call   <aesDoEncrypt@plt>
  cmpl   $0xf,0x8(%rsp)
  jle    L158
  lea    0x1a0(%rsp),%rsi
  mov    $0x10,%edx
  mov    0x10(%rsp),%rdi
  call   <memcpy@plt>
  mov    0x4(%rsp),%eax
  sub    $0x20,%eax
  mov    %eax,0x8(%rsp)
L117:
  mov    0x1c(%rsp),%eax
  sub    0x8(%rsp),%eax
  jmp    L94
L158:
  mov    $0xffffffff,%eax
L94:
  mov    0x1b8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x1c8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int aesEncrypt(unsigned char *output, int outlen, unsigned char *input, int inlen, unsigned char *password) {
  unsigned long rk[((128) / 8 + 28)];
  unsigned char key[((128) / 8)];
  int nrounds;
  int totalout = outlen;
  memcpy(key, password, 16);
  nrounds = aesSetupEncrypt(rk, key, 128);
  while (inlen) {
    unsigned char plaintext[16];
    unsigned char ciphertext[16];
    unsigned int j;
    for (j = 0; j < 16; j++) {
      if (inlen) {
        plaintext[j] = *input++;
        inlen--;
      } else
        break;
    }
    char c = 16 - j;
    unsigned int orig_block_size = j;
    for (; j < 16; j++)
      plaintext[j] = c;
    aesDoEncrypt(rk, nrounds, plaintext, ciphertext);
    if (outlen < 16)
      return -1;
    memcpy(output, ciphertext, 16);
    output += 16;
    outlen -= 16;
    if (orig_block_size == 16 && inlen == 0) {
      memset(plaintext, 16, 16);
      aesDoEncrypt(rk, nrounds, plaintext, ciphertext);
      if (outlen < 16)
        return -1;
      memcpy(output, ciphertext, 16);
      output += 16;
      outlen -= 16;
    }
  }
  return totalout - outlen;
}
```