user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x10,%edx
  mov    $0x58,%esi
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x10(%rsp),%rbx
  mov    %rbp,%rdi
  call   <memset@plt>
  nop
L133:
  xor    %r12d,%r12d
  nopl   0x0(%rax,%rax,1)
L138:
  xor    %eax,%eax
  call   <getc@plt>
  mov    %al,(%rbx,%r12,1)
  cmp    $0xa,%al
  je     L123
  add    $0x1,%r12
  cmp    $0x10,%r12
  jne    L138
  xor    %r12d,%r12d
L65:
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L10:
  movzbl 0x0(%rbp,%rax,1),%edx
  xor    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    $0x10,%rax
  jne    L10
  mov    %rbx,%rdi
  mov    %rbx,%r14
  lea    0x10(%rbx),%r15
  call   <aes_encrypt@plt>
  nopl   0x0(%rax)
L182:
  movsbl (%r14),%edi
  add    $0x1,%r14
  call   <putc@plt>
  cmp    %r15,%r14
  jne    L182
  cmp    $0x1,%r12b
  je     L174
  mov    %rbp,%rax
  mov    %rbx,%rbp
  mov    %rax,%rbx
  jmp    L133
  nopl   0x0(%rax,%rax,1)
L123:
  mov    $0x10,%r13d
  mov    $0x10,%eax
  movabs $0x101010101010101,%rsi
  sub    %r12d,%r13d
  sub    %r12,%rax
  add    %rbx,%r12
  movzbl %r13b,%edx
  imul   %rsi,%rdx
  cmp    $0x8,%eax
  jae    L163
  test   $0x4,%al
  jne    L35
  test   %eax,%eax
  jne    L36
L132:
  mov    $0x1,%r12d
  jmp    L65
L174:
  test   %r13b,%r13b
  jne    L104
  xor    %eax,%eax
  nopl   0x0(%rax)
L105:
  movzbl (%rbx,%rax,1),%edx
  xor    $0x10,%edx
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    $0x10,%rax
  jne    L105
  mov    %rbp,%rdi
  lea    0x10(%rbp),%rbx
  call   <aes_encrypt@plt>
  nopl   0x0(%rax)
L148:
  movsbl 0x0(%rbp),%edi
  add    $0x1,%rbp
  call   <putc@plt>
  cmp    %rbx,%rbp
  jne    L148
L104:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L76
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L163:
  lea    0x8(%r12),%rsi
  mov    %eax,%ecx
  mov    %rdx,(%r12)
  and    $0xfffffffffffffff8,%rsi
  mov    %rdx,-0x8(%r12,%rcx,1)
  sub    %rsi,%r12
  add    %r12d,%eax
  and    $0xfffffff8,%eax
  cmp    $0x8,%eax
  jb     L132
  and    $0xfffffff8,%eax
  xor    %ecx,%ecx
L57:
  mov    %ecx,%edi
  add    $0x8,%ecx
  mov    %rdx,(%rsi,%rdi,1)
  cmp    %eax,%ecx
  jb     L57
  jmp    L132
L36:
  mov    %dl,(%r12)
  test   $0x2,%al
  je     L132
  mov    %eax,%eax
  mov    %dx,-0x2(%r12,%rax,1)
  jmp    L132
L35:
  mov    %eax,%eax
  mov    %edx,(%r12)
  mov    %edx,-0x4(%r12,%rax,1)
  jmp    L132
L76:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  uint8_t block1[16];
  uint8_t block2[16];
  uint8_t *block_prev = block1;
  uint8_t *block_cur = block2;
  uint8_t last = 0;
  uint8_t pad = 0;
  memset(block1, 'X', 16);
  while (1) {
    size_t num_input = 0;
    for (num_input = 0; num_input < 16; num_input++) {
      block_cur[num_input] = getc();
      if (block_cur[num_input] == '\n') {
        last = 1;
        break;
      }
    }
    if (last == 1) {
      pad = 16 - (num_input % 16);
      for (; num_input < 16; num_input++) {
        block_cur[num_input] = pad;
      }
    }
    for (size_t i = 0; i < 16; i++) {
      block_cur[i] ^= block_prev[i];
    }
    aes_encrypt(block_cur);
    for (size_t i = 0; i < 16; i++) {
      putc(block_cur[i]);
    }
    uint8_t *tmp = block_prev;
    block_prev = block_cur;
    block_cur = tmp;
    if (last == 1) {
      break;
    }
  }
  if (pad == 0) {
    for (size_t i = 0; i < 16; i++) {
      block_cur[i] = block_prev[i] ^ 0x10;
    }
    aes_encrypt(block_cur);
    for (size_t i = 0; i < 16; i++) {
      putc(block_cur[i]);
    }
  }
  return 0;
}
```