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

```asm
<cms_copy_content>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbp
  mov    %edx,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L83
  mov    D50(%rip),%rax
  mov    %edx,%ecx
  and    (%rax),%ecx
  mov    %rdi,%r12
  jne    L154
L128:
  mov    %rsp,%r15
L60:
  mov    $0x1000,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <BIO_read@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jle    L77
  mov    %eax,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <BIO_write@plt>
  cmp    %ebx,%eax
  je     L60
  mov    $0x0,%ebp
  jmp    L174
L83:
  call   <BIO_s_null@plt>
  mov    %eax,%edi
  call   <BIO_new@plt>
  mov    %rax,%r12
  jmp    L76
L154:
  mov    $0x0,%eax
  call   <BIO_s_mem@plt>
  mov    %eax,%edi
  call   <BIO_new@plt>
  mov    %rax,%r12
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <BIO_set_mem_eof_return@plt>
L76:
  test   %r12,%r12
  jne    L128
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    D19(%rip),%rax
  mov    (%rax),%edi
  call   <CMSerr@plt>
  mov    $0x0,%ebp
  jmp    L42
L77:
  mov    %rbp,%rdi
  call   <BIO_method_type@plt>
  mov    D34(%rip),%rdx
  cmp    (%rdx),%rax
  je     L173
L90:
  mov    $0x0,%ebp
  test   %ebx,%ebx
  js     L174
  mov    D50(%rip),%rax
  and    (%rax),%r14d
  mov    $0x1,%ebp
  jne    L62
L174:
  test   %r12,%r12
  je     L42
  cmp    %r12,%r13
  je     L42
  mov    %r12,%rdi
  call   <BIO_free@plt>
L42:
  mov    0x1008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L73
  mov    %ebp,%eax
  add    $0x1018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L173:
  mov    %rbp,%rdi
  call   <BIO_get_cipher_status@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jne    L90
  jmp    L174
L62:
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <SMIME_text@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  je     L169
  mov    $0x1,%ebp
  jmp    L174
L169:
  mov    D6(%rip),%rax
  mov    (%rax),%esi
  mov    D19(%rip),%rax
  mov    (%rax),%edi
  call   <CMSerr@plt>
  jmp    L174
L73:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int cms_copy_content(BIO *out, BIO *in, unsigned int flags) {
  unsigned char buf[4096];
  int r = 0, i;
  BIO *tmpout = NULL;
  if (out == NULL)
    tmpout = BIO_new(BIO_s_null());
  else if (flags & CMS_TEXT) {
    tmpout = BIO_new(BIO_s_mem());
    BIO_set_mem_eof_return(tmpout, 0);
  } else
    tmpout = out;
  if (!tmpout) {
    CMSerr(CMS_F_CMS_COPY_CONTENT, ERR_R_MALLOC_FAILURE);
    goto err;
  }
  for (;;) {
    i = BIO_read(in, buf, sizeof(buf));
    if (i <= 0) {
      if (BIO_method_type(in) == BIO_TYPE_CIPHER) {
        if (!BIO_get_cipher_status(in))
          goto err;
      }
      if (i < 0)
        goto err;
      break;
    }
    if (tmpout && (BIO_write(tmpout, buf, i) != i))
      goto err;
  }
  if (flags & CMS_TEXT) {
    if (!SMIME_text(tmpout, out)) {
      CMSerr(CMS_F_CMS_COPY_CONTENT, CMS_R_SMIME_TEXT_ERROR);
      goto err;
    }
  }
  r = 1;
err:
  if (tmpout && (tmpout != out))
    BIO_free(tmpout);
  return r;
}
```