user: Demonstrate the C code that generates the assembly output below:

```asm
<smtp_recv_mail_data>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x200,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L320
  mov    $0xffffffff,%eax
  jmp    L315
L320:
  movl   $0x0,-0x38(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  movq   $0x200,-0x28(%rbp)
  movq   $0x0,-0x30(%rbp)
L149:
  lea    -0x39(%rbp),%rdx
  mov    -0x44(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <buf_read@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x1,-0x34(%rbp)
  jne    L12
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzbl -0x39(%rbp),%edx
  mov    %dl,(%rax)
  cmpl   $0x4,-0x38(%rbp)
  jne    L46
  movzbl -0x39(%rbp),%eax
  cmp    $0xa,%al
  jne    L304
  subq   $0x2,-0x30(%rbp)
  mov    -0x20(%rbp),%rax
  sub    $0x3,%rax
  movb   $0x0,(%rax)
  nop
  mov    -0x50(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  cmpq   $0x0,-0x58(%rbp)
  je     L145
  jmp    L179
L304:
  movzbl -0x39(%rbp),%eax
  cmp    $0xd,%al
  jne    L16
  movl   $0x1,-0x38(%rbp)
  jmp    L86
L16:
  movl   $0x0,-0x38(%rbp)
  jmp    L86
L46:
  cmpl   $0x3,-0x38(%rbp)
  jne    L62
  movzbl -0x39(%rbp),%eax
  cmp    $0xd,%al
  jne    L2
  movl   $0x4,-0x38(%rbp)
  jmp    L86
L2:
  movzbl -0x39(%rbp),%eax
  cmp    $0xd,%al
  jne    L259
  movl   $0x1,-0x38(%rbp)
  jmp    L86
L259:
  movl   $0x0,-0x38(%rbp)
  jmp    L86
L62:
  cmpl   $0x2,-0x38(%rbp)
  jne    L349
  movzbl -0x39(%rbp),%eax
  cmp    $0x2e,%al
  jne    L170
  movl   $0x3,-0x38(%rbp)
  jmp    L86
L170:
  movzbl -0x39(%rbp),%eax
  cmp    $0xd,%al
  jne    L80
  movl   $0x1,-0x38(%rbp)
  jmp    L86
L80:
  movl   $0x0,-0x38(%rbp)
  jmp    L86
L349:
  cmpl   $0x1,-0x38(%rbp)
  jne    L11
  movzbl -0x39(%rbp),%eax
  cmp    $0xa,%al
  jne    L252
  movl   $0x2,-0x38(%rbp)
  jmp    L86
L252:
  movzbl -0x39(%rbp),%eax
  cmp    $0xd,%al
  jne    L322
  movl   $0x1,-0x38(%rbp)
  jmp    L86
L322:
  movl   $0x0,-0x38(%rbp)
  jmp    L86
L11:
  movzbl -0x39(%rbp),%eax
  cmp    $0xd,%al
  jne    L86
  movl   $0x1,-0x38(%rbp)
  jmp    L86
L12:
  mov    -0x50(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x58(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpl   $0x1,-0x34(%rbp)
  jne    L357
  mov    $0x0,%eax
  jmp    L315
L357:
  mov    $0xffffffff,%eax
  jmp    L315
L86:
  addq   $0x1,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L149
  shlq   -0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L375
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L315
L375:
  mov    -0x18(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x10(%rbp)
  jmp    L149
L179:
  mov    -0x58(%rbp),%rax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
L145:
  mov    -0x30(%rbp),%rax
L315:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L162
  call   <__stack_chk_fail@plt>
L162:
  leave
  ret
```

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