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

/* Variables and functions */
int /*<<< orphan*/ err(int, char *, ...);
int /*<<< orphan*/ errx(int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/);
int getline(char **, size_t *, int /*<<< orphan*/);
int getopt(int, char **, char *);
char *optarg;
int pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int strlen(char *);
int /*<<< orphan*/ usage();
int /*<<< orphan*/ warnx(char *, size_t, char *, int);
int main(int argc, char *argv[]) {
  FILE *exec = NULL;
  char quot = '#';
  char *line = NULL;
  size_t len = 0;
  size_t lineno = 0;
  ssize_t read;
  int opt;
  int ret;
  while ((opt = getopt(argc, argv, "hq:i:o:")) != -1) {
    switch (opt) {
    case 'i':
      if (freopen(optarg, "r", stdin) == NULL) {
        err(1, "freopen");
      }
      break;
    case 'o':
      if (freopen(optarg, "w", stdout) == NULL) {
        err(1, "freopen");
      }
      break;
    case 's':
      if (strlen(optarg) != 1) {
        errx(1, "quote must be a byte");
      } else {
        quot = *optarg;
      }
      break;
    case 'h':
      usage();
      return 0;
    }
  }
  while ((read = getline(&line, &len, stdin)) != -1) {
    if (read != 0 && line[0] == quot) {
      if (exec == NULL) {
        if ((exec = popen(line + 1, "w")) == NULL) {
          goto FAIL;
        }
      } else {
        fprintf(exec, "%s", line + 1);
      }
    } else {
      if (exec != NULL) {
        if ((ret = pclose(exec)) == -1) {
          goto FAIL;
        } else if (ret != 0) {
          warnx("Warn - line %ld: %sstatus: %d\n", lineno, line, ret);
        }
        exec = NULL;
      }
    }
    ++lineno;
  }
  if (exec != NULL) {
    if ((ret = pclose(exec)) == -1) {
      goto FAIL;
    } else if (ret != 0) {
      warnx("Warn - line %ld: %sstatus: %d\n", lineno, line, ret);
    }
  }
  free(line);
  return 0;
FAIL:
  free(line);
  err(1, "Err - line %ld: %s", lineno, line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movb   $0x23,-0x19(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe28(%rip),%rdx
call   10d0 <getopt@plt>
mov    %eax,-0x40(%rbp)
cmp    $0xffffffff,%eax
je     131e <main+0x15e>
mov    -0x40(%rbp),%eax
add    $0xffffff98,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0xb,%eax
ja     1319 <main+0x159>
mov    -0x50(%rbp),%rax
lea    0xdc7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2daf(%rip),%rax
mov    (%rax),%rdi
mov    0x2d8d(%rip),%rax
mov    (%rax),%edx
lea    0xddc(%rip),%rsi
call   1080 <freopen@plt>
cmp    $0x0,%rax
jne    127e <main+0xbe>
mov    $0x1,%edi
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   10a0 <err@plt>
jmp    1319 <main+0x159>
mov    0x2d6e(%rip),%rax
mov    (%rax),%rdi
mov    0x2d3c(%rip),%rax
mov    (%rax),%edx
lea    0xda5(%rip),%rsi
call   1080 <freopen@plt>
cmp    $0x0,%rax
jne    12bf <main+0xff>
mov    $0x1,%edi
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   10a0 <err@plt>
jmp    1319 <main+0x159>
mov    0x2d2d(%rip),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
je     12f2 <main+0x132>
mov    $0x1,%edi
lea    0xd5c(%rip),%rsi
call   1050 <errx@plt>
jmp    1301 <main+0x141>
mov    0x2cff(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
jmp    1319 <main+0x159>
mov    $0x0,%al
call   10b0 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    14a8 <main+0x2e8>
jmp    11fa <main+0x3a>
jmp    1323 <main+0x163>
mov    0x2cb6(%rip),%rax
mov    (%rax),%edx
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10e0 <getline@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xffffffff,%eax
je     141f <main+0x25f>
cmpl   $0x0,-0x3c(%rbp)
je     13b6 <main+0x1f6>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    13b6 <main+0x1f6>
cmpq   $0x0,-0x18(%rbp)
jne    1399 <main+0x1d9>
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
lea    0xcc6(%rip),%rsi
call   10c0 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1394 <main+0x1d4>
jmp    1484 <main+0x2c4>
jmp    13b1 <main+0x1f1>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    $0x1,%rdx
lea    0xcdc(%rip),%rsi
call   1090 <fprintf@plt>
jmp    140e <main+0x24e>
cmpq   $0x0,-0x18(%rbp)
je     1409 <main+0x249>
mov    -0x18(%rbp),%rdi
call   1070 <pclose@plt>
mov    %eax,-0x44(%rbp)
cmp    $0xffffffff,%eax
jne    13db <main+0x21b>
jmp    1484 <main+0x2c4>
cmpl   $0x0,-0x44(%rbp)
je     13fc <main+0x23c>
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x44(%rbp),%ecx
lea    0xc62(%rip),%rdi
call   1060 <warnx@plt>
jmp    1401 <main+0x241>
movq   $0x0,-0x18(%rbp)
jmp    140e <main+0x24e>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1323 <main+0x163>
cmpq   $0x0,-0x18(%rbp)
je     146f <main+0x2af>
mov    -0x18(%rbp),%rdi
call   1070 <pclose@plt>
mov    %eax,-0x44(%rbp)
cmp    $0xffffffff,%eax
jne    1444 <main+0x284>
jmp    1484 <main+0x2c4>
cmpl   $0x0,-0x44(%rbp)
je     1465 <main+0x2a5>
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x44(%rbp),%ecx
lea    0xbf9(%rip),%rdi
call   1060 <warnx@plt>
jmp    146a <main+0x2aa>
jmp    146f <main+0x2af>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    14a8 <main+0x2e8>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%edi
lea    0xbd7(%rip),%rsi
mov    $0x0,%al
call   10a0 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movb   $0x23,0x7(%rsp)
lea    0xe3f(%rip),%r14
lea    0xe08(%rip),%r15
mov    0x2df9(%rip),%r12
lea    0xe3c(%rip),%r13
jmp    1220 <main+0x60>
cmp    $0xffffffff,%eax
je     12d0 <main+0x110>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10d0 <getopt@plt>
lea    -0x68(%rax),%ecx
cmp    $0xb,%ecx
ja     1208 <main+0x48>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    (%r12),%rdi
mov    0x2d97(%rip),%rax
mov    (%rax),%edx
lea    0xde6(%rip),%rsi
jmp    1270 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r12),%rdi
mov    0x2d65(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rsi
call   1090 <freopen@plt>
test   %rax,%rax
jne    1220 <main+0x60>
mov    $0x1,%edi
lea    0xdb4(%rip),%rsi
xor    %eax,%eax
call   10a0 <err@plt>
jmp    1220 <main+0x60>
nop
mov    (%r12),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
je     12b4 <main+0xf4>
mov    $0x1,%edi
lea    0xd9a(%rip),%rsi
call   1050 <errx@plt>
jmp    1220 <main+0x60>
mov    (%r12),%rax
movzbl (%rax),%eax
mov    %al,0x7(%rsp)
jmp    1220 <main+0x60>
xor    %eax,%eax
call   10b0 <usage@plt>
jmp    13e4 <main+0x224>
xor    %ebx,%ebx
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r13
lea    0xd76(%rip),%r15
lea    0xd58(%rip),%r12
xor    %ebp,%ebp
jmp    1310 <main+0x150>
xchg   %ax,%ax
add    $0x1,%rdi
test   %rbp,%rbp
je     1375 <main+0x1b5>
mov    %rbp,%rsi
call   1080 <fputs@plt>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2cc9(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %r13,%rsi
call   10e0 <getline@plt>
test   %eax,%eax
je     133b <main+0x17b>
cmp    $0xffffffff,%eax
je     1387 <main+0x1c7>
mov    0x8(%rsp),%rdi
movzbl 0x7(%rsp),%eax
cmp    %al,(%rdi)
je     12f0 <main+0x130>
test   %rbp,%rbp
jne    1350 <main+0x190>
xor    %ebp,%ebp
add    $0x1,%rbx
jmp    1310 <main+0x150>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1070 <pclose@plt>
test   %eax,%eax
je     1340 <main+0x180>
cmp    $0xffffffff,%eax
je     13bf <main+0x1ff>
mov    0x8(%rsp),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1060 <warnx@plt>
jmp    1340 <main+0x180>
mov    %r12,%rsi
call   10c0 <popen@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1342 <main+0x182>
jmp    13bf <main+0x1ff>
test   %rbp,%rbp
je     13b3 <main+0x1f3>
mov    %rbp,%rdi
call   1070 <pclose@plt>
cmp    $0xffffffff,%eax
je     13bf <main+0x1ff>
test   %eax,%eax
je     13b3 <main+0x1f3>
mov    0x8(%rsp),%rdx
lea    0xcb0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1060 <warnx@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
jmp    13e4 <main+0x224>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rcx
lea    0xca3(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <err@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"hq:i:o:\00"
@optarg = global i8* null
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [8 x i8] c"freopen\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [21 x i8] c"quote must be a byte\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [31 x i8] c"Warn - line %ld: %sstatus: %d\0A\00"
@.str.7 = [19 x i8] c"Err - line %ld: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i8 35, i8* %7
store i8* null, i8** %8
store i64 0, i64* %9
store i64 0, i64* %10
br label %14
14: ; preds = %49, %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @getopt(i32 %15, i8** %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %17, i32* %12
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %50
19: ; preds = %14
%20 = load i32, i32* %12
switch i32 %20, label %49 [
i32 105, label %21
i32 111, label %29
i32 115, label %37
i32 104, label %47
]
21: ; preds = %19
%22 = load i8*, i8** @optarg
%23 = load i32, i32* @stdin
%24 = call i32* @freopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %21
br label %49
29: ; preds = %19
%30 = load i8*, i8** @optarg
%31 = load i32, i32* @stdout
%32 = call i32* @freopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %29
br label %49
37: ; preds = %19
%38 = load i8*, i8** @optarg
%39 = call i32 @strlen(i8* %38)
%40 = icmp ne i32 %39, 1
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @errx(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %46
43: ; preds = %37
%44 = load i8*, i8** @optarg
%45 = load i8, i8* %44
store i8 %45, i8* %7
br label %46
46: ; preds = %43, %41
br label %49
47: ; preds = %19
%48 = call i32 (...) @usage()
store i32 0, i32* %3
br label %131
49: ; preds = %19, %46, %36, %28
br label %14
50: ; preds = %14
br label %51
51: ; preds = %101, %50
%52 = load i32, i32* @stdin
%53 = call i32 @getline(i8** %8, i64* %9, i32 %52)
store i32 %53, i32* %11
%54 = icmp ne i32 %53, -1
br i1 %54, label %55, label %104
55: ; preds = %51
%56 = load i32, i32* %11
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %82
58: ; preds = %55
%59 = load i8*, i8** %8
%60 = getelementptr inbounds i8, i8* %59, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = load i8, i8* %7
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %62, %64
br i1 %65, label %66, label %82
66: ; preds = %58
%67 = load i32*, i32** %6
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %76
69: ; preds = %66
%70 = load i8*, i8** %8
%71 = getelementptr inbounds i8, i8* %70, i64 1
%72 = call i32* @popen(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %72, i32** %6
%73 = icmp eq i32* %72, null
br i1 %73, label %74, label %75
74: ; preds = %69
br label %125
75: ; preds = %69
br label %81
76: ; preds = %66
%77 = load i32*, i32** %6
%78 = load i8*, i8** %8
%79 = getelementptr inbounds i8, i8* %78, i64 1
%80 = call i32 @fprintf(i32* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %79)
br label %81
81: ; preds = %76, %75
br label %101
82: ; preds = %58, %55
%83 = load i32*, i32** %6
%84 = icmp ne i32* %83, null
br i1 %84, label %85, label %100
85: ; preds = %82
%86 = load i32*, i32** %6
%87 = call i32 @pclose(i32* %86)
store i32 %87, i32* %13
%88 = icmp eq i32 %87, -1
br i1 %88, label %89, label %90
89: ; preds = %85
br label %125
90: ; preds = %85
%91 = load i32, i32* %13
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %98
93: ; preds = %90
%94 = load i64, i64* %10
%95 = load i8*, i8** %8
%96 = load i32, i32* %13
%97 = call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i64 %94, i8* %95, i32 %96)
br label %98
98: ; preds = %93, %90
br label %99
99: ; preds = %98
store i32* null, i32** %6
br label %100
100: ; preds = %99, %82
br label %101
101: ; preds = %100, %81
%102 = load i64, i64* %10
%103 = add i64 %102, 1
store i64 %103, i64* %10
br label %51
104: ; preds = %51
%105 = load i32*, i32** %6
%106 = icmp ne i32* %105, null
br i1 %106, label %107, label %122
107: ; preds = %104
%108 = load i32*, i32** %6
%109 = call i32 @pclose(i32* %108)
store i32 %109, i32* %13
%110 = icmp eq i32 %109, -1
br i1 %110, label %111, label %112
111: ; preds = %107
br label %125
112: ; preds = %107
%113 = load i32, i32* %13
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %120
115: ; preds = %112
%116 = load i64, i64* %10
%117 = load i8*, i8** %8
%118 = load i32, i32* %13
%119 = call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i64 %116, i8* %117, i32 %118)
br label %120
120: ; preds = %115, %112
br label %121
121: ; preds = %120
br label %122
122: ; preds = %121, %104
%123 = load i8*, i8** %8
%124 = call i32 @free(i8* %123)
store i32 0, i32* %3
br label %131
125: ; preds = %111, %89, %74
%126 = load i8*, i8** %8
%127 = call i32 @free(i8* %126)
%128 = load i64, i64* %10
%129 = load i8*, i8** %8
%130 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 %128, i8* %129)
br label %131
131: ; preds = %125, %122, %47
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@.str = [8 x i8] c"hq:i:o:\00"
@optarg = global i8* null
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [8 x i8] c"freopen\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [21 x i8] c"quote must be a byte\00"
@.str.6 = [31 x i8] c"Warn - line %ld: %sstatus: %d\0A\00"
@.str.7 = [19 x i8] c"Err - line %ld: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
br label %7
7: ; preds = %32, %2
%8 = phi i8 [ %34, %32 ], [ 35, %2 ]
br label %9
9: ; preds = %11, %7
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
switch i32 %10, label %11 [
i32 -1, label %37
i32 105, label %12
i32 111, label %19
i32 115, label %26
i32 104, label %35
]
11: ; preds = %9, %30, %19, %24, %12, %17
br label %9
12: ; preds = %9
%13 = load i8*, i8** @optarg
%14 = load i32, i32* @stdin
%15 = tail call i32* @freopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %11
17: ; preds = %12
%18 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %11
19: ; preds = %9
%20 = load i8*, i8** @optarg
%21 = load i32, i32* @stdout
%22 = tail call i32* @freopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %11
24: ; preds = %19
%25 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %11
26: ; preds = %9
%27 = load i8*, i8** @optarg
%28 = tail call i32 @strlen(i8* %27)
%29 = icmp eq i32 %28, 1
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %11
32: ; preds = %26
%33 = load i8*, i8** @optarg
%34 = load i8, i8* %33
br label %7
35: ; preds = %9
%36 = tail call i32 (...) @usage()
br label %79
37: ; preds = %9, %61
%38 = phi i64 [ %63, %61 ], [ 0, %9 ]
%39 = phi i32* [ %62, %61 ], [ null, %9 ]
%40 = load i32, i32* @stdin
%41 = call i32 @getline(i8** %3, i64* %4, i32 %40)
switch i32 %41, label %42 [
i32 -1, label %64
i32 0, label %54
]
42: ; preds = %37
%43 = load i8*, i8** %3
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, %8
br i1 %45, label %46, label %54
46: ; preds = %42
%47 = icmp eq i32* %39, null
%48 = getelementptr inbounds i8, i8* %43, i64 1
br i1 %47, label %49, label %52
49: ; preds = %46
%50 = call i32* @popen(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %74, label %61
52: ; preds = %46
%53 = call i32 @fputs(i8* %48, i32* %39)
br label %61
54: ; preds = %37, %42
%55 = icmp eq i32* %39, null
br i1 %55, label %61, label %56
56: ; preds = %54
%57 = call i32 @pclose(i32* %39)
switch i32 %57, label %58 [
i32 -1, label %74
i32 0, label %61
]
58: ; preds = %56
%59 = load i8*, i8** %3
%60 = call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i64 %38, i8* %59, i32 %57)
br label %61
61: ; preds = %58, %56, %54, %52, %49
%62 = phi i32* [ %50, %49 ], [ %39, %52 ], [ null, %54 ], [ null, %56 ], [ null, %58 ]
%63 = add i64 %38, 1
br label %37
64: ; preds = %37
%65 = icmp eq i32* %39, null
br i1 %65, label %71, label %66
66: ; preds = %64
%67 = call i32 @pclose(i32* %39)
switch i32 %67, label %68 [
i32 -1, label %74
i32 0, label %71
]
68: ; preds = %66
%69 = load i8*, i8** %3
%70 = call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i64 %38, i8* %69, i32 %67)
br label %71
71: ; preds = %66, %68, %64
%72 = load i8*, i8** %3
%73 = call i32 @free(i8* %72)
br label %79
74: ; preds = %56, %49, %66
%75 = load i8*, i8** %3
%76 = call i32 @free(i8* %75)
%77 = load i8*, i8** %3
%78 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 %38, i8* %77)
br label %79
79: ; preds = %74, %71, %35
ret i32 0
}