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

```asm
<decode_quoted_printable>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    (%rdx),%ebx
  movl   $0x0,(%rdx)
  test   %r14d,%r14d
  je     L243
  mov    %rdi,%r12
  lea    0x1(%r14),%edi
  mov    %rdx,%r13
  mov    %ecx,%r15d
  mov    %edi,(%rsp)
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L243
  test   %r15d,%r15d
  je     L169
  lea    -0x1(%r14),%edx
  mov    %rax,%rdi
  xor    %ecx,%ecx
  mov    $0x20,%r10d
  movabs $0x7e0000007e03ff,%r15
  jmp    L34
  nopl   0x0(%rax,%rax,1)
L199:
  cmp    $0x5f,%al
  cmove  %r10d,%eax
L12:
  add    $0x1,%ecx
  mov    %al,(%rdi)
  lea    0x1(%rdi),%rsi
  cmp    %ecx,%ebx
  jbe    L202
L305:
  lea    -0x1(%rdx),%eax
  test   %edx,%edx
  je     L202
  mov    %edx,%r14d
  mov    %rsi,%rdi
  mov    %eax,%edx
  mov    %r8,%r12
L34:
  movzbl (%r12),%eax
  lea    0x1(%r12),%r8
  cmp    $0x3d,%al
  jne    L199
  movzbl 0x1(%r12),%r9d
  mov    %r9d,%esi
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x5,%sil
  jbe    L283
  lea    -0x30(%r9),%esi
  cmp    $0x9,%sil
  ja     L12
L283:
  movzbl 0x2(%r12),%esi
  lea    -0x30(%rsi),%r11d
  cmp    $0x36,%r11b
  ja     L12
  bt     %r11,%r15
  jae    L12
  movzbl %r9b,%eax
  mov    $0x30,%r8d
  cmp    $0x39,%r9b
  jbe    L312
  cmp    $0x47,%r9b
  sbb    %r8d,%r8d
  and    $0xffffffe0,%r8d
  add    $0x57,%r8d
L312:
  sub    %r8d,%eax
  mov    $0x30,%r8d
  shl    $0x4,%eax
  cmp    $0x39,%sil
  jbe    L120
  cmp    $0x47,%sil
  sbb    %r8d,%r8d
  and    $0xffffffe0,%r8d
  add    $0x57,%r8d
L120:
  sub    %r8d,%esi
  or     %esi,%eax
  test   %edx,%edx
  je     L348
  xor    %esi,%esi
  lea    -0x3(%r14),%edx
  cmp    $0x2,%r14d
  cmove  %esi,%edx
L348:
  mov    %al,(%rdi)
  lea    0x3(%r12),%r8
  lea    0x1(%rdi),%rsi
  add    $0x1,%ecx
  cmp    %ecx,%ebx
  ja     L305
  nopl   0x0(%rax)
L202:
  movb   $0x0,(%rsi)
  sub    %rbp,%rsi
  jmp    L294
L280:
  mov    %rbp,%rdi
  call   <free@plt>
L243:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L169:
  mov    (%rsp),%edi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  test   %rax,%rax
  je     L280
  mov    %rax,%r15
  mov    %r14d,%edx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movb   $0x0,(%r15,%r14,1)
  movabs $0x7e0000007e03ff,%r12
  mov    %r15,%r14
  mov    %rbp,%r15
L133:
  mov    $0xa,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L122
  lea    -0x1(%rax),%rdx
  lea    0x1(%rax),%rdi
  cmp    %r14,%rdx
  jb     L6
  cmpb   $0xd,-0x1(%rax)
  je     L126
  nopl   0x0(%rax)
L19:
  movzbl (%rdx),%eax
  cmp    $0x20,%al
  je     L18
  cmp    $0x9,%al
  jne    L6
L18:
  sub    $0x1,%rdx
  cmp    %r14,%rdx
  jae    L19
L6:
  movb   $0x0,0x1(%rdx)
  lea    0x1(%r15),%rax
  mov    %ebx,%r8d
  nop
L175:
  movzbl (%r14),%edx
  lea    -0x1(%rax),%rcx
  lea    0x1(%r14),%r10
  test   %dl,%dl
  je     L360
  cmp    $0x3d,%dl
  jne    L203
  movzbl 0x1(%r14),%r9d
  test   %r9b,%r9b
  je     L430
  mov    %r9d,%ecx
  and    $0xffffffdf,%ecx
  sub    $0x41,%ecx
  cmp    $0x5,%cl
  jbe    L240
  lea    -0x30(%r9),%ecx
  cmp    $0x9,%cl
  jbe    L240
  nopw   0x0(%rax,%rax,1)
L203:
  mov    %rax,%rcx
  mov    %r10,%r14
L359:
  mov    %rax,%rsi
  mov    %dl,-0x1(%rax)
  add    $0x1,%rax
  sub    %rbp,%rsi
  cmp    %r8,%rsi
  jl     L175
L28:
  movb   $0x0,(%rcx)
  mov    (%rsp),%rdi
  mov    %rsi,0x8(%rsp)
  call   <free@plt>
  mov    0x8(%rsp),%rsi
L294:
  mov    %esi,0x0(%r13)
  add    $0x18,%rsp
  mov    %rbp,%rdi
  add    $0x1,%esi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10f0 <realloc@plt>
  nopl   0x0(%rax,%rax,1)
L360:
  test   %rdi,%rdi
  je     L185
  mov    %rax,%rsi
  mov    %ebx,%edx
  movb   $0xa,(%rcx)
  mov    %rax,%r15
  sub    %rbp,%rsi
  cmp    %rdx,%rsi
  jge    L70
L81:
  mov    %rdi,%r14
  jmp    L133
L240:
  movzbl 0x2(%r14),%esi
  lea    -0x30(%rsi),%ecx
  cmp    $0x36,%cl
  ja     L203
  bt     %rcx,%r12
  jae    L203
  movzbl %r9b,%edx
  mov    $0x30,%ecx
  cmp    $0x39,%r9b
  jbe    L405
  cmp    $0x47,%r9b
  sbb    %ecx,%ecx
  and    $0xffffffe0,%ecx
  add    $0x57,%ecx
L405:
  sub    %ecx,%edx
  mov    $0x30,%r9d
  shl    $0x4,%edx
  cmp    $0x39,%sil
  jbe    L252
  cmp    $0x47,%sil
  sbb    %r9d,%r9d
  and    $0xffffffe0,%r9d
  add    $0x57,%r9d
L252:
  sub    %r9d,%esi
  mov    %rax,%rcx
  add    $0x3,%r14
  or     %esi,%edx
  jmp    L359
  nopw   0x0(%rax,%rax,1)
L430:
  mov    %rcx,%rsi
  mov    %ebx,%eax
  sub    %rbp,%rsi
  cmp    %rax,%rsi
  jge    L28
  test   %rdi,%rdi
  je     L28
  mov    %rcx,%r15
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L185:
  mov    %rcx,%rsi
  sub    %rbp,%rsi
  jmp    L28
  nopl   0x0(%rax,%rax,1)
L122:
  mov    %r14,%rdi
  call   <strlen@plt>
  xor    %edi,%edi
  cltq
  lea    -0x1(%r14,%rax,1),%rdx
L276:
  cmp    %r14,%rdx
  jae    L19
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L70:
  mov    %rax,%rcx
  jmp    L28
  nopl   0x0(%rax,%rax,1)
L126:
  lea    -0x2(%rax),%rdx
  jmp    L276
```

assistant: ```c
char *decode_quoted_printable(unsigned char *buf, unsigned int len, unsigned int *ret_len, int header) {
  unsigned char *dest, *deststart;
  unsigned int limit = *ret_len;
  *ret_len = 0;
  if (!len)
    return NULL;
  if (!(dest = (unsigned char *)malloc(len + 1)))
    return NULL;
  deststart = dest;
  if (header) {
    unsigned int real_len = 0;
    while (len--) {
      unsigned char c = *buf++;
      if ('=' == c) {
        unsigned char c2;
        c = buf[0];
        c2 = buf[1];
        if (((((c) >= '0') && ((c) <= '9')) || (((c) >= 'A') && ((c) <= 'F')) || (((c) >= 'a') && ((c) <= 'f'))) && ((((c2) >= '0') && ((c2) <= '9')) || (((c2) >= 'A') && ((c2) <= 'F')) || (((c2) >= 'a') && ((c2) <= 'f')))) {
          c = (((c) - (((c) > '9') ? (((c) > 'F') ? 'a' - 10 : 'A' - 10) : '0')) << 4) | ((c2) - (((c2) > '9') ? (((c2) > 'F') ? 'a' - 10 : 'A' - 10) : '0'));
          if (len)
            len--;
          if (len)
            len--;
          buf += 2;
        } else
          c = '=';
      } else if ('_' == c)
        c = ' ';
      *dest++ = c;
      if (++real_len >= limit)
        break;
    }
    *dest = 0;
    *ret_len = dest - deststart;
    return (char *)realloc(deststart, *ret_len + 1);
  } else {
    unsigned char *text, *textstart;
    if (!(text = (unsigned char *)malloc(len + 1))) {
      free(dest);
      return NULL;
    }
    memcpy(text, buf, len);
    text[len] = 0;
    textstart = text;
    while (text) {
      unsigned char c;
      unsigned char *lp = text;
      {
        unsigned char *ep;
        if ((ep = (unsigned char *)strchr((char *)lp, '\n'))) {
          text = ep + 1;
          ep--;
          if (ep >= lp) {
            if ('\r' == *ep)
              ep--;
          }
        } else {
          ep = lp + strlen((char *)lp) - 1;
          text = NULL;
        }
        while ((ep >= lp) && (((c = *ep) == ' ') || (c == '\t')))
          ep--;
        *(ep + 1) = '\0';
      }
      do {
        switch (c = *lp++) {
        case '\0':
          if (text)
            *dest++ = '\n';
          break;
        case '=':
          if ((c = *lp)) {
            unsigned char d = *(lp + 1);
            if (((((c) >= '0') && ((c) <= '9')) || (((c) >= 'A') && ((c) <= 'F')) || (((c) >= 'a') && ((c) <= 'f'))) && ((((d) >= '0') && ((d) <= '9')) || (((d) >= 'A') && ((d) <= 'F')) || (((d) >= 'a') && ((d) <= 'f')))) {
              *dest++ = (((c) - (((c) > '9') ? (((c) > 'F') ? 'a' - 10 : 'A' - 10) : '0')) << 4) | ((d) - (((d) > '9') ? (((d) > 'F') ? 'a' - 10 : 'A' - 10) : '0'));
              lp += 2;
            } else {
              *dest++ = '=';
            }
          }
          break;
        default:
          *dest++ = c;
          break;
        }
        if ((dest - deststart) >= limit) {
          text = NULL;
          break;
        }
      } while (c);
    }
    *dest = 0;
    free(textstart);
    *ret_len = dest - deststart;
    return (char *)realloc(deststart, *ret_len + 1);
  }
}
```