#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int d;
typedef int c2;
typedef int c;

/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
scalar_t__ realloc(unsigned char *, unsigned int);
scalar_t__ strchr(char *, char);
int strlen(char *);
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);
  }
}


x86 assembly (clang, -O0):
<decode_quoted_printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
cmpl   $0x0,-0x14(%rbp)
jne    11a3 <decode_quoted_printable+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1849 <decode_quoted_printable+0x6e9>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11c9 <decode_quoted_printable+0x69>
movq   $0x0,-0x8(%rbp)
jmp    1849 <decode_quoted_printable+0x6e9>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1430 <decode_quoted_printable+0x2d0>
movl   $0x0,-0x40(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     13fb <decode_quoted_printable+0x29b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x41(%rbp)
movzbl -0x41(%rbp),%ecx
mov    $0x3d,%eax
cmp    %ecx,%eax
jne    13b1 <decode_quoted_printable+0x251>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x41(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x42(%rbp)
movzbl -0x41(%rbp),%eax
cmp    $0x30,%eax
jl     1248 <decode_quoted_printable+0xe8>
movzbl -0x41(%rbp),%eax
cmp    $0x39,%eax
jle    127c <decode_quoted_printable+0x11c>
movzbl -0x41(%rbp),%eax
cmp    $0x41,%eax
jl     1262 <decode_quoted_printable+0x102>
movzbl -0x41(%rbp),%eax
cmp    $0x46,%eax
jle    127c <decode_quoted_printable+0x11c>
movzbl -0x41(%rbp),%eax
cmp    $0x61,%eax
jl     13a8 <decode_quoted_printable+0x248>
movzbl -0x41(%rbp),%eax
cmp    $0x66,%eax
jg     13a8 <decode_quoted_printable+0x248>
movzbl -0x42(%rbp),%eax
cmp    $0x30,%eax
jl     1296 <decode_quoted_printable+0x136>
movzbl -0x42(%rbp),%eax
cmp    $0x39,%eax
jle    12ca <decode_quoted_printable+0x16a>
movzbl -0x42(%rbp),%eax
cmp    $0x41,%eax
jl     12b0 <decode_quoted_printable+0x150>
movzbl -0x42(%rbp),%eax
cmp    $0x46,%eax
jle    12ca <decode_quoted_printable+0x16a>
movzbl -0x42(%rbp),%eax
cmp    $0x61,%eax
jl     13a8 <decode_quoted_printable+0x248>
movzbl -0x42(%rbp),%eax
cmp    $0x66,%eax
jg     13a8 <decode_quoted_printable+0x248>
movzbl -0x41(%rbp),%eax
mov    %eax,-0x78(%rbp)
movzbl -0x41(%rbp),%eax
cmp    $0x39,%eax
jle    12fa <decode_quoted_printable+0x19a>
movzbl -0x41(%rbp),%edx
mov    $0x37,%eax
mov    $0x57,%ecx
cmp    $0x46,%edx
cmovg  %ecx,%eax
mov    %eax,-0x7c(%rbp)
jmp    1307 <decode_quoted_printable+0x1a7>
mov    $0x30,%eax
mov    %eax,-0x7c(%rbp)
jmp    1307 <decode_quoted_printable+0x1a7>
mov    -0x78(%rbp),%eax
mov    -0x7c(%rbp),%ecx
sub    %ecx,%eax
shl    $0x4,%eax
mov    %eax,-0x84(%rbp)
movzbl -0x42(%rbp),%eax
mov    %eax,-0x80(%rbp)
movzbl -0x42(%rbp),%eax
cmp    $0x39,%eax
jle    134b <decode_quoted_printable+0x1eb>
movzbl -0x42(%rbp),%edx
mov    $0x37,%eax
mov    $0x57,%ecx
cmp    $0x46,%edx
cmovg  %ecx,%eax
mov    %eax,-0x88(%rbp)
jmp    135b <decode_quoted_printable+0x1fb>
mov    $0x30,%eax
mov    %eax,-0x88(%rbp)
jmp    135b <decode_quoted_printable+0x1fb>
mov    -0x84(%rbp),%eax
mov    -0x80(%rbp),%ecx
mov    -0x88(%rbp),%edx
sub    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x41(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1384 <decode_quoted_printable+0x224>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1397 <decode_quoted_printable+0x237>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    13ac <decode_quoted_printable+0x24c>
movb   $0x3d,-0x41(%rbp)
jmp    13cb <decode_quoted_printable+0x26b>
movzbl -0x41(%rbp),%ecx
mov    $0x5f,%eax
cmp    %ecx,%eax
jne    13c6 <decode_quoted_printable+0x266>
movb   $0x20,-0x41(%rbp)
jmp    13cb <decode_quoted_printable+0x26b>
mov    -0x41(%rbp),%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmp    -0x3c(%rbp),%eax
jb     13f6 <decode_quoted_printable+0x296>
jmp    13fb <decode_quoted_printable+0x29b>
jmp    11e2 <decode_quoted_printable+0x82>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
call   1080 <realloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1849 <decode_quoted_printable+0x6e9>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    145f <decode_quoted_printable+0x2ff>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1849 <decode_quoted_printable+0x6e9>
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1060 <memcpy@plt>
mov    -0x50(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1810 <decode_quoted_printable+0x6b0>
mov    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x70(%rbp)
cmp    $0x0,%rax
je     1501 <decode_quoted_printable+0x3a1>
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x70(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x68(%rbp),%rax
jb     14fc <decode_quoted_printable+0x39c>
mov    -0x70(%rbp),%rax
movzbl (%rax),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
jne    14f7 <decode_quoted_printable+0x397>
mov    -0x70(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x70(%rbp)
jmp    14fc <decode_quoted_printable+0x39c>
jmp    1534 <decode_quoted_printable+0x3d4>
mov    -0x68(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x68(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x70(%rbp)
movq   $0x0,-0x50(%rbp)
jmp    1539 <decode_quoted_printable+0x3d9>
mov    -0x70(%rbp),%rcx
xor    %eax,%eax
cmp    -0x68(%rbp),%rcx
mov    %al,-0x91(%rbp)
jb     1588 <decode_quoted_printable+0x428>
mov    -0x70(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x59(%rbp)
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x92(%rbp)
je     157c <decode_quoted_printable+0x41c>
movzbl -0x59(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x92(%rbp)
mov    -0x92(%rbp),%al
mov    %al,-0x91(%rbp)
mov    -0x91(%rbp),%al
test   $0x1,%al
jne    159b <decode_quoted_printable+0x43b>
jmp    15ac <decode_quoted_printable+0x44c>
mov    -0x70(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x70(%rbp)
jmp    1539 <decode_quoted_printable+0x3d9>
mov    -0x70(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x68(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x68(%rbp)
movzbl (%rax),%ecx
mov    %ecx,-0x98(%rbp)
mov    %cl,%al
test   %ecx,%ecx
mov    %al,-0x59(%rbp)
je     15f2 <decode_quoted_printable+0x492>
jmp    15de <decode_quoted_printable+0x47e>
mov    -0x98(%rbp),%eax
sub    $0x3d,%eax
je     1614 <decode_quoted_printable+0x4b4>
jmp    17c4 <decode_quoted_printable+0x664>
cmpq   $0x0,-0x50(%rbp)
je     160f <decode_quoted_printable+0x4af>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0xa,(%rax)
jmp    17d8 <decode_quoted_printable+0x678>
mov    -0x68(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x59(%rbp)
cmp    $0x0,%al
je     17bf <decode_quoted_printable+0x65f>
mov    -0x68(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x71(%rbp)
movzbl -0x59(%rbp),%eax
cmp    $0x30,%eax
jl     1649 <decode_quoted_printable+0x4e9>
movzbl -0x59(%rbp),%eax
cmp    $0x39,%eax
jle    167d <decode_quoted_printable+0x51d>
movzbl -0x59(%rbp),%eax
cmp    $0x41,%eax
jl     1663 <decode_quoted_printable+0x503>
movzbl -0x59(%rbp),%eax
cmp    $0x46,%eax
jle    167d <decode_quoted_printable+0x51d>
movzbl -0x59(%rbp),%eax
cmp    $0x61,%eax
jl     17a8 <decode_quoted_printable+0x648>
movzbl -0x59(%rbp),%eax
cmp    $0x66,%eax
jg     17a8 <decode_quoted_printable+0x648>
movzbl -0x71(%rbp),%eax
cmp    $0x30,%eax
jl     1697 <decode_quoted_printable+0x537>
movzbl -0x71(%rbp),%eax
cmp    $0x39,%eax
jle    16cb <decode_quoted_printable+0x56b>
movzbl -0x71(%rbp),%eax
cmp    $0x41,%eax
jl     16b1 <decode_quoted_printable+0x551>
movzbl -0x71(%rbp),%eax
cmp    $0x46,%eax
jle    16cb <decode_quoted_printable+0x56b>
movzbl -0x71(%rbp),%eax
cmp    $0x61,%eax
jl     17a8 <decode_quoted_printable+0x648>
movzbl -0x71(%rbp),%eax
cmp    $0x66,%eax
jg     17a8 <decode_quoted_printable+0x648>
movzbl -0x59(%rbp),%eax
mov    %eax,-0x9c(%rbp)
movzbl -0x59(%rbp),%eax
cmp    $0x39,%eax
jle    1701 <decode_quoted_printable+0x5a1>
movzbl -0x59(%rbp),%edx
mov    $0x37,%eax
mov    $0x57,%ecx
cmp    $0x46,%edx
cmovg  %ecx,%eax
mov    %eax,-0xa0(%rbp)
jmp    1711 <decode_quoted_printable+0x5b1>
mov    $0x30,%eax
mov    %eax,-0xa0(%rbp)
jmp    1711 <decode_quoted_printable+0x5b1>
mov    -0x9c(%rbp),%eax
mov    -0xa0(%rbp),%ecx
sub    %ecx,%eax
shl    $0x4,%eax
mov    %eax,-0xa8(%rbp)
movzbl -0x71(%rbp),%eax
mov    %eax,-0xa4(%rbp)
movzbl -0x71(%rbp),%eax
cmp    $0x39,%eax
jle    175e <decode_quoted_printable+0x5fe>
movzbl -0x71(%rbp),%edx
mov    $0x37,%eax
mov    $0x57,%ecx
cmp    $0x46,%edx
cmovg  %ecx,%eax
mov    %eax,-0xac(%rbp)
jmp    176e <decode_quoted_printable+0x60e>
mov    $0x30,%eax
mov    %eax,-0xac(%rbp)
jmp    176e <decode_quoted_printable+0x60e>
mov    -0xa8(%rbp),%eax
mov    -0xa4(%rbp),%ecx
mov    -0xac(%rbp),%edx
sub    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x68(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x68(%rbp)
jmp    17ba <decode_quoted_printable+0x65a>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0x3d,(%rax)
jmp    17bf <decode_quoted_printable+0x65f>
jmp    17d8 <decode_quoted_printable+0x678>
mov    -0x59(%rbp),%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    -0x3c(%rbp),%ecx
cmp    %rcx,%rax
jl     17fc <decode_quoted_printable+0x69c>
movq   $0x0,-0x50(%rbp)
jmp    180b <decode_quoted_printable+0x6ab>
jmp    1801 <decode_quoted_printable+0x6a1>
cmpb   $0x0,-0x59(%rbp)
jne    15b4 <decode_quoted_printable+0x454>
jmp    1482 <decode_quoted_printable+0x322>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
call   1080 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_quoted_printable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    (%rdx),%r14d
movl   $0x0,(%rdx)
test   %esi,%esi
je     12bc <decode_quoted_printable+0x15c>
mov    %ecx,%r15d
mov    %esi,%ebx
mov    %rdi,%r13
mov    %rdx,0x8(%rsp)
lea    0x1(%rbx),%ebp
mov    %ebp,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     12bc <decode_quoted_printable+0x15c>
mov    %rax,%r12
test   %r15d,%r15d
je     12e1 <decode_quoted_printable+0x181>
cmp    $0x2,%r14d
mov    $0x1,%r15d
cmovae %r14d,%r15d
xor    %r8d,%r8d
mov    $0xd0,%r10d
movabs $0x3f0000003f,%r11
mov    $0x20,%r14d
xor    %edi,%edi
jmp    11ff <decode_quoted_printable+0x9f>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x5f,%al
movzbl %al,%ebp
cmove  %r14d,%ebp
mov    %bpl,(%r12,%rdi,1)
add    $0x1,%rdi
mov    %edx,%ebx
mov    %r9,%r13
cmp    %edi,%r15d
je     12c3 <decode_quoted_printable+0x163>
mov    %ebx,%edx
sub    $0x1,%edx
jb     12c3 <decode_quoted_printable+0x163>
lea    0x1(%r13),%r9
movzbl 0x0(%r13),%eax
cmp    $0x3d,%al
jne    11e0 <decode_quoted_printable+0x80>
movzbl 0x1(%r13),%eax
movzbl 0x2(%r13),%ecx
lea    -0x30(%rax),%esi
cmp    $0xa,%sil
jb     1247 <decode_quoted_printable+0xe7>
mov    $0x3d,%bpl
lea    -0x41(%rax),%r8d
cmp    $0x25,%r8b
ja     12b4 <decode_quoted_printable+0x154>
movzbl %r8b,%esi
bt     %rsi,%r11
mov    $0x0,%r8d
jae    11e9 <decode_quoted_printable+0x89>
lea    -0x30(%rcx),%esi
cmp    $0xa,%sil
jb     1266 <decode_quoted_printable+0x106>
mov    $0x3d,%bpl
lea    -0x41(%rcx),%esi
cmp    $0x25,%sil
ja     11e9 <decode_quoted_printable+0x89>
movzbl %sil,%esi
bt     %rsi,%r11
jae    11e9 <decode_quoted_printable+0x89>
cmp    $0x3a,%al
mov    $0x0,%esi
mov    $0x39,%ebp
cmovae %ebp,%esi
add    %al,%sil
shl    $0x4,%sil
cmp    $0x47,%cl
setb   %al
shl    $0x5,%al
add    $0xa9,%al
cmp    $0x3a,%cl
movzbl %al,%ebp
cmovb  %r10d,%ebp
add    %cl,%bpl
or     %sil,%bpl
add    $0xfffffffe,%ebx
test   %edx,%edx
cmove  %edx,%ebx
sub    $0x1,%ebx
cmovb  %r8d,%ebx
add    $0x3,%r13
mov    %ebx,%edx
mov    %r13,%r9
jmp    11e9 <decode_quoted_printable+0x89>
xor    %r8d,%r8d
jmp    11e9 <decode_quoted_printable+0x89>
xor    %eax,%eax
jmp    14cf <decode_quoted_printable+0x36f>
mov    %r12,%rsi
add    %rdi,%rsi
movb   $0x0,(%rsi)
sub    %r12d,%esi
mov    0x8(%rsp),%rax
mov    %esi,(%rax)
add    $0x1,%esi
mov    %r12,%rdi
jmp    14ca <decode_quoted_printable+0x36a>
mov    %ebp,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     14de <decode_quoted_printable+0x37e>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
call   1060 <memcpy@plt>
mov    %ebx,%eax
movb   $0x0,0x0(%rbp,%rax,1)
movabs $0x3f0000003f,%r15
mov    %rbp,0x10(%rsp)
mov    %rbp,%rbx
mov    %r12,%r13
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     134d <decode_quoted_printable+0x1ed>
lea    0x1(%rax),%rbp
lea    -0x1(%rax),%rdx
cmp    %rbx,%rdx
jb     1361 <decode_quoted_printable+0x201>
mov    %rax,%rsi
add    $0xfffffffffffffffe,%rsi
cmpb   $0xd,-0x1(%rax)
cmove  %rsi,%rdx
jmp    1361 <decode_quoted_printable+0x201>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdx
add    $0xffffffffffffffff,%rdx
xor    %ebp,%ebp
mov    $0x39,%r8d
mov    $0xd0,%r9d
jmp    1374 <decode_quoted_printable+0x214>
nop
add    $0xffffffffffffffff,%rdx
cmp    %rbx,%rdx
jb     1384 <decode_quoted_printable+0x224>
movzbl (%rdx),%eax
cmp    $0x20,%al
je     1370 <decode_quoted_printable+0x210>
cmp    $0x9,%al
je     1370 <decode_quoted_printable+0x210>
movb   $0x0,0x1(%rdx)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%rax
movzbl (%rbx),%edx
cmp    $0x3d,%dl
je     13c0 <decode_quoted_printable+0x260>
test   %dl,%dl
jne    1470 <decode_quoted_printable+0x310>
test   %rbp,%rbp
je     1460 <decode_quoted_printable+0x300>
movb   $0xa,0x0(%r13)
add    $0x1,%r13
jmp    1460 <decode_quoted_printable+0x300>
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%esi
test   %sil,%sil
je     1460 <decode_quoted_printable+0x300>
movzbl 0x2(%rbx),%edx
lea    -0x30(%rsi),%edi
cmp    $0xa,%dil
jb     13f4 <decode_quoted_printable+0x294>
lea    -0x41(%rsi),%edi
cmp    $0x25,%dil
ja     1490 <decode_quoted_printable+0x330>
movzbl %dil,%edi
bt     %rdi,%r15
jae    1490 <decode_quoted_printable+0x330>
lea    -0x30(%rdx),%edi
cmp    $0xa,%dil
jb     1414 <decode_quoted_printable+0x2b4>
lea    -0x41(%rdx),%edi
cmp    $0x25,%dil
ja     1490 <decode_quoted_printable+0x330>
movzbl %dil,%edi
bt     %rdi,%r15
jae    1490 <decode_quoted_printable+0x330>
cmp    $0x3a,%sil
mov    $0x0,%eax
cmovae %r8d,%eax
add    %sil,%al
shl    $0x4,%al
cmp    $0x47,%dl
setb   %cl
shl    $0x5,%cl
add    $0xa9,%cl
cmp    $0x3a,%dl
movzbl %cl,%ecx
cmovb  %r9d,%ecx
add    %dl,%cl
or     %al,%cl
mov    %cl,0x0(%r13)
add    $0x3,%rbx
add    $0x1,%r13
mov    $0x1,%dl
jmp    147b <decode_quoted_printable+0x31b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
jmp    1478 <decode_quoted_printable+0x318>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %dl,0x0(%r13)
add    $0x1,%r13
mov    %rax,%rbx
mov    %r13,%rax
sub    %r12,%rax
cmp    %r14,%rax
jge    14a6 <decode_quoted_printable+0x346>
test   %dl,%dl
jne    1390 <decode_quoted_printable+0x230>
jmp    149a <decode_quoted_printable+0x33a>
movb   $0x3d,0x0(%r13)
mov    %rax,%rbx
jmp    1449 <decode_quoted_printable+0x2e9>
mov    %rbp,%rbx
test   %rbp,%rbp
jne    131d <decode_quoted_printable+0x1bd>
movb   $0x0,0x0(%r13)
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
sub    %r12d,%r13d
mov    0x8(%rsp),%rax
mov    %r13d,(%rax)
add    $0x1,%r13d
mov    %r12,%rdi
mov    %r13d,%esi
call   1080 <realloc@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    14cf <decode_quoted_printable+0x36f>

LLVM IR (-O0):
define i8* @decode_quoted_printable(i8* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%22 = load i32*, i32** %8
%23 = load i32, i32* %22
store i32 %23, i32* %12
%24 = load i32*, i32** %8
store i32 0, i32* %24
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %4
store i8* null, i8** %5
br label %409
28: ; preds = %4
%29 = load i32, i32* %7
%30 = add i32 %29, 1
%31 = call i64 @malloc(i32 %30)
%32 = inttoptr i64 %31 to i8*
store i8* %32, i8** %10
%33 = icmp ne i8* %32, null
br i1 %33, label %35, label %34
34: ; preds = %28
store i8* null, i8** %5
br label %409
35: ; preds = %28
%36 = load i8*, i8** %10
store i8* %36, i8** %11
%37 = load i32, i32* %9
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %186
39: ; preds = %35
store i32 0, i32* %13
br label %40
40: ; preds = %170, %39
%41 = load i32, i32* %7
%42 = add i32 %41, -1
store i32 %42, i32* %7
%43 = icmp ne i32 %41, 0
br i1 %43, label %44, label %171
44: ; preds = %40
%45 = load i8*, i8** %6
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %6
%47 = load i8, i8* %45
store i8 %47, i8* %14
%48 = load i8, i8* %14
%49 = zext i8 %48 to i32
%50 = icmp eq i32 61, %49
br i1 %50, label %51, label %155
51: ; preds = %44
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i64 0
%54 = load i8, i8* %53
store i8 %54, i8* %14
%55 = load i8*, i8** %6
%56 = getelementptr inbounds i8, i8* %55, i64 1
%57 = load i8, i8* %56
store i8 %57, i8* %15
%58 = load i8, i8* %14
%59 = zext i8 %58 to i32
%60 = icmp sge i32 %59, 48
br i1 %60, label %61, label %65
61: ; preds = %51
%62 = load i8, i8* %14
%63 = zext i8 %62 to i32
%64 = icmp sle i32 %63, 57
br i1 %64, label %81, label %65
65: ; preds = %61, %51
%66 = load i8, i8* %14
%67 = zext i8 %66 to i32
%68 = icmp sge i32 %67, 65
br i1 %68, label %69, label %73
69: ; preds = %65
%70 = load i8, i8* %14
%71 = zext i8 %70 to i32
%72 = icmp sle i32 %71, 70
br i1 %72, label %81, label %73
73: ; preds = %69, %65
%74 = load i8, i8* %14
%75 = zext i8 %74 to i32
%76 = icmp sge i32 %75, 97
br i1 %76, label %77, label %153
77: ; preds = %73
%78 = load i8, i8* %14
%79 = zext i8 %78 to i32
%80 = icmp sle i32 %79, 102
br i1 %80, label %81, label %153
81: ; preds = %77, %69, %61
%82 = load i8, i8* %15
%83 = zext i8 %82 to i32
%84 = icmp sge i32 %83, 48
br i1 %84, label %85, label %89
85: ; preds = %81
%86 = load i8, i8* %15
%87 = zext i8 %86 to i32
%88 = icmp sle i32 %87, 57
br i1 %88, label %105, label %89
89: ; preds = %85, %81
%90 = load i8, i8* %15
%91 = zext i8 %90 to i32
%92 = icmp sge i32 %91, 65
br i1 %92, label %93, label %97
93: ; preds = %89
%94 = load i8, i8* %15
%95 = zext i8 %94 to i32
%96 = icmp sle i32 %95, 70
br i1 %96, label %105, label %97
97: ; preds = %93, %89
%98 = load i8, i8* %15
%99 = zext i8 %98 to i32
%100 = icmp sge i32 %99, 97
br i1 %100, label %101, label %153
101: ; preds = %97
%102 = load i8, i8* %15
%103 = zext i8 %102 to i32
%104 = icmp sle i32 %103, 102
br i1 %104, label %105, label %153
105: ; preds = %101, %93, %85
%106 = load i8, i8* %14
%107 = zext i8 %106 to i32
%108 = load i8, i8* %14
%109 = zext i8 %108 to i32
%110 = icmp sgt i32 %109, 57
br i1 %110, label %111, label %117
111: ; preds = %105
%112 = load i8, i8* %14
%113 = zext i8 %112 to i32
%114 = icmp sgt i32 %113, 70
%115 = zext i1 %114 to i64
%116 = select i1 %114, i32 87, i32 55
br label %118
117: ; preds = %105
br label %118
118: ; preds = %117, %111
%119 = phi i32 [ %116, %111 ], [ 48, %117 ]
%120 = sub nsw i32 %107, %119
%121 = shl i32 %120, 4
%122 = load i8, i8* %15
%123 = zext i8 %122 to i32
%124 = load i8, i8* %15
%125 = zext i8 %124 to i32
%126 = icmp sgt i32 %125, 57
br i1 %126, label %127, label %133
127: ; preds = %118
%128 = load i8, i8* %15
%129 = zext i8 %128 to i32
%130 = icmp sgt i32 %129, 70
%131 = zext i1 %130 to i64
%132 = select i1 %130, i32 87, i32 55
br label %134
133: ; preds = %118
br label %134
134: ; preds = %133, %127
%135 = phi i32 [ %132, %127 ], [ 48, %133 ]
%136 = sub nsw i32 %123, %135
%137 = or i32 %121, %136
%138 = trunc i32 %137 to i8
store i8 %138, i8* %14
%139 = load i32, i32* %7
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %134
%142 = load i32, i32* %7
%143 = add i32 %142, -1
store i32 %143, i32* %7
br label %144
144: ; preds = %141, %134
%145 = load i32, i32* %7
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %150
147: ; preds = %144
%148 = load i32, i32* %7
%149 = add i32 %148, -1
store i32 %149, i32* %7
br label %150
150: ; preds = %147, %144
%151 = load i8*, i8** %6
%152 = getelementptr inbounds i8, i8* %151, i64 2
store i8* %152, i8** %6
br label %154
153: ; preds = %101, %97, %77, %73
store i8 61, i8* %14
br label %154
154: ; preds = %153, %150
br label %161
155: ; preds = %44
%156 = load i8, i8* %14
%157 = zext i8 %156 to i32
%158 = icmp eq i32 95, %157
br i1 %158, label %159, label %160
159: ; preds = %155
store i8 32, i8* %14
br label %160
160: ; preds = %159, %155
br label %161
161: ; preds = %160, %154
%162 = load i8, i8* %14
%163 = load i8*, i8** %10
%164 = getelementptr inbounds i8, i8* %163, i32 1
store i8* %164, i8** %10
store i8 %162, i8* %163
%165 = load i32, i32* %13
%166 = add i32 %165, 1
store i32 %166, i32* %13
%167 = load i32, i32* %12
%168 = icmp uge i32 %166, %167
br i1 %168, label %169, label %170
169: ; preds = %161
br label %171
170: ; preds = %161
br label %40
171: ; preds = %169, %40
%172 = load i8*, i8** %10
store i8 0, i8* %172
%173 = load i8*, i8** %10
%174 = load i8*, i8** %11
%175 = ptrtoint i8* %173 to i64
%176 = ptrtoint i8* %174 to i64
%177 = sub i64 %175, %176
%178 = trunc i64 %177 to i32
%179 = load i32*, i32** %8
store i32 %178, i32* %179
%180 = load i8*, i8** %11
%181 = load i32*, i32** %8
%182 = load i32, i32* %181
%183 = add i32 %182, 1
%184 = call i64 @realloc(i8* %180, i32 %183)
%185 = inttoptr i64 %184 to i8*
store i8* %185, i8** %5
br label %409
186: ; preds = %35
%187 = load i32, i32* %7
%188 = add i32 %187, 1
%189 = call i64 @malloc(i32 %188)
%190 = inttoptr i64 %189 to i8*
store i8* %190, i8** %16
%191 = icmp ne i8* %190, null
br i1 %191, label %195, label %192
192: ; preds = %186
%193 = load i8*, i8** %10
%194 = call i32 @free(i8* %193)
store i8* null, i8** %5
br label %409
195: ; preds = %186
%196 = load i8*, i8** %16
%197 = load i8*, i8** %6
%198 = load i32, i32* %7
%199 = call i32 @memcpy(i8* %196, i8* %197, i32 %198)
%200 = load i8*, i8** %16
%201 = load i32, i32* %7
%202 = zext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %200, i64 %202
store i8 0, i8* %203
%204 = load i8*, i8** %16
store i8* %204, i8** %17
br label %205
205: ; preds = %391, %195
%206 = load i8*, i8** %16
%207 = icmp ne i8* %206, null
br i1 %207, label %208, label %392
208: ; preds = %205
%209 = load i8*, i8** %16
store i8* %209, i8** %19
%210 = load i8*, i8** %19
%211 = call i64 @strchr(i8* %210, i8 signext 10)
%212 = inttoptr i64 %211 to i8*
store i8* %212, i8** %20
%213 = icmp ne i8* %212, null
br i1 %213, label %214, label %232
214: ; preds = %208
%215 = load i8*, i8** %20
%216 = getelementptr inbounds i8, i8* %215, i64 1
store i8* %216, i8** %16
%217 = load i8*, i8** %20
%218 = getelementptr inbounds i8, i8* %217, i32 -1
store i8* %218, i8** %20
%219 = load i8*, i8** %20
%220 = load i8*, i8** %19
%221 = icmp uge i8* %219, %220
br i1 %221, label %222, label %231
222: ; preds = %214
%223 = load i8*, i8** %20
%224 = load i8, i8* %223
%225 = zext i8 %224 to i32
%226 = icmp eq i32 13, %225
br i1 %226, label %227, label %230
227: ; preds = %222
%228 = load i8*, i8** %20
%229 = getelementptr inbounds i8, i8* %228, i32 -1
store i8* %229, i8** %20
br label %230
230: ; preds = %227, %222
br label %231
231: ; preds = %230, %214
br label %239
232: ; preds = %208
%233 = load i8*, i8** %19
%234 = load i8*, i8** %19
%235 = call i32 @strlen(i8* %234)
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i8, i8* %233, i64 %236
%238 = getelementptr inbounds i8, i8* %237, i64 -1
store i8* %238, i8** %20
store i8* null, i8** %16
br label %239
239: ; preds = %232, %231
br label %240
240: ; preds = %257, %239
%241 = load i8*, i8** %20
%242 = load i8*, i8** %19
%243 = icmp uge i8* %241, %242
br i1 %243, label %244, label %255
244: ; preds = %240
%245 = load i8*, i8** %20
%246 = load i8, i8* %245
store i8 %246, i8* %18
%247 = zext i8 %246 to i32
%248 = icmp eq i32 %247, 32
br i1 %248, label %253, label %249
249: ; preds = %244
%250 = load i8, i8* %18
%251 = zext i8 %250 to i32
%252 = icmp eq i32 %251, 9
br label %253
253: ; preds = %249, %244
%254 = phi i1 [ true, %244 ], [ %252, %249 ]
br label %255
255: ; preds = %253, %240
%256 = phi i1 [ false, %240 ], [ %254, %253 ]
br i1 %256, label %257, label %260
257: ; preds = %255
%258 = load i8*, i8** %20
%259 = getelementptr inbounds i8, i8* %258, i32 -1
store i8* %259, i8** %20
br label %240
260: ; preds = %255
%261 = load i8*, i8** %20
%262 = getelementptr inbounds i8, i8* %261, i64 1
store i8 0, i8* %262
br label %263
263: ; preds = %388, %260
%264 = load i8*, i8** %19
%265 = getelementptr inbounds i8, i8* %264, i32 1
store i8* %265, i8** %19
%266 = load i8, i8* %264
store i8 %266, i8* %18
%267 = zext i8 %266 to i32
switch i32 %267, label %373 [
i32 0, label %268
i32 61, label %275
]
268: ; preds = %263
%269 = load i8*, i8** %16
%270 = icmp ne i8* %269, null
br i1 %270, label %271, label %274
271: ; preds = %268
%272 = load i8*, i8** %10
%273 = getelementptr inbounds i8, i8* %272, i32 1
store i8* %273, i8** %10
store i8 10, i8* %272
br label %274
274: ; preds = %271, %268
br label %377
275: ; preds = %263
%276 = load i8*, i8** %19
%277 = load i8, i8* %276
store i8 %277, i8* %18
%278 = icmp ne i8 %277, 0
br i1 %278, label %279, label %372
279: ; preds = %275
%280 = load i8*, i8** %19
%281 = getelementptr inbounds i8, i8* %280, i64 1
%282 = load i8, i8* %281
store i8 %282, i8* %21
%283 = load i8, i8* %18
%284 = zext i8 %283 to i32
%285 = icmp sge i32 %284, 48
br i1 %285, label %286, label %290
286: ; preds = %279
%287 = load i8, i8* %18
%288 = zext i8 %287 to i32
%289 = icmp sle i32 %288, 57
br i1 %289, label %306, label %290
290: ; preds = %286, %279
%291 = load i8, i8* %18
%292 = zext i8 %291 to i32
%293 = icmp sge i32 %292, 65
br i1 %293, label %294, label %298
294: ; preds = %290
%295 = load i8, i8* %18
%296 = zext i8 %295 to i32
%297 = icmp sle i32 %296, 70
br i1 %297, label %306, label %298
298: ; preds = %294, %290
%299 = load i8, i8* %18
%300 = zext i8 %299 to i32
%301 = icmp sge i32 %300, 97
br i1 %301, label %302, label %368
302: ; preds = %298
%303 = load i8, i8* %18
%304 = zext i8 %303 to i32
%305 = icmp sle i32 %304, 102
br i1 %305, label %306, label %368
306: ; preds = %302, %294, %286
%307 = load i8, i8* %21
%308 = zext i8 %307 to i32
%309 = icmp sge i32 %308, 48
br i1 %309, label %310, label %314
310: ; preds = %306
%311 = load i8, i8* %21
%312 = zext i8 %311 to i32
%313 = icmp sle i32 %312, 57
br i1 %313, label %330, label %314
314: ; preds = %310, %306
%315 = load i8, i8* %21
%316 = zext i8 %315 to i32
%317 = icmp sge i32 %316, 65
br i1 %317, label %318, label %322
318: ; preds = %314
%319 = load i8, i8* %21
%320 = zext i8 %319 to i32
%321 = icmp sle i32 %320, 70
br i1 %321, label %330, label %322
322: ; preds = %318, %314
%323 = load i8, i8* %21
%324 = zext i8 %323 to i32
%325 = icmp sge i32 %324, 97
br i1 %325, label %326, label %368
326: ; preds = %322
%327 = load i8, i8* %21
%328 = zext i8 %327 to i32
%329 = icmp sle i32 %328, 102
br i1 %329, label %330, label %368
330: ; preds = %326, %318, %310
%331 = load i8, i8* %18
%332 = zext i8 %331 to i32
%333 = load i8, i8* %18
%334 = zext i8 %333 to i32
%335 = icmp sgt i32 %334, 57
br i1 %335, label %336, label %342
336: ; preds = %330
%337 = load i8, i8* %18
%338 = zext i8 %337 to i32
%339 = icmp sgt i32 %338, 70
%340 = zext i1 %339 to i64
%341 = select i1 %339, i32 87, i32 55
br label %343
342: ; preds = %330
br label %343
343: ; preds = %342, %336
%344 = phi i32 [ %341, %336 ], [ 48, %342 ]
%345 = sub nsw i32 %332, %344
%346 = shl i32 %345, 4
%347 = load i8, i8* %21
%348 = zext i8 %347 to i32
%349 = load i8, i8* %21
%350 = zext i8 %349 to i32
%351 = icmp sgt i32 %350, 57
br i1 %351, label %352, label %358
352: ; preds = %343
%353 = load i8, i8* %21
%354 = zext i8 %353 to i32
%355 = icmp sgt i32 %354, 70
%356 = zext i1 %355 to i64
%357 = select i1 %355, i32 87, i32 55
br label %359
358: ; preds = %343
br label %359
359: ; preds = %358, %352
%360 = phi i32 [ %357, %352 ], [ 48, %358 ]
%361 = sub nsw i32 %348, %360
%362 = or i32 %346, %361
%363 = trunc i32 %362 to i8
%364 = load i8*, i8** %10
%365 = getelementptr inbounds i8, i8* %364, i32 1
store i8* %365, i8** %10
store i8 %363, i8* %364
%366 = load i8*, i8** %19
%367 = getelementptr inbounds i8, i8* %366, i64 2
store i8* %367, i8** %19
br label %371
368: ; preds = %326, %322, %302, %298
%369 = load i8*, i8** %10
%370 = getelementptr inbounds i8, i8* %369, i32 1
store i8* %370, i8** %10
store i8 61, i8* %369
br label %371
371: ; preds = %368, %359
br label %372
372: ; preds = %371, %275
br label %377
373: ; preds = %263
%374 = load i8, i8* %18
%375 = load i8*, i8** %10
%376 = getelementptr inbounds i8, i8* %375, i32 1
store i8* %376, i8** %10
store i8 %374, i8* %375
br label %377
377: ; preds = %373, %372, %274
%378 = load i8*, i8** %10
%379 = load i8*, i8** %11
%380 = ptrtoint i8* %378 to i64
%381 = ptrtoint i8* %379 to i64
%382 = sub i64 %380, %381
%383 = load i32, i32* %12
%384 = zext i32 %383 to i64
%385 = icmp sge i64 %382, %384
br i1 %385, label %386, label %387
386: ; preds = %377
store i8* null, i8** %16
br label %391
387: ; preds = %377
br label %388
388: ; preds = %387
%389 = load i8, i8* %18
%390 = icmp ne i8 %389, 0
br i1 %390, label %263, label %391
391: ; preds = %388, %386
br label %205
392: ; preds = %205
%393 = load i8*, i8** %10
store i8 0, i8* %393
%394 = load i8*, i8** %17
%395 = call i32 @free(i8* %394)
%396 = load i8*, i8** %10
%397 = load i8*, i8** %11
%398 = ptrtoint i8* %396 to i64
%399 = ptrtoint i8* %397 to i64
%400 = sub i64 %398, %399
%401 = trunc i64 %400 to i32
%402 = load i32*, i32** %8
store i32 %401, i32* %402
%403 = load i8*, i8** %11
%404 = load i32*, i32** %8
%405 = load i32, i32* %404
%406 = add i32 %405, 1
%407 = call i64 @realloc(i8* %403, i32 %406)
%408 = inttoptr i64 %407 to i8*
store i8* %408, i8** %5
br label %409
409: ; preds = %392, %192, %171, %34, %27
%410 = load i8*, i8** %5
ret i8* %410
}

LLVM IR (-O2):
define i8* @decode_quoted_printable(i8* %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
store i32 0, i32* %2
%6 = icmp eq i32 %1, 0
br i1 %6, label %181, label %7
7: ; preds = %4
%8 = add i32 %1, 1
%9 = tail call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = icmp eq i64 %9, 0
br i1 %11, label %181, label %12
12: ; preds = %7
%13 = icmp eq i32 %3, 0
br i1 %13, label %76, label %14
14: ; preds = %12
%15 = call i32 @llvm.umax.i32(i32 %5, i32 1)
br label %16
16: ; preds = %14, %61
%17 = phi i8* [ %65, %61 ], [ %10, %14 ]
%18 = phi i32 [ %66, %61 ], [ 0, %14 ]
%19 = phi i32 [ %63, %61 ], [ %1, %14 ]
%20 = phi i8* [ %64, %61 ], [ %0, %14 ]
%21 = add i32 %19, -1
%22 = icmp eq i32 %19, 0
br i1 %22, label %68, label %23
23: ; preds = %16
%24 = getelementptr inbounds i8, i8* %20, i64 1
%25 = load i8, i8* %20
%26 = icmp eq i8 %25, 61
br i1 %26, label %27, label %58
27: ; preds = %23
%28 = load i8, i8* %24
%29 = getelementptr inbounds i8, i8* %20, i64 2
%30 = load i8, i8* %29
%31 = freeze i8 %28
%32 = add i8 %31, -48
%33 = icmp ult i8 %32, 10
br i1 %33, label %35, label %34
34: ; preds = %27
switch i8 %31, label %61 [
i8 102, label %35
i8 101, label %35
i8 100, label %35
i8 99, label %35
i8 98, label %35
i8 97, label %35
i8 70, label %35
i8 69, label %35
i8 68, label %35
i8 67, label %35
i8 66, label %35
i8 65, label %35
]
35: ; preds = %34, %34, %34, %34, %34, %34, %34, %34, %34, %34, %34, %34, %27
%36 = freeze i8 %30
%37 = add i8 %36, -48
%38 = icmp ult i8 %37, 10
br i1 %38, label %40, label %39
39: ; preds = %35
switch i8 %36, label %61 [
i8 102, label %40
i8 101, label %40
i8 100, label %40
i8 99, label %40
i8 98, label %40
i8 97, label %40
i8 70, label %40
i8 69, label %40
i8 68, label %40
i8 67, label %40
i8 66, label %40
i8 65, label %40
]
40: ; preds = %39, %39, %39, %39, %39, %39, %39, %39, %39, %39, %39, %39, %35
%41 = icmp ugt i8 %31, 57
%42 = select i1 %41, i8 57, i8 0
%43 = add nuw i8 %42, %31
%44 = shl i8 %43, 4
%45 = icmp ugt i8 %36, 57
%46 = icmp ugt i8 %36, 70
%47 = select i1 %46, i8 -87, i8 -55
%48 = select i1 %45, i8 %47, i8 -48
%49 = add nsw i8 %48, %36
%50 = or i8 %49, %44
%51 = icmp eq i32 %21, 0
%52 = add i32 %19, -2
%53 = select i1 %51, i32 0, i32 %52
%54 = icmp eq i32 %53, 0
%55 = add i32 %53, -1
%56 = select i1 %54, i32 0, i32 %55
%57 = getelementptr inbounds i8, i8* %20, i64 3
br label %61
58: ; preds = %23
%59 = icmp eq i8 %25, 95
%60 = select i1 %59, i8 32, i8 %25
br label %61
61: ; preds = %39, %34, %40, %58
%62 = phi i8 [ %60, %58 ], [ %50, %40 ], [ 61, %39 ], [ 61, %34 ]
%63 = phi i32 [ %21, %58 ], [ %56, %40 ], [ %21, %39 ], [ %21, %34 ]
%64 = phi i8* [ %24, %58 ], [ %57, %40 ], [ %24, %39 ], [ %24, %34 ]
%65 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %62, i8* %17
%66 = add nuw i32 %18, 1
%67 = icmp eq i32 %66, %15
br i1 %67, label %68, label %16
68: ; preds = %61, %16
%69 = phi i8* [ %65, %61 ], [ %17, %16 ]
store i8 0, i8* %69
%70 = ptrtoint i8* %69 to i64
%71 = sub i64 %70, %9
%72 = trunc i64 %71 to i32
store i32 %72, i32* %2
%73 = add i32 %72, 1
%74 = tail call i64 @realloc(i8* %10, i32 %73)
%75 = inttoptr i64 %74 to i8*
br label %181
76: ; preds = %12
%77 = tail call i64 @malloc(i32 %8)
%78 = inttoptr i64 %77 to i8*
%79 = icmp eq i64 %77, 0
br i1 %79, label %80, label %82
80: ; preds = %76
%81 = tail call i32 @free(i8* %10)
br label %181
82: ; preds = %76
%83 = tail call i32 @memcpy(i8* %78, i8* %0, i32 %1)
%84 = zext i32 %1 to i64
%85 = getelementptr inbounds i8, i8* %78, i64 %84
store i8 0, i8* %85
%86 = zext i32 %5 to i64
br label %87
87: ; preds = %82, %171
%88 = phi i8* [ %78, %82 ], [ %108, %171 ]
%89 = phi i8* [ %10, %82 ], [ %163, %171 ]
%90 = tail call i64 @strchr(i8* %88, i8 signext 10)
%91 = inttoptr i64 %90 to i8*
%92 = icmp eq i64 %90, 0
br i1 %92, label %102, label %93
93: ; preds = %87
%94 = getelementptr inbounds i8, i8* %91, i64 1
%95 = getelementptr inbounds i8, i8* %91, i64 -1
%96 = icmp ult i8* %95, %88
br i1 %96, label %107, label %97
97: ; preds = %93
%98 = load i8, i8* %95
%99 = icmp eq i8 %98, 13
%100 = getelementptr inbounds i8, i8* %91, i64 -2
%101 = select i1 %99, i8* %100, i8* %95
br label %107
102: ; preds = %87
%103 = tail call i32 @strlen(i8* %88)
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %88, i64 -1
%106 = getelementptr inbounds i8, i8* %105, i64 %104
br label %107
107: ; preds = %97, %93, %102
%108 = phi i8* [ %94, %93 ], [ null, %102 ], [ %94, %97 ]
%109 = phi i8* [ %95, %93 ], [ %106, %102 ], [ %101, %97 ]
%110 = icmp ult i8* %109, %88
br i1 %110, label %117, label %111
111: ; preds = %107, %114
%112 = phi i8* [ %115, %114 ], [ %109, %107 ]
%113 = load i8, i8* %112
switch i8 %113, label %117 [
i8 32, label %114
i8 9, label %114
]
114: ; preds = %111, %111
%115 = getelementptr inbounds i8, i8* %112, i64 -1
%116 = icmp ult i8* %115, %88
br i1 %116, label %117, label %111
117: ; preds = %114, %111, %107
%118 = phi i8* [ %109, %107 ], [ %112, %111 ], [ %115, %114 ]
%119 = getelementptr inbounds i8, i8* %118, i64 1
store i8 0, i8* %119
%120 = icmp eq i8* %108, null
br label %121
121: ; preds = %169, %117
%122 = phi i8* [ %89, %117 ], [ %163, %169 ]
%123 = phi i8* [ %88, %117 ], [ %165, %169 ]
%124 = getelementptr inbounds i8, i8* %123, i64 1
%125 = load i8, i8* %123
switch i8 %125, label %160 [
i8 0, label %126
i8 61, label %129
]
126: ; preds = %121
br i1 %120, label %162, label %127
127: ; preds = %126
%128 = getelementptr inbounds i8, i8* %122, i64 1
store i8 10, i8* %122
br label %162
129: ; preds = %121
%130 = load i8, i8* %124
%131 = icmp eq i8 %130, 0
br i1 %131, label %162, label %132
132: ; preds = %129
%133 = getelementptr inbounds i8, i8* %123, i64 2
%134 = load i8, i8* %133
%135 = freeze i8 %130
%136 = add i8 %135, -48
%137 = icmp ult i8 %136, 10
br i1 %137, label %139, label %138
138: ; preds = %132
switch i8 %135, label %156 [
i8 102, label %139
i8 101, label %139
i8 100, label %139
i8 99, label %139
i8 98, label %139
i8 97, label %139
i8 70, label %139
i8 69, label %139
i8 68, label %139
i8 67, label %139
i8 66, label %139
i8 65, label %139
]
139: ; preds = %138, %138, %138, %138, %138, %138, %138, %138, %138, %138, %138, %138, %132
%140 = freeze i8 %134
%141 = add i8 %140, -48
%142 = icmp ult i8 %141, 10
br i1 %142, label %144, label %143
143: ; preds = %139
switch i8 %140, label %156 [
i8 102, label %144
i8 101, label %144
i8 100, label %144
i8 99, label %144
i8 98, label %144
i8 97, label %144
i8 70, label %144
i8 69, label %144
i8 68, label %144
i8 67, label %144
i8 66, label %144
i8 65, label %144
]
144: ; preds = %143, %143, %143, %143, %143, %143, %143, %143, %143, %143, %143, %143, %139
%145 = icmp ugt i8 %135, 57
%146 = select i1 %145, i8 57, i8 0
%147 = add nuw i8 %146, %135
%148 = shl i8 %147, 4
%149 = icmp ugt i8 %140, 57
%150 = icmp ugt i8 %140, 70
%151 = select i1 %150, i8 -87, i8 -55
%152 = select i1 %149, i8 %151, i8 -48
%153 = add nsw i8 %152, %140
%154 = or i8 %153, %148
store i8 %154, i8* %122
%155 = getelementptr inbounds i8, i8* %123, i64 3
br label %157
156: ; preds = %143, %138
store i8 61, i8* %122
br label %157
157: ; preds = %156, %144
%158 = phi i8* [ %155, %144 ], [ %124, %156 ]
%159 = getelementptr inbounds i8, i8* %122, i64 1
br label %162
160: ; preds = %121
%161 = getelementptr inbounds i8, i8* %122, i64 1
store i8 %125, i8* %122
br label %162
162: ; preds = %129, %157, %126, %127, %160
%163 = phi i8* [ %161, %160 ], [ %159, %157 ], [ %122, %129 ], [ %128, %127 ], [ %122, %126 ]
%164 = phi i8 [ %125, %160 ], [ 1, %157 ], [ 0, %129 ], [ 0, %127 ], [ 0, %126 ]
%165 = phi i8* [ %124, %160 ], [ %158, %157 ], [ %124, %129 ], [ %124, %127 ], [ %124, %126 ]
%166 = ptrtoint i8* %163 to i64
%167 = sub i64 %166, %9
%168 = icmp slt i64 %167, %86
br i1 %168, label %169, label %173
169: ; preds = %162
%170 = icmp eq i8 %164, 0
br i1 %170, label %171, label %121
171: ; preds = %169
%172 = icmp eq i8* %108, null
br i1 %172, label %173, label %87
173: ; preds = %171, %162
store i8 0, i8* %163
%174 = tail call i32 @free(i8* %78)
%175 = ptrtoint i8* %163 to i64
%176 = sub i64 %175, %9
%177 = trunc i64 %176 to i32
store i32 %177, i32* %2
%178 = add i32 %177, 1
%179 = tail call i64 @realloc(i8* %10, i32 %178)
%180 = inttoptr i64 %179 to i8*
br label %181
181: ; preds = %80, %173, %7, %4, %68
%182 = phi i8* [ %75, %68 ], [ null, %4 ], [ null, %7 ], [ %180, %173 ], [ null, %80 ]
ret i8* %182
}