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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  lea    -0x30(%rbp),%rax
  mov    %rax,-0x78(%rbp)
  movb   $0x0,-0x82(%rbp)
  movb   $0x0,-0x81(%rbp)
  lea    -0x40(%rbp),%rax
  mov    $0x10,%edx
  mov    $0x58,%esi
  mov    %rax,%rdi
  call   <memset@plt>
L189:
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x70(%rbp)
  jmp    L64
L160:
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    $0x0,%eax
  call   <getc@plt>
  mov    %al,(%rbx)
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L123
  movb   $0x1,-0x82(%rbp)
  jmp    L173
L123:
  addq   $0x1,-0x70(%rbp)
L64:
  cmpq   $0xf,-0x70(%rbp)
  jbe    L160
L173:
  cmpb   $0x1,-0x82(%rbp)
  jne    L62
  mov    -0x70(%rbp),%rax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    $0x10,%eax
  sub    %edx,%eax
  mov    %al,-0x81(%rbp)
  jmp    L50
L174:
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x81(%rbp),%eax
  mov    %al,(%rdx)
  addq   $0x1,-0x70(%rbp)
L50:
  cmpq   $0xf,-0x70(%rbp)
  jbe    L174
L62:
  movq   $0x0,-0x68(%rbp)
  jmp    L33
L163:
  mov    -0x78(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ecx
  mov    -0x80(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x78(%rbp),%rsi
  mov    -0x68(%rbp),%rax
  add    %rsi,%rax
  xor    %ecx,%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x68(%rbp)
L33:
  cmpq   $0xf,-0x68(%rbp)
  jbe    L163
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <aes_encrypt@plt>
  movq   $0x0,-0x60(%rbp)
  jmp    L41
L161:
  mov    -0x78(%rbp),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putc@plt>
  addq   $0x1,-0x60(%rbp)
L41:
  cmpq   $0xf,-0x60(%rbp)
  jbe    L161
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x78(%rbp)
  cmpb   $0x1,-0x82(%rbp)
  je     L77
  jmp    L189
L77:
  nop
  cmpb   $0x0,-0x81(%rbp)
  jne    L127
  movq   $0x0,-0x58(%rbp)
  jmp    L180
L130:
  mov    -0x80(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x78(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  add    %rcx,%rax
  xor    $0x10,%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x58(%rbp)
L180:
  cmpq   $0xf,-0x58(%rbp)
  jbe    L130
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <aes_encrypt@plt>
  movq   $0x0,-0x50(%rbp)
  jmp    L132
L14:
  mov    -0x78(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putc@plt>
  addq   $0x1,-0x50(%rbp)
L132:
  cmpq   $0xf,-0x50(%rbp)
  jbe    L14
L127:
  mov    $0x0,%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L110
  call   <__stack_chk_fail@plt>
L110:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

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;
}
```