#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/backlight/intel_backlight"
                     "/brightness",
                     "r"))) {
    perror("failed to open the screen backlight file: "
           "/sys/class/backlight/intel_backlight"
           "/brightness");
    return 1;
  }
  fscanf(file, "%d", &current);
  fclose(file);
  if ((file = fopen("/sys/class/backlight/intel_backlight"
                    "/max_brightness",
                    "r"))) {
    fscanf(file, "%d", &maxval);
    fclose(file);
  } else {
    maxval = 2000;
  }
  if (!strcmp(argv[1], "up"))
    next = current >= maxval - 150 ? maxval : current + 150;
  else if (!strcmp(argv[1], "down"))
    next = current <= 150 ? 0 : current - 150;
  else if (!strcmp(argv[1], "off"))
    next = 0;
  else if (!strcmp(argv[1], "max"))
    next = maxval;
  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/backlight/intel_backlight"
                    "/brightness",
                    "w"))) {
    fprintf(file, "%d", next);
    fclose(file);
  } else {
    perror("failed to write to the keyboard backlight file: "
           "/sys/class/backlight/intel_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    0xf4e(%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    1472 <main+0x2e2>
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   $0x7d0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12a9 <main+0x119>
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x96,%ecx
cmp    %ecx,%eax
jl     1293 <main+0x103>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    129e <main+0x10e>
mov    -0x14(%rbp),%eax
add    $0x96,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    141d <main+0x28d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdde(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12f3 <main+0x163>
cmpl   $0x96,-0x14(%rbp)
jg     12dd <main+0x14d>
xor    %eax,%eax
mov    %eax,-0x38(%rbp)
jmp    12e8 <main+0x158>
mov    -0x14(%rbp),%eax
sub    $0x96,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1418 <main+0x288>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd99(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    131c <main+0x18c>
movl   $0x0,-0x18(%rbp)
jmp    1413 <main+0x283>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd74(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1344 <main+0x1b4>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    140e <main+0x27e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd50(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13c5 <main+0x235>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     139b <main+0x20b>
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    13c0 <main+0x230>
mov    0x2c3e(%rip),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%edx
lea    0xcf8(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1472 <main+0x2e2>
jmp    1409 <main+0x279>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd02(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13fd <main+0x26d>
mov    -0x14(%rbp),%esi
lea    0xce6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1472 <main+0x2e2>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    1409 <main+0x279>
jmp    140e <main+0x27e>
jmp    1413 <main+0x283>
jmp    1418 <main+0x288>
jmp    141d <main+0x28d>
lea    0xce8(%rip),%rdi
lea    0xcaf(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     145f <main+0x2cf>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xc10(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
jmp    146b <main+0x2db>
lea    0xc76(%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    0xf5e(%rip),%rdi
lea    0xe4b(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     131d <main+0x18d>
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   $0x7d0,(%rsp)
mov    0x8(%r14),%rbx
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12a7 <main+0x117>
lea    0xe58(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12c1 <main+0x131>
lea    0xe4a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12d7 <main+0x147>
lea    0xe3b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12db <main+0x14b>
lea    0xe2c(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1330 <main+0x1a0>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1383 <main+0x1f3>
xor    %eax,%eax
call   1090 <usage@plt>
jmp    12de <main+0x14e>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
lea    -0x96(%rcx),%edx
lea    0x96(%rax),%ebp
cmp    %edx,%eax
cmovge %ecx,%ebp
jmp    12de <main+0x14e>
mov    0x4(%rsp),%eax
lea    -0x96(%rax),%ecx
xor    %ebp,%ebp
cmp    $0x97,%eax
cmovge %ecx,%ebp
jmp    12de <main+0x14e>
xor    %ebp,%ebp
jmp    12de <main+0x14e>
mov    (%rsp),%ebp
lea    0xe27(%rip),%rdi
lea    0xdee(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1375 <main+0x1e5>
mov    %rax,%rbx
lea    0xd5c(%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    0xcde(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%eax
jmp    1314 <main+0x184>
mov    0x10(%r14),%rdi
test   %rdi,%rdi
je     1355 <main+0x1c5>
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rax
cmp    0x10(%r14),%rax
jne    12de <main+0x14e>
mov    0x2c84(%rip),%rax
mov    (%rax),%rdi
mov    (%rsp),%edx
lea    0xd3e(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%eax
jmp    1314 <main+0x184>
lea    0xd60(%rip),%rdi
call   10b0 <perror@plt>
jmp    1312 <main+0x182>
mov    0x4(%rsp),%esi
lea    0xd44(%rip),%rdi
call   1040 <printf@plt>
jmp    1312 <main+0x182>

LLVM IR (-O0):
@.str = [48 x i8] c"/sys/class/backlight/intel_backlight/brightness\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [90 x i8] c"failed to open the screen backlight file: /sys/class/backlight/intel_backlight/brightness\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [52 x i8] c"/sys/class/backlight/intel_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 = [96 x i8] c"failed to write to the keyboard backlight file: /sys/class/backlight/intel_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 ([48 x i8], [48 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 %135
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 ([52 x i8], [52 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 2000, 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, 150
%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, 150
br label %49
49: ; preds = %46, %44
%50 = phi i32 [ %45, %44 ], [ %48, %46 ]
store i32 %50, i32* %7
br label %123
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, 150
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, 150
br label %64
64: ; preds = %61, %60
%65 = phi i32 [ 0, %60 ], [ %63, %61 ]
store i32 %65, i32* %7
br label %122
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 %121
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 %81, label %79
79: ; preds = %73
%80 = load i32, i32* %8
store i32 %80, i32* %7
br label %120
81: ; preds = %73
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 1
%84 = load i8*, i8** %83
%85 = call i32 @strcmp(i8* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%86 = icmp ne i32 %85, 0
br i1 %86, label %107, label %87
87: ; preds = %81
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 2
%90 = load i8*, i8** %89
%91 = icmp ne i8* %90, null
br i1 %91, label %92, label %102
92: ; preds = %87
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 2
%95 = load i8*, i8** %94
%96 = call i32 @strtol(i8* %95, i8** %10, i32 10)
store i32 %96, i32* %7
%97 = load i8*, i8** %10
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 2
%100 = load i8*, i8** %99
%101 = icmp eq i8* %97, %100
br i1 %101, label %102, label %106
102: ; preds = %92, %87
%103 = load i32*, i32** @stderr
%104 = load i32, i32* %8
%105 = call i32 @fprintf(i32* %103, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i32 %104)
store i32 1, i32* %3
br label %135
106: ; preds = %92
br label %119
107: ; preds = %81
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 1
%110 = load i8*, i8** %109
%111 = call i32 @strcmp(i8* %110, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%112 = icmp ne i32 %111, 0
br i1 %112, label %116, label %113
113: ; preds = %107
%114 = load i32, i32* %6
%115 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %114)
store i32 0, i32* %3
br label %135
116: ; preds = %107
%117 = call i32 (...) @usage()
br label %118
118: ; preds = %116
br label %119
119: ; preds = %118, %106
br label %120
120: ; preds = %119, %79
br label %121
121: ; preds = %120, %72
br label %122
122: ; preds = %121, %64
br label %123
123: ; preds = %122, %49
%124 = call i32* @fopen(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32* %124, i32** %9
%125 = icmp ne i32* %124, null
br i1 %125, label %126, label %132
126: ; preds = %123
%127 = load i32*, i32** %9
%128 = load i32, i32* %7
%129 = call i32 @fprintf(i32* %127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %128)
%130 = load i32*, i32** %9
%131 = call i32 @fclose(i32* %130)
br label %134
132: ; preds = %123
%133 = call i32 @perror(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.14, i64 0, i64 0))
br label %134
134: ; preds = %132, %126
store i32 0, i32* %3
br label %135
135: ; preds = %134, %113, %102, %18
%136 = load i32, i32* %3
ret i32 %136
}

LLVM IR (-O2):
@.str = [48 x i8] c"/sys/class/backlight/intel_backlight/brightness\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [90 x i8] c"failed to open the screen backlight file: /sys/class/backlight/intel_backlight/brightness\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [52 x i8] c"/sys/class/backlight/intel_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 = [96 x i8] c"failed to write to the keyboard backlight file: /sys/class/backlight/intel_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 ([48 x i8], [48 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 %88
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 ([52 x i8], [52 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 2000, 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, -150
%34 = icmp slt i32 %31, %33
%35 = add nsw i32 %31, 150
%36 = select i1 %34, i32 %35, i32 %32
br label %79
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, 151
%43 = add nsw i32 %41, -150
%44 = select i1 %42, i32 0, i32 %43
br label %79
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 %79, 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 %51, label %53
51: ; preds = %48
%52 = load i32, i32* %4
br label %79
53: ; preds = %48
%54 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %71
56: ; preds = %53
%57 = bitcast i8** %5 to i8*
%58 = getelementptr inbounds i8*, i8** %1, i64 2
%59 = load i8*, i8** %58
%60 = icmp eq i8* %59, null
br i1 %60, label %67, label %61
61: ; preds = %56
%62 = call i32 @strtol(i8* %59, i8** %5, i32 10)
%63 = load i8*, i8** %5
%64 = load i8*, i8** %58
%65 = icmp eq i8* %63, %64
br i1 %65, label %67, label %66
66: ; preds = %61
br label %79
67: ; preds = %56, %61
%68 = load i32*, i32** @stderr
%69 = load i32, i32* %4
%70 = call i32 @fprintf(i32* %68, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i32 %69)
br label %88
71: ; preds = %53
%72 = call i32 @strcmp(i8* dereferenceable(1) %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = load i32, i32* %3
%76 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %75)
br label %88
77: ; preds = %71
%78 = call i32 (...) @usage()
br label %79
79: ; preds = %66, %45, %40, %51, %77, %30
%80 = phi i32 [ undef, %77 ], [ %52, %51 ], [ %44, %40 ], [ %36, %30 ], [ 0, %45 ], [ %62, %66 ]
%81 = call i32* @fopen(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%82 = icmp eq i32* %81, null
br i1 %82, label %86, label %83
83: ; preds = %79
%84 = call i32 @fprintf(i32* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %80)
%85 = call i32 @fclose(i32* %81)
br label %88
86: ; preds = %79
%87 = call i32 @perror(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.14, i64 0, i64 0))
br label %88
88: ; preds = %67, %83, %86, %74, %14
%89 = phi i32 [ 0, %74 ], [ 1, %67 ], [ 1, %14 ], [ 0, %86 ], [ 0, %83 ]
ret i32 %89
}