void printresponse(const unsigned char *resp, int n) {
  int i, l;
  int notif_type;
  unsigned int nresp;
  const unsigned char *p;
  if (n == 0)
    return;
  for (i = 0; i < n; i += 16) {
    printf("%06x | ", i);
    for (l = i; l < n && l < (i + 16); l++)
      printf("%02x ", resp[l]);
    while (l < (i + 16)) {
      printf("   ");
      l++;
    }
    printf("| ");
    for (l = i; l < n && l < (i + 16); l++)
      putchar((resp[l] >= ' ' && resp[l] < 128) ? resp[l] : '.');
    putchar('\n');
  }
  for (p = resp; p < resp + n;) {
    nresp = p[0];
    if (nresp == 0xff) {
      notif_type = p[1];
      nresp = p[2];
      printf("Notification : ");
      switch (notif_type) {
      case 1:
        printf("new\n");
        break;
      case 2:
        printf("update\n");
        break;
      case 3:
        printf("remove\n");
        break;
      default:
        printf("**UNKNOWN**\n");
      }
      p += 3;
    } else {
      p++;
    }
    for (i = 0; i < (int)nresp; i++) {
      if (p >= resp + n)
        goto error;
      l = 0;
      do {
        l = (l << 7) | (*p & 0x7f);
      } while ((*(p++) & 0x80) && (l < (1 << 25)));
      ;
      if (p + l > resp + n)
        goto error;
      printf("%d - %.*s\n", i, l, p);
      p += l;
      if (p >= resp + n)
        goto error;
      l = 0;
      do {
        l = (l << 7) | (*p & 0x7f);
      } while ((*(p++) & 0x80) && (l < (1 << 25)));
      ;
      if (p + l > resp + n)
        goto error;
      printf("    %.*s\n", l, p);
      p += l;
      if (p >= resp + n)
        goto error;
      l = 0;
      do {
        l = (l << 7) | (*p & 0x7f);
      } while ((*(p++) & 0x80) && (l < (1 << 25)));
      ;
      if (p + l > resp + n)
        goto error;
      printf("    %.*s\n", l, p);
      p += l;
    }
  }
  return;
error:
  printf("*** WARNING : TRUNCATED RESPONSE ***\n");
}


x86 assembly (clang, -O0):
<printresponse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <printresponse+0x1e>
jmp    162d <printresponse+0x50d>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12b9 <printresponse+0x199>
mov    -0x10(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x29(%rbp)
jge    118a <printresponse+0x6a>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x10,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    119a <printresponse+0x7a>
jmp    11c2 <printresponse+0xa2>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1168 <printresponse+0x48>
jmp    11c7 <printresponse+0xa7>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x10,%ecx
cmp    %ecx,%eax
jge    11f4 <printresponse+0xd4>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c7 <printresponse+0xa7>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x2a(%rbp)
jge    122a <printresponse+0x10a>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x10,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
test   $0x1,%al
jne    123a <printresponse+0x11a>
jmp    129f <printresponse+0x17f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     127a <printresponse+0x15a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jge    127a <printresponse+0x15a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x30(%rbp)
jmp    1287 <printresponse+0x167>
mov    $0x2e,%eax
mov    %eax,-0x30(%rbp)
jmp    1287 <printresponse+0x167>
mov    -0x30(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1208 <printresponse+0xe8>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <printresponse+0x25>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    161a <printresponse+0x4fa>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xff,-0x1c(%rbp)
jne    13a2 <printresponse+0x282>
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x1c(%rbp)
lea    0xd05(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x1,%eax
je     134a <printresponse+0x22a>
jmp    1328 <printresponse+0x208>
mov    -0x34(%rbp),%eax
sub    $0x2,%eax
je     135d <printresponse+0x23d>
jmp    1339 <printresponse+0x219>
mov    -0x34(%rbp),%eax
sub    $0x3,%eax
je     1370 <printresponse+0x250>
jmp    1383 <printresponse+0x263>
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1391 <printresponse+0x271>
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1391 <printresponse+0x271>
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1391 <printresponse+0x271>
lea    0xcad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x28(%rbp)
jmp    13ae <printresponse+0x28e>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1615 <printresponse+0x4f5>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jb     13de <printresponse+0x2be>
jmp    161f <printresponse+0x4ff>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x7,%eax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0x7f,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movzbl (%rax),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x35(%rbp)
je     142d <printresponse+0x30d>
cmpl   $0x2000000,-0x14(%rbp)
setl   %al
mov    %al,-0x35(%rbp)
mov    -0x35(%rbp),%al
test   $0x1,%al
jne    13e5 <printresponse+0x2c5>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jbe    145c <printresponse+0x33c>
jmp    161f <printresponse+0x4ff>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%rcx
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jb     14a2 <printresponse+0x382>
jmp    161f <printresponse+0x4ff>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x7,%eax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0x7f,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movzbl (%rax),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x36(%rbp)
je     14f1 <printresponse+0x3d1>
cmpl   $0x2000000,-0x14(%rbp)
setl   %al
mov    %al,-0x36(%rbp)
mov    -0x36(%rbp),%al
test   $0x1,%al
jne    14a9 <printresponse+0x389>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jbe    1520 <printresponse+0x400>
jmp    161f <printresponse+0x4ff>
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
lea    0xb21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jb     1563 <printresponse+0x443>
jmp    161f <printresponse+0x4ff>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x7,%eax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0x7f,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movzbl (%rax),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x37(%rbp)
je     15b2 <printresponse+0x492>
cmpl   $0x2000000,-0x14(%rbp)
setl   %al
mov    %al,-0x37(%rbp)
mov    -0x37(%rbp),%al
test   $0x1,%al
jne    156a <printresponse+0x44a>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jbe    15e1 <printresponse+0x4c1>
jmp    161f <printresponse+0x4ff>
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
lea    0xa60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13b5 <printresponse+0x295>
jmp    12c1 <printresponse+0x1a1>
jmp    162d <printresponse+0x50d>
lea    0xa33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printresponse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
je     140a <printresponse+0x2da>
jle    140a <printresponse+0x2da>
mov    %esi,%ebp
mov    %rdi,%r13
mov    $0x2,%ebx
mov    $0x1,%r14d
xor    %r12d,%r12d
jmp    1190 <printresponse+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    0xc(%rsp),%ebx
add    $0x10,%ebx
add    $0x10,%r14
cmp    %ebp,%r12d
jge    126f <printresponse+0x13f>
mov    %r14,0x10(%rsp)
mov    %r12,%r14
lea    0xe61(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%r12
mov    %ebx,0xc(%rsp)
mov    %ebx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%r15d
mov    %r14d,%ebx
movzbl 0x0(%r13,%r14,1),%esi
lea    0xe35(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14
lea    0x1(%rbx),%eax
cmp    %ebp,%eax
jge    11ee <printresponse+0xbe>
lea    0x1(%r15),%eax
cmp    %r12,%r14
jb     11c0 <printresponse+0x90>
mov    %r14d,%eax
cmp    %rax,%r12
lea    0xe13(%rip),%rbx
jbe    1216 <printresponse+0xe6>
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15d,%eax
add    $0x1,%r15d
cmp    %rax,%r12
ja     1200 <printresponse+0xd0>
lea    0xde8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%r14
mov    %r14,%rbx
mov    $0x2e,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x1(%r13,%rbx,1),%eax
cmp    $0x20,%al
cmovl  %r15d,%eax
movzbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
cmp    %ebp,%ebx
jge    1170 <printresponse+0x40>
lea    0x1(%rbx),%rax
cmp    %r12,%rbx
mov    %rax,%rbx
jb     1240 <printresponse+0x110>
jmp    1170 <printresponse+0x40>
test   %ebp,%ebp
jle    140a <printresponse+0x2da>
movslq %ebp,%r12
add    %r13,%r12
lea    0xd8e(%rip),%r14
lea    0xde3(%rip),%r15
mov    0x0(%r13),%bpl
cmp    $0xff,%bpl
je     12a8 <printresponse+0x178>
add    $0x1,%r13
test   %bpl,%bpl
jne    12e5 <printresponse+0x1b5>
cmp    %r12,%r13
jb     128b <printresponse+0x15b>
jmp    140a <printresponse+0x2da>
mov    0x1(%r13),%bl
mov    0x2(%r13),%bpl
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xff,%bl
mov    %r15,%rdi
cmp    $0x2,%bl
ja     12d7 <printresponse+0x1a7>
movsbq %bl,%rax
lea    0xdac(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <puts@plt>
add    $0x3,%r13
test   %bpl,%bpl
je     129e <printresponse+0x16e>
movzbl %bpl,%eax
mov    %eax,0xc(%rsp)
xor    %ebx,%ebx
nop
cmp    %r12,%r13
jae    1419 <printresponse+0x2e9>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
shl    $0x7,%edx
movzbl 0x0(%r13),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
movslq %edx,%rdx
or     %rcx,%rdx
add    $0x1,%r13
test   $0x80,%al
je     1323 <printresponse+0x1f3>
cmp    $0x2000000,%edx
jl     1300 <printresponse+0x1d0>
mov    %rdx,%r14
add    %r13,%r14
cmp    %r12,%r14
ja     1419 <printresponse+0x2e9>
lea    0xce9(%rip),%rdi
mov    %ebx,%esi
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r12,%r14
jae    1419 <printresponse+0x2e9>
xor    %esi,%esi
shl    $0x7,%esi
movzbl (%r14),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
movslq %esi,%rsi
or     %rcx,%rsi
add    $0x1,%r14
test   $0x80,%al
je     1372 <printresponse+0x242>
cmp    $0x2000000,%esi
jl     1350 <printresponse+0x220>
mov    %rsi,%r15
add    %r14,%r15
cmp    %r12,%r15
ja     1419 <printresponse+0x2e9>
lea    0xca5(%rip),%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r12,%r15
jae    1419 <printresponse+0x2e9>
xor    %ebp,%ebp
nopl   (%rax)
shl    $0x7,%ebp
movzbl (%r15),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
movslq %ebp,%rbp
or     %rcx,%rbp
add    $0x1,%r15
test   $0x80,%al
je     13c2 <printresponse+0x292>
cmp    $0x2000000,%ebp
jl     13a0 <printresponse+0x270>
movslq %ebp,%r13
add    %r15,%r13
cmp    %r12,%r13
ja     1419 <printresponse+0x2e9>
lea    0xc59(%rip),%rdi
mov    %ebp,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jne    12f0 <printresponse+0x1c0>
add    %rbp,%r15
mov    %r15,%r13
lea    0xc18(%rip),%r14
lea    0xc6d(%rip),%r15
cmp    %r12,%r13
jb     128b <printresponse+0x15b>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc17(%rip),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%06x | \00"
@.str.1 = [6 x i8] c"%02x \00"
@.str.2 = [4 x i8] c" \00"
@.str.3 = [3 x i8] c"| \00"
@.str.4 = [16 x i8] c"Notification : \00"
@.str.5 = [5 x i8] c"new\0A\00"
@.str.6 = [8 x i8] c"update\0A\00"
@.str.7 = [8 x i8] c"remove\0A\00"
@.str.8 = [13 x i8] c"**UNKNOWN**\0A\00"
@.str.9 = [11 x i8] c"%d - %.*s\0A\00"
@.str.10 = [10 x i8] c" %.*s\0A\00"
@.str.11 = [38 x i8] c"*** WARNING : TRUNCATED RESPONSE ***\0A\00"
define void @printresponse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
br label %299
13: ; preds = %2
store i32 0, i32* %5
br label %14
14: ; preds = %100, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %103
18: ; preds = %14
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %5
store i32 %21, i32* %6
br label %22
22: ; preds = %41, %18
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i32, i32* %6
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 16
%30 = icmp slt i32 %27, %29
br label %31
31: ; preds = %26, %22
%32 = phi i1 [ false, %22 ], [ %30, %26 ]
br i1 %32, label %33, label %44
33: ; preds = %31
%34 = load i8*, i8** %3
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %33
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %22
44: ; preds = %31
br label %45
45: ; preds = %50, %44
%46 = load i32, i32* %6
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 16
%49 = icmp slt i32 %46, %48
br i1 %49, label %50, label %54
50: ; preds = %45
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
br label %45
54: ; preds = %45
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* %5
store i32 %56, i32* %6
br label %57
57: ; preds = %95, %54
%58 = load i32, i32* %6
%59 = load i32, i32* %4
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %66
61: ; preds = %57
%62 = load i32, i32* %6
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 16
%65 = icmp slt i32 %62, %64
br label %66
66: ; preds = %61, %57
%67 = phi i1 [ false, %57 ], [ %65, %61 ]
br i1 %67, label %68, label %98
68: ; preds = %66
%69 = load i8*, i8** %3
%70 = load i32, i32* %6
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = icmp sge i32 %74, 32
br i1 %75, label %76, label %91
76: ; preds = %68
%77 = load i8*, i8** %3
%78 = load i32, i32* %6
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %77, i64 %79
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = icmp slt i32 %82, 128
br i1 %83, label %84, label %91
84: ; preds = %76
%85 = load i8*, i8** %3
%86 = load i32, i32* %6
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
br label %92
91: ; preds = %76, %68
br label %92
92: ; preds = %91, %84
%93 = phi i32 [ %90, %84 ], [ 46, %91 ]
%94 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %93)
br label %95
95: ; preds = %92
%96 = load i32, i32* %6
%97 = add nsw i32 %96, 1
store i32 %97, i32* %6
br label %57
98: ; preds = %66
%99 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
br label %100
100: ; preds = %98
%101 = load i32, i32* %5
%102 = add nsw i32 %101, 16
store i32 %102, i32* %5
br label %14
103: ; preds = %14
%104 = load i8*, i8** %3
store i8* %104, i8** %9
br label %105
105: ; preds = %295, %103
%106 = load i8*, i8** %9
%107 = load i8*, i8** %3
%108 = load i32, i32* %4
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
%111 = icmp ult i8* %106, %110
br i1 %111, label %112, label %296
112: ; preds = %105
%113 = load i8*, i8** %9
%114 = getelementptr inbounds i8, i8* %113, i64 0
%115 = load i8, i8* %114
%116 = zext i8 %115 to i32
store i32 %116, i32* %8
%117 = load i32, i32* %8
%118 = icmp eq i32 %117, 255
br i1 %118, label %119, label %141
119: ; preds = %112
%120 = load i8*, i8** %9
%121 = getelementptr inbounds i8, i8* %120, i64 1
%122 = load i8, i8* %121
%123 = zext i8 %122 to i32
store i32 %123, i32* %7
%124 = load i8*, i8** %9
%125 = getelementptr inbounds i8, i8* %124, i64 2
%126 = load i8, i8* %125
%127 = zext i8 %126 to i32
store i32 %127, i32* %8
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%129 = load i32, i32* %7
switch i32 %129, label %136 [
i32 1, label %130
i32 2, label %132
i32 3, label %134
]
130: ; preds = %119
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %138
132: ; preds = %119
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %138
134: ; preds = %119
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %138
136: ; preds = %119
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %138
138: ; preds = %136, %134, %132, %130
%139 = load i8*, i8** %9
%140 = getelementptr inbounds i8, i8* %139, i64 3
store i8* %140, i8** %9
br label %144
141: ; preds = %112
%142 = load i8*, i8** %9
%143 = getelementptr inbounds i8, i8* %142, i32 1
store i8* %143, i8** %9
br label %144
144: ; preds = %141, %138
store i32 0, i32* %5
br label %145
145: ; preds = %292, %144
%146 = load i32, i32* %5
%147 = load i32, i32* %8
%148 = icmp slt i32 %146, %147
br i1 %148, label %149, label %295
149: ; preds = %145
%150 = load i8*, i8** %9
%151 = load i8*, i8** %3
%152 = load i32, i32* %4
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %151, i64 %153
%155 = icmp uge i8* %150, %154
br i1 %155, label %156, label %157
156: ; preds = %149
br label %297
157: ; preds = %149
store i32 0, i32* %6
br label %158
158: ; preds = %176, %157
%159 = load i32, i32* %6
%160 = shl i32 %159, 7
%161 = load i8*, i8** %9
%162 = load i8, i8* %161
%163 = zext i8 %162 to i32
%164 = and i32 %163, 127
%165 = or i32 %160, %164
store i32 %165, i32* %6
br label %166
166: ; preds = %158
%167 = load i8*, i8** %9
%168 = getelementptr inbounds i8, i8* %167, i32 1
store i8* %168, i8** %9
%169 = load i8, i8* %167
%170 = zext i8 %169 to i32
%171 = and i32 %170, 128
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %176
173: ; preds = %166
%174 = load i32, i32* %6
%175 = icmp slt i32 %174, 33554432
br label %176
176: ; preds = %173, %166
%177 = phi i1 [ false, %166 ], [ %175, %173 ]
br i1 %177, label %158, label %178
178: ; preds = %176
%179 = load i8*, i8** %9
%180 = load i32, i32* %6
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %179, i64 %181
%183 = load i8*, i8** %3
%184 = load i32, i32* %4
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i8, i8* %183, i64 %185
%187 = icmp ugt i8* %182, %186
br i1 %187, label %188, label %189
188: ; preds = %178
br label %297
189: ; preds = %178
%190 = load i32, i32* %5
%191 = load i32, i32* %6
%192 = load i8*, i8** %9
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %190, i32 %191, i8* %192)
%194 = load i32, i32* %6
%195 = load i8*, i8** %9
%196 = sext i32 %194 to i64
%197 = getelementptr inbounds i8, i8* %195, i64 %196
store i8* %197, i8** %9
%198 = load i8*, i8** %9
%199 = load i8*, i8** %3
%200 = load i32, i32* %4
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i8, i8* %199, i64 %201
%203 = icmp uge i8* %198, %202
br i1 %203, label %204, label %205
204: ; preds = %189
br label %297
205: ; preds = %189
store i32 0, i32* %6
br label %206
206: ; preds = %224, %205
%207 = load i32, i32* %6
%208 = shl i32 %207, 7
%209 = load i8*, i8** %9
%210 = load i8, i8* %209
%211 = zext i8 %210 to i32
%212 = and i32 %211, 127
%213 = or i32 %208, %212
store i32 %213, i32* %6
br label %214
214: ; preds = %206
%215 = load i8*, i8** %9
%216 = getelementptr inbounds i8, i8* %215, i32 1
store i8* %216, i8** %9
%217 = load i8, i8* %215
%218 = zext i8 %217 to i32
%219 = and i32 %218, 128
%220 = icmp ne i32 %219, 0
br i1 %220, label %221, label %224
221: ; preds = %214
%222 = load i32, i32* %6
%223 = icmp slt i32 %222, 33554432
br label %224
224: ; preds = %221, %214
%225 = phi i1 [ false, %214 ], [ %223, %221 ]
br i1 %225, label %206, label %226
226: ; preds = %224
%227 = load i8*, i8** %9
%228 = load i32, i32* %6
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds i8, i8* %227, i64 %229
%231 = load i8*, i8** %3
%232 = load i32, i32* %4
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i8, i8* %231, i64 %233
%235 = icmp ugt i8* %230, %234
br i1 %235, label %236, label %237
236: ; preds = %226
br label %297
237: ; preds = %226
%238 = load i32, i32* %6
%239 = load i8*, i8** %9
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %238, i8* %239)
%241 = load i32, i32* %6
%242 = load i8*, i8** %9
%243 = sext i32 %241 to i64
%244 = getelementptr inbounds i8, i8* %242, i64 %243
store i8* %244, i8** %9
%245 = load i8*, i8** %9
%246 = load i8*, i8** %3
%247 = load i32, i32* %4
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i8, i8* %246, i64 %248
%250 = icmp uge i8* %245, %249
br i1 %250, label %251, label %252
251: ; preds = %237
br label %297
252: ; preds = %237
store i32 0, i32* %6
br label %253
253: ; preds = %271, %252
%254 = load i32, i32* %6
%255 = shl i32 %254, 7
%256 = load i8*, i8** %9
%257 = load i8, i8* %256
%258 = zext i8 %257 to i32
%259 = and i32 %258, 127
%260 = or i32 %255, %259
store i32 %260, i32* %6
br label %261
261: ; preds = %253
%262 = load i8*, i8** %9
%263 = getelementptr inbounds i8, i8* %262, i32 1
store i8* %263, i8** %9
%264 = load i8, i8* %262
%265 = zext i8 %264 to i32
%266 = and i32 %265, 128
%267 = icmp ne i32 %266, 0
br i1 %267, label %268, label %271
268: ; preds = %261
%269 = load i32, i32* %6
%270 = icmp slt i32 %269, 33554432
br label %271
271: ; preds = %268, %261
%272 = phi i1 [ false, %261 ], [ %270, %268 ]
br i1 %272, label %253, label %273
273: ; preds = %271
%274 = load i8*, i8** %9
%275 = load i32, i32* %6
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds i8, i8* %274, i64 %276
%278 = load i8*, i8** %3
%279 = load i32, i32* %4
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds i8, i8* %278, i64 %280
%282 = icmp ugt i8* %277, %281
br i1 %282, label %283, label %284
283: ; preds = %273
br label %297
284: ; preds = %273
%285 = load i32, i32* %6
%286 = load i8*, i8** %9
%287 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %285, i8* %286)
%288 = load i32, i32* %6
%289 = load i8*, i8** %9
%290 = sext i32 %288 to i64
%291 = getelementptr inbounds i8, i8* %289, i64 %290
store i8* %291, i8** %9
br label %292
292: ; preds = %284
%293 = load i32, i32* %5
%294 = add nsw i32 %293, 1
store i32 %294, i32* %5
br label %145
295: ; preds = %145
br label %105
296: ; preds = %105
br label %299
297: ; preds = %283, %251, %236, %204, %188, %156
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0))
br label %299
299: ; preds = %297, %296, %12
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%06x | \00"
@.str.1 = [6 x i8] c"%02x \00"
@.str.2 = [4 x i8] c" \00"
@.str.3 = [3 x i8] c"| \00"
@.str.4 = [16 x i8] c"Notification : \00"
@.str.9 = [11 x i8] c"%d - %.*s\0A\00"
@.str.10 = [10 x i8] c" %.*s\0A\00"
@str = [37 x i8] c"*** WARNING : TRUNCATED RESPONSE ***\00"
@str.12 = [7 x i8] c"remove\00"
@str.13 = [7 x i8] c"update\00"
@str.14 = [4 x i8] c"new\00"
@str.15 = [12 x i8] c"**UNKNOWN**\00"
@reltable.printresponse = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.14 to i64), i64 ptrtoint ([3 x i32]* @reltable.printresponse to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.13 to i64), i64 ptrtoint ([3 x i32]* @reltable.printresponse to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.12 to i64), i64 ptrtoint ([3 x i32]* @reltable.printresponse to i64)) to i32)]
define void @printresponse(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %150, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %9, label %150
6: ; preds = %51
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br i1 %5, label %58, label %150
9: ; preds = %4, %51
%10 = phi i64 [ %13, %51 ], [ 0, %4 ]
%11 = trunc i64 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw i64 %10, 16
br label %19
14: ; preds = %19
%15 = and i64 %25, 4294967295
%16 = icmp ugt i64 %13, %15
br i1 %16, label %17, label %36
17: ; preds = %14
%18 = trunc i64 %25 to i32
br label %30
19: ; preds = %9, %19
%20 = phi i64 [ %10, %9 ], [ %25, %19 ]
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = add nuw i64 %20, 1
%26 = trunc i64 %25 to i32
%27 = icmp slt i32 %26, %1
%28 = icmp ult i64 %25, %13
%29 = select i1 %27, i1 %28, i1 false
br i1 %29, label %19, label %14
30: ; preds = %17, %30
%31 = phi i32 [ %33, %30 ], [ %18, %17 ]
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%33 = add nuw nsw i32 %31, 1
%34 = zext i32 %33 to i64
%35 = icmp ugt i64 %13, %34
br i1 %35, label %30, label %36
36: ; preds = %30, %14
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %38
38: ; preds = %36, %38
%39 = phi i64 [ %10, %36 ], [ %46, %38 ]
%40 = getelementptr inbounds i8, i8* %0, i64 %39
%41 = load i8, i8* %40
%42 = icmp sgt i8 %41, 31
%43 = select i1 %42, i8 %41, i8 46
%44 = zext i8 %43 to i32
%45 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %44)
%46 = add nuw i64 %39, 1
%47 = trunc i64 %46 to i32
%48 = icmp slt i32 %47, %1
%49 = icmp ult i64 %46, %13
%50 = select i1 %48, i1 %49, i1 false
br i1 %50, label %38, label %51
51: ; preds = %38
%52 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
%53 = trunc i64 %13 to i32
%54 = icmp slt i32 %53, %1
br i1 %54, label %9, label %6
55: ; preds = %144, %78
%56 = phi i8* [ %80, %78 ], [ %142, %144 ]
%57 = icmp ult i8* %56, %8
br i1 %57, label %58, label %150
58: ; preds = %6, %55
%59 = phi i8* [ %56, %55 ], [ %0, %6 ]
%60 = load i8, i8* %59
%61 = icmp eq i8 %60, -1
%62 = getelementptr inbounds i8, i8* %59, i64 1
br i1 %61, label %63, label %78
63: ; preds = %58
%64 = load i8, i8* %62
%65 = getelementptr inbounds i8, i8* %59, i64 2
%66 = load i8, i8* %65
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%68 = add i8 %64, -1
%69 = icmp ult i8 %68, 3
br i1 %69, label %70, label %74
70: ; preds = %63
%71 = sext i8 %68 to i64
%72 = shl i64 %71, 2
%73 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.printresponse to i8*), i64 %72)
br label %74
74: ; preds = %63, %70
%75 = phi i8* [ %73, %70 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0), %63 ]
%76 = tail call i32 @puts(i8* dereferenceable(1) %75)
%77 = getelementptr inbounds i8, i8* %59, i64 3
br label %78
78: ; preds = %58, %74
%79 = phi i8 [ %66, %74 ], [ %60, %58 ]
%80 = phi i8* [ %77, %74 ], [ %62, %58 ]
%81 = zext i8 %79 to i32
%82 = icmp eq i8 %79, 0
br i1 %82, label %55, label %83
83: ; preds = %78, %144
%84 = phi i8* [ %142, %144 ], [ %80, %78 ]
%85 = phi i32 [ %146, %144 ], [ 0, %78 ]
%86 = icmp ult i8* %84, %8
br i1 %86, label %87, label %148
87: ; preds = %83, %87
%88 = phi i32 [ %94, %87 ], [ 0, %83 ]
%89 = phi i8* [ %95, %87 ], [ %84, %83 ]
%90 = shl i32 %88, 7
%91 = load i8, i8* %89
%92 = zext i8 %91 to i32
%93 = and i32 %92, 127
%94 = or i32 %93, %90
%95 = getelementptr inbounds i8, i8* %89, i64 1
%96 = and i32 %92, 128
%97 = icmp ne i32 %96, 0
%98 = icmp slt i32 %94, 33554432
%99 = select i1 %97, i1 %98, i1 false
br i1 %99, label %87, label %100
100: ; preds = %87
%101 = sext i32 %94 to i64
%102 = getelementptr inbounds i8, i8* %95, i64 %101
%103 = icmp ugt i8* %102, %8
br i1 %103, label %148, label %104
104: ; preds = %100
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %85, i32 %94, i8* %95)
%106 = icmp ult i8* %102, %8
br i1 %106, label %107, label %148
107: ; preds = %104, %107
%108 = phi i32 [ %114, %107 ], [ 0, %104 ]
%109 = phi i8* [ %115, %107 ], [ %102, %104 ]
%110 = shl i32 %108, 7
%111 = load i8, i8* %109
%112 = zext i8 %111 to i32
%113 = and i32 %112, 127
%114 = or i32 %113, %110
%115 = getelementptr inbounds i8, i8* %109, i64 1
%116 = and i32 %112, 128
%117 = icmp ne i32 %116, 0
%118 = icmp slt i32 %114, 33554432
%119 = select i1 %117, i1 %118, i1 false
br i1 %119, label %107, label %120
120: ; preds = %107
%121 = sext i32 %114 to i64
%122 = getelementptr inbounds i8, i8* %115, i64 %121
%123 = icmp ugt i8* %122, %8
br i1 %123, label %148, label %124
124: ; preds = %120
%125 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %114, i8* %115)
%126 = icmp ult i8* %122, %8
br i1 %126, label %127, label %148
127: ; preds = %124, %127
%128 = phi i32 [ %134, %127 ], [ 0, %124 ]
%129 = phi i8* [ %135, %127 ], [ %122, %124 ]
%130 = shl i32 %128, 7
%131 = load i8, i8* %129
%132 = zext i8 %131 to i32
%133 = and i32 %132, 127
%134 = or i32 %133, %130
%135 = getelementptr inbounds i8, i8* %129, i64 1
%136 = and i32 %132, 128
%137 = icmp ne i32 %136, 0
%138 = icmp slt i32 %134, 33554432
%139 = select i1 %137, i1 %138, i1 false
br i1 %139, label %127, label %140
140: ; preds = %127
%141 = sext i32 %134 to i64
%142 = getelementptr inbounds i8, i8* %135, i64 %141
%143 = icmp ugt i8* %142, %8
br i1 %143, label %148, label %144
144: ; preds = %140
%145 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %134, i8* %135)
%146 = add nuw nsw i32 %85, 1
%147 = icmp eq i32 %146, %81
br i1 %147, label %55, label %83
148: ; preds = %140, %124, %120, %104, %100, %83
%149 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %150
150: ; preds = %55, %4, %6, %2, %148
ret void
}