#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ L_DEBUG(char *, ...);
int l2escaped(int const *, int, char *, int);
int ll2escaped(const uint8_t *base, const uint8_t *ll, int ll_left,
               char *escaped, int escaped_left) {
  const uint8_t *oll = ll;
  int r;
  if (escaped_left <= 0) {
    L_DEBUG("no output string available");
    return -1;
  }
  while (1) {
    if (!ll_left--) {
      L_DEBUG("out of input string (before last null label)");
      return -2;
    }
    uint8_t c = *(ll++);
    if (c) {
      if ((c & (64 | 128)) == (64 | 128)) {
        if (!base)
          return -3;
        if (!ll_left--) {
          L_DEBUG("out of input string (before last null label)");
          return -2;
        }
        uint8_t c2 = *(ll++);
        const uint8_t *nofs = base + ((c % 64) << 8) + c2;
        r = ll2escaped(base, nofs, ll + ll_left - nofs, escaped, escaped_left);
        if (r < 0)
          return r;
        return ll - oll;
      }
      if (c & (64 | 128)) {
        L_DEBUG("high-order bits set in length");
        return -2;
      }
      ll_left -= c;
      if (ll_left < 0) {
        L_DEBUG("%d/%d bytes of label body missing", -ll_left, c);
        return -2;
      }
      r = l2escaped(ll, c, escaped, escaped_left);
      if (r < 0)
        return r;
      ll += c;
      escaped += r;
      escaped_left -= r;
    }
    if (!c)
      break;
    do {
      if (!escaped_left--) {
        L_DEBUG("out of space in escaped pushing %d", '.');
        return -1;
      }
      *(escaped++) = '.';
    } while (0);
  }
  do {
    if (!escaped_left--) {
      L_DEBUG("out of space in escaped pushing %d", 0);
      return -1;
    }
    *(escaped++) = 0;
  } while (0);
  return ll - oll;
}


x86 assembly (clang, -O0):
<ll2escaped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jg     1177 <ll2escaped+0x47>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
jmp    117c <ll2escaped+0x4c>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jne    11aa <ll2escaped+0x7a>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
je     1385 <ll2escaped+0x255>
mov    -0x40(%rbp),%eax
and    $0xc0,%eax
cmp    $0xc0,%eax
jne    12c7 <ll2escaped+0x197>
cmpq   $0x0,-0x10(%rbp)
jne    11f2 <ll2escaped+0xc2>
movl   $0xfffffffd,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jne    1220 <ll2escaped+0xf0>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x40(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    -0x58(%rbp),%rax
shl    $0x8,%edx
movslq %edx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x44(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x50(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%edx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1040 <ll2escaped@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    12b0 <ll2escaped+0x180>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x40(%rbp),%eax
and    $0xc0,%eax
cmp    $0x0,%eax
je     12f2 <ll2escaped+0x1c2>
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x40(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1329 <ll2escaped+0x1f9>
xor    %esi,%esi
sub    -0x1c(%rbp),%esi
mov    -0x40(%rbp),%edx
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1030 <l2escaped@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    1354 <ll2escaped+0x224>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x40(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x2c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x40(%rbp)
jne    1394 <ll2escaped+0x264>
jmp    13e3 <ll2escaped+0x2b3>
jmp    1399 <ll2escaped+0x269>
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2c(%rbp)
cmp    $0x0,%eax
jne    13cc <ll2escaped+0x29c>
lea    0xcd4(%rip),%rdi
mov    $0x2e,%esi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x2e,(%rax)
jmp    117c <ll2escaped+0x4c>
jmp    13e8 <ll2escaped+0x2b8>
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2c(%rbp)
cmp    $0x0,%eax
jne    1418 <ll2escaped+0x2e8>
lea    0xc85(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <L_DEBUG@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143c <ll2escaped+0x30c>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll2escaped>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x8(%rsp)
test   %r8d,%r8d
jle    11da <ll2escaped+0xaa>
mov    %rdi,0x10(%rsp)
test   %edx,%edx
je     1268 <ll2escaped+0x138>
mov    %r8d,%ebp
mov    %rcx,%rbx
mov    0x8(%rsp),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x4(%rax),%r12
movslq (%rax),%r13
test   %r13,%r13
je     128e <ll2escaped+0x15e>
lea    -0x1(%rdx),%r15d
mov    %r13d,%ecx
and    $0xc0,%cl
jne    11f3 <ll2escaped+0xc3>
sub    %r13d,%r15d
js     12ac <ll2escaped+0x17c>
mov    %r12,%rdi
mov    %r13d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <l2escaped@plt>
mov    %eax,%r14d
test   %eax,%eax
js     127c <ll2escaped+0x14c>
sub    %r14d,%ebp
je     12c5 <ll2escaped+0x195>
mov    %r14d,%eax
add    %rax,%rbx
add    $0xffffffff,%ebp
lea    (%r12,%r13,4),%rax
movb   $0x2e,(%rbx)
add    $0x1,%rbx
mov    %r15d,%edx
test   %r15d,%r15d
jne    1170 <ll2escaped+0x40>
jmp    1268 <ll2escaped+0x138>
lea    0xe1f(%rip),%rdi
xor    %eax,%eax
call   1050 <L_DEBUG@plt>
mov    $0xffffffff,%r14d
jmp    127c <ll2escaped+0x14c>
cmp    $0xc0,%cl
jne    12a3 <ll2escaped+0x173>
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
je     12eb <ll2escaped+0x1bb>
test   %r15d,%r15d
je     1268 <ll2escaped+0x138>
add    $0xfffffffe,%edx
lea    0x8(%rax),%r14
movslq 0x4(%rax),%rcx
lea    0x3f(%r13),%esi
test   %r13d,%r13d
cmovns %r13d,%esi
and    $0xffffc0,%esi
sub    %esi,%r13d
shl    $0x8,%r13d
movslq %r13d,%rsi
lea    (%rdi,%rsi,4),%rsi
lea    (%rsi,%rcx,4),%rsi
lea    (%rax,%rdx,4),%rdx
add    $0x8,%rdx
sub    %rsi,%rdx
shr    $0x2,%rdx
mov    %rbx,%rcx
mov    %ebp,%r8d
call   1040 <ll2escaped@plt>
sub    0x8(%rsp),%r14
shr    $0x2,%r14
test   %eax,%eax
cmovs  %eax,%r14d
jmp    127c <ll2escaped+0x14c>
lea    0xdac(%rip),%rdi
xor    %eax,%eax
call   1050 <L_DEBUG@plt>
mov    $0xfffffffe,%r14d
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %ebp,%ebp
je     12d3 <ll2escaped+0x1a3>
movb   $0x0,(%rbx)
sub    0x8(%rsp),%r12
shr    $0x2,%r12
mov    %r12d,%r14d
jmp    127c <ll2escaped+0x14c>
lea    0xd9e(%rip),%rdi
jmp    126f <ll2escaped+0x13f>
neg    %r15d
lea    0xdb0(%rip),%rdi
mov    %r15d,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <L_DEBUG@plt>
jmp    1276 <ll2escaped+0x146>
lea    0xdbc(%rip),%rdi
mov    $0x2e,%esi
jmp    12dc <ll2escaped+0x1ac>
lea    0xdae(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <L_DEBUG@plt>
mov    $0xffffffff,%r14d
jmp    127c <ll2escaped+0x14c>
mov    $0xfffffffd,%r14d
jmp    127c <ll2escaped+0x14c>

LLVM IR (-O0):
@.str = [27 x i8] c"no output string available\00"
@.str.1 = [45 x i8] c"out of input string (before last null label)\00"
@.str.2 = [30 x i8] c"high-order bits set in length\00"
@.str.3 = [34 x i8] c"%d/%d bytes of label body missing\00"
@.str.4 = [35 x i8] c"out of space in escaped pushing %d\00"
define i32 @ll2escaped(i32* %0, i32* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%17 = load i32*, i32** %8
store i32* %17, i32** %12
%18 = load i32, i32* %11
%19 = icmp sle i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %5
%21 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %6
br label %161
22: ; preds = %5
br label %23
23: ; preds = %22, %142
%24 = load i32, i32* %9
%25 = add nsw i32 %24, -1
store i32 %25, i32* %9
%26 = icmp ne i32 %24, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
store i32 -2, i32* %6
br label %161
29: ; preds = %23
%30 = load i32*, i32** %8
%31 = getelementptr inbounds i32, i32* %30, i32 1
store i32* %31, i32** %8
%32 = load i32, i32* %30
store i32 %32, i32* %14
%33 = load i32, i32* %14
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %128
35: ; preds = %29
%36 = load i32, i32* %14
%37 = and i32 %36, 192
%38 = icmp eq i32 %37, 192
br i1 %38, label %39, label %89
39: ; preds = %35
%40 = load i32*, i32** %7
%41 = icmp ne i32* %40, null
br i1 %41, label %43, label %42
42: ; preds = %39
store i32 -3, i32* %6
br label %161
43: ; preds = %39
%44 = load i32, i32* %9
%45 = add nsw i32 %44, -1
store i32 %45, i32* %9
%46 = icmp ne i32 %44, 0
br i1 %46, label %49, label %47
47: ; preds = %43
%48 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
store i32 -2, i32* %6
br label %161
49: ; preds = %43
%50 = load i32*, i32** %8
%51 = getelementptr inbounds i32, i32* %50, i32 1
store i32* %51, i32** %8
%52 = load i32, i32* %50
store i32 %52, i32* %15
%53 = load i32*, i32** %7
%54 = load i32, i32* %14
%55 = srem i32 %54, 64
%56 = shl i32 %55, 8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %53, i64 %57
%59 = load i32, i32* %15
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
store i32* %61, i32** %16
%62 = load i32*, i32** %7
%63 = load i32*, i32** %16
%64 = load i32*, i32** %8
%65 = load i32, i32* %9
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %64, i64 %66
%68 = load i32*, i32** %16
%69 = ptrtoint i32* %67 to i64
%70 = ptrtoint i32* %68 to i64
%71 = sub i64 %69, %70
%72 = sdiv exact i64 %71, 4
%73 = trunc i64 %72 to i32
%74 = load i8*, i8** %10
%75 = load i32, i32* %11
%76 = call i32 @ll2escaped(i32* %62, i32* %63, i32 %73, i8* %74, i32 %75)
store i32 %76, i32* %13
%77 = load i32, i32* %13
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %49
%80 = load i32, i32* %13
store i32 %80, i32* %6
br label %161
81: ; preds = %49
%82 = load i32*, i32** %8
%83 = load i32*, i32** %12
%84 = ptrtoint i32* %82 to i64
%85 = ptrtoint i32* %83 to i64
%86 = sub i64 %84, %85
%87 = sdiv exact i64 %86, 4
%88 = trunc i64 %87 to i32
store i32 %88, i32* %6
br label %161
89: ; preds = %35
%90 = load i32, i32* %14
%91 = and i32 %90, 192
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
store i32 -2, i32* %6
br label %161
95: ; preds = %89
%96 = load i32, i32* %14
%97 = load i32, i32* %9
%98 = sub nsw i32 %97, %96
store i32 %98, i32* %9
%99 = load i32, i32* %9
%100 = icmp slt i32 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %95
%102 = load i32, i32* %9
%103 = sub nsw i32 0, %102
%104 = load i32, i32* %14
%105 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %103, i32 %104)
store i32 -2, i32* %6
br label %161
106: ; preds = %95
%107 = load i32*, i32** %8
%108 = load i32, i32* %14
%109 = load i8*, i8** %10
%110 = load i32, i32* %11
%111 = call i32 @l2escaped(i32* %107, i32 %108, i8* %109, i32 %110)
store i32 %111, i32* %13
%112 = load i32, i32* %13
%113 = icmp slt i32 %112, 0
br i1 %113, label %114, label %116
114: ; preds = %106
%115 = load i32, i32* %13
store i32 %115, i32* %6
br label %161
116: ; preds = %106
%117 = load i32, i32* %14
%118 = load i32*, i32** %8
%119 = sext i32 %117 to i64
%120 = getelementptr inbounds i32, i32* %118, i64 %119
store i32* %120, i32** %8
%121 = load i32, i32* %13
%122 = load i8*, i8** %10
%123 = sext i32 %121 to i64
%124 = getelementptr inbounds i8, i8* %122, i64 %123
store i8* %124, i8** %10
%125 = load i32, i32* %13
%126 = load i32, i32* %11
%127 = sub nsw i32 %126, %125
store i32 %127, i32* %11
br label %128
128: ; preds = %116, %29
%129 = load i32, i32* %14
%130 = icmp ne i32 %129, 0
br i1 %130, label %132, label %131
131: ; preds = %128
br label %143
132: ; preds = %128
br label %133
133: ; preds = %132
%134 = load i32, i32* %11
%135 = add nsw i32 %134, -1
store i32 %135, i32* %11
%136 = icmp ne i32 %134, 0
br i1 %136, label %139, label %137
137: ; preds = %133
%138 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 46)
store i32 -1, i32* %6
br label %161
139: ; preds = %133
%140 = load i8*, i8** %10
%141 = getelementptr inbounds i8, i8* %140, i32 1
store i8* %141, i8** %10
store i8 46, i8* %140
br label %142
142: ; preds = %139
br label %23
143: ; preds = %131
br label %144
144: ; preds = %143
%145 = load i32, i32* %11
%146 = add nsw i32 %145, -1
store i32 %146, i32* %11
%147 = icmp ne i32 %145, 0
br i1 %147, label %150, label %148
148: ; preds = %144
%149 = call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 0)
store i32 -1, i32* %6
br label %161
150: ; preds = %144
%151 = load i8*, i8** %10
%152 = getelementptr inbounds i8, i8* %151, i32 1
store i8* %152, i8** %10
store i8 0, i8* %151
br label %153
153: ; preds = %150
%154 = load i32*, i32** %8
%155 = load i32*, i32** %12
%156 = ptrtoint i32* %154 to i64
%157 = ptrtoint i32* %155 to i64
%158 = sub i64 %156, %157
%159 = sdiv exact i64 %158, 4
%160 = trunc i64 %159 to i32
store i32 %160, i32* %6
br label %161
161: ; preds = %153, %148, %137, %114, %101, %93, %81, %79, %47, %42, %27, %20
%162 = load i32, i32* %6
ret i32 %162
}

LLVM IR (-O2):
@.str = [27 x i8] c"no output string available\00"
@.str.1 = [45 x i8] c"out of input string (before last null label)\00"
@.str.2 = [30 x i8] c"high-order bits set in length\00"
@.str.3 = [34 x i8] c"%d/%d bytes of label body missing\00"
@.str.4 = [35 x i8] c"out of space in escaped pushing %d\00"
define i32 @ll2escaped(i32* %0, i32* %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp slt i32 %4, 1
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = icmp eq i32 %2, 0
br i1 %8, label %11, label %13
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %31
11: ; preds = %76, %7
%12 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %31
13: ; preds = %7, %76
%14 = phi i32* [ %79, %76 ], [ %1, %7 ]
%15 = phi i32 [ %61, %76 ], [ %2, %7 ]
%16 = phi i8* [ %80, %76 ], [ %3, %7 ]
%17 = phi i32 [ %77, %76 ], [ %4, %7 ]
%18 = add nsw i32 %15, -1
%19 = getelementptr inbounds i32, i32* %14, i64 1
%20 = load i32, i32* %14
%21 = icmp eq i32 %20, 0
br i1 %21, label %82, label %22
22: ; preds = %13
%23 = trunc i32 %20 to i8
%24 = and i8 %23, -64
switch i8 %24, label %58 [
i8 -64, label %25
i8 0, label %60
]
25: ; preds = %22
%26 = icmp eq i32* %0, null
br i1 %26, label %31, label %27
27: ; preds = %25
%28 = icmp eq i32 %18, 0
br i1 %28, label %29, label %33
29: ; preds = %27
%30 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %66, %9, %11, %84, %86, %29, %58, %63, %74, %25, %33
%32 = phi i32 [ %57, %33 ], [ -1, %9 ], [ %91, %86 ], [ -1, %84 ], [ -2, %11 ], [ -3, %25 ], [ -1, %74 ], [ -2, %63 ], [ -2, %58 ], [ -2, %29 ], [ %67, %66 ]
ret i32 %32
33: ; preds = %27
%34 = add nsw i32 %15, -2
%35 = getelementptr inbounds i32, i32* %14, i64 2
%36 = load i32, i32* %19
%37 = srem i32 %20, 64
%38 = shl nsw i32 %37, 8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %0, i64 %39
%41 = sext i32 %36 to i64
%42 = getelementptr inbounds i32, i32* %40, i64 %41
%43 = sext i32 %34 to i64
%44 = getelementptr inbounds i32, i32* %35, i64 %43
%45 = ptrtoint i32* %44 to i64
%46 = ptrtoint i32* %42 to i64
%47 = sub i64 %45, %46
%48 = lshr exact i64 %47, 2
%49 = trunc i64 %48 to i32
%50 = tail call i32 @ll2escaped(i32* %0, i32* %42, i32 %49, i8* %16, i32 %17)
%51 = icmp slt i32 %50, 0
%52 = ptrtoint i32* %35 to i64
%53 = ptrtoint i32* %1 to i64
%54 = sub i64 %52, %53
%55 = lshr exact i64 %54, 2
%56 = trunc i64 %55 to i32
%57 = select i1 %51, i32 %50, i32 %56
br label %31
58: ; preds = %22
%59 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %31
60: ; preds = %22
%61 = sub nsw i32 %18, %20
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = sub nsw i32 0, %61
%65 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %64, i32 %20)
br label %31
66: ; preds = %60
%67 = tail call i32 @l2escaped(i32* %19, i32 %20, i8* %16, i32 %17)
%68 = icmp slt i32 %67, 0
br i1 %68, label %31, label %69
69: ; preds = %66
%70 = zext i32 %67 to i64
%71 = getelementptr inbounds i8, i8* %16, i64 %70
%72 = sub nsw i32 %17, %67
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %69
%75 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 46)
br label %31
76: ; preds = %69
%77 = add nsw i32 %72, -1
%78 = sext i32 %20 to i64
%79 = getelementptr inbounds i32, i32* %19, i64 %78
%80 = getelementptr inbounds i8, i8* %71, i64 1
store i8 46, i8* %71
%81 = icmp eq i32 %61, 0
br i1 %81, label %11, label %13
82: ; preds = %13
%83 = icmp eq i32 %17, 0
br i1 %83, label %84, label %86
84: ; preds = %82
%85 = tail call i32 (i8*, ...) @L_DEBUG(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %31
86: ; preds = %82
store i8 0, i8* %16
%87 = ptrtoint i32* %19 to i64
%88 = ptrtoint i32* %1 to i64
%89 = sub i64 %87, %88
%90 = lshr exact i64 %89, 2
%91 = trunc i64 %90 to i32
br label %31
}