#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*/ three;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(void *);
int cpu_info(char const *, char *, int, int, char const *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt(int, char **, char *);
void *optarg;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *format = "%c %3d";
  int interval = 1;
  bool snoop = false;
  bool avg = false;
  const char *delimeter = " ";
  const char *prefix = "";
  int opt;
  while ((opt = getopt(argc, argv, "hscad:p:f:i:")) != -1) {
    switch (opt) {
    case 'h':
      printf(
          "cpu [-h|-s|-c|-a|-d DELIMETER|-p PREFIX|-f FORMAT|-i INTERVAL]\n");
      return EXIT_SUCCESS;
    case 'c': {
      FILE *f = fopen("/proc/stat", "r");
      int count = 0;
      do {
        char three[4];
        fgets(three, sizeof(three), f);
        count += !strcmp(three, "cpu");
      } while (!feof(f));
      fclose(f);
      printf("%d\n", count - 1);
    }
      return EXIT_SUCCESS;
    case 'a':
      avg = true;
      break;
    case 'd':
      delimeter = optarg;
      break;
    case 'p':
      prefix = optarg;
      break;
    case 's':
      snoop = true;
      break;
    case 'f':
      format = optarg;
      break;
    case 'i':
      interval = atoi(optarg);
      break;
    }
  }
  int exit_code;
  char *p = format;
  int hasc = 0;
  while (*p)
    if (*p++ == '%') {
      if (*p == '%')
        p++;
      else
        hasc++;
    }
  if (hasc == 0 || hasc > 2)
    fprintf(stderr, "Invalid format.\n");
  if (snoop)
    while ((exit_code = cpu_info(prefix, format, avg, (hasc - 1), delimeter)) !=
           EXIT_FAILURE)
      sleep(interval);
  else
    exit_code = cpu_info(prefix, format, avg, (hasc - 1), delimeter);
  return exit_code;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe66(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe4b(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xffffffff,%eax
je     1365 <main+0x1b5>
mov    -0x3c(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x12,%eax
ja     1360 <main+0x1b0>
mov    -0x70(%rbp),%rax
lea    0xdc5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <main+0x2b9>
lea    0xe38(%rip),%rdi
lea    0xe3c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x4,%esi
call   1050 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xe11(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1281 <main+0xd1>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4c(%rbp),%esi
sub    $0x1,%esi
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2cd5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <main+0x2b9>
movl   $0x1,-0x24(%rbp)
jmp    1360 <main+0x1b0>
mov    0x2ce8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    1360 <main+0x1b0>
mov    0x2cd5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    1360 <main+0x1b0>
movl   $0x1,-0x20(%rbp)
jmp    1360 <main+0x1b0>
mov    0x2cb6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1360 <main+0x1b0>
mov    0x2ca3(%rip),%rax
mov    (%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    11fc <main+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x60(%rbp),%rax
cmpb   $0x0,(%rax)
je     13d0 <main+0x220>
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x60(%rbp)
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    13cb <main+0x21b>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    13bd <main+0x20d>
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    13c6 <main+0x216>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    13cb <main+0x21b>
jmp    1374 <main+0x1c4>
cmpl   $0x0,-0x64(%rbp)
je     13e4 <main+0x234>
cmpl   $0x2,-0x64(%rbp)
jle    13f9 <main+0x249>
mov    0x2bed(%rip),%rax
mov    (%rax),%edi
lea    0xcc3(%rip),%rsi
call   1070 <fprintf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1446 <main+0x296>
jmp    1408 <main+0x258>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%r8
call   1090 <cpu_info@plt>
mov    %eax,-0x54(%rbp)
mov    0x2ba4(%rip),%rcx
cmp    (%rcx),%eax
je     1441 <main+0x291>
mov    -0x1c(%rbp),%edi
call   10d0 <sleep@plt>
jmp    1408 <main+0x258>
jmp    1463 <main+0x2b3>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%r8
call   1090 <cpu_info@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbp
mov    %edi,%r12d
lea    0xe81(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xeb0(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe70(%rip),%rax
mov    %rax,0x10(%rsp)
xor    %r13d,%r13d
mov    $0x1,%ebx
lea    0xe5e(%rip),%r14
lea    0xe02(%rip),%r15
movl   $0x0,0x4(%rsp)
jmp    1219 <main+0x69>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     131c <main+0x16c>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
call   10b0 <getopt@plt>
lea    -0x61(%rax),%ecx
cmp    $0x12,%ecx
ja     1210 <main+0x60>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
movl   $0x1,0x4(%rsp)
jmp    1219 <main+0x69>
mov    0x2daf(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
jmp    1219 <main+0x69>
mov    0x2d9e(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
jmp    1219 <main+0x69>
mov    0x2d8d(%rip),%rax
mov    (%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebx
jmp    1219 <main+0x69>
mov    0x2d7a(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
jmp    1219 <main+0x69>
mov    $0x1,%r13d
jmp    1219 <main+0x69>
lea    0xdcb(%rip),%rdi
lea    0xdcf(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
xor    %ebx,%ebx
lea    0x24(%rsp),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    $0x4,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
xor    %eax,%eax
cmpl   $0x757063,0x24(%rsp)
sete   %al
add    %eax,%ebx
mov    %rbp,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     12b0 <main+0x100>
mov    %rbp,%rdi
call   1040 <fclose@plt>
add    $0xffffffff,%ebx
lea    0xd86(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1304 <main+0x154>
lea    0xd89(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cbd(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rsp),%rsi
mov    (%rsi),%al
xor    %ebp,%ebp
test   %al,%al
je     1370 <main+0x1c0>
mov    %rsi,%rdx
mov    0x18(%rsp),%r14
mov    0x10(%rsp),%r15
mov    %ebx,%r12d
mov    0x4(%rsp),%ebx
jmp    1351 <main+0x1a1>
nop
add    $0x2,%rdx
mov    %rdx,%rcx
movzbl (%rcx),%eax
mov    %rcx,%rdx
test   %al,%al
je     1365 <main+0x1b5>
lea    0x1(%rdx),%rcx
cmp    $0x25,%al
jne    1347 <main+0x197>
movzbl (%rcx),%eax
cmp    $0x25,%al
je     1340 <main+0x190>
add    $0x1,%ebp
jmp    134a <main+0x19a>
test   %ebp,%ebp
je     1381 <main+0x1d1>
cmp    $0x3,%ebp
jl     139b <main+0x1eb>
jmp    1381 <main+0x1d1>
mov    0x18(%rsp),%r14
mov    0x10(%rsp),%r15
mov    %ebx,%r12d
mov    0x4(%rsp),%ebx
mov    0x2c50(%rip),%rax
mov    (%rax),%edi
lea    0xce6(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x8(%rsp),%rsi
add    $0xffffffff,%ebp
mov    %r14,%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r15,%r8
call   1090 <cpu_info@plt>
test   %r13d,%r13d
je     130d <main+0x15d>
mov    0x2c13(%rip),%rcx
cmp    (%rcx),%eax
je     130d <main+0x15d>
mov    0x8(%rsp),%rbx
mov    %ebp,%r13d
nopl   (%rax)
mov    %r12d,%edi
mov    %rcx,%rbp
call   10d0 <sleep@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    0x4(%rsp),%edx
mov    %r13d,%ecx
mov    %r15,%r8
call   1090 <cpu_info@plt>
mov    %rbp,%rcx
cmp    0x0(%rbp),%eax
jne    13d0 <main+0x220>
jmp    130d <main+0x15d>

LLVM IR (-O0):
@.str = [7 x i8] c"%c %3d\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [13 x i8] c"hscad:p:f:i:\00"
@.str.4 = [64 x i8] c"cpu [-h|-s|-c|-a|-d DELIMETER|-p PREFIX|-f FORMAT|-i INTERVAL]\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.5 = [11 x i8] c"/proc/stat\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [4 x i8] c"cpu\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.9 = [17 x i8] c"Invalid format.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32
%15 = alloca [4 x i8]
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %6
store i32 1, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %11
br label %19
19: ; preds = %65, %2
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @getopt(i32 %20, i8** %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i32 %22, i32* %12
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %66
24: ; preds = %19
%25 = load i32, i32* %12
switch i32 %25, label %65 [
i32 104, label %26
i32 99, label %29
i32 97, label %54
i32 100, label %55
i32 112, label %57
i32 115, label %59
i32 102, label %60
i32 105, label %62
]
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32, i32* @EXIT_SUCCESS
store i32 %28, i32* %3
br label %128
29: ; preds = %24
%30 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %30, i32** %13
store i32 0, i32* %14
br label %31
31: ; preds = %42, %29
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
%33 = load i32*, i32** %13
%34 = call i32 @fgets(i8* %32, i32 4, i32* %33)
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = load i32, i32* %14
%41 = add nsw i32 %40, %39
store i32 %41, i32* %14
br label %42
42: ; preds = %31
%43 = load i32*, i32** %13
%44 = call i32 @feof(i32* %43)
%45 = icmp ne i32 %44, 0
%46 = xor i1 %45, true
br i1 %46, label %31, label %47
47: ; preds = %42
%48 = load i32*, i32** %13
%49 = call i32 @fclose(i32* %48)
%50 = load i32, i32* %14
%51 = sub nsw i32 %50, 1
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %51)
%53 = load i32, i32* @EXIT_SUCCESS
store i32 %53, i32* %3
br label %128
54: ; preds = %24
store i32 1, i32* %9
br label %65
55: ; preds = %24
%56 = load i8*, i8** @optarg
store i8* %56, i8** %10
br label %65
57: ; preds = %24
%58 = load i8*, i8** @optarg
store i8* %58, i8** %11
br label %65
59: ; preds = %24
store i32 1, i32* %8
br label %65
60: ; preds = %24
%61 = load i8*, i8** @optarg
store i8* %61, i8** %6
br label %65
62: ; preds = %24
%63 = load i8*, i8** @optarg
%64 = call i32 @atoi(i8* %63)
store i32 %64, i32* %7
br label %65
65: ; preds = %24, %62, %60, %59, %57, %55, %54
br label %19
66: ; preds = %19
%67 = load i8*, i8** %6
store i8* %67, i8** %17
store i32 0, i32* %18
br label %68
68: ; preds = %90, %66
%69 = load i8*, i8** %17
%70 = load i8, i8* %69
%71 = icmp ne i8 %70, 0
br i1 %71, label %72, label %91
72: ; preds = %68
%73 = load i8*, i8** %17
%74 = getelementptr inbounds i8, i8* %73, i32 1
store i8* %74, i8** %17
%75 = load i8, i8* %73
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 37
br i1 %77, label %78, label %90
78: ; preds = %72
%79 = load i8*, i8** %17
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 37
br i1 %82, label %83, label %86
83: ; preds = %78
%84 = load i8*, i8** %17
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %17
br label %89
86: ; preds = %78
%87 = load i32, i32* %18
%88 = add nsw i32 %87, 1
store i32 %88, i32* %18
br label %89
89: ; preds = %86, %83
br label %90
90: ; preds = %89, %72
br label %68
91: ; preds = %68
%92 = load i32, i32* %18
%93 = icmp eq i32 %92, 0
br i1 %93, label %97, label %94
94: ; preds = %91
%95 = load i32, i32* %18
%96 = icmp sgt i32 %95, 2
br i1 %96, label %97, label %100
97: ; preds = %94, %91
%98 = load i32, i32* @stderr
%99 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
br label %100
100: ; preds = %97, %94
%101 = load i32, i32* %8
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %118
103: ; preds = %100
br label %104
104: ; preds = %114, %103
%105 = load i8*, i8** %11
%106 = load i8*, i8** %6
%107 = load i32, i32* %9
%108 = load i32, i32* %18
%109 = sub nsw i32 %108, 1
%110 = load i8*, i8** %10
%111 = call i32 @cpu_info(i8* %105, i8* %106, i32 %107, i32 %109, i8* %110)
store i32 %111, i32* %16
%112 = load i32, i32* @EXIT_FAILURE
%113 = icmp ne i32 %111, %112
br i1 %113, label %114, label %117
114: ; preds = %104
%115 = load i32, i32* %7
%116 = call i32 @sleep(i32 %115)
br label %104
117: ; preds = %104
br label %126
118: ; preds = %100
%119 = load i8*, i8** %11
%120 = load i8*, i8** %6
%121 = load i32, i32* %9
%122 = load i32, i32* %18
%123 = sub nsw i32 %122, 1
%124 = load i8*, i8** %10
%125 = call i32 @cpu_info(i8* %119, i8* %120, i32 %121, i32 %123, i8* %124)
store i32 %125, i32* %16
br label %126
126: ; preds = %118, %117
%127 = load i32, i32* %16
store i32 %127, i32* %3
br label %128
128: ; preds = %126, %47, %26
%129 = load i32, i32* %3
ret i32 %129
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c %3d\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [13 x i8] c"hscad:p:f:i:\00"
@EXIT_SUCCESS = global i32 0
@.str.5 = [11 x i8] c"/proc/stat\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [4 x i8] c"cpu\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.9 = [17 x i8] c"Invalid format.\0A\00"
@EXIT_FAILURE = global i32 0
@str = [63 x i8] c"cpu [-h|-s|-c|-a|-d DELIMETER|-p PREFIX|-f FORMAT|-i INTERVAL]\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [4 x i8]
br label %4
4: ; preds = %62, %2
%5 = phi i32 [ %64, %62 ], [ 1, %2 ]
%6 = phi i32 [ %12, %62 ], [ 0, %2 ]
%7 = phi i32 [ %18, %62 ], [ 0, %2 ]
%8 = phi i8* [ %23, %62 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %2 ]
%9 = phi i8* [ %27, %62 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %2 ]
%10 = phi i8* [ %30, %62 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ]
br label %11
11: ; preds = %31, %4
%12 = phi i32 [ %6, %4 ], [ 1, %31 ]
%13 = phi i32 [ %7, %4 ], [ %18, %31 ]
%14 = phi i8* [ %8, %4 ], [ %23, %31 ]
%15 = phi i8* [ %9, %4 ], [ %27, %31 ]
%16 = phi i8* [ %10, %4 ], [ %30, %31 ]
br label %17
17: ; preds = %31, %11
%18 = phi i32 [ %13, %11 ], [ 1, %31 ]
%19 = phi i8* [ %14, %11 ], [ %23, %31 ]
%20 = phi i8* [ %15, %11 ], [ %27, %31 ]
%21 = phi i8* [ %16, %11 ], [ %30, %31 ]
br label %22
22: ; preds = %17, %56
%23 = phi i8* [ %19, %17 ], [ %57, %56 ]
%24 = phi i8* [ %20, %17 ], [ %27, %56 ]
%25 = phi i8* [ %21, %17 ], [ %30, %56 ]
br label %26
26: ; preds = %22, %58
%27 = phi i8* [ %24, %22 ], [ %59, %58 ]
%28 = phi i8* [ %25, %22 ], [ %30, %58 ]
br label %29
29: ; preds = %26, %60
%30 = phi i8* [ %28, %26 ], [ %61, %60 ]
br label %31
31: ; preds = %29, %31
%32 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
switch i32 %32, label %31 [
i32 -1, label %33
i32 104, label %36
i32 99, label %39
i32 97, label %17
i32 100, label %56
i32 112, label %58
i32 115, label %11
i32 102, label %60
i32 105, label %62
]
33: ; preds = %31
%34 = load i8, i8* %30
%35 = icmp eq i8 %34, 0
br i1 %35, label %90, label %65
36: ; preds = %31
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%38 = load i32, i32* @EXIT_SUCCESS
br label %107
39: ; preds = %31
%40 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%41 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
br label %42
42: ; preds = %42, %39
%43 = phi i32 [ 0, %39 ], [ %48, %42 ]
%44 = call i32 @fgets(i8* %41, i32 4, i32* %40)
%45 = call i32 @bcmp(i8* dereferenceable(4) %41, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64 4)
%46 = icmp eq i32 %45, 0
%47 = zext i1 %46 to i32
%48 = add nuw nsw i32 %43, %47
%49 = call i32 @feof(i32* %40)
%50 = icmp eq i32 %49, 0
br i1 %50, label %42, label %51
51: ; preds = %42
%52 = call i32 @fclose(i32* %40)
%53 = add nsw i32 %48, -1
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %53)
%55 = load i32, i32* @EXIT_SUCCESS
br label %107
56: ; preds = %31
%57 = load i8*, i8** @optarg
br label %22
58: ; preds = %31
%59 = load i8*, i8** @optarg
br label %26
60: ; preds = %31
%61 = load i8*, i8** @optarg
br label %29
62: ; preds = %31
%63 = load i8*, i8** @optarg
%64 = tail call i32 @atoi(i8* %63)
br label %4
65: ; preds = %33, %81
%66 = phi i8 [ %82, %81 ], [ %34, %33 ]
%67 = phi i32 [ %84, %81 ], [ 0, %33 ]
%68 = phi i8* [ %83, %81 ], [ %30, %33 ]
%69 = getelementptr inbounds i8, i8* %68, i64 1
%70 = icmp eq i8 %66, 37
br i1 %70, label %71, label %78
71: ; preds = %65
%72 = load i8, i8* %69
%73 = icmp eq i8 %72, 37
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = getelementptr inbounds i8, i8* %68, i64 2
br label %78
76: ; preds = %71
%77 = add nsw i32 %67, 1
br label %81
78: ; preds = %65, %74
%79 = phi i8* [ %69, %65 ], [ %75, %74 ]
%80 = load i8, i8* %79
br label %81
81: ; preds = %78, %76
%82 = phi i8 [ %80, %78 ], [ %72, %76 ]
%83 = phi i8* [ %79, %78 ], [ %69, %76 ]
%84 = phi i32 [ %67, %78 ], [ %77, %76 ]
%85 = icmp eq i8 %82, 0
br i1 %85, label %86, label %65
86: ; preds = %81
%87 = icmp eq i32 %84, 0
%88 = icmp sgt i32 %84, 2
%89 = or i1 %87, %88
br i1 %89, label %90, label %94
90: ; preds = %33, %86
%91 = phi i32 [ %84, %86 ], [ 0, %33 ]
%92 = load i32, i32* @stderr
%93 = tail call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
br label %94
94: ; preds = %86, %90
%95 = phi i32 [ %84, %86 ], [ %91, %90 ]
%96 = icmp eq i32 %12, 0
%97 = add nsw i32 %95, -1
%98 = tail call i32 @cpu_info(i8* %27, i8* %30, i32 %18, i32 %97, i8* %23)
%99 = load i32, i32* @EXIT_FAILURE
%100 = icmp eq i32 %98, %99
%101 = select i1 %96, i1 true, i1 %100
br i1 %101, label %107, label %102
102: ; preds = %94, %102
%103 = tail call i32 @sleep(i32 %5)
%104 = tail call i32 @cpu_info(i8* %27, i8* %30, i32 %18, i32 %97, i8* %23)
%105 = load i32, i32* @EXIT_FAILURE
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %102
107: ; preds = %102, %94, %51, %36
%108 = phi i32 [ %55, %51 ], [ %38, %36 ], [ %98, %94 ], [ %104, %102 ]
ret i32 %108
}