#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int strtol(char *, char **, int);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int current, next, maxval;
  FILE *file;
  if (argc < 2) {
    usage();
  }
  if (!(file = fopen("/sys/class/leds/smc::kbd_backlight"
                     "/brightness",
                     "r"))) {
    perror("failed to open the keyboard backlight file: "
           "/sys/class/leds/smc::kbd_backlight"
           "/brightness");
    return 1;
  }
  fscanf(file, "%d", &current);
  fclose(file);
  if ((file = fopen("/sys/class/leds/smc::kbd_backlight"
                    "/max_brightness",
                    "r"))) {
    fscanf(file, "%d", &maxval);
    fclose(file);
  } else {
    maxval = 255;
  }
  if (!strcmp(argv[1], "up"))
    next = current >= maxval - 16 ? maxval : current + 16;
  else if (!strcmp(argv[1], "down"))
    next = current <= 16 ? 0 : current - 16;
  else if (!strcmp(argv[1], "off"))
    next = 0;
  else if (!strcmp(argv[1], "max"))
    next = 255;
  else if (!strcmp(argv[1], "set")) {
    char *endp;
    if (!argv[2] || (next = strtol(argv[2], &endp, 10), endp == argv[2])) {
      fprintf(stderr, "set must be followed by a number from 0 to %d\n",
              maxval);
      return 1;
    }
  } else if (!strcmp(argv[1], "get")) {
    printf("%d\n", current);
    return 0;
  } else
    usage();
  if ((file = fopen("/sys/class/leds/smc::kbd_backlight"
                    "/brightness",
                    "w"))) {
    fprintf(file, "%d", next);
    fclose(file);
  } else {
    perror("failed to write to the keyboard backlight file: "
           "/sys/class/leds/smc::kbd_backlight"
           "/brightness");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11b7 <main+0x27>
mov    $0x0,%al
call   1090 <usage@plt>
lea    0xe70(%rip),%rdi
lea    0xe3b(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    11f0 <main+0x60>
lea    0xe23(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1469 <main+0x2d9>
mov    -0x28(%rbp),%rdi
lea    0xe61(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe4b(%rip),%rdi
lea    0xde5(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1250 <main+0xc0>
mov    -0x28(%rbp),%rdi
lea    0xe23(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1257 <main+0xc7>
movl   $0xff,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12a4 <main+0x114>
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x10,%ecx
cmp    %ecx,%eax
jl     1290 <main+0x100>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1299 <main+0x109>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1414 <main+0x284>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde1(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12e9 <main+0x159>
cmpl   $0x10,-0x14(%rbp)
jg     12d5 <main+0x145>
xor    %eax,%eax
mov    %eax,-0x38(%rbp)
jmp    12de <main+0x14e>
mov    -0x14(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    140f <main+0x27f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda1(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1312 <main+0x182>
movl   $0x0,-0x18(%rbp)
jmp    140a <main+0x27a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd7c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    133b <main+0x1ab>
movl   $0xff,-0x18(%rbp)
jmp    1405 <main+0x275>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd57(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13bc <main+0x22c>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     1392 <main+0x202>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x10(%rcx),%rax
jne    13b7 <main+0x227>
mov    0x2c47(%rip),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%edx
lea    0xcff(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1469 <main+0x2d9>
jmp    1400 <main+0x270>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd09(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13f4 <main+0x264>
mov    -0x14(%rbp),%esi
lea    0xced(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1469 <main+0x2d9>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    1400 <main+0x270>
jmp    1405 <main+0x275>
jmp    140a <main+0x27a>
jmp    140f <main+0x27f>
jmp    1414 <main+0x284>
lea    0xc13(%rip),%rdi
lea    0xcb6(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1456 <main+0x2c6>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xc19(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1462 <main+0x2d2>
lea    0xc7d(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
cmp    $0x1,%edi
jg     11a7 <main+0x17>
xor    %eax,%eax
call   1090 <usage@plt>
lea    0xe80(%rip),%rdi
lea    0xe4b(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1314 <main+0x184>
mov    %rax,%rbx
lea    0xe8f(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1050 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xe76(%rip),%rdi
lea    0xe10(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1219 <main+0x89>
mov    %rax,%rbx
lea    0xe58(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1050 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    1220 <main+0x90>
movl   $0xff,(%rsp)
mov    0x8(%r14),%rbx
lea    0xe66(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12a7 <main+0x117>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12bb <main+0x12b>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12cc <main+0x13c>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12d0 <main+0x140>
lea    0xe2a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1327 <main+0x197>
lea    0xe46(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     137a <main+0x1ea>
xor    %eax,%eax
call   1090 <usage@plt>
jmp    12d5 <main+0x145>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
lea    -0x10(%rcx),%edx
lea    0x10(%rax),%ebp
cmp    %edx,%eax
cmovge %ecx,%ebp
jmp    12d5 <main+0x145>
mov    0x4(%rsp),%eax
lea    -0x10(%rax),%ecx
xor    %ebp,%ebp
cmp    $0x11,%eax
cmovge %ecx,%ebp
jmp    12d5 <main+0x145>
xor    %ebp,%ebp
jmp    12d5 <main+0x145>
mov    $0xff,%ebp
lea    0xd52(%rip),%rdi
lea    0xdf5(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     136c <main+0x1dc>
mov    %rax,%rbx
lea    0xd65(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xce7(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%eax
jmp    130b <main+0x17b>
mov    0x10(%r14),%rdi
test   %rdi,%rdi
je     134c <main+0x1bc>
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rax
cmp    0x10(%r14),%rax
jne    12d5 <main+0x145>
mov    0x2c8d(%rip),%rax
mov    (%rax),%rdi
mov    (%rsp),%edx
lea    0xd45(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%eax
jmp    130b <main+0x17b>
lea    0xd67(%rip),%rdi
call   10b0 <perror@plt>
jmp    1309 <main+0x179>
mov    0x4(%rsp),%esi
lea    0xd4b(%rip),%rdi
call   1040 <printf@plt>
jmp    1309 <main+0x179>

LLVM IR (-O0):
@.str = [46 x i8] c"/sys/class/leds/smc::kbd_backlight/brightness\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [90 x i8] c"failed to open the keyboard backlight file: /sys/class/leds/smc::kbd_backlight/brightness\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [50 x i8] c"/sys/class/leds/smc::kbd_backlight/max_brightness\00"
@.str.5 = [3 x i8] c"up\00"
@.str.6 = [5 x i8] c"down\00"
@.str.7 = [4 x i8] c"off\00"
@.str.8 = [4 x i8] c"max\00"
@.str.9 = [4 x i8] c"set\00"
@stderr = global i32* null
@.str.10 = [47 x i8] c"set must be followed by a number from 0 to %d\0A\00"
@.str.11 = [4 x i8] c"get\00"
@.str.12 = [4 x i8] c"%d\0A\00"
@.str.13 = [2 x i8] c"w\00"
@.str.14 = [94 x i8] c"failed to write to the keyboard backlight file: /sys/class/leds/smc::kbd_backlight/brightness\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @usage()
br label %15
15: ; preds = %13, %2
%16 = call i32* @fopen(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %16, i32** %9
%17 = icmp ne i32* %16, null
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 @perror(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %134
20: ; preds = %15
%21 = load i32*, i32** %9
%22 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%23 = load i32*, i32** %9
%24 = call i32 @fclose(i32* %23)
%25 = call i32* @fopen(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %25, i32** %9
%26 = icmp ne i32* %25, null
br i1 %26, label %27, label %32
27: ; preds = %20
%28 = load i32*, i32** %9
%29 = call i32 @fscanf(i32* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%30 = load i32*, i32** %9
%31 = call i32 @fclose(i32* %30)
br label %33
32: ; preds = %20
store i32 255, i32* %8
br label %33
33: ; preds = %32, %27
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %51, label %39
39: ; preds = %33
%40 = load i32, i32* %6
%41 = load i32, i32* %8
%42 = sub nsw i32 %41, 16
%43 = icmp sge i32 %40, %42
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = load i32, i32* %8
br label %49
46: ; preds = %39
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 16
br label %49
49: ; preds = %46, %44
%50 = phi i32 [ %45, %44 ], [ %48, %46 ]
store i32 %50, i32* %7
br label %122
51: ; preds = %33
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i32 @strcmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%56 = icmp ne i32 %55, 0
br i1 %56, label %66, label %57
57: ; preds = %51
%58 = load i32, i32* %6
%59 = icmp sle i32 %58, 16
br i1 %59, label %60, label %61
60: ; preds = %57
br label %64
61: ; preds = %57
%62 = load i32, i32* %6
%63 = sub nsw i32 %62, 16
br label %64
64: ; preds = %61, %60
%65 = phi i32 [ 0, %60 ], [ %63, %61 ]
store i32 %65, i32* %7
br label %121
66: ; preds = %51
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %73, label %72
72: ; preds = %66
store i32 0, i32* %7
br label %120
73: ; preds = %66
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = call i32 @strcmp(i8* %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%78 = icmp ne i32 %77, 0
br i1 %78, label %80, label %79
79: ; preds = %73
store i32 255, i32* %7
br label %119
80: ; preds = %73
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 1
%83 = load i8*, i8** %82
%84 = call i32 @strcmp(i8* %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%85 = icmp ne i32 %84, 0
br i1 %85, label %106, label %86
86: ; preds = %80
%87 = load i8**, i8*** %5
%88 = getelementptr inbounds i8*, i8** %87, i64 2
%89 = load i8*, i8** %88
%90 = icmp ne i8* %89, null
br i1 %90, label %91, label %101
91: ; preds = %86
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 2
%94 = load i8*, i8** %93
%95 = call i32 @strtol(i8* %94, i8** %10, i32 10)
store i32 %95, i32* %7
%96 = load i8*, i8** %10
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 2
%99 = load i8*, i8** %98
%100 = icmp eq i8* %96, %99
br i1 %100, label %101, label %105
101: ; preds = %91, %86
%102 = load i32*, i32** @stderr
%103 = load i32, i32* %8
%104 = call i32 @fprintf(i32* %102, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i32 %103)
store i32 1, i32* %3
br label %134
105: ; preds = %91
br label %118
106: ; preds = %80
%107 = load i8**, i8*** %5
%108 = getelementptr inbounds i8*, i8** %107, i64 1
%109 = load i8*, i8** %108
%110 = call i32 @strcmp(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%111 = icmp ne i32 %110, 0
br i1 %111, label %115, label %112
112: ; preds = %106
%113 = load i32, i32* %6
%114 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %113)
store i32 0, i32* %3
br label %134
115: ; preds = %106
%116 = call i32 (...) @usage()
br label %117
117: ; preds = %115
br label %118
118: ; preds = %117, %105
br label %119
119: ; preds = %118, %79
br label %120
120: ; preds = %119, %72
br label %121
121: ; preds = %120, %64
br label %122
122: ; preds = %121, %49
%123 = call i32* @fopen(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32* %123, i32** %9
%124 = icmp ne i32* %123, null
br i1 %124, label %125, label %131
125: ; preds = %122
%126 = load i32*, i32** %9
%127 = load i32, i32* %7
%128 = call i32 @fprintf(i32* %126, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %127)
%129 = load i32*, i32** %9
%130 = call i32 @fclose(i32* %129)
br label %133
131: ; preds = %122
%132 = call i32 @perror(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.14, i64 0, i64 0))
br label %133
133: ; preds = %131, %125
store i32 0, i32* %3
br label %134
134: ; preds = %133, %112, %101, %18
%135 = load i32, i32* %3
ret i32 %135
}

LLVM IR (-O2):
@.str = [46 x i8] c"/sys/class/leds/smc::kbd_backlight/brightness\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [90 x i8] c"failed to open the keyboard backlight file: /sys/class/leds/smc::kbd_backlight/brightness\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [50 x i8] c"/sys/class/leds/smc::kbd_backlight/max_brightness\00"
@.str.5 = [3 x i8] c"up\00"
@.str.6 = [5 x i8] c"down\00"
@.str.7 = [4 x i8] c"off\00"
@.str.8 = [4 x i8] c"max\00"
@.str.9 = [4 x i8] c"set\00"
@stderr = global i32* null
@.str.10 = [47 x i8] c"set must be followed by a number from 0 to %d\0A\00"
@.str.11 = [4 x i8] c"get\00"
@.str.12 = [4 x i8] c"%d\0A\00"
@.str.13 = [2 x i8] c"w\00"
@.str.14 = [94 x i8] c"failed to write to the keyboard backlight file: /sys/class/leds/smc::kbd_backlight/brightness\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = icmp slt i32 %0, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (...) @usage()
br label %11
11: ; preds = %9, %2
%12 = tail call i32* @fopen(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @perror(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.2, i64 0, i64 0))
br label %86
16: ; preds = %11
%17 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%18 = call i32 @fclose(i32* %12)
%19 = call i32* @fopen(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %24, label %21
21: ; preds = %16
%22 = call i32 @fscanf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%23 = call i32 @fclose(i32* %19)
br label %25
24: ; preds = %16
store i32 255, i32* %4
br label %25
25: ; preds = %24, %21
%26 = getelementptr inbounds i8*, i8** %1, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %37
30: ; preds = %25
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = add nsw i32 %32, -16
%34 = icmp slt i32 %31, %33
%35 = add nsw i32 %31, 16
%36 = select i1 %34, i32 %35, i32 %32
br label %77
37: ; preds = %25
%38 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %37
%41 = load i32, i32* %3
%42 = icmp slt i32 %41, 17
%43 = add nsw i32 %41, -16
%44 = select i1 %42, i32 0, i32 %43
br label %77
45: ; preds = %37
%46 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%47 = icmp eq i32 %46, 0
br i1 %47, label %77, label %48
48: ; preds = %45
%49 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%50 = icmp eq i32 %49, 0
br i1 %50, label %77, label %51
51: ; preds = %48
%52 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %69
54: ; preds = %51
%55 = bitcast i8** %5 to i8*
%56 = getelementptr inbounds i8*, i8** %1, i64 2
%57 = load i8*, i8** %56
%58 = icmp eq i8* %57, null
br i1 %58, label %65, label %59
59: ; preds = %54
%60 = call i32 @strtol(i8* %57, i8** %5, i32 10)
%61 = load i8*, i8** %5
%62 = load i8*, i8** %56
%63 = icmp eq i8* %61, %62
br i1 %63, label %65, label %64
64: ; preds = %59
br label %77
65: ; preds = %54, %59
%66 = load i32*, i32** @stderr
%67 = load i32, i32* %4
%68 = call i32 @fprintf(i32* %66, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i32 %67)
br label %86
69: ; preds = %51
%70 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i32, i32* %3
%74 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %73)
br label %86
75: ; preds = %69
%76 = call i32 (...) @usage()
br label %77
77: ; preds = %64, %48, %45, %40, %75, %30
%78 = phi i32 [ undef, %75 ], [ %44, %40 ], [ %36, %30 ], [ 0, %45 ], [ 255, %48 ], [ %60, %64 ]
%79 = call i32* @fopen(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%80 = icmp eq i32* %79, null
br i1 %80, label %84, label %81
81: ; preds = %77
%82 = call i32 @fprintf(i32* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %78)
%83 = call i32 @fclose(i32* %79)
br label %86
84: ; preds = %77
%85 = call i32 @perror(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.14, i64 0, i64 0))
br label %86
86: ; preds = %65, %81, %84, %72, %14
%87 = phi i32 [ 0, %72 ], [ 1, %65 ], [ 1, %14 ], [ 0, %84 ], [ 0, %81 ]
ret i32 %87
}