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

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int open(char *, int /*<<< orphan*/);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
char *identifyKeyboardDevice() {
  char *buf = (char *)malloc(1024);
  char *buf2 = (char *)malloc(1024);
  char *buf3 = (char *)malloc(1024);
  char *ptr = buf;
  char *template = (char *)malloc(19);
  strcpy(template, "/dev/input/");
  int fd = open("/proc/bus/input/devices", O_RDONLY);
  while (read(fd, ptr, 1)) {
    if (*ptr == '\n') {
      *ptr = 0;
      if (strstr(buf, "EV=120013") || strstr(buf, "EV=12001f")) {
        ptr = strstr(buf3, "event");
        char a[8] = "event";
        int i;
        int verified = 1;
        for (i = 0; i < 5; i++) {
          if (a[i] != ptr[i]) {
            verified = 0;
            break;
          }
        }
        if (!verified)
          continue;
        char c;
        while ((c = ptr[i]) != ' ' && c != '\n')
          a[i++] = c;
        strcat(template, a);
        free(buf);
        free(buf2);
        free(buf3);
        return template;
      }
      char *tmp = buf;
      buf = buf3;
      buf3 = buf2;
      buf2 = tmp;
      ptr = buf;
    } else {
      ptr++;
    }
  }
  close(fd);
  free(buf);
  free(buf2);
  free(buf3);
  fprintf(stderr, "Could not autodetect keyboard\n");
  return NULL;
}


x86 assembly (clang, -O0):
<identifyKeyboardDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x13,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <strcpy@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%esi
lea    0xe14(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1060 <read@plt>
cmp    $0x0,%rax
je     13b5 <identifyKeyboardDevice+0x225>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    13a4 <identifyKeyboardDevice+0x214>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
jne    1266 <identifyKeyboardDevice+0xd6>
mov    -0x10(%rbp),%rdi
lea    0xdd7(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1377 <identifyKeyboardDevice+0x1e7>
mov    -0x20(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x28(%rbp)
mov    0xddc(%rip),%rax
mov    %rax,-0x3c(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x5,-0x40(%rbp)
jge    12d9 <identifyKeyboardDevice+0x149>
movslq -0x40(%rbp),%rax
movsbl -0x3c(%rbp,%rax,1),%eax
mov    -0x28(%rbp),%rcx
movslq -0x40(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     12c6 <identifyKeyboardDevice+0x136>
movl   $0x0,-0x44(%rbp)
jmp    12d9 <identifyKeyboardDevice+0x149>
jmp    12cb <identifyKeyboardDevice+0x13b>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1293 <identifyKeyboardDevice+0x103>
cmpl   $0x0,-0x44(%rbp)
jne    12e8 <identifyKeyboardDevice+0x158>
jmp    1200 <identifyKeyboardDevice+0x70>
jmp    12ed <identifyKeyboardDevice+0x15d>
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x45(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x51(%rbp)
je     1319 <identifyKeyboardDevice+0x189>
movsbl -0x45(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
test   $0x1,%al
jne    1329 <identifyKeyboardDevice+0x199>
jmp    1342 <identifyKeyboardDevice+0x1b2>
mov    -0x45(%rbp),%cl
mov    -0x40(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x40(%rbp)
cltq
mov    %cl,-0x3c(%rbp,%rax,1)
jmp    12ed <identifyKeyboardDevice+0x15d>
mov    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    13f5 <identifyKeyboardDevice+0x265>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    13b0 <identifyKeyboardDevice+0x220>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1200 <identifyKeyboardDevice+0x70>
mov    -0x34(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
lea    0xc56(%rip),%rsi
call   1070 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifyKeyboardDevice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    $0x13,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
lea    0xe27(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
lea    0xe1b(%rip),%rdi
call   1090 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %r12,%rsi
mov    $0x1,%edx
call   1060 <read@plt>
test   %rax,%rax
mov    %r14,0x8(%rsp)
je     1301 <identifyKeyboardDevice+0x171>
mov    %rbx,0x20(%rsp)
mov    %r15,%r14
lea    0xe14(%rip),%r15
movabs $0x746e657665,%r13
mov    %r12,%rbx
jmp    1258 <identifyKeyboardDevice+0xc8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1060 <read@plt>
test   %rax,%rax
je     12fa <identifyKeyboardDevice+0x16a>
cmpb   $0xa,(%rbx)
jne    12bd <identifyKeyboardDevice+0x12d>
movb   $0x0,(%rbx)
mov    %r12,%rdi
lea    0xdba(%rip),%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
jne    1288 <identifyKeyboardDevice+0xf8>
mov    %r12,%rdi
lea    0xdb0(%rip),%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     12c8 <identifyKeyboardDevice+0x138>
mov    %r14,%rdi
mov    %r15,%rsi
call   10b0 <strstr@plt>
mov    %rax,%rbx
mov    %r13,0x18(%rsp)
cmpb   $0x65,(%rax)
jne    1240 <identifyKeyboardDevice+0xb0>
cmpb   $0x76,0x1(%rbx)
jne    1240 <identifyKeyboardDevice+0xb0>
cmpb   $0x65,0x2(%rbx)
jne    1240 <identifyKeyboardDevice+0xb0>
cmpb   $0x6e,0x3(%rbx)
jne    1240 <identifyKeyboardDevice+0xb0>
cmpb   $0x74,0x4(%rbx)
jne    1240 <identifyKeyboardDevice+0xb0>
jmp    1352 <identifyKeyboardDevice+0x1c2>
add    $0x1,%rbx
mov    %r14,0x10(%rsp)
jmp    12e0 <identifyKeyboardDevice+0x150>
mov    %r14,%rbx
mov    0x8(%rsp),%rax
mov    %r12,0x8(%rsp)
mov    %r14,%r12
mov    %rax,0x10(%rsp)
mov    %rax,%r14
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1060 <read@plt>
test   %rax,%rax
jne    1258 <identifyKeyboardDevice+0xc8>
jmp    1306 <identifyKeyboardDevice+0x176>
mov    %r14,0x10(%rsp)
jmp    1306 <identifyKeyboardDevice+0x176>
mov    %r15,0x10(%rsp)
mov    %ebp,%edi
call   1050 <close@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
lea    0xd05(%rip),%rsi
call   1070 <fprintf@plt>
xor    %ebp,%ebp
mov    %rbp,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x5,%eax
mov    0x20(%rsp),%rbp
nopl   0x0(%rax)
movzbl (%rbx,%rax,1),%ecx
cmp    $0xa,%cl
je     1378 <identifyKeyboardDevice+0x1e8>
cmp    $0x20,%cl
je     1378 <identifyKeyboardDevice+0x1e8>
mov    %cl,0x18(%rsp,%rax,1)
add    $0x1,%rax
jmp    1360 <identifyKeyboardDevice+0x1d0>
lea    0x18(%rsp),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1340 <identifyKeyboardDevice+0x1b0>

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/input/\00"
@.str.1 = [24 x i8] c"/proc/bus/input/devices\00"
@O_RDONLY = global i32 0
@.str.2 = [10 x i8] c"EV=120013\00"
@.str.3 = [10 x i8] c"EV=12001f\00"
@.str.4 = [6 x i8] c"event\00"
@__const.identifyKeyboardDevice.a = [8 x i8] c"event\00\00\00"
@stderr = global i32 0
@.str.5 = [31 x i8] c"Could not autodetect keyboard\0A\00"
define i8* @identifyKeyboardDevice() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [8 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8*
%13 = call i64 @malloc(i32 1024)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %2
%15 = call i64 @malloc(i32 1024)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %3
%17 = call i64 @malloc(i32 1024)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %4
%19 = load i8*, i8** %2
store i8* %19, i8** %5
%20 = call i64 @malloc(i32 19)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @O_RDONLY
%25 = call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %24)
store i32 %25, i32* %7
br label %26
26: ; preds = %115, %73, %0
%27 = load i32, i32* %7
%28 = load i8*, i8** %5
%29 = call i64 @read(i32 %27, i8* %28, i32 1)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %116
31: ; preds = %26
%32 = load i8*, i8** %5
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 10
br i1 %35, label %36, label %112
36: ; preds = %31
%37 = load i8*, i8** %5
store i8 0, i8* %37
%38 = load i8*, i8** %2
%39 = call i8* @strstr(i8* %38, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp ne i8* %39, null
br i1 %40, label %45, label %41
41: ; preds = %36
%42 = load i8*, i8** %2
%43 = call i8* @strstr(i8* %42, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %106
45: ; preds = %41, %36
%46 = load i8*, i8** %4
%47 = call i8* @strstr(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i8* %47, i8** %5
%48 = bitcast [8 x i8]* %8 to i8*
store i32 1, i32* %10
store i32 0, i32* %9
br label %49
49: ; preds = %67, %45
%50 = load i32, i32* %9
%51 = icmp slt i32 %50, 5
br i1 %51, label %52, label %70
52: ; preds = %49
%53 = load i32, i32* %9
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = load i8*, i8** %5
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %58, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp ne i32 %57, %63
br i1 %64, label %65, label %66
65: ; preds = %52
store i32 0, i32* %10
br label %70
66: ; preds = %52
br label %67
67: ; preds = %66
%68 = load i32, i32* %9
%69 = add nsw i32 %68, 1
store i32 %69, i32* %9
br label %49
70: ; preds = %65, %49
%71 = load i32, i32* %10
%72 = icmp ne i32 %71, 0
br i1 %72, label %74, label %73
73: ; preds = %70
br label %26
74: ; preds = %70
br label %75
75: ; preds = %89, %74
%76 = load i8*, i8** %5
%77 = load i32, i32* %9
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %76, i64 %78
%80 = load i8, i8* %79
store i8 %80, i8* %11
%81 = sext i8 %80 to i32
%82 = icmp ne i32 %81, 32
br i1 %82, label %83, label %87
83: ; preds = %75
%84 = load i8, i8* %11
%85 = sext i8 %84 to i32
%86 = icmp ne i32 %85, 10
br label %87
87: ; preds = %83, %75
%88 = phi i1 [ false, %75 ], [ %86, %83 ]
br i1 %88, label %89, label %95
89: ; preds = %87
%90 = load i8, i8* %11
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
%93 = sext i32 %91 to i64
%94 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 %93
store i8 %90, i8* %94
br label %75
95: ; preds = %87
%96 = load i8*, i8** %6
%97 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%98 = call i32 @strcat(i8* %96, i8* %97)
%99 = load i8*, i8** %2
%100 = call i32 @free(i8* %99)
%101 = load i8*, i8** %3
%102 = call i32 @free(i8* %101)
%103 = load i8*, i8** %4
%104 = call i32 @free(i8* %103)
%105 = load i8*, i8** %6
store i8* %105, i8** %1
br label %127
106: ; preds = %41
%107 = load i8*, i8** %2
store i8* %107, i8** %12
%108 = load i8*, i8** %4
store i8* %108, i8** %2
%109 = load i8*, i8** %3
store i8* %109, i8** %4
%110 = load i8*, i8** %12
store i8* %110, i8** %3
%111 = load i8*, i8** %2
store i8* %111, i8** %5
br label %115
112: ; preds = %31
%113 = load i8*, i8** %5
%114 = getelementptr inbounds i8, i8* %113, i32 1
store i8* %114, i8** %5
br label %115
115: ; preds = %112, %106
br label %26
116: ; preds = %26
%117 = load i32, i32* %7
%118 = call i32 @close(i32 %117)
%119 = load i8*, i8** %2
%120 = call i32 @free(i8* %119)
%121 = load i8*, i8** %3
%122 = call i32 @free(i8* %121)
%123 = load i8*, i8** %4
%124 = call i32 @free(i8* %123)
%125 = load i32, i32* @stderr
%126 = call i32 @fprintf(i32 %125, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
store i8* null, i8** %1
br label %127
127: ; preds = %116, %95
%128 = load i8*, i8** %1
ret i8* %128
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/input/\00"
@.str.1 = [24 x i8] c"/proc/bus/input/devices\00"
@O_RDONLY = global i32 0
@.str.2 = [10 x i8] c"EV=120013\00"
@.str.3 = [10 x i8] c"EV=12001f\00"
@.str.4 = [6 x i8] c"event\00"
@stderr = global i32 0
@.str.5 = [31 x i8] c"Could not autodetect keyboard\0A\00"
define i8* @identifyKeyboardDevice() {
%1 = alloca i64
%2 = bitcast i64* %1 to [8 x i8]*
%3 = tail call i64 @malloc(i32 1024)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @malloc(i32 1024)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @malloc(i32 1024)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i64 @malloc(i32 19)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @O_RDONLY
%13 = tail call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = bitcast i64* %1 to i8*
%15 = call i64 @read(i32 %13, i8* %4, i32 1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %71, label %17
17: ; preds = %0, %64
%18 = phi i8* [ %68, %64 ], [ %4, %0 ]
%19 = phi i8* [ %67, %64 ], [ %6, %0 ]
%20 = phi i8* [ %66, %64 ], [ %8, %0 ]
%21 = phi i8* [ %65, %64 ], [ %4, %0 ]
br label %22
22: ; preds = %17, %59
%23 = phi i8* [ %21, %17 ], [ %33, %59 ]
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 10
br i1 %25, label %26, label %62
26: ; preds = %22
store i8 0, i8* %23
%27 = call i8* @strstr(i8* dereferenceable(1) %18, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = call i8* @strstr(i8* dereferenceable(1) %18, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i8* %30, null
br i1 %31, label %64, label %32
32: ; preds = %29, %26
%33 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i64 500068349541, i64* %1
%34 = load i8, i8* %33
%35 = icmp eq i8 %34, 101
br i1 %35, label %36, label %59
36: ; preds = %32
%37 = getelementptr inbounds i8, i8* %33, i64 1
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 118
br i1 %39, label %40, label %59
40: ; preds = %36
%41 = getelementptr inbounds i8, i8* %33, i64 2
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 101
br i1 %43, label %44, label %59
44: ; preds = %40
%45 = getelementptr inbounds i8, i8* %33, i64 3
%46 = load i8, i8* %45
%47 = icmp eq i8 %46, 110
br i1 %47, label %48, label %59
48: ; preds = %44
%49 = getelementptr inbounds i8, i8* %33, i64 4
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 116
br i1 %51, label %52, label %59
52: ; preds = %48, %56
%53 = phi i64 [ %57, %56 ], [ 5, %48 ]
%54 = getelementptr inbounds i8, i8* %33, i64 %53
%55 = load i8, i8* %54
switch i8 %55, label %56 [
i8 32, label %81
i8 10, label %81
]
56: ; preds = %52
%57 = add nuw i64 %53, 1
%58 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 %53
store i8 %55, i8* %58
br label %52
59: ; preds = %32, %36, %40, %44, %48
%60 = call i64 @read(i32 %13, i8* %33, i32 1)
%61 = icmp eq i64 %60, 0
br i1 %61, label %71, label %22
62: ; preds = %22
%63 = getelementptr inbounds i8, i8* %23, i64 1
br label %64
64: ; preds = %29, %62
%65 = phi i8* [ %63, %62 ], [ %20, %29 ]
%66 = phi i8* [ %20, %62 ], [ %19, %29 ]
%67 = phi i8* [ %19, %62 ], [ %18, %29 ]
%68 = phi i8* [ %18, %62 ], [ %20, %29 ]
%69 = call i64 @read(i32 %13, i8* %65, i32 1)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %17
71: ; preds = %64, %59, %0
%72 = phi i8* [ %8, %0 ], [ %20, %59 ], [ %66, %64 ]
%73 = phi i8* [ %6, %0 ], [ %19, %59 ], [ %67, %64 ]
%74 = phi i8* [ %4, %0 ], [ %18, %59 ], [ %68, %64 ]
%75 = call i32 @close(i32 %13)
%76 = call i32 @free(i8* %74)
%77 = call i32 @free(i8* %73)
%78 = call i32 @free(i8* %72)
%79 = load i32, i32* @stderr
%80 = call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
br label %86
81: ; preds = %52, %52
%82 = call i32 @strcat(i8* %10, i8* %14)
%83 = call i32 @free(i8* %18)
%84 = call i32 @free(i8* %19)
%85 = call i32 @free(i8* %20)
br label %86
86: ; preds = %81, %71
%87 = phi i8* [ null, %71 ], [ %10, %81 ]
ret i8* %87
}