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

```asm
<aes_encrypt>:
  endbr64
  push   %r14
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  lea    0x140(%r12),%r14
  push   %rbx
  mov    %rsi,%rbx
  mov    %r12,%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  movzbl (%rdi),%edx
  mov    %rsp,%rbp
  mov    %dl,(%rsp)
  movzbl 0x1(%rdi),%edx
  mov    %dl,0x4(%rsp)
  movzbl 0x2(%rdi),%edx
  mov    %dl,0x8(%rsp)
  movzbl 0x3(%rdi),%edx
  mov    %dl,0xc(%rsp)
  movzbl 0x4(%rdi),%edx
  mov    %dl,0x1(%rsp)
  movzbl 0x5(%rdi),%edx
  mov    %dl,0x5(%rsp)
  movzbl 0x6(%rdi),%edx
  mov    %dl,0x9(%rsp)
  movzbl 0x7(%rdi),%edx
  mov    %dl,0xd(%rsp)
  movzbl 0x8(%rdi),%edx
  mov    %dl,0x2(%rsp)
  movzbl 0x9(%rdi),%edx
  mov    %dl,0x6(%rsp)
  movzbl 0xa(%rdi),%edx
  mov    %dl,0xa(%rsp)
  movzbl 0xb(%rdi),%edx
  mov    %dl,0xe(%rsp)
  movzbl 0xc(%rdi),%edx
  movzbl 0xf(%rdi),%eax
  mov    %dl,0x3(%rsp)
  movzbl 0xd(%rdi),%edx
  mov    %al,0xf(%rsp)
  mov    %dl,0x7(%rsp)
  movzbl 0xe(%rdi),%edx
  mov    %rbp,%rdi
  mov    %dl,0xb(%rsp)
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0x20(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0x40(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0x60(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0x80(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0xa0(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0xc0(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0xe0(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0x100(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  mov    %rbp,%rdi
  lea    0x120(%r12),%rsi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  cmp    $0x80,%r13d
  je     L30
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  lea    0x180(%r12),%r14
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  mov    %rbp,%rdi
  lea    0x160(%r12),%rsi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  cmp    $0xc0,%r13d
  je     L30
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  lea    0x1a0(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  lea    0x1c0(%r12),%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  jmp    L7
  nopw   0x0(%rax,%rax,1)
L30:
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
L7:
  movzbl (%rsp),%eax
  mov    %al,(%rbx)
  movzbl 0x4(%rsp),%eax
  mov    %al,0x1(%rbx)
  movzbl 0x8(%rsp),%eax
  mov    %al,0x2(%rbx)
  movzbl 0xc(%rsp),%eax
  mov    %al,0x3(%rbx)
  movzbl 0x1(%rsp),%eax
  mov    %al,0x4(%rbx)
  movzbl 0x5(%rsp),%eax
  mov    %al,0x5(%rbx)
  movzbl 0x9(%rsp),%eax
  mov    %al,0x6(%rbx)
  movzbl 0xd(%rsp),%eax
  mov    %al,0x7(%rbx)
  movzbl 0x2(%rsp),%eax
  mov    %al,0x8(%rbx)
  movzbl 0x6(%rsp),%eax
  mov    %al,0x9(%rbx)
  movzbl 0xa(%rsp),%eax
  mov    %al,0xa(%rbx)
  movzbl 0xe(%rsp),%eax
  mov    %al,0xb(%rbx)
  movzbl 0x3(%rsp),%eax
  mov    %al,0xc(%rbx)
  movzbl 0x7(%rsp),%eax
  mov    %al,0xd(%rbx)
  movzbl 0xb(%rsp),%eax
  mov    %al,0xe(%rbx)
  movzbl 0xf(%rsp),%eax
  mov    %al,0xf(%rbx)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L29
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L29:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void aes_encrypt(unsigned char in[], unsigned char out[], unsigned long key[], int keysize) {
  unsigned char state[4][4];
  state[0][0] = in[0];
  state[1][0] = in[1];
  state[2][0] = in[2];
  state[3][0] = in[3];
  state[0][1] = in[4];
  state[1][1] = in[5];
  state[2][1] = in[6];
  state[3][1] = in[7];
  state[0][2] = in[8];
  state[1][2] = in[9];
  state[2][2] = in[10];
  state[3][2] = in[11];
  state[0][3] = in[12];
  state[1][3] = in[13];
  state[2][3] = in[14];
  state[3][3] = in[15];
  AddRoundKey(state, &key[0]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[4]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[8]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[12]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[16]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[20]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[24]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[28]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[32]);
  SubBytes(state);
  ShiftRows(state);
  MixColumns(state);
  AddRoundKey(state, &key[36]);
  if (keysize != 128) {
    SubBytes(state);
    ShiftRows(state);
    MixColumns(state);
    AddRoundKey(state, &key[40]);
    SubBytes(state);
    ShiftRows(state);
    MixColumns(state);
    AddRoundKey(state, &key[44]);
    if (keysize != 192) {
      SubBytes(state);
      ShiftRows(state);
      MixColumns(state);
      AddRoundKey(state, &key[48]);
      SubBytes(state);
      ShiftRows(state);
      MixColumns(state);
      AddRoundKey(state, &key[52]);
      SubBytes(state);
      ShiftRows(state);
      AddRoundKey(state, &key[56]);
    } else {
      SubBytes(state);
      ShiftRows(state);
      AddRoundKey(state, &key[48]);
    }
  } else {
    SubBytes(state);
    ShiftRows(state);
    AddRoundKey(state, &key[40]);
  }
  out[0] = state[0][0];
  out[1] = state[1][0];
  out[2] = state[2][0];
  out[3] = state[3][0];
  out[4] = state[0][1];
  out[5] = state[1][1];
  out[6] = state[2][1];
  out[7] = state[3][1];
  out[8] = state[0][2];
  out[9] = state[1][2];
  out[10] = state[2][2];
  out[11] = state[3][2];
  out[12] = state[0][3];
  out[13] = state[1][3];
  out[14] = state[2][3];
  out[15] = state[3][3];
}
```