user: 这段汇编代码用C语言表示是什么样的：

```asm
<smtp_recv_mail_data>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  mov    $0x200,%edi
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  test   %rax,%rax
  je     L201
  mov    %rax,(%rsp)
  mov    %rax,%r15
  mov    $0x200,%ebx
  xor    %r14d,%r14d
  xor    %r13d,%r13d
  lea    0x27(%rsp),%r12
  jmp    L47
  nopw   0x0(%rax,%rax,1)
L211:
  cmp    $0x3,%r13d
  je     L35
  cmp    $0x2,%r13d
  je     L142
  cmp    $0x1,%r13d
  je     L20
  cmp    $0xd,%al
  mov    $0x1,%eax
  cmove  %eax,%r13d
L122:
  add    $0x1,%r14
  cmp    %r14,%rbx
  je     L136
L36:
  mov    %r9,%r15
L47:
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <buf_read@plt>
  cmp    $0x1,%eax
  jne    L193
  movzbl 0x27(%rsp),%eax
  lea    0x1(%r15),%r9
  mov    %al,(%r15)
  cmp    $0x4,%r13d
  jne    L211
  cmp    $0xa,%al
  je     L51
L188:
  xor    %r13d,%r13d
  cmp    $0xd,%al
  sete   %r13b
  add    $0x1,%r14
  cmp    %r14,%rbx
  jne    L36
L136:
  add    %rbx,%rbx
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L191
  mov    (%rsp),%rsi
  lea    (%rax,%r14,1),%r9
  mov    %r14,%rdx
  mov    %rax,%rdi
  mov    %r9,0x8(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %r15,(%rsp)
  mov    0x8(%rsp),%r9
  jmp    L36
  nopw   0x0(%rax,%rax,1)
L35:
  xor    %ecx,%ecx
  cmp    $0xd,%al
  sete   %cl
  lea    0x0(,%rcx,4),%r13d
  jmp    L122
  nopl   0x0(%rax)
L142:
  mov    $0x3,%r13d
  cmp    $0x2e,%al
  jne    L188
  jmp    L122
  nopw   0x0(%rax,%rax,1)
L20:
  mov    $0x2,%r13d
  cmp    $0xa,%al
  jne    L188
  jmp    L122
  nopl   0x0(%rax,%rax,1)
L193:
  mov    0x18(%rsp),%rax
  mov    (%rsp),%rdi
  movq   $0x0,(%rax)
  mov    0x10(%rsp),%rax
  movq   $0x0,(%rax)
  call   <free@plt>
  mov    $0xffffffff,%eax
L116:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L38
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L51:
  mov    0x18(%rsp),%rdx
  mov    (%rsp),%rcx
  movb   $0x0,-0x2(%r15)
  lea    -0x2(%r14),%rax
  cmpq   $0x0,0x10(%rsp)
  mov    %rcx,(%rdx)
  je     L116
  mov    0x10(%rsp),%rdx
  mov    %rbx,(%rdx)
  jmp    L116
L191:
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L116
L201:
  or     $0xffffffff,%eax
  jmp    L116
L38:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t smtp_recv_mail_data(int sockfd, char **buf_ptr, size_t *buf_size) {
  int rc, state;
  size_t n, buflen;
  char c, *ptr, *buf, *temp_buf;
  if (NULL == (buf = malloc(512 * sizeof(char))))
    return -1;
  state = 0;
  ptr = buf;
  buflen = 512;
  n = 0;
  for (;;) {
    if ((rc = buf_read(sockfd, &c)) == 1) {
      *ptr++ = c;
      if (4 == state) {
        if (c == '\n') {
          n -= 2;
          *(ptr - 3) = '\0';
          break;
        } else if (c == '\r')
          state = 1;
        else
          state = 0;
      } else if (3 == state) {
        if (c == '\r')
          state = 4;
        else if (c == '\r')
          state = 1;
        else
          state = 0;
      } else if (2 == state) {
        if (c == '.')
          state = 3;
        else if (c == '\r')
          state = 1;
        else
          state = 0;
      } else if (1 == state) {
        if (c == '\n')
          state = 2;
        else if (c == '\r')
          state = 1;
        else
          state = 0;
      } else if (c == '\r')
        state = 1;
    } else {
      *buf_ptr = NULL;
      *buf_size = 0;
      free(buf);
      if (rc == 1)
        return 0;
      else
        return -1;
    }
    ++n;
    if (n == buflen) {
      buflen *= 2;
      temp_buf = buf;
      if (NULL == (buf = malloc(buflen * sizeof(char)))) {
        free(temp_buf);
        return -1;
      }
      ptr = buf + n;
      memcpy(buf, temp_buf, n);
      free(temp_buf);
      temp_buf = NULL;
    }
  }
  *buf_ptr = buf;
  if (NULL != buf_size)
    *buf_size = buflen;
  return n;
}
```