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

```asm
<aes_encrypt>:
  endbr64
  push   %r13
  mov    %rdi,%rax
  mov    %rdx,%rdi
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0xc8(%rsp)
  xor    %edx,%edx
  movzbl (%rax),%edx
  lea    0x10(%rsp),%r12
  mov    %rsp,%rbp
  mov    %r12,%rsi
  lea    0xb0(%rsp),%r13
  mov    %dl,(%rsp)
  movzbl 0x1(%rax),%edx
  mov    %dl,0x4(%rsp)
  movzbl 0x2(%rax),%edx
  mov    %dl,0x8(%rsp)
  movzbl 0x3(%rax),%edx
  mov    %dl,0xc(%rsp)
  movzbl 0x4(%rax),%edx
  mov    %dl,0x1(%rsp)
  movzbl 0x5(%rax),%edx
  mov    %dl,0x5(%rsp)
  movzbl 0x6(%rax),%edx
  mov    %dl,0x9(%rsp)
  movzbl 0x7(%rax),%edx
  mov    %dl,0xd(%rsp)
  movzbl 0x8(%rax),%edx
  mov    %dl,0x2(%rsp)
  movzbl 0x9(%rax),%edx
  mov    %dl,0x6(%rsp)
  movzbl 0xa(%rax),%edx
  mov    %dl,0xa(%rsp)
  movzbl 0xb(%rax),%edx
  mov    %dl,0xe(%rsp)
  movzbl 0xc(%rax),%edx
  mov    %dl,0x3(%rsp)
  movzbl 0xd(%rax),%edx
  mov    %dl,0x7(%rsp)
  movzbl 0xe(%rax),%edx
  movzbl 0xf(%rax),%eax
  mov    %dl,0xb(%rsp)
  mov    $0x80,%edx
  mov    %al,0xf(%rsp)
  call   <KeyExpansion@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  lea    0x20(%rsp),%r12
  call   <AddRoundKey@plt>
  nopl   0x0(%rax,%rax,1)
L17:
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %rbp,%rdi
  call   <MixColumns@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x10,%r12
  call   <AddRoundKey@plt>
  cmp    %r13,%r12
  jne    L17
  mov    %rbp,%rdi
  call   <SubBytes@plt>
  mov    %rbp,%rdi
  call   <ShiftRows@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <AddRoundKey@plt>
  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    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void aes_encrypt(unsigned char in[], unsigned char out[], unsigned char key[], int keysize) {
  unsigned char state[4][4];
  short i = 0;
  unsigned int w[44];
  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];
  KeyExpansion(key, w, 128);
  AddRoundKey(state, (unsigned char *)&w[0]);
  for (i = 1; i < 10; i++) {
    SubBytes(state);
    ShiftRows(state);
    MixColumns(state);
    AddRoundKey(state, (unsigned char *)&w[4 * i]);
  }
  SubBytes(state);
  ShiftRows(state);
  AddRoundKey(state, (unsigned char *)&w[4 * i]);
  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];
}
```