#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 /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ lkerr(char *);
char *tstr(char **pp, int xlate) {
  char *p;
  char ch;
  int i;
  static char buf[10];
  static char tstr_control_k[] = {(('K') & 037), 40, 6, 1, 1, 1, '\0'};
  p = *pp;
  switch (*p) {
  case '\\':
    ++p;
    switch (*p) {
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
      ch = 0;
      i = 0;
      do
        ch = 8 * ch + (*p - '0');
      while (*++p >= '0' && *p <= '7' && ++i < 3);
      *pp = p;
      if (xlate && ch == (('K') & 037))
        return (tstr_control_k);
      buf[0] = ch;
      buf[1] = '\0';
      return (buf);
    case 'b':
      *pp = p + 1;
      return ("\b");
    case 'e':
      *pp = p + 1;
      buf[0] = (('[') & 037);
      buf[1] = '\0';
      return (buf);
    case 'n':
      *pp = p + 1;
      return ("\n");
    case 'r':
      *pp = p + 1;
      return ("\r");
    case 't':
      *pp = p + 1;
      return ("\t");
    case 'k':
      if (xlate) {
        switch (*++p) {
        case 'u':
          ch = 3;
          break;
        case 'd':
          ch = 4;
          break;
        case 'r':
          ch = 1;
          break;
        case 'l':
          ch = 2;
          break;
        case 'U':
          ch = 5;
          break;
        case 'D':
          ch = 6;
          break;
        case 'h':
          ch = 7;
          break;
        case 'e':
          ch = 8;
          break;
        case 'x':
          ch = 9;
          break;
        default:
          lkerr("illegal char after \\k");
          *pp = p + 1;
          return ("");
        }
        *pp = p + 1;
        buf[0] = (('K') & 037);
        buf[1] = ch;
        buf[2] = 6;
        buf[3] = 1;
        buf[4] = 1;
        buf[5] = 1;
        buf[6] = '\0';
        return (buf);
      }
    default:
      *pp = p + 1;
      buf[0] = *p;
      buf[1] = '\0';
      if (xlate && buf[0] == (('K') & 037))
        return (tstr_control_k);
      return (buf);
    }
  case '^':
    *pp = p + 2;
    buf[0] = ((p[1]) & 037);
    buf[1] = '\0';
    if (buf[0] == (('K') & 037))
      return (tstr_control_k);
    return (buf);
  }
  *pp = p + 1;
  buf[0] = *p;
  buf[1] = '\0';
  if (xlate && buf[0] == (('K') & 037))
    return (tstr_control_k);
  return (buf);
}


x86 assembly (clang, -O0):
<tstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x5c,%eax
je     1153 <tstr+0x43>
jmp    1142 <tstr+0x32>
mov    -0x2c(%rbp),%eax
sub    $0x5e,%eax
je     146d <tstr+0x35d>
jmp    14c4 <tstr+0x3b4>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x44,%eax
ja     1411 <tstr+0x301>
mov    -0x38(%rbp),%rax
lea    0xe7d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x21(%rbp)
movl   $0x0,-0x28(%rbp)
movsbl -0x21(%rbp),%eax
shl    $0x3,%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x39(%rbp)
jl     11f5 <tstr+0xe5>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x37,%ecx
mov    %al,-0x39(%rbp)
jg     11f5 <tstr+0xe5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmp    $0x3,%eax
setl   %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    1197 <tstr+0x87>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
cmpl   $0x0,-0x14(%rbp)
je     1232 <tstr+0x122>
movsbl -0x21(%rbp),%eax
cmp    $0xb,%eax
jne    1232 <tstr+0x122>
lea    0x2dff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x21(%rbp),%al
mov    %al,0x2df5(%rip)
movb   $0x0,0x2def(%rip)
lea    0x2de7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    0xf80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movb   $0x1b,0x2da9(%rip)
movb   $0x0,0x2da3(%rip)
lea    0x2d9b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    0xf36(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    0xf19(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    0xefc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
cmpl   $0x0,-0x14(%rbp)
je     140c <tstr+0x2fc>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl 0x1(%rax),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x34,%eax
ja     138f <tstr+0x27f>
mov    -0x48(%rbp),%rax
lea    0xddf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x3,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x4,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x1,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x2,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x5,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x6,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x7,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x8,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
movb   $0x9,-0x21(%rbp)
jmp    13ba <tstr+0x2aa>
lea    0xe5a(%rip),%rdi
call   1030 <lkerr@plt>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    0xe38(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movb   $0xb,0x2c60(%rip)
mov    -0x21(%rbp),%al
mov    %al,0x2c58(%rip)
movb   $0x6,0x2c52(%rip)
movb   $0x1,0x2c4c(%rip)
movb   $0x1,0x2c46(%rip)
movb   $0x1,0x2c40(%rip)
movb   $0x0,0x2c3a(%rip)
lea    0x2c2d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
jmp    1411 <tstr+0x301>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2c04(%rip)
movb   $0x0,0x2bfe(%rip)
cmpl   $0x0,-0x14(%rbp)
je     145d <tstr+0x34d>
movsbl 0x2bec(%rip),%eax
cmp    $0xb,%eax
jne    145d <tstr+0x34d>
lea    0x2bd4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
lea    0x2bcc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x2,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x1f,%eax
mov    %al,0x2ba3(%rip)
movb   $0x0,0x2b9d(%rip)
movsbl 0x2b95(%rip),%eax
cmp    $0xb,%eax
jne    14b4 <tstr+0x3a4>
lea    0x2b7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
lea    0x2b75(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2b51(%rip)
movb   $0x0,0x2b4b(%rip)
cmpl   $0x0,-0x14(%rbp)
je     1510 <tstr+0x400>
movsbl 0x2b39(%rip),%eax
cmp    $0xb,%eax
jne    1510 <tstr+0x400>
lea    0x2b21(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    151b <tstr+0x40b>
lea    0x2b19(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
movsbl (%rbx),%eax
cmp    $0x5e,%eax
je     1189 <tstr+0x79>
cmp    $0x5c,%eax
jne    11b8 <tstr+0xa8>
movsbl 0x1(%rbx),%eax
lea    -0x30(%rax),%ecx
cmp    $0x44,%ecx
ja     127a <tstr+0x16a>
lea    0xebe(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
movzbl %al,%eax
add    $0xffffffd0,%eax
movzbl 0x2(%rbx),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
cmp    $0x30,%dl
jne    11f0 <tstr+0xe0>
movsbl %al,%eax
lea    (%rcx,%rax,8),%eax
add    $0xffffffd0,%eax
movzbl 0x3(%rbx),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
cmp    $0x30,%dl
jne    11f6 <tstr+0xe6>
movsbl %al,%eax
lea    (%rcx,%rax,8),%eax
add    $0xffffffd0,%eax
add    $0x4,%rbx
jmp    11fa <tstr+0xea>
lea    0x2(%rbx),%rax
mov    %rax,(%r14)
mov    0x1(%rbx),%al
and    $0x1f,%al
mov    %al,0x2e95(%rip)
lea    0x2e8e(%rip),%rcx
movb   $0x0,0x2e88(%rip)
cmp    $0xb,%al
lea    0x2e76(%rip),%rax
cmovne %rcx,%rax
jmp    11e8 <tstr+0xd8>
lea    0x1(%rbx),%rax
mov    %rax,(%r14)
mov    (%rbx),%al
mov    %al,0x2e69(%rip)
lea    0x2e62(%rip),%rcx
cmp    $0xb,%al
lea    0x2e51(%rip),%rax
cmovne %rcx,%rax
movb   $0x0,0x2e4f(%rip)
test   %esi,%esi
cmove  %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
add    $0x2,%rbx
jmp    11fa <tstr+0xea>
add    $0x3,%rbx
mov    %rbx,(%r14)
test   %esi,%esi
je     1212 <tstr+0x102>
movzbl %al,%ecx
cmp    $0xb,%ecx
jne    1212 <tstr+0x102>
lea    0x2e18(%rip),%rax
jmp    11e8 <tstr+0xd8>
mov    %al,0x2e18(%rip)
lea    0x2e11(%rip),%rax
movb   $0x0,0x2e0b(%rip)
jmp    11e8 <tstr+0xd8>
add    $0x2,%rbx
mov    %rbx,(%r14)
lea    0xfb2(%rip),%rax
jmp    11e8 <tstr+0xd8>
add    $0x2,%rbx
mov    %rbx,(%r14)
movw   $0x1b,0x2de8(%rip)
lea    0x2de1(%rip),%rax
jmp    11e8 <tstr+0xd8>
test   %esi,%esi
je     127a <tstr+0x16a>
movsbl 0x2(%rbx),%eax
add    $0xffffffbc,%eax
cmp    $0x34,%eax
ja     12c2 <tstr+0x1b2>
mov    $0x3,%cl
lea    0xeaa(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
mov    $0x6,%cl
jmp    12fb <tstr+0x1eb>
lea    0x2(%rbx),%rax
mov    %rax,(%r14)
mov    0x1(%rbx),%al
jmp    11c1 <tstr+0xb1>
add    $0x2,%rbx
mov    %rbx,(%r14)
lea    0xf53(%rip),%rax
jmp    11e8 <tstr+0xd8>
add    $0x2,%rbx
mov    %rbx,(%r14)
lea    0xf42(%rip),%rax
jmp    11e8 <tstr+0xd8>
add    $0x2,%rbx
mov    %rbx,(%r14)
lea    0xf31(%rip),%rax
jmp    11e8 <tstr+0xd8>
lea    0xf27(%rip),%rdi
call   1030 <lkerr@plt>
add    $0x3,%rbx
mov    %rbx,(%r14)
lea    0xf0d(%rip),%rax
jmp    11e8 <tstr+0xd8>
mov    $0x5,%cl
jmp    12fb <tstr+0x1eb>
mov    $0x4,%cl
jmp    12fb <tstr+0x1eb>
mov    $0x8,%cl
jmp    12fb <tstr+0x1eb>
mov    $0x7,%cl
jmp    12fb <tstr+0x1eb>
mov    $0x2,%cl
jmp    12fb <tstr+0x1eb>
mov    $0x1,%cl
jmp    12fb <tstr+0x1eb>
mov    $0x9,%cl
add    $0x3,%rbx
mov    %rbx,(%r14)
movb   $0xb,0x2d27(%rip)
lea    0x2d20(%rip),%rax
mov    %cl,0x2d1b(%rip)
movl   $0x1010106,0x2d12(%rip)
01 01 01
movb   $0x0,0x2d0f(%rip)
jmp    11e8 <tstr+0xd8>

LLVM IR (-O0):
@tstr.buf = internal global [10 x i8] zeroinitializer
@tstr.tstr_control_k = internal global [7 x i8] c"\0B(\06\01\01\01\00"
@.str = [2 x i8] c"\08\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"\0D\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [22 x i8] c"illegal char after \\k\00"
@.str.5 = [1 x i8] zeroinitializer
define i8* @tstr(i8** %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %137 [
i32 92, label %14
i32 94, label %122
]
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
switch i32 %19, label %108 [
i32 48, label %20
i32 49, label %20
i32 50, label %20
i32 51, label %20
i32 52, label %20
i32 53, label %20
i32 54, label %20
i32 55, label %20
i32 98, label %60
i32 101, label %64
i32 110, label %68
i32 114, label %72
i32 116, label %76
i32 107, label %80
]
20: ; preds = %14, %14, %14, %14, %14, %14, %14, %14
store i8 0, i8* %7
store i32 0, i32* %8
br label %21
21: ; preds = %46, %20
%22 = load i8, i8* %7
%23 = sext i8 %22 to i32
%24 = mul nsw i32 8, %23
%25 = load i8*, i8** %6
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 48
%29 = add nsw i32 %24, %28
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
br label %31
31: ; preds = %21
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %6
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp sge i32 %35, 48
br i1 %36, label %37, label %46
37: ; preds = %31
%38 = load i8*, i8** %6
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp sle i32 %40, 55
br i1 %41, label %42, label %46
42: ; preds = %37
%43 = load i32, i32* %8
%44 = add nsw i32 %43, 1
store i32 %44, i32* %8
%45 = icmp slt i32 %44, 3
br label %46
46: ; preds = %42, %37, %31
%47 = phi i1 [ false, %37 ], [ false, %31 ], [ %45, %42 ]
br i1 %47, label %21, label %48
48: ; preds = %46
%49 = load i8*, i8** %6
%50 = load i8**, i8*** %4
store i8* %49, i8** %50
%51 = load i32, i32* %5
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %58
53: ; preds = %48
%54 = load i8, i8* %7
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 11
br i1 %56, label %57, label %58
57: ; preds = %53
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8** %3
br label %151
58: ; preds = %53, %48
%59 = load i8, i8* %7
store i8 %59, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), i8** %3
br label %151
60: ; preds = %14
%61 = load i8*, i8** %6
%62 = getelementptr inbounds i8, i8* %61, i64 1
%63 = load i8**, i8*** %4
store i8* %62, i8** %63
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %151
64: ; preds = %14
%65 = load i8*, i8** %6
%66 = getelementptr inbounds i8, i8* %65, i64 1
%67 = load i8**, i8*** %4
store i8* %66, i8** %67
store i8 27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), i8** %3
br label %151
68: ; preds = %14
%69 = load i8*, i8** %6
%70 = getelementptr inbounds i8, i8* %69, i64 1
%71 = load i8**, i8*** %4
store i8* %70, i8** %71
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %151
72: ; preds = %14
%73 = load i8*, i8** %6
%74 = getelementptr inbounds i8, i8* %73, i64 1
%75 = load i8**, i8*** %4
store i8* %74, i8** %75
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %151
76: ; preds = %14
%77 = load i8*, i8** %6
%78 = getelementptr inbounds i8, i8* %77, i64 1
%79 = load i8**, i8*** %4
store i8* %78, i8** %79
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %151
80: ; preds = %14
%81 = load i32, i32* %5
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %107
83: ; preds = %80
%84 = load i8*, i8** %6
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %6
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
switch i32 %87, label %97 [
i32 117, label %88
i32 100, label %89
i32 114, label %90
i32 108, label %91
i32 85, label %92
i32 68, label %93
i32 104, label %94
i32 101, label %95
i32 120, label %96
]
88: ; preds = %83
store i8 3, i8* %7
br label %102
89: ; preds = %83
store i8 4, i8* %7
br label %102
90: ; preds = %83
store i8 1, i8* %7
br label %102
91: ; preds = %83
store i8 2, i8* %7
br label %102
92: ; preds = %83
store i8 5, i8* %7
br label %102
93: ; preds = %83
store i8 6, i8* %7
br label %102
94: ; preds = %83
store i8 7, i8* %7
br label %102
95: ; preds = %83
store i8 8, i8* %7
br label %102
96: ; preds = %83
store i8 9, i8* %7
br label %102
97: ; preds = %83
%98 = call i32 @lkerr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%99 = load i8*, i8** %6
%100 = getelementptr inbounds i8, i8* %99, i64 1
%101 = load i8**, i8*** %4
store i8* %100, i8** %101
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %151
102: ; preds = %96, %95, %94, %93, %92, %91, %90, %89, %88
%103 = load i8*, i8** %6
%104 = getelementptr inbounds i8, i8* %103, i64 1
%105 = load i8**, i8*** %4
store i8* %104, i8** %105
store i8 11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
%106 = load i8, i8* %7
store i8 %106, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
store i8 6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 2)
store i8 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 3)
store i8 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 4)
store i8 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 5)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 6)
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), i8** %3
br label %151
107: ; preds = %80
br label %108
108: ; preds = %14, %107
%109 = load i8*, i8** %6
%110 = getelementptr inbounds i8, i8* %109, i64 1
%111 = load i8**, i8*** %4
store i8* %110, i8** %111
%112 = load i8*, i8** %6
%113 = load i8, i8* %112
store i8 %113, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
%114 = load i32, i32* %5
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %121
116: ; preds = %108
%117 = load i8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
%118 = sext i8 %117 to i32
%119 = icmp eq i32 %118, 11
br i1 %119, label %120, label %121
120: ; preds = %116
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8** %3
br label %151
121: ; preds = %116, %108
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), i8** %3
br label %151
122: ; preds = %2
%123 = load i8*, i8** %6
%124 = getelementptr inbounds i8, i8* %123, i64 2
%125 = load i8**, i8*** %4
store i8* %124, i8** %125
%126 = load i8*, i8** %6
%127 = getelementptr inbounds i8, i8* %126, i64 1
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = and i32 %129, 31
%131 = trunc i32 %130 to i8
store i8 %131, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
%132 = load i8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 11
br i1 %134, label %135, label %136
135: ; preds = %122
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8** %3
br label %151
136: ; preds = %122
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), i8** %3
br label %151
137: ; preds = %2
%138 = load i8*, i8** %6
%139 = getelementptr inbounds i8, i8* %138, i64 1
%140 = load i8**, i8*** %4
store i8* %139, i8** %140
%141 = load i8*, i8** %6
%142 = load i8, i8* %141
store i8 %142, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
%143 = load i32, i32* %5
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %150
145: ; preds = %137
%146 = load i8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 11
br i1 %148, label %149, label %150
149: ; preds = %145
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8** %3
br label %151
150: ; preds = %145, %137
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), i8** %3
br label %151
151: ; preds = %150, %149, %136, %135, %121, %120, %102, %97, %76, %72, %68, %64, %60, %58, %57
%152 = load i8*, i8** %3
ret i8* %152
}

LLVM IR (-O2):
@tstr.buf = internal global [10 x i8] zeroinitializer
@tstr.tstr_control_k = internal global [7 x i8] c"\0B(\06\01\01\01\00"
@.str = [2 x i8] c"\08\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"\0D\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [22 x i8] c"illegal char after \\k\00"
@.str.5 = [1 x i8] zeroinitializer
define i8* @tstr(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %87 [
i32 92, label %6
i32 94, label %80
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
switch i32 %9, label %73 [
i32 48, label %10
i32 49, label %10
i32 50, label %10
i32 51, label %10
i32 52, label %10
i32 53, label %10
i32 54, label %10
i32 55, label %10
i32 98, label %43
i32 101, label %45
i32 110, label %47
i32 114, label %49
i32 116, label %51
i32 107, label %53
]
10: ; preds = %6, %6, %6, %6, %6, %6, %6, %6
%11 = zext i8 %8 to i32
%12 = add nsw i32 %11, -48
%13 = getelementptr inbounds i8, i8* %3, i64 2
%14 = load i8, i8* %13
%15 = and i8 %14, -8
%16 = icmp eq i8 %15, 48
br i1 %16, label %17, label %34
17: ; preds = %10
%18 = shl i32 %12, 24
%19 = ashr exact i32 %18, 21
%20 = zext i8 %14 to i32
%21 = add nsw i32 %19, -48
%22 = add nsw i32 %21, %20
%23 = getelementptr inbounds i8, i8* %3, i64 3
%24 = load i8, i8* %23
%25 = and i8 %24, -8
%26 = icmp eq i8 %25, 48
br i1 %26, label %27, label %34
27: ; preds = %17
%28 = shl i32 %22, 24
%29 = ashr exact i32 %28, 21
%30 = zext i8 %24 to i32
%31 = add nsw i32 %29, -48
%32 = add nsw i32 %31, %30
%33 = getelementptr inbounds i8, i8* %3, i64 4
br label %34
34: ; preds = %27, %17, %10
%35 = phi i32 [ %12, %10 ], [ %22, %17 ], [ %32, %27 ]
%36 = phi i8* [ %13, %10 ], [ %23, %17 ], [ %33, %27 ]
store i8* %36, i8** %0
%37 = icmp ne i32 %1, 0
%38 = and i32 %35, 255
%39 = icmp eq i32 %38, 11
%40 = select i1 %37, i1 %39, i1 false
br i1 %40, label %94, label %41
41: ; preds = %34
%42 = trunc i32 %35 to i8
store i8 %42, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
br label %94
43: ; preds = %6
%44 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %44, i8** %0
br label %94
45: ; preds = %6
%46 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %46, i8** %0
store i8 27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
br label %94
47: ; preds = %6
%48 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %48, i8** %0
br label %94
49: ; preds = %6
%50 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %50, i8** %0
br label %94
51: ; preds = %6
%52 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %52, i8** %0
br label %94
53: ; preds = %6
%54 = icmp eq i32 %1, 0
br i1 %54, label %73, label %55
55: ; preds = %53
%56 = getelementptr inbounds i8, i8* %3, i64 2
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
switch i32 %58, label %67 [
i32 117, label %70
i32 100, label %59
i32 114, label %60
i32 108, label %61
i32 85, label %62
i32 68, label %63
i32 104, label %64
i32 101, label %65
i32 120, label %66
]
59: ; preds = %55
br label %70
60: ; preds = %55
br label %70
61: ; preds = %55
br label %70
62: ; preds = %55
br label %70
63: ; preds = %55
br label %70
64: ; preds = %55
br label %70
65: ; preds = %55
br label %70
66: ; preds = %55
br label %70
67: ; preds = %55
%68 = tail call i32 @lkerr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%69 = getelementptr inbounds i8, i8* %3, i64 3
store i8* %69, i8** %0
br label %94
70: ; preds = %55, %66, %65, %64, %63, %62, %61, %60, %59
%71 = phi i8 [ 9, %66 ], [ 8, %65 ], [ 7, %64 ], [ 6, %63 ], [ 5, %62 ], [ 2, %61 ], [ 1, %60 ], [ 4, %59 ], [ 3, %55 ]
%72 = getelementptr inbounds i8, i8* %3, i64 3
store i8* %72, i8** %0
store i8 11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 %71, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
store i8 6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 2)
store i8 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 3)
store i8 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 4)
store i8 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 5)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 6)
br label %94
73: ; preds = %53, %6
%74 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %74, i8** %0
%75 = load i8, i8* %7
store i8 %75, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
%76 = icmp ne i32 %1, 0
%77 = icmp eq i8 %75, 11
%78 = select i1 %76, i1 %77, i1 false
%79 = select i1 %78, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
br label %94
80: ; preds = %2
%81 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %81, i8** %0
%82 = getelementptr inbounds i8, i8* %3, i64 1
%83 = load i8, i8* %82
%84 = and i8 %83, 31
store i8 %84, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
%85 = icmp eq i8 %84, 11
%86 = select i1 %85, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
br label %94
87: ; preds = %2
%88 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %88, i8** %0
%89 = load i8, i8* %3
store i8 %89, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 1)
%90 = icmp ne i32 %1, 0
%91 = icmp eq i8 %89, 11
%92 = select i1 %90, i1 %91, i1 false
%93 = select i1 %92, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0)
br label %94
94: ; preds = %87, %80, %73, %34, %70, %67, %51, %49, %47, %45, %43, %41
%95 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), %67 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), %70 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %51 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %49 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %47 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), %45 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %43 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @tstr.buf, i64 0, i64 0), %41 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @tstr.tstr_control_k, i64 0, i64 0), %34 ], [ %79, %73 ], [ %86, %80 ], [ %93, %87 ]
ret i8* %95
}