#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 u_int;
typedef int u_char;

/* Variables and functions */
int /*<<< orphan*/ EMSGSIZE;
int /*<<< orphan*/ ENOENT;
int NS_IN6ADDRSZ;
int NS_INADDRSZ;
int NS_INT16SZ;
int /*<<< orphan*/ errno;
int getbits(char const *, int);
scalar_t__ inet_cidr_pton_ipv4(char const *, int *, int *, int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int /*<<< orphan*/ memset(int *, char, int);
char *strchr(char const *, int);
int inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
  static const char xdigits_l[] = "0123456789abcdef",
                    xdigits_u[] = "0123456789ABCDEF";
  u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
  const char *xdigits, *curtok;
  int ch, saw_xdigit;
  u_int val;
  int bits;
  memset((tp = tmp), '\0', NS_IN6ADDRSZ);
  endp = tp + NS_IN6ADDRSZ;
  colonp = NULL;
  if (*src == ':')
    if (*++src != ':')
      return (0);
  curtok = src;
  saw_xdigit = 0;
  val = 0;
  bits = -1;
  while ((ch = *src++) != '\0') {
    const char *pch;
    if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
      pch = strchr((xdigits = xdigits_u), ch);
    if (pch != NULL) {
      val <<= 4;
      val |= (pch - xdigits);
      if (val > 0xffff)
        return (0);
      saw_xdigit = 1;
      continue;
    }
    if (ch == ':') {
      curtok = src;
      if (!saw_xdigit) {
        if (colonp)
          return (0);
        colonp = tp;
        continue;
      } else if (*src == '\0') {
        return (0);
      }
      if (tp + NS_INT16SZ > endp)
        return (0);
      *tp++ = (u_char)(val >> 8) & 0xff;
      *tp++ = (u_char)val & 0xff;
      saw_xdigit = 0;
      val = 0;
      continue;
    }
    if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
        inet_cidr_pton_ipv4(curtok, tp, &bits, 1) == 0) {
      tp += NS_INADDRSZ;
      saw_xdigit = 0;
      break;
    }
    if (ch == '/') {
      bits = getbits(src, 1);
      if (bits == -2)
        goto enoent;
      break;
    }
    goto enoent;
  }
  if (saw_xdigit) {
    if (tp + NS_INT16SZ > endp)
      goto emsgsize;
    *tp++ = (u_char)(val >> 8) & 0xff;
    *tp++ = (u_char)val & 0xff;
  }
  if (colonp != NULL) {
    const int n = tp - colonp;
    int i;
    if (tp == endp)
      goto enoent;
    for (i = 1; i <= n; i++) {
      endp[-i] = colonp[n - i];
      colonp[n - i] = 0;
    }
    tp = endp;
  }
  memcpy(dst, tmp, NS_IN6ADDRSZ);
  *pbits = bits;
  return (0);
enoent:
  errno = ENOENT;
  return (-1);
emsgsize:
  errno = EMSGSIZE;
  return (-1);
}


x86 assembly (clang, -O0):
<inet_cidr_pton_ipv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x88(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x30(%rbp)
mov    %rdi,-0x38(%rbp)
mov    0x2e3e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rax
mov    0x2e2a(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1210 <inet_cidr_pton_ipv6+0xc0>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
je     120b <inet_cidr_pton_ipv6+0xbb>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
jmp    1210 <inet_cidr_pton_ipv6+0xc0>
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0xffffffff,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x5c(%rbp)
cmp    $0x0,%eax
je     1475 <inet_cidr_pton_ipv6+0x325>
lea    0xdae(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xda0(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,-0x78(%rbp)
cmp    $0x0,%rax
jne    1291 <inet_cidr_pton_ipv6+0x141>
lea    0xda6(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xd98(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
je     12e6 <inet_cidr_pton_ipv6+0x196>
mov    -0x64(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x64(%rbp)
mov    -0x78(%rbp),%rcx
mov    -0x50(%rbp),%rax
sub    %rax,%rcx
movslq -0x64(%rbp),%rax
or     %rcx,%rax
mov    %eax,-0x64(%rbp)
cmpl   $0xffff,-0x64(%rbp)
jle    12da <inet_cidr_pton_ipv6+0x18a>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
movl   $0x1,-0x60(%rbp)
jmp    122d <inet_cidr_pton_ipv6+0xdd>
cmpl   $0x3a,-0x5c(%rbp)
jne    13d1 <inet_cidr_pton_ipv6+0x281>
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpl   $0x0,-0x60(%rbp)
jne    132d <inet_cidr_pton_ipv6+0x1dd>
cmpq   $0x0,-0x48(%rbp)
je     1320 <inet_cidr_pton_ipv6+0x1d0>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    122d <inet_cidr_pton_ipv6+0xdd>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1350 <inet_cidr_pton_ipv6+0x200>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
jmp    1355 <inet_cidr_pton_ipv6+0x205>
mov    -0x38(%rbp),%rax
mov    0x2c68(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x40(%rbp),%rax
jbe    1387 <inet_cidr_pton_ipv6+0x237>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
mov    -0x64(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x38(%rbp)
mov    %ecx,(%rax)
mov    -0x64(%rbp),%ecx
and    $0xff,%ecx
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x38(%rbp)
mov    %ecx,(%rax)
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
jmp    122d <inet_cidr_pton_ipv6+0xdd>
cmpl   $0x2e,-0x5c(%rbp)
jne    1441 <inet_cidr_pton_ipv6+0x2f1>
mov    -0x38(%rbp),%rax
mov    0x2bca(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x40(%rbp),%rax
ja     1441 <inet_cidr_pton_ipv6+0x2f1>
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%rsi
lea    -0x68(%rbp),%rdx
mov    $0x1,%ecx
call   1060 <inet_cidr_pton_ipv4@plt>
cmp    $0x0,%rax
jne    1441 <inet_cidr_pton_ipv6+0x2f1>
mov    0x2b8f(%rip),%rax
mov    (%rax),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x60(%rbp)
jmp    1475 <inet_cidr_pton_ipv6+0x325>
cmpl   $0x2f,-0x5c(%rbp)
jne    1470 <inet_cidr_pton_ipv6+0x320>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <getbits@plt>
mov    %eax,-0x68(%rbp)
cmpl   $0xfffffffe,-0x68(%rbp)
jne    146b <inet_cidr_pton_ipv6+0x31b>
jmp    159b <inet_cidr_pton_ipv6+0x44b>
jmp    1475 <inet_cidr_pton_ipv6+0x325>
jmp    159b <inet_cidr_pton_ipv6+0x44b>
cmpl   $0x0,-0x60(%rbp)
je     14da <inet_cidr_pton_ipv6+0x38a>
mov    -0x38(%rbp),%rax
mov    0x2b3e(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x40(%rbp),%rax
jbe    14a3 <inet_cidr_pton_ipv6+0x353>
jmp    15c0 <inet_cidr_pton_ipv6+0x470>
mov    -0x64(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x38(%rbp)
mov    %ecx,(%rax)
mov    -0x64(%rbp),%ecx
and    $0xff,%ecx
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x38(%rbp)
mov    %ecx,(%rax)
cmpq   $0x0,-0x48(%rbp)
je     1566 <inet_cidr_pton_ipv6+0x416>
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x7c(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    150a <inet_cidr_pton_ipv6+0x3ba>
jmp    159b <inet_cidr_pton_ipv6+0x44b>
movl   $0x1,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jg     155e <inet_cidr_pton_ipv6+0x40e>
mov    -0x48(%rbp),%rax
mov    -0x7c(%rbp),%ecx
sub    -0x80(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x40(%rbp),%rax
xor    %ecx,%ecx
sub    -0x80(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
mov    -0x7c(%rbp),%ecx
sub    -0x80(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1511 <inet_cidr_pton_ipv6+0x3c1>
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rsi
mov    -0x18(%rbp),%rdi
mov    0x2a68(%rip),%rax
mov    (%rax),%edx
call   1070 <memcpy@plt>
mov    -0x68(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
mov    0x2a16(%rip),%rax
mov    (%rax),%ecx
mov    0x2a25(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    15e0 <inet_cidr_pton_ipv6+0x490>
mov    0x2a21(%rip),%rax
mov    (%rax),%ecx
mov    0x2a00(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_cidr_pton_ipv6>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdx,-0x78(%rbp)
mov    %rsi,-0x70(%rbp)
mov    %rdi,%rbx
mov    0x2e6d(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
lea    0xf(,%rdx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
xor    %r14d,%r14d
mov    %rdi,-0x50(%rbp)
xor    %esi,%esi
call   1030 <memset@plt>
movslq (%r15),%rax
mov    %rax,-0x60(%rbp)
mov    (%rbx),%r12b
cmp    $0x3a,%r12b
jne    11c6 <inet_cidr_pton_ipv6+0x76>
cmpb   $0x3a,0x1(%rbx)
jne    1499 <inet_cidr_pton_ipv6+0x349>
mov    %rbx,%rax
add    $0x1,%rbx
movl   $0xffffffff,-0x3c(%rbp)
mov    $0x3a,%r12b
jmp    11d6 <inet_cidr_pton_ipv6+0x86>
movl   $0xffffffff,-0x3c(%rbp)
test   %r12b,%r12b
je     1426 <inet_cidr_pton_ipv6+0x2d6>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
lea    (%rax,%rcx,4),%rcx
mov    %rcx,-0x48(%rbp)
mov    %rbx,-0x68(%rbp)
lea    0x1(%rbx),%r15
xor    %ebx,%ebx
xor    %r14d,%r14d
xor    %ecx,%ecx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
nopl   (%rax)
mov    %r14d,-0x54(%rbp)
movsbl %r12b,%r13d
mov    $0x11,%edx
lea    0xdec(%rip),%r14
mov    %r14,%rdi
mov    %r13d,%esi
call   1040 <memchr@plt>
test   %rax,%rax
jne    1240 <inet_cidr_pton_ipv6+0xf0>
mov    $0x11,%edx
lea    0xdf0(%rip),%r14
mov    %r14,%rdi
mov    %r13d,%esi
call   1040 <memchr@plt>
test   %rax,%rax
je     126d <inet_cidr_pton_ipv6+0x11d>
shl    $0x4,%ebx
sub    %r14d,%eax
or     %ebx,%eax
mov    $0x1,%r14d
mov    %eax,%ebx
cmp    $0xffff,%eax
jg     12df <inet_cidr_pton_ipv6+0x18f>
movzbl (%r15),%r12d
add    $0x1,%r15
test   %r12b,%r12b
jne    1200 <inet_cidr_pton_ipv6+0xb0>
jmp    1318 <inet_cidr_pton_ipv6+0x1c8>
cmp    $0x3a,%r12b
jne    12e7 <inet_cidr_pton_ipv6+0x197>
cmpl   $0x0,-0x54(%rbp)
je     12c4 <inet_cidr_pton_ipv6+0x174>
xor    %r14d,%r14d
cmpb   $0x0,(%r15)
je     1499 <inet_cidr_pton_ipv6+0x349>
mov    0x2d3b(%rip),%rax
movslq (%rax),%rax
mov    -0x38(%rbp),%rcx
lea    (%rcx,%rax,4),%rax
cmp    -0x48(%rbp),%rax
ja     1499 <inet_cidr_pton_ipv6+0x349>
movzbl %bh,%eax
mov    -0x38(%rbp),%rcx
mov    %eax,(%rcx)
movzbl %bl,%eax
mov    %eax,0x4(%rcx)
add    $0x8,%rcx
mov    %rcx,-0x38(%rbp)
xor    %r14d,%r14d
mov    %r15,-0x68(%rbp)
xor    %ebx,%ebx
jmp    125b <inet_cidr_pton_ipv6+0x10b>
xor    %r14d,%r14d
mov    %r15,-0x68(%rbp)
cmpq   $0x0,-0x30(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
je     125b <inet_cidr_pton_ipv6+0x10b>
jmp    1499 <inet_cidr_pton_ipv6+0x349>
xor    %r14d,%r14d
jmp    1499 <inet_cidr_pton_ipv6+0x349>
cmp    $0x2e,%r12b
mov    -0x54(%rbp),%r14d
je     144a <inet_cidr_pton_ipv6+0x2fa>
cmp    $0x2f,%r12b
jne    1481 <inet_cidr_pton_ipv6+0x331>
mov    %r15,%rdi
mov    $0x1,%esi
call   1050 <getbits@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xfffffffe,%eax
je     1481 <inet_cidr_pton_ipv6+0x331>
test   %r14d,%r14d
je     1344 <inet_cidr_pton_ipv6+0x1f4>
mov    0x2ca4(%rip),%rax
movslq (%rax),%rax
mov    -0x38(%rbp),%rdx
lea    (%rdx,%rax,4),%rax
mov    -0x48(%rbp),%rcx
cmp    %rcx,%rax
jbe    1358 <inet_cidr_pton_ipv6+0x208>
mov    0x2ca9(%rip),%rax
jmp    1488 <inet_cidr_pton_ipv6+0x338>
mov    -0x48(%rbp),%rcx
mov    -0x38(%rbp),%rdx
cmpq   $0x0,-0x30(%rbp)
jne    1372 <inet_cidr_pton_ipv6+0x222>
jmp    1426 <inet_cidr_pton_ipv6+0x2d6>
movzbl %bh,%eax
mov    %eax,(%rdx)
movzbl %bl,%eax
mov    %eax,0x4(%rdx)
add    $0x8,%rdx
cmpq   $0x0,-0x30(%rbp)
je     1426 <inet_cidr_pton_ipv6+0x2d6>
cmp    %rcx,%rdx
je     1481 <inet_cidr_pton_ipv6+0x331>
mov    %rdx,%r14
sub    -0x30(%rbp),%r14
mov    %r14,%r11
shr    $0x2,%r11
test   %r11d,%r11d
mov    -0x48(%rbp),%rcx
jle    1426 <inet_cidr_pton_ipv6+0x2d6>
movslq %r11d,%r9
add    $0x1,%r11d
lea    -0x1(%r11),%r10
mov    $0x1,%esi
cmp    $0x8,%r10
jae    14ab <inet_cidr_pton_ipv6+0x35b>
lea    0x1(%rsi),%rax
test   $0x4,%r14b
je     13df <inet_cidr_pton_ipv6+0x28f>
mov    %r9,%rdx
sub    %rsi,%rdx
mov    -0x30(%rbp),%rdi
mov    (%rdi,%rdx,4),%r8d
shl    $0x2,%rsi
mov    %rcx,%rbx
sub    %rsi,%rbx
mov    %r8d,(%rbx)
movl   $0x0,(%rdi,%rdx,4)
mov    %rax,%rsi
cmp    %rax,%r11
je     1426 <inet_cidr_pton_ipv6+0x2d6>
mov    -0x30(%rbp),%rax
lea    (%rax,%r9,4),%rax
neg    %rsi
neg    %r11
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rax,%rsi,4),%edx
mov    %edx,(%rcx,%rsi,4)
movl   $0x0,(%rax,%rsi,4)
mov    -0x4(%rax,%rsi,4),%edx
mov    %edx,-0x4(%rcx,%rsi,4)
movl   $0x0,-0x4(%rax,%rsi,4)
add    $0xfffffffffffffffe,%rsi
cmp    %rsi,%r11
jne    1400 <inet_cidr_pton_ipv6+0x2b0>
mov    0x2bb3(%rip),%rax
mov    (%rax),%edx
mov    -0x70(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1070 <memcpy@plt>
mov    -0x3c(%rbp),%eax
mov    -0x78(%rbp),%rcx
mov    %eax,(%rcx)
xor    %r14d,%r14d
jmp    1499 <inet_cidr_pton_ipv6+0x349>
mov    0x2b5f(%rip),%rbx
movslq (%rbx),%rax
mov    -0x38(%rbp),%rcx
lea    (%rcx,%rax,4),%rax
cmp    -0x48(%rbp),%rax
ja     1481 <inet_cidr_pton_ipv6+0x331>
lea    -0x3c(%rbp),%rdx
mov    -0x68(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x1,%ecx
call   1060 <inet_cidr_pton_ipv4@plt>
test   %rax,%rax
je     15d0 <inet_cidr_pton_ipv6+0x480>
mov    0x2b30(%rip),%rax
mov    (%rax),%eax
mov    0x2b3f(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%r14d
mov    %r14d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    -0x2(%r11),%rax
mov    $0x4,%edx
mul    %rdx
mov    -0x50(%rbp),%rdx
mov    -0x60(%rbp),%rdi
lea    -0x4(%rdx,%rdi,4),%rbx
seto   %dl
mov    %rbx,%rdi
sub    %rax,%rdi
cmp    %rbx,%rdi
ja     13b0 <inet_cidr_pton_ipv6+0x260>
test   %dl,%dl
jne    13b0 <inet_cidr_pton_ipv6+0x260>
mov    -0x30(%rbp),%rdi
lea    (%rdi,%r9,4),%rbx
add    $0xfffffffffffffffc,%rbx
mov    %rbx,%rdi
sub    %rax,%rdi
cmp    %rbx,%rdi
ja     13b0 <inet_cidr_pton_ipv6+0x260>
test   %dl,%dl
jne    13b0 <inet_cidr_pton_ipv6+0x260>
mov    -0x60(%rbp),%rax
sub    %r11,%rax
mov    -0x50(%rbp),%rdx
lea    (%rdx,%rax,4),%rax
add    $0x4,%rax
mov    -0x30(%rbp),%rdx
lea    (%rdx,%r9,4),%rdx
cmp    %rdx,%rax
jae    153c <inet_cidr_pton_ipv6+0x3ec>
mov    %r9,%rax
sub    %r11,%rax
mov    -0x30(%rbp),%rdx
lea    (%rdx,%rax,4),%rax
add    $0x4,%rax
cmp    %rcx,%rax
jb     13b0 <inet_cidr_pton_ipv6+0x260>
mov    %r10,%rsi
and    $0xfffffffffffffff8,%rsi
lea    -0x8(%rsi),%rax
mov    %rax,%r8
shr    $0x3,%r8
add    $0x1,%r8
test   %rax,%rax
je     15ef <inet_cidr_pton_ipv6+0x49f>
mov    %r8,%rdx
and    $0xfffffffffffffffe,%rdx
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rdi
lea    (%rax,%rdi,4),%rdi
add    $0xfffffffffffffff0,%rdi
mov    -0x30(%rbp),%rax
lea    (%rax,%r9,4),%rbx
add    $0xfffffffffffffff0,%rbx
xor    %eax,%eax
xorps  %xmm0,%xmm0
movups -0x10(%rbx,%rax,4),%xmm1
movups (%rbx,%rax,4),%xmm2
movups %xmm2,(%rdi,%rax,4)
movups %xmm1,-0x10(%rdi,%rax,4)
movups %xmm0,(%rbx,%rax,4)
movups %xmm0,-0x10(%rbx,%rax,4)
movups -0x30(%rbx,%rax,4),%xmm1
movups -0x20(%rbx,%rax,4),%xmm2
movups %xmm2,-0x20(%rdi,%rax,4)
movups %xmm1,-0x30(%rdi,%rax,4)
movups %xmm0,-0x20(%rbx,%rax,4)
movups %xmm0,-0x30(%rbx,%rax,4)
add    $0xfffffffffffffff0,%rax
add    $0xfffffffffffffffe,%rdx
jne    1583 <inet_cidr_pton_ipv6+0x433>
mov    $0x1,%edx
sub    %rax,%rdx
jmp    15f4 <inet_cidr_pton_ipv6+0x4a4>
movslq (%rbx),%rax
mov    -0x38(%rbp),%rdx
lea    (%rdx,%rax,4),%rdx
mov    -0x48(%rbp),%rcx
cmpq   $0x0,-0x30(%rbp)
jne    1372 <inet_cidr_pton_ipv6+0x222>
jmp    1426 <inet_cidr_pton_ipv6+0x2d6>
mov    $0x1,%edx
test   $0x1,%r8b
je     162d <inet_cidr_pton_ipv6+0x4dd>
mov    %r9,%rax
sub    %rdx,%rax
mov    -0x30(%rbp),%rbx
movups -0x1c(%rbx,%rax,4),%xmm0
movups -0xc(%rbx,%rax,4),%xmm1
shl    $0x2,%rdx
mov    %rcx,%rdi
sub    %rdx,%rdi
movups %xmm1,-0xc(%rdi)
movups %xmm0,-0x1c(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,-0xc(%rbx,%rax,4)
movups %xmm0,-0x1c(%rbx,%rax,4)
cmp    %rsi,%r10
je     1426 <inet_cidr_pton_ipv6+0x2d6>
or     $0x1,%rsi
jmp    13b0 <inet_cidr_pton_ipv6+0x260>

LLVM IR (-O0):
@inet_cidr_pton_ipv6.xdigits_l = internal constant [17 x i8] c"0123456789abcdef\00"
@inet_cidr_pton_ipv6.xdigits_u = internal constant [17 x i8] c"0123456789ABCDEF\00"
@NS_IN6ADDRSZ = global i32 0
@NS_INT16SZ = global i32 0
@NS_INADDRSZ = global i32 0
@ENOENT = global i32 0
@errno = global i32 0
@EMSGSIZE = global i32 0
define i32 @inet_cidr_pton_ipv6(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%23 = load i32, i32* @NS_IN6ADDRSZ
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %8
%26 = alloca i32, i64 %24
store i64 %24, i64* %9
store i32* %26, i32** %10
%27 = load i32, i32* @NS_IN6ADDRSZ
%28 = call i32 @memset(i32* %26, i8 signext 0, i32 %27)
%29 = load i32*, i32** %10
%30 = load i32, i32* @NS_IN6ADDRSZ
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
store i32* %32, i32** %11
store i32* null, i32** %12
%33 = load i8*, i8** %5
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 58
br i1 %36, label %37, label %45
37: ; preds = %3
%38 = load i8*, i8** %5
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %5
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 58
br i1 %42, label %43, label %44
43: ; preds = %37
store i32 0, i32* %4
store i32 1, i32* %19
br label %223
44: ; preds = %37
br label %45
45: ; preds = %44, %3
%46 = load i8*, i8** %5
store i8* %46, i8** %14
store i32 0, i32* %16
store i32 0, i32* %17
store i32 -1, i32* %18
br label %47
47: ; preds = %107, %90, %78, %45
%48 = load i8*, i8** %5
%49 = getelementptr inbounds i8, i8* %48, i32 1
store i8* %49, i8** %5
%50 = load i8, i8* %48
%51 = sext i8 %50 to i32
store i32 %51, i32* %15
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %148
53: ; preds = %47
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_l, i64 0, i64 0), i8** %13
%54 = load i32, i32* %15
%55 = call i8* @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_l, i64 0, i64 0), i32 %54)
store i8* %55, i8** %20
%56 = icmp eq i8* %55, null
br i1 %56, label %57, label %60
57: ; preds = %53
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_u, i64 0, i64 0), i8** %13
%58 = load i32, i32* %15
%59 = call i8* @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_u, i64 0, i64 0), i32 %58)
store i8* %59, i8** %20
br label %60
60: ; preds = %57, %53
%61 = load i8*, i8** %20
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %79
63: ; preds = %60
%64 = load i32, i32* %17
%65 = shl i32 %64, 4
store i32 %65, i32* %17
%66 = load i8*, i8** %20
%67 = load i8*, i8** %13
%68 = ptrtoint i8* %66 to i64
%69 = ptrtoint i8* %67 to i64
%70 = sub i64 %68, %69
%71 = load i32, i32* %17
%72 = sext i32 %71 to i64
%73 = or i64 %72, %70
%74 = trunc i64 %73 to i32
store i32 %74, i32* %17
%75 = load i32, i32* %17
%76 = icmp sgt i32 %75, 65535
br i1 %76, label %77, label %78
77: ; preds = %63
store i32 0, i32* %4
store i32 1, i32* %19
br label %223
78: ; preds = %63
store i32 1, i32* %16
br label %47
79: ; preds = %60
%80 = load i32, i32* %15
%81 = icmp eq i32 %80, 58
br i1 %81, label %82, label %117
82: ; preds = %79
%83 = load i8*, i8** %5
store i8* %83, i8** %14
%84 = load i32, i32* %16
%85 = icmp ne i32 %84, 0
br i1 %85, label %92, label %86
86: ; preds = %82
%87 = load i32*, i32** %12
%88 = icmp ne i32* %87, null
br i1 %88, label %89, label %90
89: ; preds = %86
store i32 0, i32* %4
store i32 1, i32* %19
br label %223
90: ; preds = %86
%91 = load i32*, i32** %10
store i32* %91, i32** %12
br label %47
92: ; preds = %82
%93 = load i8*, i8** %5
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %98
97: ; preds = %92
store i32 0, i32* %4
store i32 1, i32* %19
br label %223
98: ; preds = %92
br label %99
99: ; preds = %98
%100 = load i32*, i32** %10
%101 = load i32, i32* @NS_INT16SZ
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i32, i32* %100, i64 %102
%104 = load i32*, i32** %11
%105 = icmp ugt i32* %103, %104
br i1 %105, label %106, label %107
106: ; preds = %99
store i32 0, i32* %4
store i32 1, i32* %19
br label %223
107: ; preds = %99
%108 = load i32, i32* %17
%109 = ashr i32 %108, 8
%110 = and i32 %109, 255
%111 = load i32*, i32** %10
%112 = getelementptr inbounds i32, i32* %111, i32 1
store i32* %112, i32** %10
store i32 %110, i32* %111
%113 = load i32, i32* %17
%114 = and i32 %113, 255
%115 = load i32*, i32** %10
%116 = getelementptr inbounds i32, i32* %115, i32 1
store i32* %116, i32** %10
store i32 %114, i32* %115
store i32 0, i32* %16
store i32 0, i32* %17
br label %47
117: ; preds = %79
%118 = load i32, i32* %15
%119 = icmp eq i32 %118, 46
br i1 %119, label %120, label %137
120: ; preds = %117
%121 = load i32*, i32** %10
%122 = load i32, i32* @NS_INADDRSZ
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i32, i32* %121, i64 %123
%125 = load i32*, i32** %11
%126 = icmp ule i32* %124, %125
br i1 %126, label %127, label %137
127: ; preds = %120
%128 = load i8*, i8** %14
%129 = load i32*, i32** %10
%130 = call i64 @inet_cidr_pton_ipv4(i8* %128, i32* %129, i32* %18, i32 1)
%131 = icmp eq i64 %130, 0
br i1 %131, label %132, label %137
132: ; preds = %127
%133 = load i32, i32* @NS_INADDRSZ
%134 = load i32*, i32** %10
%135 = sext i32 %133 to i64
%136 = getelementptr inbounds i32, i32* %134, i64 %135
store i32* %136, i32** %10
store i32 0, i32* %16
br label %148
137: ; preds = %127, %120, %117
%138 = load i32, i32* %15
%139 = icmp eq i32 %138, 47
br i1 %139, label %140, label %147
140: ; preds = %137
%141 = load i8*, i8** %5
%142 = call i32 @getbits(i8* %141, i32 1)
store i32 %142, i32* %18
%143 = load i32, i32* %18
%144 = icmp eq i32 %143, -2
br i1 %144, label %145, label %146
145: ; preds = %140
br label %219
146: ; preds = %140
br label %148
147: ; preds = %137
br label %219
148: ; preds = %146, %132, %47
%149 = load i32, i32* %16
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %169
151: ; preds = %148
%152 = load i32*, i32** %10
%153 = load i32, i32* @NS_INT16SZ
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32, i32* %152, i64 %154
%156 = load i32*, i32** %11
%157 = icmp ugt i32* %155, %156
br i1 %157, label %158, label %159
158: ; preds = %151
br label %221
159: ; preds = %151
%160 = load i32, i32* %17
%161 = ashr i32 %160, 8
%162 = and i32 %161, 255
%163 = load i32*, i32** %10
%164 = getelementptr inbounds i32, i32* %163, i32 1
store i32* %164, i32** %10
store i32 %162, i32* %163
%165 = load i32, i32* %17
%166 = and i32 %165, 255
%167 = load i32*, i32** %10
%168 = getelementptr inbounds i32, i32* %167, i32 1
store i32* %168, i32** %10
store i32 %166, i32* %167
br label %169
169: ; preds = %159, %148
%170 = load i32*, i32** %12
%171 = icmp ne i32* %170, null
br i1 %171, label %172, label %213
172: ; preds = %169
%173 = load i32*, i32** %10
%174 = load i32*, i32** %12
%175 = ptrtoint i32* %173 to i64
%176 = ptrtoint i32* %174 to i64
%177 = sub i64 %175, %176
%178 = sdiv exact i64 %177, 4
%179 = trunc i64 %178 to i32
store i32 %179, i32* %21
%180 = load i32*, i32** %10
%181 = load i32*, i32** %11
%182 = icmp eq i32* %180, %181
br i1 %182, label %183, label %184
183: ; preds = %172
br label %219
184: ; preds = %172
store i32 1, i32* %22
br label %185
185: ; preds = %208, %184
%186 = load i32, i32* %22
%187 = load i32, i32* %21
%188 = icmp sle i32 %186, %187
br i1 %188, label %189, label %211
189: ; preds = %185
%190 = load i32*, i32** %12
%191 = load i32, i32* %21
%192 = load i32, i32* %22
%193 = sub nsw i32 %191, %192
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i32, i32* %190, i64 %194
%196 = load i32, i32* %195
%197 = load i32*, i32** %11
%198 = load i32, i32* %22
%199 = sub nsw i32 0, %198
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i32, i32* %197, i64 %200
store i32 %196, i32* %201
%202 = load i32*, i32** %12
%203 = load i32, i32* %21
%204 = load i32, i32* %22
%205 = sub nsw i32 %203, %204
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds i32, i32* %202, i64 %206
store i32 0, i32* %207
br label %208
208: ; preds = %189
%209 = load i32, i32* %22
%210 = add nsw i32 %209, 1
store i32 %210, i32* %22
br label %185
211: ; preds = %185
%212 = load i32*, i32** %11
store i32* %212, i32** %10
br label %213
213: ; preds = %211, %169
%214 = load i32*, i32** %6
%215 = load i32, i32* @NS_IN6ADDRSZ
%216 = call i32 @memcpy(i32* %214, i32* %26, i32 %215)
%217 = load i32, i32* %18
%218 = load i32*, i32** %7
store i32 %217, i32* %218
store i32 0, i32* %4
store i32 1, i32* %19
br label %223
219: ; preds = %183, %147, %145
%220 = load i32, i32* @ENOENT
store i32 %220, i32* @errno
store i32 -1, i32* %4
store i32 1, i32* %19
br label %223
221: ; preds = %158
%222 = load i32, i32* @EMSGSIZE
store i32 %222, i32* @errno
store i32 -1, i32* %4
store i32 1, i32* %19
br label %223
223: ; preds = %221, %219, %213, %106, %97, %89, %77, %43
%224 = load i8*, i8** %8
%225 = load i32, i32* %4
ret i32 %225
}

LLVM IR (-O2):
@inet_cidr_pton_ipv6.xdigits_l = internal constant [17 x i8] c"0123456789abcdef\00"
@inet_cidr_pton_ipv6.xdigits_u = internal constant [17 x i8] c"0123456789ABCDEF\00"
@NS_IN6ADDRSZ = global i32 0
@NS_INT16SZ = global i32 0
@NS_INADDRSZ = global i32 0
@ENOENT = global i32 0
@errno = global i32 0
@EMSGSIZE = global i32 0
define i32 @inet_cidr_pton_ipv6(i8* %0, i32* %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = load i32, i32* @NS_IN6ADDRSZ
%6 = zext i32 %5 to i64
%7 = alloca i32, i64 %6
%8 = bitcast i32* %4 to i8*
%9 = call i32 @memset(i32* %7, i8 signext 0, i32 %5)
%10 = load i32, i32* @NS_IN6ADDRSZ
%11 = sext i32 %10 to i64
%12 = getelementptr i32, i32* %7, i64 %11
%13 = load i8, i8* %0
%14 = icmp eq i8 %13, 58
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = getelementptr inbounds i8, i8* %0, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 58
br i1 %18, label %19, label %281
19: ; preds = %15
store i32 -1, i32* %4
br label %22
20: ; preds = %3
store i32 -1, i32* %4
%21 = icmp eq i8 %13, 0
br i1 %21, label %273, label %22
22: ; preds = %19, %20
%23 = phi i8 [ %13, %20 ], [ 58, %19 ]
%24 = phi i8* [ %0, %20 ], [ %16, %19 ]
br label %25
25: ; preds = %22, %84
%26 = phi i8 [ %90, %84 ], [ %23, %22 ]
%27 = phi i8* [ %33, %84 ], [ %24, %22 ]
%28 = phi i32 [ %89, %84 ], [ 0, %22 ]
%29 = phi i32 [ %88, %84 ], [ 0, %22 ]
%30 = phi i8* [ %87, %84 ], [ %24, %22 ]
%31 = phi i32* [ %86, %84 ], [ null, %22 ]
%32 = phi i32* [ %85, %84 ], [ %7, %22 ]
%33 = getelementptr inbounds i8, i8* %27, i64 1
%34 = sext i8 %26 to i32
%35 = call i8* @memchr(i8* dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_l, i64 0, i64 0), i32 %34, i64 17)
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %40
37: ; preds = %25
%38 = call i8* @memchr(i8* dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_u, i64 0, i64 0), i32 %34, i64 17)
%39 = icmp eq i8* %38, null
br i1 %39, label %50, label %40
40: ; preds = %25, %37
%41 = phi i8* [ %38, %37 ], [ %35, %25 ]
%42 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_u, i64 0, i64 0), %37 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @inet_cidr_pton_ipv6.xdigits_l, i64 0, i64 0), %25 ]
%43 = shl i32 %28, 4
%44 = ptrtoint i8* %41 to i64
%45 = ptrtoint i8* %42 to i64
%46 = sub i64 %44, %45
%47 = trunc i64 %46 to i32
%48 = or i32 %43, %47
%49 = icmp sgt i32 %48, 65535
br i1 %49, label %281, label %84
50: ; preds = %37
switch i8 %26, label %277 [
i8 58, label %51
i8 46, label %69
i8 47, label %81
]
51: ; preds = %50
%52 = icmp eq i32 %29, 0
br i1 %52, label %53, label %55
53: ; preds = %51
%54 = icmp eq i32* %31, null
br i1 %54, label %84, label %281
55: ; preds = %51
%56 = load i8, i8* %33
%57 = icmp eq i8 %56, 0
%58 = load i32, i32* @NS_INT16SZ
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %32, i64 %59
%61 = icmp ugt i32* %60, %12
%62 = select i1 %57, i1 true, i1 %61
br i1 %62, label %281, label %63
63: ; preds = %55
%64 = lshr i32 %28, 8
%65 = and i32 %64, 255
%66 = getelementptr inbounds i32, i32* %32, i64 1
store i32 %65, i32* %32
%67 = and i32 %28, 255
%68 = getelementptr inbounds i32, i32* %32, i64 2
store i32 %67, i32* %66
br label %84
69: ; preds = %50
%70 = load i32, i32* @NS_INADDRSZ
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %32, i64 %71
%73 = icmp ugt i32* %72, %12
br i1 %73, label %277, label %74
74: ; preds = %69
%75 = call i64 @inet_cidr_pton_ipv4(i8* %30, i32* %32, i32* %4, i32 1)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %277
77: ; preds = %74
%78 = load i32, i32* @NS_INADDRSZ
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i32, i32* %32, i64 %79
br label %109
81: ; preds = %50
%82 = call i32 @getbits(i8* %33, i32 1)
store i32 %82, i32* %4
%83 = icmp eq i32 %82, -2
br i1 %83, label %277, label %92
84: ; preds = %53, %40, %63
%85 = phi i32* [ %68, %63 ], [ %32, %40 ], [ %32, %53 ]
%86 = phi i32* [ %31, %63 ], [ %31, %40 ], [ %32, %53 ]
%87 = phi i8* [ %33, %63 ], [ %30, %40 ], [ %33, %53 ]
%88 = phi i32 [ 0, %63 ], [ 1, %40 ], [ 0, %53 ]
%89 = phi i32 [ 0, %63 ], [ %48, %40 ], [ %28, %53 ]
%90 = load i8, i8* %33
%91 = icmp eq i8 %90, 0
br i1 %91, label %92, label %25
92: ; preds = %84, %81
%93 = phi i32* [ %32, %81 ], [ %85, %84 ]
%94 = phi i32* [ %31, %81 ], [ %86, %84 ]
%95 = phi i32 [ %29, %81 ], [ %88, %84 ]
%96 = phi i32 [ %28, %81 ], [ %89, %84 ]
%97 = icmp eq i32 %95, 0
br i1 %97, label %109, label %98
98: ; preds = %92
%99 = load i32, i32* @NS_INT16SZ
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i32, i32* %93, i64 %100
%102 = icmp ugt i32* %101, %12
br i1 %102, label %279, label %103
103: ; preds = %98
%104 = lshr i32 %96, 8
%105 = and i32 %104, 255
%106 = getelementptr inbounds i32, i32* %93, i64 1
store i32 %105, i32* %93
%107 = and i32 %96, 255
%108 = getelementptr inbounds i32, i32* %93, i64 2
store i32 %107, i32* %106
br label %109
109: ; preds = %77, %103, %92
%110 = phi i32* [ %94, %103 ], [ %94, %92 ], [ %31, %77 ]
%111 = phi i32* [ %108, %103 ], [ %93, %92 ], [ %80, %77 ]
%112 = icmp eq i32* %110, null
br i1 %112, label %273, label %113
113: ; preds = %109
%114 = ptrtoint i32* %111 to i64
%115 = ptrtoint i32* %110 to i64
%116 = sub i64 %114, %115
%117 = lshr exact i64 %116, 2
%118 = icmp eq i32* %111, %12
br i1 %118, label %277, label %119
119: ; preds = %113
%120 = trunc i64 %117 to i32
%121 = icmp slt i32 %120, 1
br i1 %121, label %273, label %122
122: ; preds = %119
%123 = shl i64 %116, 30
%124 = ashr i64 %123, 32
%125 = add nuw nsw i64 %117, 1
%126 = and i64 %125, 4294967295
%127 = add nsw i64 %126, -1
%128 = icmp ult i64 %127, 8
br i1 %128, label %243, label %129
129: ; preds = %122
%130 = add nsw i64 %126, -2
%131 = add nsw i64 %11, -1
%132 = getelementptr i32, i32* %7, i64 %131
%133 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %130, i64 4)
%134 = extractvalue { i64, i1 } %133, 0
%135 = extractvalue { i64, i1 } %133, 1
%136 = bitcast i32* %132 to i8*
%137 = sub i64 0, %134
%138 = getelementptr i8, i8* %136, i64 %137
%139 = icmp ugt i8* %138, %136
%140 = or i1 %139, %135
%141 = add nsw i64 %124, -1
%142 = getelementptr i32, i32* %110, i64 %141
%143 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %130, i64 4)
%144 = extractvalue { i64, i1 } %143, 0
%145 = extractvalue { i64, i1 } %143, 1
%146 = bitcast i32* %142 to i8*
%147 = sub i64 0, %144
%148 = getelementptr i8, i8* %146, i64 %147
%149 = icmp ugt i8* %148, %146
%150 = or i1 %149, %145
%151 = or i1 %140, %150
br i1 %151, label %243, label %152
152: ; preds = %129
%153 = add nsw i64 %11, 1
%154 = sub nsw i64 %153, %126
%155 = getelementptr i32, i32* %7, i64 %154
%156 = add nsw i64 %124, 1
%157 = sub nsw i64 %156, %126
%158 = getelementptr i32, i32* %110, i64 %157
%159 = getelementptr i32, i32* %110, i64 %124
%160 = icmp ult i32* %155, %159
%161 = icmp ult i32* %158, %12
%162 = and i1 %160, %161
br i1 %162, label %243, label %163
163: ; preds = %152
%164 = and i64 %127, -8
%165 = or i64 %164, 1
%166 = add nsw i64 %164, -8
%167 = lshr exact i64 %166, 3
%168 = add nuw nsw i64 %167, 1
%169 = and i64 %168, 1
%170 = icmp eq i64 %166, 0
br i1 %170, label %219, label %171
171: ; preds = %163
%172 = and i64 %168, 4611686018427387902
br label %173
173: ; preds = %173, %171
%174 = phi i64 [ 0, %171 ], [ %214, %173 ]
%175 = phi i64 [ 0, %171 ], [ %215, %173 ]
%176 = or i64 %174, 1
%177 = sub nsw i64 %124, %176
%178 = getelementptr inbounds i32, i32* %110, i64 %177
%179 = getelementptr inbounds i32, i32* %178, i64 -3
%180 = bitcast i32* %179 to <4 x i32>*
%181 = load <4 x i32>, <4 x i32>* %180
%182 = getelementptr inbounds i32, i32* %178, i64 -4
%183 = getelementptr inbounds i32, i32* %182, i64 -3
%184 = bitcast i32* %183 to <4 x i32>*
%185 = load <4 x i32>, <4 x i32>* %184
%186 = sub nsw i64 0, %176
%187 = getelementptr inbounds i32, i32* %12, i64 %186
%188 = getelementptr inbounds i32, i32* %187, i64 -3
%189 = bitcast i32* %188 to <4 x i32>*
store <4 x i32> %181, <4 x i32>* %189
%190 = getelementptr inbounds i32, i32* %187, i64 -4
%191 = getelementptr inbounds i32, i32* %190, i64 -3
%192 = bitcast i32* %191 to <4 x i32>*
store <4 x i32> %185, <4 x i32>* %192
%193 = bitcast i32* %179 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %193
%194 = bitcast i32* %183 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %194
%195 = or i64 %174, 9
%196 = sub nsw i64 %124, %195
%197 = getelementptr inbounds i32, i32* %110, i64 %196
%198 = getelementptr inbounds i32, i32* %197, i64 -3
%199 = bitcast i32* %198 to <4 x i32>*
%200 = load <4 x i32>, <4 x i32>* %199
%201 = getelementptr inbounds i32, i32* %197, i64 -4
%202 = getelementptr inbounds i32, i32* %201, i64 -3
%203 = bitcast i32* %202 to <4 x i32>*
%204 = load <4 x i32>, <4 x i32>* %203
%205 = sub nsw i64 0, %195
%206 = getelementptr inbounds i32, i32* %12, i64 %205
%207 = getelementptr inbounds i32, i32* %206, i64 -3
%208 = bitcast i32* %207 to <4 x i32>*
store <4 x i32> %200, <4 x i32>* %208
%209 = getelementptr inbounds i32, i32* %206, i64 -4
%210 = getelementptr inbounds i32, i32* %209, i64 -3
%211 = bitcast i32* %210 to <4 x i32>*
store <4 x i32> %204, <4 x i32>* %211
%212 = bitcast i32* %198 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %212
%213 = bitcast i32* %202 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %213
%214 = add nuw i64 %174, 16
%215 = add i64 %175, 2
%216 = icmp eq i64 %215, %172
br i1 %216, label %217, label %173
217: ; preds = %173
%218 = or i64 %214, 1
br label %219
219: ; preds = %217, %163
%220 = phi i64 [ 1, %163 ], [ %218, %217 ]
%221 = icmp eq i64 %169, 0
br i1 %221, label %241, label %222
222: ; preds = %219
%223 = sub nsw i64 %124, %220
%224 = getelementptr inbounds i32, i32* %110, i64 %223
%225 = getelementptr inbounds i32, i32* %224, i64 -3
%226 = bitcast i32* %225 to <4 x i32>*
%227 = load <4 x i32>, <4 x i32>* %226
%228 = getelementptr inbounds i32, i32* %224, i64 -4
%229 = getelementptr inbounds i32, i32* %228, i64 -3
%230 = bitcast i32* %229 to <4 x i32>*
%231 = load <4 x i32>, <4 x i32>* %230
%232 = sub nsw i64 0, %220
%233 = getelementptr inbounds i32, i32* %12, i64 %232
%234 = getelementptr inbounds i32, i32* %233, i64 -3
%235 = bitcast i32* %234 to <4 x i32>*
store <4 x i32> %227, <4 x i32>* %235
%236 = getelementptr inbounds i32, i32* %233, i64 -4
%237 = getelementptr inbounds i32, i32* %236, i64 -3
%238 = bitcast i32* %237 to <4 x i32>*
store <4 x i32> %231, <4 x i32>* %238
%239 = bitcast i32* %225 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %239
%240 = bitcast i32* %229 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %240
br label %241
241: ; preds = %219, %222
%242 = icmp eq i64 %127, %164
br i1 %242, label %273, label %243
243: ; preds = %152, %129, %122, %241
%244 = phi i64 [ 1, %152 ], [ 1, %129 ], [ 1, %122 ], [ %165, %241 ]
%245 = add nsw i64 %244, 1
%246 = and i64 %116, 4
%247 = icmp eq i64 %246, 0
br i1 %247, label %255, label %248
248: ; preds = %243
%249 = sub nsw i64 %124, %244
%250 = getelementptr inbounds i32, i32* %110, i64 %249
%251 = load i32, i32* %250
%252 = sub nsw i64 0, %244
%253 = getelementptr inbounds i32, i32* %12, i64 %252
store i32 %251, i32* %253
store i32 0, i32* %250
%254 = add nuw nsw i64 %244, 1
br label %255
255: ; preds = %248, %243
%256 = phi i64 [ %244, %243 ], [ %254, %248 ]
%257 = icmp eq i64 %126, %245
br i1 %257, label %273, label %258
258: ; preds = %255, %258
%259 = phi i64 [ %271, %258 ], [ %256, %255 ]
%260 = sub nsw i64 %124, %259
%261 = getelementptr inbounds i32, i32* %110, i64 %260
%262 = load i32, i32* %261
%263 = sub nsw i64 0, %259
%264 = getelementptr inbounds i32, i32* %12, i64 %263
store i32 %262, i32* %264
store i32 0, i32* %261
%265 = xor i64 %259, -1
%266 = add i64 %124, %265
%267 = getelementptr inbounds i32, i32* %110, i64 %266
%268 = load i32, i32* %267
%269 = xor i64 %259, -1
%270 = getelementptr inbounds i32, i32* %12, i64 %269
store i32 %268, i32* %270
store i32 0, i32* %267
%271 = add nuw nsw i64 %259, 2
%272 = icmp eq i64 %271, %126
br i1 %272, label %273, label %258
273: ; preds = %255, %258, %241, %20, %119, %109
%274 = load i32, i32* @NS_IN6ADDRSZ
%275 = call i32 @memcpy(i32* %1, i32* %7, i32 %274)
%276 = load i32, i32* %4
store i32 %276, i32* %2
br label %281
277: ; preds = %50, %81, %69, %74, %113
%278 = load i32, i32* @ENOENT
store i32 %278, i32* @errno
br label %281
279: ; preds = %98
%280 = load i32, i32* @EMSGSIZE
store i32 %280, i32* @errno
br label %281
281: ; preds = %40, %55, %53, %15, %279, %277, %273
%282 = phi i32 [ -1, %277 ], [ -1, %279 ], [ 0, %273 ], [ 0, %15 ], [ 0, %53 ], [ 0, %55 ], [ 0, %40 ]
ret i32 %282
}