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

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
char *strdup(char *);
scalar_t__ strncmp(char *, char *, int);
scalar_t__ strstr(char *, char *);
char tolower(char);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("usage: %s /usr/include/linux/capability.h\n", argv[0]);
    return 1;
  }
  FILE *fp = fopen(argv[1], "r");
  if (!fp) {
    fprintf(stderr, "Error: cannot open file\n");
    return 1;
  }
  char buf[4096];
  while (fgets(buf, 4096, fp)) {
    char *start = buf;
    while (*start == ' ' || *start == '\t')
      start++;
    char *end = strchr(start, '\n');
    if (end)
      *end = '\0';
    if (strncmp(start, "#define CAP_", 12) == 0) {
      if (strstr(start, "CAP_LAST_CAP"))
        break;
      char *ptr1 = start + 8;
      char *ptr2 = ptr1;
      while (*ptr2 == ' ' || *ptr2 == '\t')
        ptr2++;
      while (*ptr2 != ' ' && *ptr2 != '\t')
        ptr2++;
      *ptr2 = '\0';
      ptr2 = strdup(ptr1);
      assert(ptr2);
      ptr2 += 4;
      char *ptr3 = ptr2;
      while (*ptr3 != '\0') {
        *ptr3 = tolower(*ptr3);
        ptr3++;
      }
      printf("#ifdef %s\n", ptr1);
      printf("\t{\"%s\", %s },\n", ptr2, ptr1);
      printf("#endif\n");
    }
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11f4 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14f5 <main+0x345>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe28(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1238 <main+0x88>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xe06(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14f5 <main+0x345>
jmp    123d <main+0x8d>
lea    -0x1020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1000,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     14e5 <main+0x335>
lea    -0x1020(%rbp),%rax
mov    %rax,-0x1028(%rbp)
mov    -0x1028(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x1049(%rbp)
je     129b <main+0xeb>
mov    -0x1028(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x1049(%rbp)
mov    -0x1049(%rbp),%al
test   $0x1,%al
jne    12ae <main+0xfe>
jmp    12c5 <main+0x115>
mov    -0x1028(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1028(%rbp)
jmp    126a <main+0xba>
mov    -0x1028(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x1030(%rbp)
cmpq   $0x0,-0x1030(%rbp)
je     12f5 <main+0x145>
mov    -0x1030(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x1028(%rbp),%rdi
lea    0xd43(%rip),%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    14e0 <main+0x330>
mov    -0x1028(%rbp),%rdi
lea    0xd2e(%rip),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
je     1339 <main+0x189>
jmp    14e5 <main+0x335>
mov    -0x1028(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x1038(%rbp)
mov    -0x1038(%rbp),%rax
mov    %rax,-0x1040(%rbp)
mov    -0x1040(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x104a(%rbp)
je     138a <main+0x1da>
mov    -0x1040(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x104a(%rbp)
mov    -0x104a(%rbp),%al
test   $0x1,%al
jne    139d <main+0x1ed>
jmp    13b4 <main+0x204>
mov    -0x1040(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1040(%rbp)
jmp    1359 <main+0x1a9>
jmp    13b9 <main+0x209>
mov    -0x1040(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x104b(%rbp)
je     13ea <main+0x23a>
mov    -0x1040(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x104b(%rbp)
mov    -0x104b(%rbp),%al
test   $0x1,%al
jne    13fd <main+0x24d>
jmp    1414 <main+0x264>
mov    -0x1040(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1040(%rbp)
jmp    13b9 <main+0x209>
mov    -0x1040(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x1038(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rax,-0x1040(%rbp)
mov    -0x1040(%rbp),%rdi
call   1080 <assert@plt>
mov    -0x1040(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x1040(%rbp)
mov    -0x1040(%rbp),%rax
mov    %rax,-0x1048(%rbp)
mov    -0x1048(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     14a1 <main+0x2f1>
mov    -0x1048(%rbp),%rax
movsbl (%rax),%edi
call   10a0 <tolower@plt>
mov    %al,%cl
mov    -0x1048(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1048(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1048(%rbp)
jmp    145d <main+0x2ad>
mov    -0x1038(%rbp),%rsi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1040(%rbp),%rsi
mov    -0x1038(%rbp),%rdx
lea    0xba0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xba1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    123d <main+0x8d>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
cmp    $0x2,%edi
jne    1374 <main+0x1b4>
mov    0x8(%rsi),%rdi
lea    0xe46(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1387 <main+0x1c7>
mov    %rax,%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x1000,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1368 <main+0x1a8>
lea    0xe2b(%rip),%r12
mov    %r15,%r14
mov    %rbx,0x8(%rsp)
jmp    1234 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r14
mov    (%r14),%al
cmp    $0x20,%al
je     1230 <main+0x70>
cmp    $0x9,%al
je     1230 <main+0x70>
mov    %r14,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1254 <main+0x94>
movb   $0x0,(%rax)
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    134c <main+0x18c>
mov    %r14,%rdi
lea    0xddc(%rip),%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    1368 <main+0x1a8>
lea    0x8(%r14),%r13
add    $0x9,%r14
mov    %r13,%rcx
jmp    12a8 <main+0xe8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
add    $0x1,%r14
movzbl (%rcx),%eax
cmp    $0x9,%al
je     12a0 <main+0xe0>
cmp    $0x20,%al
je     12a0 <main+0xe0>
jmp    12c8 <main+0x108>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r14),%eax
add    $0x1,%r14
cmp    $0x9,%al
je     12d0 <main+0x110>
cmp    $0x20,%al
jne    12c0 <main+0x100>
movb   $0x0,-0x1(%r14)
mov    %r13,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <assert@plt>
lea    0x4(%rbx),%rbp
mov    0x4(%rbx),%al
test   %al,%al
je     1316 <main+0x156>
add    $0x5,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   10b0 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1300 <main+0x140>
lea    0xd43(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd3d(%rip),%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd38(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%rbx
mov    %r15,%rdi
mov    $0x1000,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
mov    %r15,%r14
test   %rax,%rax
jne    1234 <main+0x74>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
jmp    13a1 <main+0x1e1>
mov    (%rsi),%rsi
lea    0xc82(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    139c <main+0x1dc>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
lea    0xc96(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%eax
add    $0x1018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"usage: %s /usr/include/linux/capability.h\0A\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Error: cannot open file\0A\00"
@.str.3 = [13 x i8] c"#define CAP_\00"
@.str.4 = [13 x i8] c"CAP_LAST_CAP\00"
@.str.5 = [11 x i8] c"#ifdef %s\0A\00"
@.str.6 = [15 x i8] c"\09{\22%s\22, %s },\0A\00"
@.str.7 = [8 x i8] c"#endif\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [4096 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 1, i32* %3
br label %136
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %6
%25 = load i32*, i32** %6
%26 = icmp ne i32* %25, null
br i1 %26, label %30, label %27
27: ; preds = %20
%28 = load i32, i32* @stderr
%29 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %136
30: ; preds = %20
br label %31
31: ; preds = %132, %30
%32 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%33 = load i32*, i32** %6
%34 = call i64 @fgets(i8* %32, i32 4096, i32* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %133
36: ; preds = %31
%37 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
store i8* %37, i8** %8
br label %38
38: ; preds = %50, %36
%39 = load i8*, i8** %8
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 32
br i1 %42, label %48, label %43
43: ; preds = %38
%44 = load i8*, i8** %8
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 9
br label %48
48: ; preds = %43, %38
%49 = phi i1 [ true, %38 ], [ %47, %43 ]
br i1 %49, label %50, label %53
50: ; preds = %48
%51 = load i8*, i8** %8
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %8
br label %38
53: ; preds = %48
%54 = load i8*, i8** %8
%55 = call i8* @strchr(i8* %54, i8 signext 10)
store i8* %55, i8** %9
%56 = load i8*, i8** %9
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = load i8*, i8** %9
store i8 0, i8* %59
br label %60
60: ; preds = %58, %53
%61 = load i8*, i8** %8
%62 = call i64 @strncmp(i8* %61, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %132
64: ; preds = %60
%65 = load i8*, i8** %8
%66 = call i64 @strstr(i8* %65, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %64
br label %133
69: ; preds = %64
%70 = load i8*, i8** %8
%71 = getelementptr inbounds i8, i8* %70, i64 8
store i8* %71, i8** %10
%72 = load i8*, i8** %10
store i8* %72, i8** %11
br label %73
73: ; preds = %85, %69
%74 = load i8*, i8** %11
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 32
br i1 %77, label %83, label %78
78: ; preds = %73
%79 = load i8*, i8** %11
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 9
br label %83
83: ; preds = %78, %73
%84 = phi i1 [ true, %73 ], [ %82, %78 ]
br i1 %84, label %85, label %88
85: ; preds = %83
%86 = load i8*, i8** %11
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %11
br label %73
88: ; preds = %83
br label %89
89: ; preds = %101, %88
%90 = load i8*, i8** %11
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp ne i32 %92, 32
br i1 %93, label %94, label %99
94: ; preds = %89
%95 = load i8*, i8** %11
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp ne i32 %97, 9
br label %99
99: ; preds = %94, %89
%100 = phi i1 [ false, %89 ], [ %98, %94 ]
br i1 %100, label %101, label %104
101: ; preds = %99
%102 = load i8*, i8** %11
%103 = getelementptr inbounds i8, i8* %102, i32 1
store i8* %103, i8** %11
br label %89
104: ; preds = %99
%105 = load i8*, i8** %11
store i8 0, i8* %105
%106 = load i8*, i8** %10
%107 = call i8* @strdup(i8* %106)
store i8* %107, i8** %11
%108 = load i8*, i8** %11
%109 = call i32 @assert(i8* %108)
%110 = load i8*, i8** %11
%111 = getelementptr inbounds i8, i8* %110, i64 4
store i8* %111, i8** %11
%112 = load i8*, i8** %11
store i8* %112, i8** %12
br label %113
113: ; preds = %118, %104
%114 = load i8*, i8** %12
%115 = load i8, i8* %114
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %125
118: ; preds = %113
%119 = load i8*, i8** %12
%120 = load i8, i8* %119
%121 = call signext i8 @tolower(i8 signext %120)
%122 = load i8*, i8** %12
store i8 %121, i8* %122
%123 = load i8*, i8** %12
%124 = getelementptr inbounds i8, i8* %123, i32 1
store i8* %124, i8** %12
br label %113
125: ; preds = %113
%126 = load i8*, i8** %10
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %126)
%128 = load i8*, i8** %11
%129 = load i8*, i8** %10
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %128, i8* %129)
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %132
132: ; preds = %125, %60
br label %31
133: ; preds = %68, %31
%134 = load i32*, i32** %6
%135 = call i32 @fclose(i32* %134)
store i32 0, i32* %3
br label %136
136: ; preds = %133, %27, %15
%137 = load i32, i32* %3
ret i32 %137
}

LLVM IR (-O2):
@.str = [43 x i8] c"usage: %s /usr/include/linux/capability.h\0A\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Error: cannot open file\0A\00"
@.str.3 = [13 x i8] c"#define CAP_\00"
@.str.4 = [13 x i8] c"CAP_LAST_CAP\00"
@.str.5 = [11 x i8] c"#ifdef %s\0A\00"
@.str.6 = [15 x i8] c"\09{\22%s\22, %s },\0A\00"
@str = [7 x i8] c"#endif\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = icmp eq i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %72
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %72
16: ; preds = %8
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%18 = call i64 @fgets(i8* %17, i32 4096, i32* %11)
%19 = icmp eq i64 %18, 0
br i1 %19, label %70, label %20
20: ; preds = %16, %25
%21 = phi i8* [ %26, %25 ], [ %17, %16 ]
%22 = load i8, i8* %21
switch i8 %22, label %27 [
i8 32, label %23
i8 9, label %23
]
23: ; preds = %20, %20
%24 = getelementptr inbounds i8, i8* %21, i64 1
br label %25
25: ; preds = %23, %67
%26 = phi i8* [ %24, %23 ], [ %17, %67 ]
br label %20
27: ; preds = %20
%28 = call i8* @strchr(i8* %21, i8 signext 10)
%29 = icmp eq i8* %28, null
br i1 %29, label %31, label %30
30: ; preds = %27
store i8 0, i8* %28
br label %31
31: ; preds = %30, %27
%32 = call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %67
34: ; preds = %31
%35 = call i64 @strstr(i8* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %70
37: ; preds = %34
%38 = getelementptr inbounds i8, i8* %21, i64 8
br label %39
39: ; preds = %42, %37
%40 = phi i8* [ %38, %37 ], [ %43, %42 ]
%41 = load i8, i8* %40
switch i8 %41, label %44 [
i8 32, label %42
i8 9, label %42
]
42: ; preds = %39, %39
%43 = getelementptr inbounds i8, i8* %40, i64 1
br label %39
44: ; preds = %39, %47
%45 = phi i8 [ %49, %47 ], [ %41, %39 ]
%46 = phi i8* [ %48, %47 ], [ %40, %39 ]
switch i8 %45, label %47 [
i8 32, label %50
i8 9, label %50
]
47: ; preds = %44
%48 = getelementptr inbounds i8, i8* %46, i64 1
%49 = load i8, i8* %48
br label %44
50: ; preds = %44, %44
store i8 0, i8* %46
%51 = call i8* @strdup(i8* %38)
%52 = call i32 @assert(i8* %51)
%53 = getelementptr inbounds i8, i8* %51, i64 4
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 0
br i1 %55, label %63, label %56
56: ; preds = %50, %56
%57 = phi i8 [ %61, %56 ], [ %54, %50 ]
%58 = phi i8* [ %60, %56 ], [ %53, %50 ]
%59 = call signext i8 @tolower(i8 signext %57)
store i8 %59, i8* %58
%60 = getelementptr inbounds i8, i8* %58, i64 1
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 0
br i1 %62, label %63, label %56
63: ; preds = %56, %50
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %38)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %53, i8* %38)
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %67
67: ; preds = %31, %63
%68 = call i64 @fgets(i8* %17, i32 4096, i32* %11)
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %25
70: ; preds = %67, %34, %16
%71 = call i32 @fclose(i32* %11)
br label %72
72: ; preds = %13, %70, %5
%73 = phi i32 [ 1, %5 ], [ 0, %70 ], [ 1, %13 ]
ret i32 %73
}