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

```asm
<asn1_string_canon>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    0x10(%rsi),%edi
  call   <ASN1_tag2bit@plt>
  mov    D37(%rip),%rdx
  mov    %eax,%r8d
  mov    D68(%rip),%rax
  mov    (%rax),%eax
  or     (%rdx),%eax
  mov    D45(%rip),%rdx
  or     (%rdx),%eax
  mov    D9(%rip),%rdx
  or     (%rdx),%eax
  mov    D29(%rip),%rdx
  or     (%rdx),%eax
  mov    D3(%rip),%rdx
  or     (%rdx),%eax
  mov    D7(%rip),%rdx
  or     (%rdx),%eax
  test   %r8d,%eax
  jne    L86
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <ASN1_STRING_copy@plt>
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
L89:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L86:
  mov    D38(%rip),%rax
  mov    0x8(%rsp),%rbx
  mov    %rbp,%rsi
  mov    (%rax),%eax
  lea    0x8(%rbx),%rdi
  mov    %eax,0x10(%rbx)
  call   <ASN1_STRING_to_UTF8@plt>
  mov    %eax,%ebp
  mov    %eax,(%rbx)
  xor    %eax,%eax
  cmp    $0xffffffff,%ebp
  je     L89
  mov    0x8(%rbx),%rbx
  test   %ebp,%ebp
  jg     L65
  jmp    L199
  nopl   (%rax)
L63:
  call   <isspace@plt>
  test   %rax,%rax
  je     L52
  add    $0x1,%rbx
  sub    $0x1,%ebp
  je     L199
L65:
  movzbl (%rbx),%edi
  test   %dil,%dil
  jns    L63
L52:
  movslq %ebp,%rax
  lea    -0x1(%rbx,%rax,1),%r12
  jmp    L146
  nopl   0x0(%rax)
L179:
  call   <isspace@plt>
  test   %rax,%rax
  je     L27
  sub    $0x1,%r12
  sub    $0x1,%ebp
  je     L199
L146:
  movzbl (%r12),%edi
  test   %dil,%dil
  jns    L179
L27:
  mov    0x8(%rsp),%rax
  xor    %r14d,%r14d
  mov    0x8(%rax),%r13
  jmp    L121
  nopw   0x0(%rax,%rax,1)
L133:
  mov    %dil,-0x1(%r13)
  mov    %r15d,%r14d
  mov    %r12,%rbx
L54:
  cmp    %ebp,%r14d
  jge    L175
L121:
  movzbl (%rbx),%edi
  add    $0x1,%r13
  lea    0x1(%rbx),%r12
  lea    0x1(%r14),%r15d
  test   %dil,%dil
  js     L133
  call   <isspace@plt>
  test   %rax,%rax
  jne    L155
  movzbl (%rbx),%edi
  mov    %r15d,%r14d
  mov    %r12,%rbx
  call   <tolower@plt>
  mov    %al,-0x1(%r13)
  cmp    %ebp,%r14d
  jl     L121
L175:
  mov    0x8(%rsp),%rax
  sub    0x8(%rax),%r13d
L100:
  mov    %r13d,(%rax)
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L155:
  movb   $0x20,-0x1(%r13)
  mov    %rbx,%r15
  jmp    L112
  nopw   0x0(%rax,%rax,1)
L152:
  call   <isspace@plt>
  test   %rax,%rax
  je     L157
L112:
  add    $0x1,%r15
  movzbl (%r15),%edi
  lea    (%r14,%r15,1),%r12d
  sub    %ebx,%r12d
  test   %dil,%dil
  jns    L152
L157:
  mov    %r12d,%r14d
  mov    %r15,%rbx
  jmp    L54
  nopl   0x0(%rax)
L199:
  mov    0x8(%rsp),%rax
  xor    %r13d,%r13d
  jmp    L100
```

assistant: ```c
int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) {
  unsigned char *to, *from;
  int len, i;
  if (!(ASN1_tag2bit(in->type) & (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING))) {
    if (!ASN1_STRING_copy(out, in))
      return 0;
    return 1;
  }
  out->type = V_ASN1_UTF8STRING;
  out->length = ASN1_STRING_to_UTF8(&out->data, in);
  if (out->length == -1)
    return 0;
  to = out->data;
  from = to;
  len = out->length;
  while ((len > 0) && !(*from & 0x80) && isspace(*from)) {
    from++;
    len--;
  }
  to = from + len - 1;
  while ((len > 0) && !(*to & 0x80) && isspace(*to)) {
    to--;
    len--;
  }
  to = out->data;
  i = 0;
  while (i < len) {
    if (*from & 0x80) {
      *to++ = *from++;
      i++;
    } else if (isspace(*from)) {
      *to++ = ' ';
      do {
        from++;
        i++;
      } while (!(*from & 0x80) && isspace(*from));
    } else {
      *to++ = tolower(*from);
      from++;
      i++;
    }
  }
  out->length = to - out->data;
  return 1;
}
```