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

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fail(char *);
int open(char *, int /*<<< orphan*/);
int sprintf(char *, char *, long);
int write(int, char *, int);
void dump_input(const char *data, long size) {
  static int kmsg = -1;
  if (kmsg == -1) {
    kmsg = open("/dev/kmsg", O_WRONLY);
    if (kmsg == -1)
      fail("open(/dev/kmsg) failed");
    int printk_devkmsg = open("/proc/sys/kernel/printk_devkmsg", O_WRONLY);
    if (printk_devkmsg == -1)
      fail("open(/proc/sys/kernel/printk_devkmsg) failed");
    if (write(printk_devkmsg, "on", 3) != 3)
      fail("write(/proc/sys/kernel/printk_devkmsg) failed");
    close(printk_devkmsg);
  }
  char buf[1024];
  char *pos = buf + sprintf(buf, "INPUT[%ld]: ", size);
  for (long i = 0; i < size; i++) {
    if (pos > buf + sizeof(buf) - 10) {
      *pos++ = '.';
      *pos++ = '.';
      *pos++ = '.';
      break;
    }
    char ch = data[i];
    if (ch >= 0x20 && ch < 0x7f && ch != '\\') {
      *pos++ = ch;
      continue;
    }
    *pos++ = '\\';
    *pos++ = 'x';
    char hi = ch >> 4;
    if (hi <= 9)
      *pos++ = '0' + hi;
    else
      *pos++ = 'a' + hi - 9;
    char lo = ch & 0xf;
    if (lo <= 9)
      *pos++ = '0' + lo;
    else
      *pos++ = 'a' + lo - 9;
  }
  *pos++ = '\n';
  if (write(kmsg, buf, pos - buf) != pos - buf)
    fail("write(/dev/kmsg) failed");
}


x86 assembly (clang, -O0):
<dump_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,0x2ede(%rip)
jne    1203 <dump_input+0xb3>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
lea    0xe80(%rip),%rdi
call   1060 <open@plt>
mov    %eax,0x2ebd(%rip)
cmpl   $0xffffffff,0x2eb6(%rip)
jne    11a4 <dump_input+0x54>
lea    0xe6b(%rip),%rdi
call   1040 <fail@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%esi
lea    0xe6d(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    11d2 <dump_input+0x82>
lea    0xe74(%rip),%rdi
call   1040 <fail@plt>
mov    -0x14(%rbp),%edi
lea    0xe92(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
cmp    $0x3,%eax
je     11fb <dump_input+0xab>
lea    0xe7b(%rip),%rdi
call   1040 <fail@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
lea    -0x420(%rbp),%rax
mov    %rax,-0x440(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe7c(%rip),%rsi
call   1070 <sprintf@plt>
mov    %eax,%ecx
mov    -0x440(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x428(%rbp)
movq   $0x0,-0x430(%rbp)
mov    -0x430(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1457 <dump_input+0x307>
mov    -0x428(%rbp),%rax
lea    -0x420(%rbp),%rcx
add    $0x400,%rcx
add    $0xfffffffffffffff6,%rcx
cmp    %rcx,%rax
jbe    12c9 <dump_input+0x179>
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
movb   $0x2e,(%rax)
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
movb   $0x2e,(%rax)
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
movb   $0x2e,(%rax)
jmp    1457 <dump_input+0x307>
mov    -0x8(%rbp),%rax
mov    -0x430(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x431(%rbp)
movsbl -0x431(%rbp),%eax
cmp    $0x20,%eax
jl     132f <dump_input+0x1df>
movsbl -0x431(%rbp),%eax
cmp    $0x7f,%eax
jge    132f <dump_input+0x1df>
movsbl -0x431(%rbp),%eax
cmp    $0x5c,%eax
je     132f <dump_input+0x1df>
mov    -0x431(%rbp),%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
jmp    1440 <dump_input+0x2f0>
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
movb   $0x5c,(%rax)
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
movb   $0x78,(%rax)
movsbl -0x431(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x432(%rbp)
movsbl -0x432(%rbp),%eax
cmp    $0x9,%eax
jg     13a7 <dump_input+0x257>
movsbl -0x432(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
jmp    13cd <dump_input+0x27d>
movsbl -0x432(%rbp),%eax
add    $0x61,%eax
sub    $0x9,%eax
mov    %al,%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
movsbl -0x431(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x433(%rbp)
movsbl -0x433(%rbp),%eax
cmp    $0x9,%eax
jg     1415 <dump_input+0x2c5>
movsbl -0x433(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
jmp    143b <dump_input+0x2eb>
movsbl -0x433(%rbp),%eax
add    $0x61,%eax
sub    $0x9,%eax
mov    %al,%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
jmp    1440 <dump_input+0x2f0>
mov    -0x430(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x430(%rbp)
jmp    1249 <dump_input+0xf9>
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
movb   $0xa,(%rax)
mov    0x2bd3(%rip),%edi
lea    -0x420(%rbp),%rsi
mov    -0x428(%rbp),%rax
lea    -0x420(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <write@plt>
cltq
mov    -0x428(%rbp),%rcx
lea    -0x420(%rbp),%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
je     14bc <dump_input+0x36c>
lea    0xbf5(%rip),%rdi
call   1040 <fail@plt>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_input>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r12
mov    %rdi,%r14
cmpl   $0xffffffff,0x2edd(%rip)
jne    11e5 <dump_input+0x95>
mov    0x2e64(%rip),%rbx
mov    (%rbx),%esi
lea    0xe83(%rip),%rdi
call   1060 <open@plt>
mov    %eax,0x2ec0(%rip)
cmp    $0xffffffff,%eax
jne    1199 <dump_input+0x49>
lea    0xe76(%rip),%rdi
call   1040 <fail@plt>
mov    (%rbx),%esi
lea    0xe7f(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    11ba <dump_input+0x6a>
lea    0xe8c(%rip),%rdi
call   1040 <fail@plt>
lea    0xead(%rip),%rsi
mov    %ebx,%edi
mov    $0x3,%edx
call   1030 <write@plt>
cmp    $0x3,%eax
je     11de <dump_input+0x8e>
lea    0xe98(%rip),%rdi
call   1040 <fail@plt>
mov    %ebx,%edi
call   1050 <close@plt>
lea    0xeb3(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r12,%rdx
call   1070 <sprintf@plt>
cltq
lea    (%rsp,%rax,1),%rbx
test   %r12,%r12
jle    1282 <dump_input+0x132>
lea    0x3f6(%rsp),%rdi
xor    %ecx,%ecx
jmp    1255 <dump_input+0x105>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movw   $0x785c,(%rbx)
mov    %edx,%eax
sar    $0x4,%al
add    $0x30,%al
mov    %al,0x2(%rbx)
and    $0xf,%dl
lea    0x58(%rdx),%eax
lea    0x30(%rdx),%esi
cmp    $0xa,%dl
movzbl %sil,%edx
movzbl %al,%eax
cmovb  %edx,%eax
mov    %al,0x3(%rbx)
add    $0x4,%rbx
add    $0x1,%rcx
cmp    %rcx,%r12
je     1282 <dump_input+0x132>
cmp    %rdi,%rbx
ja     1275 <dump_input+0x125>
movzbl (%r14,%rcx,1),%edx
cmp    $0x5c,%dl
je     1220 <dump_input+0xd0>
lea    -0x20(%rdx),%esi
cmp    $0x5e,%sil
ja     1220 <dump_input+0xd0>
mov    %dl,(%rbx)
add    $0x1,%rbx
jmp    124c <dump_input+0xfc>
movw   $0x2e2e,(%rbx)
movb   $0x2e,0x2(%rbx)
add    $0x3,%rbx
movb   $0xa,(%rbx)
mov    0x2dbd(%rip),%edi
sub    %r15,%rbx
add    $0x1,%rbx
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <write@plt>
cltq
cmp    %rax,%rbx
je     12af <dump_input+0x15f>
lea    0xe02(%rip),%rdi
call   1040 <fail@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@dump_input.kmsg = internal unnamed_addr global i32 -1
@.str = [10 x i8] c"/dev/kmsg\00"
@O_WRONLY = global i32 0
@.str.1 = [23 x i8] c"open(/dev/kmsg) failed\00"
@.str.2 = [32 x i8] c"/proc/sys/kernel/printk_devkmsg\00"
@.str.3 = [45 x i8] c"open(/proc/sys/kernel/printk_devkmsg) failed\00"
@.str.4 = [3 x i8] c"on\00"
@.str.5 = [46 x i8] c"write(/proc/sys/kernel/printk_devkmsg) failed\00"
@.str.6 = [13 x i8] c"INPUT[%ld]: \00"
@.str.7 = [24 x i8] c"write(/dev/kmsg) failed\00"
define void @dump_input(i8* nocapture %0, i64 %1) {
%3 = alloca [1024 x i8]
%4 = load i32, i32* @dump_input.kmsg
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %25
6: ; preds = %2
%7 = load i32, i32* @O_WRONLY
%8 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* @dump_input.kmsg
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @fail(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
%13 = load i32, i32* @O_WRONLY
%14 = tail call i32 @open(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 @fail(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %12
%19 = tail call i32 @write(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 3)
%20 = icmp eq i32 %19, 3
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = tail call i32 @fail(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = tail call i32 @close(i32 %14)
br label %25
25: ; preds = %23, %2
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%27 = call i32 @sprintf(i8* %26, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i64 %1)
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %28
%30 = icmp sgt i64 %1, 0
br i1 %30, label %31, label %65
31: ; preds = %25
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1014
br label %33
33: ; preds = %31, %61
%34 = phi i8* [ %29, %31 ], [ %62, %61 ]
%35 = phi i64 [ 0, %31 ], [ %63, %61 ]
%36 = icmp ugt i8* %34, %32
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = getelementptr inbounds i8, i8* %34, i64 1
store i8 46, i8* %34
%39 = getelementptr inbounds i8, i8* %34, i64 2
store i8 46, i8* %38
%40 = getelementptr inbounds i8, i8* %34, i64 3
store i8 46, i8* %39
br label %65
41: ; preds = %33
%42 = getelementptr inbounds i8, i8* %0, i64 %35
%43 = load i8, i8* %42
%44 = add i8 %43, -32
%45 = icmp ult i8 %44, 95
%46 = icmp ne i8 %43, 92
%47 = and i1 %46, %45
%48 = getelementptr inbounds i8, i8* %34, i64 1
br i1 %47, label %49, label %50
49: ; preds = %41
store i8 %43, i8* %34
br label %61
50: ; preds = %41
store i8 92, i8* %34
store i8 120, i8* %48
%51 = getelementptr inbounds i8, i8* %34, i64 2
%52 = ashr i8 %43, 4
%53 = add nsw i8 %52, 48
%54 = getelementptr inbounds i8, i8* %34, i64 3
store i8 %53, i8* %51
%55 = and i8 %43, 15
%56 = icmp ult i8 %55, 10
%57 = add nuw nsw i8 %55, 88
%58 = or i8 %55, 48
%59 = select i1 %56, i8 %58, i8 %57
%60 = getelementptr inbounds i8, i8* %34, i64 4
store i8 %59, i8* %54
br label %61
61: ; preds = %50, %49
%62 = phi i8* [ %48, %49 ], [ %60, %50 ]
%63 = add nuw nsw i64 %35, 1
%64 = icmp eq i64 %63, %1
br i1 %64, label %65, label %33
65: ; preds = %61, %25, %37
%66 = phi i8* [ %40, %37 ], [ %29, %25 ], [ %62, %61 ]
%67 = getelementptr inbounds i8, i8* %66, i64 1
store i8 10, i8* %66
%68 = load i32, i32* @dump_input.kmsg
%69 = ptrtoint i8* %67 to i64
%70 = ptrtoint [1024 x i8]* %3 to i64
%71 = sub i64 %69, %70
%72 = trunc i64 %71 to i32
%73 = call i32 @write(i32 %68, i8* %26, i32 %72)
%74 = sext i32 %73 to i64
%75 = icmp eq i64 %71, %74
br i1 %75, label %78, label %76
76: ; preds = %65
%77 = call i32 @fail(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %78
78: ; preds = %76, %65
ret void
}