#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 */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ isdigit(int);
scalar_t__ isupper(int);
scalar_t__ memcmp(char *, char const *, int);
int /*<<< orphan*/ memcpy(unsigned char *, char const *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int sscanf(char const *, char *, int *, int *);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char const *);
char *strpbrk(char const *, char *);
int strspn(char const *, char *);
char *strstr(char const *, char *);
int decode_sym_transportid(const char *lcp, unsigned char *tidp) {
  int k, j, n, b, c, len, alen;
  const char *ecp;
  const char *isip;
  if ((0 == memcmp("sas,", lcp, 4)) || (0 == memcmp("SAS,", lcp, 4))) {
    lcp += 4;
    k = strspn(lcp, "0123456789aAbBcCdDeEfF");
    if (16 != k) {
      fprintf(stderr, "badly formed symbolic SAS TransportID: %s\n", lcp);
      return 0;
    }
    memset(tidp, 0, 24);
    tidp[0] = 6;
    for (k = 0, j = 0, b = 0; k < 16; ++k) {
      c = lcp[k];
      if (isdigit(c))
        n = c - 0x30;
      else if (isupper(c))
        n = c - 0x37;
      else
        n = c - 0x57;
      if (k & 1) {
        tidp[4 + j] = b | n;
        ++j;
      } else
        b = n << 4;
    }
    return 1;
  } else if ((0 == memcmp("spi,", lcp, 4)) || (0 == memcmp("SPI,", lcp, 4))) {
    lcp += 4;
    if (2 != sscanf(lcp, "%d,%d", &b, &c)) {
      fprintf(stderr, "badly formed symbolic SPI TransportID: %s\n", lcp);
      return 0;
    }
    tidp[0] = 1;
    tidp[2] = (b >> 8) & 0xff;
    tidp[3] = b & 0xff;
    tidp[6] = (c >> 8) & 0xff;
    tidp[7] = c & 0xff;
    return 1;
  } else if ((0 == memcmp("fcp,", lcp, 4)) || (0 == memcmp("FCP,", lcp, 4))) {
    lcp += 4;
    k = strspn(lcp, "0123456789aAbBcCdDeEfF");
    if (16 != k) {
      fprintf(stderr, "badly formed symbolic FCP TransportID: %s\n", lcp);
      return 0;
    }
    memset(tidp, 0, 24);
    tidp[0] = 0;
    for (k = 0, j = 0, b = 0; k < 16; ++k) {
      c = lcp[k];
      if (isdigit(c))
        n = c - 0x30;
      else if (isupper(c))
        n = c - 0x37;
      else
        n = c - 0x57;
      if (k & 1) {
        tidp[8 + j] = b | n;
        ++j;
      } else
        b = n << 4;
    }
    return 1;
  } else if ((0 == memcmp("sbp,", lcp, 4)) || (0 == memcmp("SBP,", lcp, 4))) {
    lcp += 4;
    k = strspn(lcp, "0123456789aAbBcCdDeEfF");
    if (16 != k) {
      fprintf(stderr, "badly formed symbolic SBP TransportID: %s\n", lcp);
      return 0;
    }
    memset(tidp, 0, 24);
    tidp[0] = 3;
    for (k = 0, j = 0, b = 0; k < 16; ++k) {
      c = lcp[k];
      if (isdigit(c))
        n = c - 0x30;
      else if (isupper(c))
        n = c - 0x37;
      else
        n = c - 0x57;
      if (k & 1) {
        tidp[8 + j] = b | n;
        ++j;
      } else
        b = n << 4;
    }
    return 1;
  } else if ((0 == memcmp("srp,", lcp, 4)) || (0 == memcmp("SRP,", lcp, 4))) {
    lcp += 4;
    k = strspn(lcp, "0123456789aAbBcCdDeEfF");
    if (16 != k) {
      fprintf(stderr, "badly formed symbolic SRP TransportID: %s\n", lcp);
      return 0;
    }
    memset(tidp, 0, 24);
    tidp[0] = 4;
    for (k = 0, j = 0, b = 0; k < 32; ++k) {
      c = lcp[k];
      if (isdigit(c))
        n = c - 0x30;
      else if (isupper(c))
        n = c - 0x37;
      else
        n = c - 0x57;
      if (k & 1) {
        tidp[8 + j] = b | n;
        ++j;
      } else
        b = n << 4;
    }
    return 1;
  } else if (0 == memcmp("iqn.", lcp, 4)) {
    ecp = strpbrk(lcp, " \t");
    isip = strstr(lcp, ",i,0x");
    if (ecp && (isip > ecp))
      isip = NULL;
    len = ecp ? (ecp - lcp) : (int)strlen(lcp);
    memset(tidp, 0, 24);
    tidp[0] = 5 | (isip ? 0x40 : 0x0);
    alen = len + 1;
    if (alen < 20)
      alen = 20;
    else if (0 != (alen % 4))
      alen = ((alen / 4) + 1) * 4;
    if (alen > 241) {
      fprintf(stderr, "iSCSI name too long, alen=%d\n", alen);
      return 0;
    }
    tidp[3] = alen & 0xff;
    memcpy(tidp + 4, lcp, len);
    return 1;
  }
  fprintf(stderr, "unable to parse symbolic TransportID: %s\n", lcp);
  return 0;
}


x86 assembly (clang, -O0):
<decode_sym_transportid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe35(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1206 <decode_sym_transportid+0x56>
mov    -0x10(%rbp),%rsi
lea    0xe17(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    134a <decode_sym_transportid+0x19a>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x10,%eax
cmp    -0x1c(%rbp),%eax
je     125a <decode_sym_transportid+0xaa>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x6,(%rax)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    133e <decode_sym_transportid+0x18e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     12bf <decode_sym_transportid+0x10f>
mov    -0x2c(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x24(%rbp)
jmp    12ed <decode_sym_transportid+0x13d>
mov    -0x2c(%rbp),%edi
call   10c0 <isupper@plt>
cmp    $0x0,%rax
je     12df <decode_sym_transportid+0x12f>
mov    -0x2c(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x24(%rbp)
jmp    12e8 <decode_sym_transportid+0x138>
mov    -0x2c(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x24(%rbp)
jmp    12ed <decode_sym_transportid+0x13d>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1322 <decode_sym_transportid+0x172>
mov    -0x28(%rbp),%eax
or     -0x24(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    132b <decode_sym_transportid+0x17b>
mov    -0x24(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    1330 <decode_sym_transportid+0x180>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1286 <decode_sym_transportid+0xd6>
movl   $0x1,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x10(%rbp),%rsi
lea    0xcf7(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1390 <decode_sym_transportid+0x1e0>
mov    -0x10(%rbp),%rsi
lea    0xcd9(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1447 <decode_sym_transportid+0x297>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xcaf(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
call   10a0 <sscanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     13ea <decode_sym_transportid+0x23a>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x28(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x28(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x2c(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x7(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x10(%rbp),%rsi
lea    0xc35(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     148d <decode_sym_transportid+0x2dd>
mov    -0x10(%rbp),%rsi
lea    0xc17(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    15d1 <decode_sym_transportid+0x421>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xb66(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x10,%eax
cmp    -0x1c(%rbp),%eax
je     14e1 <decode_sym_transportid+0x331>
mov    0x2b1f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xbc3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    15c5 <decode_sym_transportid+0x415>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1546 <decode_sym_transportid+0x396>
mov    -0x2c(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x24(%rbp)
jmp    1574 <decode_sym_transportid+0x3c4>
mov    -0x2c(%rbp),%edi
call   10c0 <isupper@plt>
cmp    $0x0,%rax
je     1566 <decode_sym_transportid+0x3b6>
mov    -0x2c(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x24(%rbp)
jmp    156f <decode_sym_transportid+0x3bf>
mov    -0x2c(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x24(%rbp)
jmp    1574 <decode_sym_transportid+0x3c4>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     15a9 <decode_sym_transportid+0x3f9>
mov    -0x28(%rbp),%eax
or     -0x24(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    15b2 <decode_sym_transportid+0x402>
mov    -0x24(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    15b7 <decode_sym_transportid+0x407>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    150d <decode_sym_transportid+0x35d>
movl   $0x1,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x10(%rbp),%rsi
lea    0xae0(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1617 <decode_sym_transportid+0x467>
mov    -0x10(%rbp),%rsi
lea    0xac2(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    175b <decode_sym_transportid+0x5ab>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x9dc(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x10,%eax
cmp    -0x1c(%rbp),%eax
je     166b <decode_sym_transportid+0x4bb>
mov    0x2995(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xa6e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x3,(%rax)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    174f <decode_sym_transportid+0x59f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     16d0 <decode_sym_transportid+0x520>
mov    -0x2c(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x24(%rbp)
jmp    16fe <decode_sym_transportid+0x54e>
mov    -0x2c(%rbp),%edi
call   10c0 <isupper@plt>
cmp    $0x0,%rax
je     16f0 <decode_sym_transportid+0x540>
mov    -0x2c(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x24(%rbp)
jmp    16f9 <decode_sym_transportid+0x549>
mov    -0x2c(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x24(%rbp)
jmp    16fe <decode_sym_transportid+0x54e>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1733 <decode_sym_transportid+0x583>
mov    -0x28(%rbp),%eax
or     -0x24(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    173c <decode_sym_transportid+0x58c>
mov    -0x24(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    1741 <decode_sym_transportid+0x591>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1697 <decode_sym_transportid+0x4e7>
movl   $0x1,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x10(%rbp),%rsi
lea    0x98b(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     17a1 <decode_sym_transportid+0x5f1>
mov    -0x10(%rbp),%rsi
lea    0x96d(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    18e5 <decode_sym_transportid+0x735>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x852(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x10,%eax
cmp    -0x1c(%rbp),%eax
je     17f5 <decode_sym_transportid+0x645>
mov    0x280b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0x919(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x4,(%rax)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    18d9 <decode_sym_transportid+0x729>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     185a <decode_sym_transportid+0x6aa>
mov    -0x2c(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x24(%rbp)
jmp    1888 <decode_sym_transportid+0x6d8>
mov    -0x2c(%rbp),%edi
call   10c0 <isupper@plt>
cmp    $0x0,%rax
je     187a <decode_sym_transportid+0x6ca>
mov    -0x2c(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x24(%rbp)
jmp    1883 <decode_sym_transportid+0x6d3>
mov    -0x2c(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x24(%rbp)
jmp    1888 <decode_sym_transportid+0x6d8>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     18bd <decode_sym_transportid+0x70d>
mov    -0x28(%rbp),%eax
or     -0x24(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    18c6 <decode_sym_transportid+0x716>
mov    -0x24(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    18cb <decode_sym_transportid+0x71b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1821 <decode_sym_transportid+0x671>
movl   $0x1,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x10(%rbp),%rsi
lea    0x836(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1a64 <decode_sym_transportid+0x8b4>
mov    -0x10(%rbp),%rdi
lea    0x818(%rip),%rsi
call   10b0 <strpbrk@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x807(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1951 <decode_sym_transportid+0x7a1>
mov    -0x48(%rbp),%rax
cmp    -0x40(%rbp),%rax
jbe    1951 <decode_sym_transportid+0x7a1>
movq   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1970 <decode_sym_transportid+0x7c0>
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x50(%rbp)
jmp    197f <decode_sym_transportid+0x7cf>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cltq
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    -0x48(%rbp),%rdx
xor    %eax,%eax
mov    $0x40,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
or     $0x5,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x14,-0x34(%rbp)
jge    19d2 <decode_sym_transportid+0x822>
movl   $0x14,-0x34(%rbp)
jmp    1a00 <decode_sym_transportid+0x850>
mov    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
je     19fb <decode_sym_transportid+0x84b>
mov    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
shl    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    1a00 <decode_sym_transportid+0x850>
cmpl   $0xf1,-0x34(%rbp)
jle    1a33 <decode_sym_transportid+0x883>
mov    0x25cc(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%edx
lea    0x714(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
mov    -0x34(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%edx
call   1090 <memcpy@plt>
movl   $0x1,-0x4(%rbp)
jmp    1a9f <decode_sym_transportid+0x8ef>
jmp    1a69 <decode_sym_transportid+0x8b9>
jmp    1a6e <decode_sym_transportid+0x8be>
jmp    1a73 <decode_sym_transportid+0x8c3>
jmp    1a78 <decode_sym_transportid+0x8c8>
jmp    1a7d <decode_sym_transportid+0x8cd>
mov    0x255c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0x6c1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_sym_transportid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xe38(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1315 <decode_sym_transportid+0x165>
lea    0xe20(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1315 <decode_sym_transportid+0x165>
lea    0xe4a(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     13cc <decode_sym_transportid+0x21c>
lea    0xe32(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     13cc <decode_sym_transportid+0x21c>
lea    0xe4b(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     142a <decode_sym_transportid+0x27a>
lea    0xe33(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     142a <decode_sym_transportid+0x27a>
lea    0xe46(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     14d8 <decode_sym_transportid+0x328>
lea    0xe2e(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     14d8 <decode_sym_transportid+0x328>
lea    0xe41(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1591 <decode_sym_transportid+0x3e1>
lea    0xe29(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1591 <decode_sym_transportid+0x3e1>
lea    0xe3c(%rip),%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1656 <decode_sym_transportid+0x4a6>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
jmp    1630 <decode_sym_transportid+0x480>
add    $0x4,%r15
lea    0xcea(%rip),%rsi
mov    %r15,%rdi
call   1060 <strspn@plt>
cmp    $0x10,%eax
jne    13b7 <decode_sym_transportid+0x207>
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
movb   $0x6,(%r14)
movl   $0x0,(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    1374 <decode_sym_transportid+0x1c4>
cs nopw 0x0(%rax,%rax,1)
nop
shl    $0x4,%ecx
mov    %ecx,%r13d
add    $0x1,%rbx
cmp    $0x10,%rbx
je     140b <decode_sym_transportid+0x25b>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
mov    $0xffffffd0,%ecx
test   %rax,%rax
jne    139f <decode_sym_transportid+0x1ef>
mov    %ebp,%edi
call   10c0 <isupper@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
add    %ebp,%ecx
test   $0x1,%bl
je     1360 <decode_sym_transportid+0x1b0>
or     %r13d,%ecx
movslq %r12d,%r12
mov    %cl,0x4(%r12,%r14,1)
add    $0x1,%r12d
jmp    1366 <decode_sym_transportid+0x1b6>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
lea    0xc5a(%rip),%rsi
jmp    1630 <decode_sym_transportid+0x480>
add    $0x4,%r15
lea    0xc7f(%rip),%rsi
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
mov    %r15,%rdi
call   10a0 <sscanf@plt>
cmp    $0x2,%eax
jne    1415 <decode_sym_transportid+0x265>
movb   $0x1,(%r14)
movzwl (%rsp),%eax
rol    $0x8,%ax
mov    %ax,0x2(%r14)
movzwl 0x4(%rsp),%eax
rol    $0x8,%ax
mov    %ax,0x6(%r14)
mov    $0x1,%ebp
jmp    163c <decode_sym_transportid+0x48c>
mov    0x2bc4(%rip),%rax
mov    (%rax),%edi
lea    0xc37(%rip),%rsi
jmp    1630 <decode_sym_transportid+0x480>
add    $0x4,%r15
lea    0xbd5(%rip),%rsi
mov    %r15,%rdi
call   1060 <strspn@plt>
cmp    $0x10,%eax
jne    14c3 <decode_sym_transportid+0x313>
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
movb   $0x0,(%r14)
movl   $0x0,(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    1480 <decode_sym_transportid+0x2d0>
nopw   0x0(%rax,%rax,1)
shl    $0x4,%ecx
mov    %ecx,%r13d
add    $0x1,%rbx
cmp    $0x10,%rbx
je     140b <decode_sym_transportid+0x25b>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
mov    $0xffffffd0,%ecx
test   %rax,%rax
jne    14ab <decode_sym_transportid+0x2fb>
mov    %ebp,%edi
call   10c0 <isupper@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
add    %ebp,%ecx
test   $0x1,%bl
je     1470 <decode_sym_transportid+0x2c0>
or     %r13d,%ecx
movslq %r12d,%r12
mov    %cl,0x8(%r12,%r14,1)
add    $0x1,%r12d
jmp    1476 <decode_sym_transportid+0x2c6>
mov    0x2b16(%rip),%rax
mov    (%rax),%edi
lea    0xbbe(%rip),%rsi
jmp    1630 <decode_sym_transportid+0x480>
add    $0x4,%r15
lea    0xb27(%rip),%rsi
mov    %r15,%rdi
call   1060 <strspn@plt>
cmp    $0x10,%eax
jne    157c <decode_sym_transportid+0x3cc>
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
movb   $0x3,(%r14)
movl   $0x0,(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    1539 <decode_sym_transportid+0x389>
nopl   0x0(%rax,%rax,1)
shl    $0x4,%ecx
mov    %ecx,%r13d
add    $0x1,%rbx
mov    $0x1,%ebp
cmp    $0x10,%rbx
je     163c <decode_sym_transportid+0x48c>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
mov    $0xffffffd0,%ecx
test   %rax,%rax
jne    1564 <decode_sym_transportid+0x3b4>
mov    %ebp,%edi
call   10c0 <isupper@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
add    %ebp,%ecx
test   $0x1,%bl
je     1520 <decode_sym_transportid+0x370>
or     %r13d,%ecx
movslq %r12d,%r12
mov    %cl,0x8(%r12,%r14,1)
add    $0x1,%r12d
jmp    1526 <decode_sym_transportid+0x376>
mov    0x2a5d(%rip),%rax
mov    (%rax),%edi
lea    0xb3a(%rip),%rsi
jmp    1630 <decode_sym_transportid+0x480>
add    $0x4,%r15
lea    0xa6e(%rip),%rsi
mov    %r15,%rdi
call   1060 <strspn@plt>
cmp    $0x10,%eax
jne    1620 <decode_sym_transportid+0x470>
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
movb   $0x4,(%r14)
movl   $0x0,(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    15dd <decode_sym_transportid+0x42d>
shl    $0x4,%ecx
mov    %ecx,%r13d
add    $0x1,%rbx
cmp    $0x20,%rbx
je     164d <decode_sym_transportid+0x49d>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
mov    $0xffffffd0,%ecx
test   %rax,%rax
jne    1608 <decode_sym_transportid+0x458>
mov    %ebp,%edi
call   10c0 <isupper@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
add    %ebp,%ecx
test   $0x1,%bl
je     15cd <decode_sym_transportid+0x41d>
or     %r13d,%ecx
movslq %r12d,%r12
mov    %cl,0x8(%r12,%r14,1)
add    $0x1,%r12d
jmp    15d3 <decode_sym_transportid+0x423>
mov    0x29b9(%rip),%rax
mov    (%rax),%edi
lea    0xacb(%rip),%rsi
xor    %ebp,%ebp
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,0x4(%rsp)
jmp    140b <decode_sym_transportid+0x25b>
lea    0xace(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strpbrk@plt>
mov    %rax,%rbp
lea    0xabf(%rip),%rsi
mov    %r15,%rdi
call   10d0 <strstr@plt>
xor    %ebx,%ebx
cmp    %rbp,%rax
cmovbe %rax,%rbx
test   %rbp,%rbp
cmove  %rax,%rbx
je     168e <decode_sym_transportid+0x4de>
sub    %r15,%rbp
jmp    1699 <decode_sym_transportid+0x4e9>
mov    %r15,%rdi
call   1040 <strlen@plt>
movslq %eax,%rbp
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
test   %rbx,%rbx
setne  %al
shl    $0x6,%al
or     $0x5,%al
mov    %al,(%r14)
mov    $0x14,%edx
cmp    $0x13,%ebp
jl     16f4 <decode_sym_transportid+0x544>
lea    0x1(%rbp),%eax
lea    0x5(%rbp),%edx
and    $0xfffffffc,%edx
test   $0x3,%al
cmove  %eax,%edx
cmp    $0xf2,%edx
jl     16f4 <decode_sym_transportid+0x544>
mov    0x2903(%rip),%rax
mov    (%rax),%edi
lea    0xa4e(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    163c <decode_sym_transportid+0x48c>
mov    %dl,0x3(%r14)
add    $0x4,%r14
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1090 <memcpy@plt>
jmp    140b <decode_sym_transportid+0x25b>

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

LLVM IR (-O2):
@.str = [5 x i8] c"sas,\00"
@.str.1 = [5 x i8] c"SAS,\00"
@.str.2 = [23 x i8] c"0123456789aAbBcCdDeEfF\00"
@stderr = global i32 0
@.str.3 = [43 x i8] c"badly formed symbolic SAS TransportID: %s\0A\00"
@.str.4 = [5 x i8] c"spi,\00"
@.str.5 = [5 x i8] c"SPI,\00"
@.str.6 = [6 x i8] c"%d,%d\00"
@.str.7 = [43 x i8] c"badly formed symbolic SPI TransportID: %s\0A\00"
@.str.8 = [5 x i8] c"fcp,\00"
@.str.9 = [5 x i8] c"FCP,\00"
@.str.10 = [43 x i8] c"badly formed symbolic FCP TransportID: %s\0A\00"
@.str.11 = [5 x i8] c"sbp,\00"
@.str.12 = [5 x i8] c"SBP,\00"
@.str.13 = [43 x i8] c"badly formed symbolic SBP TransportID: %s\0A\00"
@.str.14 = [5 x i8] c"srp,\00"
@.str.15 = [5 x i8] c"SRP,\00"
@.str.16 = [43 x i8] c"badly formed symbolic SRP TransportID: %s\0A\00"
@.str.17 = [5 x i8] c"iqn.\00"
@.str.18 = [3 x i8] c" \09\00"
@.str.19 = [6 x i8] c",i,0x\00"
@.str.20 = [30 x i8] c"iSCSI name too long, alen=%d\0A\00"
@.str.21 = [42 x i8] c"unable to parse symbolic TransportID: %s\0A\00"
define i32 @decode_sym_transportid(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32 4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %53
12: ; preds = %9, %2
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = tail call i32 @strspn(i8* %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 16
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* %13)
br label %267
19: ; preds = %12
%20 = tail call i32 @memset(i8* %1, i32 0, i32 24)
store i8 6, i8* %1
store i32 0, i32* %3
br label %21
21: ; preds = %19, %48
%22 = phi i64 [ 0, %19 ], [ %51, %48 ]
%23 = phi i32 [ 0, %19 ], [ %50, %48 ]
%24 = phi i32 [ 0, %19 ], [ %49, %48 ]
%25 = getelementptr inbounds i8, i8* %13, i64 %22
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = tail call i64 @isdigit(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %21
%31 = tail call i64 @isupper(i32 %27)
%32 = icmp eq i64 %31, 0
%33 = select i1 %32, i32 -87, i32 -55
br label %34
34: ; preds = %30, %21
%35 = phi i32 [ -48, %21 ], [ %33, %30 ]
%36 = add nsw i32 %35, %27
%37 = and i64 %22, 1
%38 = icmp eq i64 %37, 0
br i1 %38, label %46, label %39
39: ; preds = %34
%40 = or i32 %24, %36
%41 = trunc i32 %40 to i8
%42 = add nsw i32 %23, 4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %1, i64 %43
store i8 %41, i8* %44
%45 = add nsw i32 %23, 1
br label %48
46: ; preds = %34
%47 = shl nsw i32 %36, 4
br label %48
48: ; preds = %39, %46
%49 = phi i32 [ %24, %39 ], [ %47, %46 ]
%50 = phi i32 [ %45, %39 ], [ %23, %46 ]
%51 = add nuw nsw i64 %22, 1
%52 = icmp eq i64 %51, 16
br i1 %52, label %267, label %21
53: ; preds = %9
%54 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %0, i32 4)
%55 = icmp eq i64 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %0, i32 4)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %79
59: ; preds = %56, %53
%60 = getelementptr inbounds i8, i8* %0, i64 4
%61 = call i32 @sscanf(i8* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %3, i32* %4)
%62 = icmp eq i32 %61, 2
br i1 %62, label %66, label %63
63: ; preds = %59
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %60)
br label %267
66: ; preds = %59
store i8 1, i8* %1
%67 = load i32, i32* %3
%68 = lshr i32 %67, 8
%69 = trunc i32 %68 to i8
%70 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %69, i8* %70
%71 = trunc i32 %67 to i8
%72 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %71, i8* %72
%73 = load i32, i32* %4
%74 = lshr i32 %73, 8
%75 = trunc i32 %74 to i8
%76 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %75, i8* %76
%77 = trunc i32 %73 to i8
%78 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %77, i8* %78
br label %267
79: ; preds = %56
%80 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %0, i32 4)
%81 = icmp eq i64 %80, 0
br i1 %81, label %85, label %82
82: ; preds = %79
%83 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %0, i32 4)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %126
85: ; preds = %82, %79
%86 = getelementptr inbounds i8, i8* %0, i64 4
%87 = tail call i32 @strspn(i8* %86, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%88 = icmp eq i32 %87, 16
br i1 %88, label %92, label %89
89: ; preds = %85
%90 = load i32, i32* @stderr
%91 = tail call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i8* %86)
br label %267
92: ; preds = %85
%93 = tail call i32 @memset(i8* %1, i32 0, i32 24)
store i8 0, i8* %1
store i32 0, i32* %3
br label %94
94: ; preds = %92, %121
%95 = phi i64 [ 0, %92 ], [ %124, %121 ]
%96 = phi i32 [ 0, %92 ], [ %123, %121 ]
%97 = phi i32 [ 0, %92 ], [ %122, %121 ]
%98 = getelementptr inbounds i8, i8* %86, i64 %95
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = tail call i64 @isdigit(i32 %100)
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %107
103: ; preds = %94
%104 = tail call i64 @isupper(i32 %100)
%105 = icmp eq i64 %104, 0
%106 = select i1 %105, i32 -87, i32 -55
br label %107
107: ; preds = %103, %94
%108 = phi i32 [ -48, %94 ], [ %106, %103 ]
%109 = add nsw i32 %108, %100
%110 = and i64 %95, 1
%111 = icmp eq i64 %110, 0
br i1 %111, label %119, label %112
112: ; preds = %107
%113 = or i32 %97, %109
%114 = trunc i32 %113 to i8
%115 = add nsw i32 %96, 8
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %1, i64 %116
store i8 %114, i8* %117
%118 = add nsw i32 %96, 1
br label %121
119: ; preds = %107
%120 = shl nsw i32 %109, 4
br label %121
121: ; preds = %112, %119
%122 = phi i32 [ %97, %112 ], [ %120, %119 ]
%123 = phi i32 [ %118, %112 ], [ %96, %119 ]
%124 = add nuw nsw i64 %95, 1
%125 = icmp eq i64 %124, 16
br i1 %125, label %267, label %94
126: ; preds = %82
%127 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* %0, i32 4)
%128 = icmp eq i64 %127, 0
br i1 %128, label %132, label %129
129: ; preds = %126
%130 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* %0, i32 4)
%131 = icmp eq i64 %130, 0
br i1 %131, label %132, label %173
132: ; preds = %129, %126
%133 = getelementptr inbounds i8, i8* %0, i64 4
%134 = tail call i32 @strspn(i8* %133, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%135 = icmp eq i32 %134, 16
br i1 %135, label %139, label %136
136: ; preds = %132
%137 = load i32, i32* @stderr
%138 = tail call i32 (i32, i8*, ...) @fprintf(i32 %137, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), i8* %133)
br label %267
139: ; preds = %132
%140 = tail call i32 @memset(i8* %1, i32 0, i32 24)
store i8 3, i8* %1
store i32 0, i32* %3
br label %141
141: ; preds = %139, %168
%142 = phi i64 [ 0, %139 ], [ %171, %168 ]
%143 = phi i32 [ 0, %139 ], [ %170, %168 ]
%144 = phi i32 [ 0, %139 ], [ %169, %168 ]
%145 = getelementptr inbounds i8, i8* %133, i64 %142
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = tail call i64 @isdigit(i32 %147)
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %141
%151 = tail call i64 @isupper(i32 %147)
%152 = icmp eq i64 %151, 0
%153 = select i1 %152, i32 -87, i32 -55
br label %154
154: ; preds = %150, %141
%155 = phi i32 [ -48, %141 ], [ %153, %150 ]
%156 = add nsw i32 %155, %147
%157 = and i64 %142, 1
%158 = icmp eq i64 %157, 0
br i1 %158, label %166, label %159
159: ; preds = %154
%160 = or i32 %144, %156
%161 = trunc i32 %160 to i8
%162 = add nsw i32 %143, 8
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %1, i64 %163
store i8 %161, i8* %164
%165 = add nsw i32 %143, 1
br label %168
166: ; preds = %154
%167 = shl nsw i32 %156, 4
br label %168
168: ; preds = %159, %166
%169 = phi i32 [ %144, %159 ], [ %167, %166 ]
%170 = phi i32 [ %165, %159 ], [ %143, %166 ]
%171 = add nuw nsw i64 %142, 1
%172 = icmp eq i64 %171, 16
br i1 %172, label %267, label %141
173: ; preds = %129
%174 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8* %0, i32 4)
%175 = icmp eq i64 %174, 0
br i1 %175, label %179, label %176
176: ; preds = %173
%177 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %0, i32 4)
%178 = icmp eq i64 %177, 0
br i1 %178, label %179, label %220
179: ; preds = %176, %173
%180 = getelementptr inbounds i8, i8* %0, i64 4
%181 = tail call i32 @strspn(i8* %180, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%182 = icmp eq i32 %181, 16
br i1 %182, label %186, label %183
183: ; preds = %179
%184 = load i32, i32* @stderr
%185 = tail call i32 (i32, i8*, ...) @fprintf(i32 %184, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.16, i64 0, i64 0), i8* %180)
br label %267
186: ; preds = %179
%187 = tail call i32 @memset(i8* %1, i32 0, i32 24)
store i8 4, i8* %1
store i32 0, i32* %3
br label %188
188: ; preds = %186, %215
%189 = phi i64 [ 0, %186 ], [ %218, %215 ]
%190 = phi i32 [ 0, %186 ], [ %217, %215 ]
%191 = phi i32 [ 0, %186 ], [ %216, %215 ]
%192 = getelementptr inbounds i8, i8* %180, i64 %189
%193 = load i8, i8* %192
%194 = sext i8 %193 to i32
%195 = tail call i64 @isdigit(i32 %194)
%196 = icmp eq i64 %195, 0
br i1 %196, label %197, label %201
197: ; preds = %188
%198 = tail call i64 @isupper(i32 %194)
%199 = icmp eq i64 %198, 0
%200 = select i1 %199, i32 -87, i32 -55
br label %201
201: ; preds = %197, %188
%202 = phi i32 [ -48, %188 ], [ %200, %197 ]
%203 = add nsw i32 %202, %194
%204 = and i64 %189, 1
%205 = icmp eq i64 %204, 0
br i1 %205, label %213, label %206
206: ; preds = %201
%207 = or i32 %191, %203
%208 = trunc i32 %207 to i8
%209 = add nsw i32 %190, 8
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %1, i64 %210
store i8 %208, i8* %211
%212 = add nsw i32 %190, 1
br label %215
213: ; preds = %201
%214 = shl nsw i32 %203, 4
br label %215
215: ; preds = %206, %213
%216 = phi i32 [ %191, %206 ], [ %214, %213 ]
%217 = phi i32 [ %212, %206 ], [ %190, %213 ]
%218 = add nuw nsw i64 %189, 1
%219 = icmp eq i64 %218, 32
br i1 %219, label %265, label %188
220: ; preds = %176
%221 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %0, i32 4)
%222 = icmp eq i64 %221, 0
br i1 %222, label %223, label %262
223: ; preds = %220
%224 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%225 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%226 = icmp eq i8* %224, null
%227 = icmp ugt i8* %225, %224
%228 = select i1 %227, i8* null, i8* %225
%229 = select i1 %226, i8* %225, i8* %228
br i1 %226, label %234, label %230
230: ; preds = %223
%231 = ptrtoint i8* %224 to i64
%232 = ptrtoint i8* %0 to i64
%233 = sub i64 %231, %232
br label %238
234: ; preds = %223
%235 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%236 = shl i64 %235, 32
%237 = ashr exact i64 %236, 32
br label %238
238: ; preds = %234, %230
%239 = phi i64 [ %233, %230 ], [ %237, %234 ]
%240 = trunc i64 %239 to i32
%241 = tail call i32 @memset(i8* %1, i32 0, i32 24)
%242 = icmp eq i8* %229, null
%243 = select i1 %242, i8 5, i8 69
store i8 %243, i8* %1
%244 = add nsw i32 %240, 1
%245 = icmp slt i32 %240, 19
br i1 %245, label %256, label %246
246: ; preds = %238
%247 = and i32 %244, 3
%248 = icmp eq i32 %247, 0
%249 = add nuw i32 %240, 5
%250 = and i32 %249, -4
%251 = select i1 %248, i32 %244, i32 %250
%252 = icmp sgt i32 %251, 241
br i1 %252, label %253, label %256
253: ; preds = %246
%254 = load i32, i32* @stderr
%255 = tail call i32 (i32, i8*, ...) @fprintf(i32 %254, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0), i32 %251)
br label %267
256: ; preds = %238, %246
%257 = phi i32 [ %251, %246 ], [ 20, %238 ]
%258 = trunc i32 %257 to i8
%259 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %258, i8* %259
%260 = getelementptr inbounds i8, i8* %1, i64 4
%261 = tail call i32 @memcpy(i8* %260, i8* %0, i32 %240)
br label %267
262: ; preds = %220
%263 = load i32, i32* @stderr
%264 = tail call i32 (i32, i8*, ...) @fprintf(i32 %263, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.21, i64 0, i64 0), i8* %0)
br label %267
265: ; preds = %215
%266 = sext i8 %193 to i32
store i32 %266, i32* %4
br label %267
267: ; preds = %168, %121, %48, %265, %262, %256, %253, %183, %136, %89, %66, %63, %16
%268 = phi i32 [ 0, %16 ], [ 0, %63 ], [ 1, %66 ], [ 0, %89 ], [ 0, %136 ], [ 0, %183 ], [ 0, %253 ], [ 1, %256 ], [ 0, %262 ], [ 1, %265 ], [ 1, %48 ], [ 1, %121 ], [ 1, %168 ]
ret i32 %268
}