#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ escape_single_quotes(char *, char *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setregid(int, int);
int snprintf(char *, int, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  FILE *fp;
  char buf[256];
  char escaped_name[256];
  char *filename;
  int lines, chars, cpl;
  setregid(1012, 1012);
  if (argc != 2) {
    fprintf(stderr, "Usage: %s filename\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  filename = argv[1];
  printf("Counting %s ... \n", filename);
  if (!escape_single_quotes(escaped_name, filename, 256)) {
    fprintf(stderr, "Escaped filename is too long!\n");
    exit(EXIT_FAILURE);
  }
  printf("vertify : %s\n", escaped_name);
  if (snprintf(buf, 256, "wc -l '%s'", escaped_name) >= 256) {
    fprintf(stderr, "Filename %s is too long!\n", filename);
    exit(EXIT_FAILURE);
  }
  fp = popen(buf, "r");
  if (!fp) {
    fprintf(stderr, "Command execution failed! Sorry!\n");
    exit(EXIT_FAILURE);
  }
  if (1 != fscanf(fp, "%d", &lines)) {
    fprintf(stderr, "Cannot scan! Sorry!\n");
  }
  pclose(fp);
  snprintf(buf, 256, "wc -c '%s'", escaped_name);
  fp = popen(buf, "r");
  if (!fp) {
    fprintf(stderr, "Command execution failed! Bummer!\n");
    exit(EXIT_FAILURE);
  }
  if (1 != fscanf(fp, "%d", &chars)) {
    fprintf(stderr, "Cannot scan! Sorry!\n");
  }
  pclose(fp);
  cpl = chars / lines;
  printf("Chars per line is %d.\n", cpl);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3f4,%esi
mov    %esi,%edi
call   1090 <setregid@plt>
cmpl   $0x2,-0x8(%rbp)
je     11eb <main+0x5b>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x228(%rbp)
mov    -0x228(%rbp),%rsi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x220(%rbp),%rdi
mov    -0x228(%rbp),%rsi
mov    $0x100,%edx
call   1030 <escape_single_quotes@plt>
cmp    $0x0,%eax
jne    1255 <main+0xc5>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
lea    0xde6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
lea    -0x220(%rbp),%rsi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x120(%rbp),%rdi
lea    -0x220(%rbp),%rcx
mov    $0x100,%esi
lea    0xdcf(%rip),%rdx
call   1060 <snprintf@plt>
cmp    $0x100,%eax
jl     12c0 <main+0x130>
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
mov    -0x228(%rbp),%rdx
lea    0xdb3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
lea    -0x120(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   10a0 <popen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1307 <main+0x177>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
lea    0xd88(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2cd8(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    0xd8a(%rip),%rsi
lea    -0x22c(%rbp),%rdx
call   1070 <fscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1344 <main+0x1b4>
mov    0x2cac(%rip),%rax
mov    (%rax),%edi
lea    0xd62(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <pclose@plt>
lea    -0x120(%rbp),%rdi
lea    -0x220(%rbp),%rcx
mov    $0x100,%esi
lea    0xd4d(%rip),%rdx
call   1060 <snprintf@plt>
lea    -0x120(%rbp),%rdi
lea    0xcfe(%rip),%rsi
call   10a0 <popen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13b3 <main+0x223>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2c2c(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    0xcde(%rip),%rsi
lea    -0x230(%rbp),%rdx
call   1070 <fscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     13f0 <main+0x260>
mov    0x2c00(%rip),%rax
mov    (%rax),%edi
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <pclose@plt>
mov    -0x230(%rbp),%eax
cltd
idivl  -0x22c(%rbp)
mov    %eax,-0x234(%rbp)
mov    -0x234(%rbp),%esi
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2ba9(%rip),%rax
mov    (%rax),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x218,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x3f4,%edi
mov    $0x3f4,%esi
call   1090 <setregid@plt>
cmp    $0x2,%ebp
jne    131a <main+0x18a>
mov    0x8(%rbx),%rbx
lea    0xe53(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1030 <escape_single_quotes@plt>
test   %eax,%eax
je     132f <main+0x19f>
lea    0xe59(%rip),%rdi
lea    0x10(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe51(%rip),%rdx
lea    0x110(%rsp),%rdi
mov    $0x100,%esi
mov    %rbp,%rcx
call   1060 <snprintf@plt>
cmp    $0x100,%eax
jge    1341 <main+0x1b1>
lea    0xe4f(%rip),%rsi
lea    0x110(%rsp),%rdi
call   10a0 <popen@plt>
test   %rax,%rax
je     135d <main+0x1cd>
mov    %rax,%rbx
lea    0xe53(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1070 <fscanf@plt>
cmp    $0x1,%eax
je     1272 <main+0xe2>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <pclose@plt>
lea    0xe33(%rip),%rdx
lea    0x110(%rsp),%rbx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1060 <snprintf@plt>
lea    0xdd6(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <popen@plt>
test   %rax,%rax
je     136f <main+0x1df>
mov    %rax,%rbx
lea    0xddf(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1070 <fscanf@plt>
cmp    $0x1,%eax
je     12e6 <main+0x156>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
lea    0xdc0(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <pclose@plt>
mov    0x8(%rsp),%eax
cltd
idivl  0xc(%rsp)
lea    0xde4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2cc2(%rip),%rax
mov    (%rax),%eax
add    $0x218,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xcd3(%rip),%rsi
jmp    1354 <main+0x1c4>
mov    0x2caa(%rip),%rax
mov    (%rax),%edi
lea    0xce7(%rip),%rsi
jmp    137f <main+0x1ef>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
lea    0xd0d(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1386 <main+0x1f6>
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
lea    0xd0d(%rip),%rsi
jmp    137f <main+0x1ef>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
lea    0xd40(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [18 x i8] c"Counting %s ... \0A\00"
@.str.2 = [31 x i8] c"Escaped filename is too long!\0A\00"
@.str.3 = [14 x i8] c"vertify : %s\0A\00"
@.str.4 = [11 x i8] c"wc -l '%s'\00"
@.str.5 = [26 x i8] c"Filename %s is too long!\0A\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [34 x i8] c"Command execution failed! Sorry!\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [21 x i8] c"Cannot scan! Sorry!\0A\00"
@.str.10 = [11 x i8] c"wc -c '%s'\00"
@.str.11 = [35 x i8] c"Command execution failed! Bummer!\0A\00"
@.str.12 = [23 x i8] c"Chars per line is %d.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 @setregid(i32 1012, i32 1012)
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
store i8* %27, i8** %9
%28 = load i8*, i8** %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%31 = load i8*, i8** %9
%32 = call i32 @escape_single_quotes(i8* %30, i8* %31, i32 256)
%33 = icmp ne i32 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %24
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %24
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%44 = call i32 @snprintf(i8* %42, i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %43)
%45 = icmp sge i32 %44, 256
br i1 %45, label %46, label %52
46: ; preds = %39
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %9
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %48)
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %39
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%54 = call i32* @popen(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %54, i32** %6
%55 = load i32*, i32** %6
%56 = icmp ne i32* %55, null
br i1 %56, label %62, label %57
57: ; preds = %52
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %52
%63 = load i32*, i32** %6
%64 = call i32 @fscanf(i32* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %10)
%65 = icmp ne i32 1, %64
br i1 %65, label %66, label %69
66: ; preds = %62
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %69
69: ; preds = %66, %62
%70 = load i32*, i32** %6
%71 = call i32 @pclose(i32* %70)
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%74 = call i32 @snprintf(i8* %72, i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %73)
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%76 = call i32* @popen(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %76, i32** %6
%77 = load i32*, i32** %6
%78 = icmp ne i32* %77, null
br i1 %78, label %84, label %79
79: ; preds = %69
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0))
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 @exit(i32 %82)
unreachable
84: ; preds = %69
%85 = load i32*, i32** %6
%86 = call i32 @fscanf(i32* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %11)
%87 = icmp ne i32 1, %86
br i1 %87, label %88, label %91
88: ; preds = %84
%89 = load i32, i32* @stderr
%90 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %91
91: ; preds = %88, %84
%92 = load i32*, i32** %6
%93 = call i32 @pclose(i32* %92)
%94 = load i32, i32* %11
%95 = load i32, i32* %10
%96 = sdiv i32 %94, %95
store i32 %96, i32* %12
%97 = load i32, i32* %12
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %97)
%99 = load i32, i32* @EXIT_SUCCESS
ret i32 %99
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [18 x i8] c"Counting %s ... \0A\00"
@.str.2 = [31 x i8] c"Escaped filename is too long!\0A\00"
@.str.3 = [14 x i8] c"vertify : %s\0A\00"
@.str.4 = [11 x i8] c"wc -l '%s'\00"
@.str.5 = [26 x i8] c"Filename %s is too long!\0A\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [34 x i8] c"Command execution failed! Sorry!\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [21 x i8] c"Cannot scan! Sorry!\0A\00"
@.str.10 = [11 x i8] c"wc -c '%s'\00"
@.str.11 = [35 x i8] c"Command execution failed! Bummer!\0A\00"
@.str.12 = [23 x i8] c"Chars per line is %d.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = tail call i32 @setregid(i32 1012, i32 1012)
%12 = icmp eq i32 %0, 2
br i1 %12, label %19, label %13
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = tail call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = call i32 @escape_single_quotes(i8* %8, i8* %21, i32 256)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %19
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%32 = call i32 @snprintf(i8* %7, i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%33 = icmp sgt i32 %32, 255
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %30
%40 = call i32* @popen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %39
%48 = call i32 @fscanf(i32* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %5)
%49 = icmp eq i32 %48, 1
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %53
53: ; preds = %50, %47
%54 = call i32 @pclose(i32* %40)
%55 = call i32 @snprintf(i8* %7, i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %8)
%56 = call i32* @popen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %63
58: ; preds = %53
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0))
%61 = load i32, i32* @EXIT_FAILURE
%62 = call i32 @exit(i32 %61)
unreachable
63: ; preds = %53
%64 = call i32 @fscanf(i32* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %6)
%65 = icmp eq i32 %64, 1
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %69
69: ; preds = %66, %63
%70 = call i32 @pclose(i32* %56)
%71 = load i32, i32* %6
%72 = load i32, i32* %5
%73 = sdiv i32 %71, %72
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %73)
%75 = load i32, i32* @EXIT_SUCCESS
ret i32 %75
}