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

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
char *strtok(char *, char *);
int put_infos(char *path, char *format) {
  FILE *bf = fopen(path, "r");
  if (bf == NULL) {
    fprintf(stderr, "Can't open '%s'.\n", path);
    return EXIT_FAILURE;
  }
  char line[256] = {0};
  char status[256] = {0};
  int capacity = -1;
  bool found_status = false, found_capacity = false;
  while (fgets(line, sizeof(line), bf) != NULL) {
    char *key = strtok(line, "=\n");
    if (key != NULL) {
      if (!found_status && strcmp(key, "POWER_SUPPLY_"
                                       "STATUS") == 0) {
        strncpy(status, strtok(NULL, "=\n"), sizeof(status));
        found_status = true;
      } else if (capacity == -1 && strcmp(key, "POWER_SUPPLY_"
                                               "CAPACITY") == 0) {
        capacity = atoi(strtok(NULL, "=\n"));
        found_capacity = true;
      }
    }
  }
  fclose(bf);
  if (!found_capacity || !found_status) {
    fprintf(stderr, "The battery information is missing.\n");
    return EXIT_FAILURE;
  } else {
    if (strstr(format, "%s") == NULL)
      printf(format, capacity);
    else if (strstr(format, "%i") == NULL)
      printf(format, status);
    else
      printf(format, status, capacity);
    printf("\n");
    fflush(stdout);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<put_infos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    121e <put_infos+0x5e>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1466 <put_infos+0x2a6>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
lea    -0x220(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
movl   $0xffffffff,-0x224(%rbp)
ff ff ff
movl   $0x0,-0x228(%rbp)
movl   $0x0,-0x22c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1375 <put_infos+0x1b5>
lea    -0x120(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x238(%rbp)
cmpq   $0x0,-0x238(%rbp)
je     1370 <put_infos+0x1b0>
cmpl   $0x0,-0x228(%rbp)
jne    1314 <put_infos+0x154>
mov    -0x238(%rbp),%rdi
lea    0xd53(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1314 <put_infos+0x154>
lea    -0x220(%rbp),%rax
mov    %rax,-0x240(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd28(%rip),%rsi
call   10c0 <strtok@plt>
mov    -0x240(%rbp),%rdi
mov    %rax,%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
movl   $0x1,-0x228(%rbp)
jmp    136b <put_infos+0x1ab>
cmpl   $0xffffffff,-0x224(%rbp)
jne    1366 <put_infos+0x1a6>
mov    -0x238(%rbp),%rdi
lea    0xcfc(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1366 <put_infos+0x1a6>
xor    %eax,%eax
mov    %eax,%edi
lea    0xccb(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x224(%rbp)
movl   $0x1,-0x22c(%rbp)
jmp    136b <put_infos+0x1ab>
jmp    1370 <put_infos+0x1b0>
jmp    1262 <put_infos+0xa2>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x22c(%rbp)
je     1398 <put_infos+0x1d8>
cmpl   $0x0,-0x228(%rbp)
jne    13c0 <put_infos+0x200>
mov    0x2c41(%rip),%rax
mov    (%rax),%edi
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2c22(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1466 <put_infos+0x2a6>
mov    -0x18(%rbp),%rdi
lea    0xc9b(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
jne    13f0 <put_infos+0x230>
mov    -0x18(%rbp),%rdi
mov    -0x224(%rbp),%esi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    143e <put_infos+0x27e>
mov    -0x18(%rbp),%rdi
lea    0xc6e(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
jne    1421 <put_infos+0x261>
mov    -0x18(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1439 <put_infos+0x279>
mov    -0x18(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    -0x224(%rbp),%edx
mov    $0x0,%al
call   1050 <printf@plt>
jmp    143e <put_infos+0x27e>
lea    0xbcd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2b67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_infos>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
mov    %rsi,%r14
mov    %rdi,%rbp
lea    0xe22(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13d8 <put_infos+0x218>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0x110(%rsp),%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
mov    %r14,0x8(%rsp)
je     13fe <put_infos+0x23e>
mov    $0xffffffff,%r12d
xor    %eax,%eax
mov    %rax,(%rsp)
lea    0xd01(%rip),%r15
lea    0x110(%rsp),%rbp
xor    %r13d,%r13d
jmp    1369 <put_infos+0x1a9>
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
lea    0x10(%rsp),%rdi
mov    %rax,%rsi
mov    $0x100,%edx
call   1040 <strncpy@plt>
mov    $0x1,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     140d <put_infos+0x24d>
mov    %rbp,%rdi
mov    %r15,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
je     1350 <put_infos+0x190>
mov    %rax,%r14
test   %r13d,%r13d
jne    1395 <put_infos+0x1d5>
mov    %r14,%rdi
lea    0xc8c(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1320 <put_infos+0x160>
cmp    $0xffffffff,%r12d
jne    1350 <put_infos+0x190>
mov    %r14,%rdi
lea    0xc86(%rip),%rsi
call   1080 <strcmp@plt>
mov    $0xffffffff,%r12d
test   %rax,%rax
jne    1350 <put_infos+0x190>
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    %rax,%rdi
call   10d0 <atoi@plt>
mov    %eax,%r12d
mov    $0x1,%eax
mov    %rax,(%rsp)
jmp    1350 <put_infos+0x190>
mov    0x2c01(%rip),%rax
mov    (%rax),%edi
lea    0xc1a(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2bdf(%rip),%rax
jmp    14b6 <put_infos+0x2f6>
xor    %r13d,%r13d
mov    $0xffffffff,%r12d
xor    %eax,%eax
mov    %rax,(%rsp)
mov    %rbx,%rdi
call   1050 <fclose@plt>
cmpl   $0x0,(%rsp)
je     1461 <put_infos+0x2a1>
test   %r13d,%r13d
je     1461 <put_infos+0x2a1>
lea    0xc3f(%rip),%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1481 <put_infos+0x2c1>
lea    0xc29(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strstr@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
test   %rax,%rax
je     1490 <put_infos+0x2d0>
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1497 <put_infos+0x2d7>
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
lea    0xbd0(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2b59(%rip),%rax
jmp    14b6 <put_infos+0x2f6>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1497 <put_infos+0x2d7>
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2b28(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2b12(%rip),%rax
mov    (%rax),%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [18 x i8] c"Can't open '%s'.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"=\0A\00"
@.str.3 = [20 x i8] c"POWER_SUPPLY_STATUS\00"
@.str.4 = [22 x i8] c"POWER_SUPPLY_CAPACITY\00"
@.str.5 = [37 x i8] c"The battery information is missing.\0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%i\00"
@.str.8 = [2 x i8] c"\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @put_infos(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%13 = load i8*, i8** %4
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %4
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @EXIT_FAILURE
store i32 %21, i32* %3
br label %99
22: ; preds = %2
%23 = bitcast [256 x i8]* %7 to i8*
%24 = bitcast [256 x i8]* %8 to i8*
store i32 -1, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
br label %25
25: ; preds = %58, %22
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%27 = load i32*, i32** %6
%28 = call i32* @fgets(i8* %26, i32 256, i32* %27)
%29 = icmp ne i32* %28, null
br i1 %29, label %30, label %59
30: ; preds = %25
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%32 = call i8* @strtok(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %32, i8** %12
%33 = load i8*, i8** %12
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %58
35: ; preds = %30
%36 = load i32, i32* %10
%37 = icmp ne i32 %36, 0
br i1 %37, label %46, label %38
38: ; preds = %35
%39 = load i8*, i8** %12
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%44 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%45 = call i32 @strncpy(i8* %43, i8* %44, i32 256)
store i32 1, i32* %10
br label %57
46: ; preds = %38, %35
%47 = load i32, i32* %9
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %56
49: ; preds = %46
%50 = load i8*, i8** %12
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%55 = call i32 @atoi(i8* %54)
store i32 %55, i32* %9
store i32 1, i32* %11
br label %56
56: ; preds = %53, %49, %46
br label %57
57: ; preds = %56, %42
br label %58
58: ; preds = %57, %30
br label %25
59: ; preds = %25
%60 = load i32*, i32** %6
%61 = call i32 @fclose(i32* %60)
%62 = load i32, i32* %11
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = load i32, i32* %10
%66 = icmp ne i32 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %64, %59
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%70 = load i32, i32* @EXIT_FAILURE
store i32 %70, i32* %3
br label %99
71: ; preds = %64
%72 = load i8*, i8** %5
%73 = call i32* @strstr(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%74 = icmp eq i32* %73, null
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i8*, i8** %5
%77 = load i32, i32* %9
%78 = call i32 (i8*, ...) @printf(i8* %76, i32 %77)
br label %93
79: ; preds = %71
%80 = load i8*, i8** %5
%81 = call i32* @strstr(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%82 = icmp eq i32* %81, null
br i1 %82, label %83, label %87
83: ; preds = %79
%84 = load i8*, i8** %5
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%86 = call i32 (i8*, ...) @printf(i8* %84, i8* %85)
br label %92
87: ; preds = %79
%88 = load i8*, i8** %5
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%90 = load i32, i32* %9
%91 = call i32 (i8*, ...) @printf(i8* %88, i8* %89, i32 %90)
br label %92
92: ; preds = %87, %83
br label %93
93: ; preds = %92, %75
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%95 = load i32, i32* @stdout
%96 = call i32 @fflush(i32 %95)
br label %97
97: ; preds = %93
%98 = load i32, i32* @EXIT_SUCCESS
store i32 %98, i32* %3
br label %99
99: ; preds = %97, %67, %17
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [18 x i8] c"Can't open '%s'.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"=\0A\00"
@.str.3 = [20 x i8] c"POWER_SUPPLY_STATUS\00"
@.str.4 = [22 x i8] c"POWER_SUPPLY_CAPACITY\00"
@.str.5 = [37 x i8] c"The battery information is missing.\0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%i\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @put_infos(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%10 = load i32, i32* @EXIT_FAILURE
br label %74
11: ; preds = %2
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%14 = call i32* @fgets(i8* %12, i32 256, i32* %5)
%15 = icmp eq i32* %14, null
br i1 %15, label %44, label %16
16: ; preds = %11, %38
%17 = phi i32 [ %41, %38 ], [ 0, %11 ]
%18 = phi i32 [ %40, %38 ], [ 0, %11 ]
%19 = phi i32 [ %39, %38 ], [ -1, %11 ]
%20 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %38, label %22
22: ; preds = %16
%23 = icmp eq i32 %18, 0
br i1 %23, label %24, label %30
24: ; preds = %22
%25 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @strncpy(i8* %13, i8* %28, i32 256)
br label %38
30: ; preds = %24, %22
%31 = icmp eq i32 %19, -1
br i1 %31, label %32, label %38
32: ; preds = %30
%33 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 @atoi(i8* %36)
br label %38
38: ; preds = %27, %35, %32, %30, %16
%39 = phi i32 [ %37, %35 ], [ -1, %32 ], [ %19, %30 ], [ %19, %27 ], [ %19, %16 ]
%40 = phi i32 [ %18, %35 ], [ %18, %32 ], [ %18, %30 ], [ 1, %27 ], [ %18, %16 ]
%41 = phi i32 [ 1, %35 ], [ %17, %32 ], [ %17, %30 ], [ %17, %27 ], [ %17, %16 ]
%42 = call i32* @fgets(i8* %12, i32 256, i32* %5)
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %16
44: ; preds = %38, %11
%45 = phi i32 [ -1, %11 ], [ %39, %38 ]
%46 = phi i32 [ 0, %11 ], [ %40, %38 ]
%47 = phi i32 [ 0, %11 ], [ %41, %38 ]
%48 = call i32 @fclose(i32* %5)
%49 = icmp ne i32 %47, 0
%50 = icmp ne i32 %46, 0
%51 = select i1 %49, i1 %50, i1 false
br i1 %51, label %55, label %52
52: ; preds = %44
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
br label %71
55: ; preds = %44
%56 = call i32* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %1, i32 %45)
br label %67
60: ; preds = %55
%61 = call i32* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%62 = icmp eq i32* %61, null
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %1, i8* %13)
br label %67
65: ; preds = %60
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %1, i8* %13, i32 %45)
br label %67
67: ; preds = %63, %65, %58
%68 = call i32 @putchar(i32 10)
%69 = load i32, i32* @stdout
%70 = call i32 @fflush(i32 %69)
br label %71
71: ; preds = %67, %52
%72 = phi i32* [ @EXIT_SUCCESS, %67 ], [ @EXIT_FAILURE, %52 ]
%73 = load i32, i32* %72
br label %74
74: ; preds = %71, %7
%75 = phi i32 [ %10, %7 ], [ %73, %71 ]
ret i32 %75
}