#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*/ files;
typedef enum ErrorMode { ____Placeholder_ErrorMode } ErrorMode;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char getopt(int, char **, char *);
char *optarg;
int optind;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  enum ErrorMode { WARN, WARN_NOPIPE, EXIT, EXIT_NOPIPE };
  enum ErrorMode error_mode = WARN_NOPIPE;
  char output_mode = 'w';
  char flag;
  while ((flag = getopt(argc, argv, "aip:")) != EOF) {
    switch (flag) {
    case 'a':
      output_mode = 'a';
      break;
    case 'i':
      signal(SIGINT, SIG_IGN);
      break;
    case 'p':
      if (strcmp("warn", optarg) == 0)
        error_mode = WARN;
      else if (strcmp("warn-nopipe", optarg) == 0)
        error_mode = WARN_NOPIPE;
      else if (strcmp("exit", optarg) == 0)
        error_mode = EXIT;
      else if (strcmp("exit-nopipe", optarg) == 0)
        error_mode = EXIT_NOPIPE;
      else {
        fprintf(stderr, "Unknown option for -p flag: '%s'\n", optarg);
        return 1;
      };
      break;
    default:
      fprintf(stderr, "Unknown option: '%s'\n", optarg);
      return 1;
    };
  }
  FILE *files[argc - optind];
  for (int i = 0; i < argc - optind; i++) {
    files[i] = fopen(argv[optind + i], &output_mode);
  }
  unsigned long num_files = sizeof(files) / sizeof(files[0]);
  char input[80];
  while (fgets(input, 80, stdin) > 0) {
    printf("%s", input);
    for (int i = 0; i < num_files; i++)
      fprintf(files[i], "%s", input);
  }
  for (int i = 0; i < num_files; i++)
    fclose(files[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movb   $0x77,-0x15(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe4e(%rip),%rdx
call   10a0 <getopt@plt>
mov    %al,-0x16(%rbp)
movsbl %al,%eax
mov    0x2e0c(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1351 <main+0x1d1>
movsbl -0x16(%rbp),%eax
mov    %eax,-0x9c(%rbp)
sub    $0x61,%eax
je     120f <main+0x8f>
jmp    11e7 <main+0x67>
mov    -0x9c(%rbp),%eax
sub    $0x69,%eax
je     1218 <main+0x98>
jmp    11fb <main+0x7b>
mov    -0x9c(%rbp),%eax
sub    $0x70,%eax
je     1234 <main+0xb4>
jmp    1320 <main+0x1a0>
movb   $0x61,-0x15(%rbp)
jmp    134c <main+0x1cc>
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
mov    0x2d98(%rip),%rax
mov    (%rax),%esi
call   1070 <signal@plt>
jmp    134c <main+0x1cc>
mov    0x2dbd(%rip),%rax
mov    (%rax),%rsi
lea    0xdc0(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    125f <main+0xdf>
movl   $0x0,-0x14(%rbp)
jmp    131b <main+0x19b>
mov    0x2d92(%rip),%rax
mov    (%rax),%rsi
lea    0xd9a(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    128a <main+0x10a>
movl   $0x1,-0x14(%rbp)
jmp    1316 <main+0x196>
mov    0x2d67(%rip),%rax
mov    (%rax),%rsi
lea    0xd7b(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12b5 <main+0x135>
movl   $0x2,-0x14(%rbp)
jmp    1311 <main+0x191>
mov    0x2d3c(%rip),%rax
mov    (%rax),%rsi
lea    0xd55(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12e0 <main+0x160>
movl   $0x3,-0x14(%rbp)
jmp    130c <main+0x18c>
mov    0x2cc9(%rip),%rax
mov    (%rax),%rdi
mov    0x2d07(%rip),%rax
mov    (%rax),%rdx
lea    0xd2c(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14e2 <main+0x362>
jmp    1311 <main+0x191>
jmp    1316 <main+0x196>
jmp    131b <main+0x19b>
jmp    134c <main+0x1cc>
mov    0x2c89(%rip),%rax
mov    (%rax),%rdi
mov    0x2cc7(%rip),%rax
mov    (%rax),%rdx
lea    0xd0e(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14e2 <main+0x362>
jmp    11a4 <main+0x24>
mov    -0x8(%rbp),%eax
mov    0x2c6d(%rip),%rcx
mov    (%rcx),%ecx
sub    %ecx,%eax
mov    %rax,-0xb0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    0x2c27(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
jge    13eb <main+0x26b>
mov    -0x10(%rbp),%rax
mov    0x2c12(%rip),%rcx
mov    (%rcx),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x15(%rbp),%rsi
call   1090 <fopen@plt>
mov    %rax,%rdx
mov    -0xa8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1394 <main+0x214>
mov    -0xb0(%rbp),%rax
shl    $0x3,%rax
shr    $0x3,%rax
mov    %rax,-0x38(%rbp)
lea    -0x90(%rbp),%rdi
mov    0x2bcc(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
jle    148e <main+0x30e>
lea    -0x90(%rbp),%rsi
lea    0xc2f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x94(%rbp)
movslq -0x94(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1489 <main+0x309>
mov    -0xa8(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x90(%rbp),%rdx
lea    0xbef(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    143f <main+0x2bf>
jmp    13fe <main+0x27e>
movl   $0x0,-0x98(%rbp)
movslq -0x98(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    14d4 <main+0x354>
mov    -0xa8(%rbp),%rax
movslq -0x98(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <fclose@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1498 <main+0x318>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0xe52(%rip),%rdx
call   10b0 <getopt@plt>
mov    0x2e16(%rip),%r12
movb   $0x77,-0x29(%rbp)
cmp    (%r12),%al
jne    12e7 <main+0x157>
mov    %rsp,-0x38(%rbp)
mov    -0x29(%rbp),%al
mov    %al,-0x2a(%rbp)
mov    0x2def(%rip),%rdx
mov    %r14d,%r13d
sub    (%rdx),%r13d
lea    0xf(,%r13,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    (%rdx),%eax
cmp    %r14d,%eax
jge    1240 <main+0xb0>
xor    %r15d,%r15d
mov    %r14d,-0x30(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %r15d,%eax
cltq
mov    (%rbx,%rax,8),%rdi
lea    -0x2a(%rbp),%rsi
mov    %rdx,%r14
call   10a0 <fopen@plt>
mov    %r14,%rdx
mov    -0x30(%rbp),%ecx
mov    %rax,(%r12,%r15,8)
add    $0x1,%r15
mov    (%r14),%eax
sub    %eax,%ecx
movslq %ecx,%rcx
cmp    %rcx,%r15
jl     1210 <main+0x80>
mov    0x2d91(%rip),%rax
mov    (%rax),%edx
lea    -0x90(%rbp),%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
test   %rax,%rax
jle    12b7 <main+0x127>
lea    0xdf9(%rip),%r14
lea    -0x90(%rbp),%rbx
jmp    128b <main+0xfb>
nop
mov    0x2d61(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
test   %rax,%rax
jle    12b7 <main+0x127>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
test   %r13d,%r13d
je     1270 <main+0xe0>
xor    %r15d,%r15d
xchg   %ax,%ax
mov    (%r12,%r15,8),%rsi
mov    %rbx,%rdi
call   1050 <fputs@plt>
add    $0x1,%r15
cmp    %r15,%r13
jne    12a0 <main+0x110>
jmp    1270 <main+0xe0>
test   %r13,%r13
je     12d2 <main+0x142>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r12,%rbx,8),%rdi
call   1030 <fclose@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    12c0 <main+0x130>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movb   $0x77,-0x29(%rbp)
lea    0xd0e(%rip),%r15
jmp    131c <main+0x18c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x61,-0x29(%rbp)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   10b0 <getopt@plt>
cmp    (%r12),%al
je     11c8 <main+0x38>
movsbl %al,%eax
cmp    $0x61,%eax
je     1300 <main+0x170>
cmp    $0x70,%eax
je     1350 <main+0x1c0>
cmp    $0x69,%eax
jne    13c4 <main+0x234>
mov    0x2ca7(%rip),%rax
mov    (%rax),%edi
mov    0x2c7e(%rip),%rax
mov    (%rax),%esi
call   1080 <signal@plt>
jmp    1304 <main+0x174>
nopl   0x0(%rax,%rax,1)
mov    0x2ca1(%rip),%rax
mov    (%rax),%r13
lea    0xca4(%rip),%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1304 <main+0x174>
lea    0xc96(%rip),%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1304 <main+0x174>
lea    0xc8f(%rip),%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1304 <main+0x174>
lea    0xc7d(%rip),%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1304 <main+0x174>
mov    0x2bfb(%rip),%rax
mov    (%rax),%rdi
lea    0xc68(%rip),%rsi
mov    %r13,%rdx
jmp    13df <main+0x24f>
mov    0x2be5(%rip),%rax
mov    (%rax),%rdi
mov    0x2c23(%rip),%rax
mov    (%rax),%rdx
lea    0xc6a(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%eax
jmp    12d8 <main+0x148>

LLVM IR (-O0):
@.str = [5 x i8] c"aip:\00"
@EOF = global i8 0
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@.str.1 = [5 x i8] c"warn\00"
@optarg = global i8* null
@.str.2 = [12 x i8] c"warn-nopipe\00"
@.str.3 = [5 x i8] c"exit\00"
@.str.4 = [12 x i8] c"exit-nopipe\00"
@stderr = global i32* null
@.str.5 = [34 x i8] c"Unknown option for -p flag: '%s'\0A\00"
@.str.6 = [22 x i8] c"Unknown option: '%s'\0A\00"
@optind = global i32 0
@stdin = global i32 0
@.str.7 = [3 x i8] c"%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 i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i64
%13 = alloca [80 x i8]
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i8 119, i8* %7
br label %16
16: ; preds = %64, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call signext i8 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8 %19, i8* %8
%20 = sext i8 %19 to i32
%21 = load i8, i8* @EOF
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %20, %22
br i1 %23, label %24, label %65
24: ; preds = %16
%25 = load i8, i8* %8
%26 = sext i8 %25 to i32
switch i32 %26, label %60 [
i32 97, label %27
i32 105, label %28
i32 112, label %32
]
27: ; preds = %24
store i8 97, i8* %7
br label %64
28: ; preds = %24
%29 = load i32, i32* @SIGINT
%30 = load i32, i32* @SIG_IGN
%31 = call i32 @signal(i32 %29, i32 %30)
br label %64
32: ; preds = %24
%33 = load i8*, i8** @optarg
%34 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 0, i32* %6
br label %59
37: ; preds = %32
%38 = load i8*, i8** @optarg
%39 = call i32 @strcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 1, i32* %6
br label %58
42: ; preds = %37
%43 = load i8*, i8** @optarg
%44 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %43)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 2, i32* %6
br label %57
47: ; preds = %42
%48 = load i8*, i8** @optarg
%49 = call i32 @strcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %48)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 3, i32* %6
br label %56
52: ; preds = %47
%53 = load i32*, i32** @stderr
%54 = load i8*, i8** @optarg
%55 = call i32 @fprintf(i32* %53, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %54)
store i32 1, i32* %3
br label %137
56: ; preds = %51
br label %57
57: ; preds = %56, %46
br label %58
58: ; preds = %57, %41
br label %59
59: ; preds = %58, %36
br label %64
60: ; preds = %24
%61 = load i32*, i32** @stderr
%62 = load i8*, i8** @optarg
%63 = call i32 @fprintf(i32* %61, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %62)
store i32 1, i32* %3
br label %137
64: ; preds = %59, %28, %27
br label %16
65: ; preds = %16
%66 = load i32, i32* %4
%67 = load i32, i32* @optind
%68 = sub nsw i32 %66, %67
%69 = zext i32 %68 to i64
%70 = call i8* @llvm.stacksave()
store i8* %70, i8** %9
%71 = alloca i32*, i64 %69
store i64 %69, i64* %10
store i32 0, i32* %11
br label %72
72: ; preds = %90, %65
%73 = load i32, i32* %11
%74 = load i32, i32* %4
%75 = load i32, i32* @optind
%76 = sub nsw i32 %74, %75
%77 = icmp slt i32 %73, %76
br i1 %77, label %78, label %93
78: ; preds = %72
%79 = load i8**, i8*** %5
%80 = load i32, i32* @optind
%81 = load i32, i32* %11
%82 = add nsw i32 %80, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8*, i8** %79, i64 %83
%85 = load i8*, i8** %84
%86 = call i32* @fopen(i8* %85, i8* %7)
%87 = load i32, i32* %11
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32*, i32** %71, i64 %88
store i32* %86, i32** %89
br label %90
90: ; preds = %78
%91 = load i32, i32* %11
%92 = add nsw i32 %91, 1
store i32 %92, i32* %11
br label %72
93: ; preds = %72
%94 = mul nuw i64 8, %69
%95 = udiv i64 %94, 8
store i64 %95, i64* %12
br label %96
96: ; preds = %119, %93
%97 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%98 = load i32, i32* @stdin
%99 = call i64 @fgets(i8* %97, i32 80, i32 %98)
%100 = icmp sgt i64 %99, 0
br i1 %100, label %101, label %120
101: ; preds = %96
%102 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%103 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %102)
store i32 0, i32* %14
br label %104
104: ; preds = %116, %101
%105 = load i32, i32* %14
%106 = sext i32 %105 to i64
%107 = load i64, i64* %12
%108 = icmp ult i64 %106, %107
br i1 %108, label %109, label %119
109: ; preds = %104
%110 = load i32, i32* %14
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32*, i32** %71, i64 %111
%113 = load i32*, i32** %112
%114 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%115 = call i32 @fprintf(i32* %113, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %114)
br label %116
116: ; preds = %109
%117 = load i32, i32* %14
%118 = add nsw i32 %117, 1
store i32 %118, i32* %14
br label %104
119: ; preds = %104
br label %96
120: ; preds = %96
store i32 0, i32* %15
br label %121
121: ; preds = %132, %120
%122 = load i32, i32* %15
%123 = sext i32 %122 to i64
%124 = load i64, i64* %12
%125 = icmp ult i64 %123, %124
br i1 %125, label %126, label %135
126: ; preds = %121
%127 = load i32, i32* %15
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i32*, i32** %71, i64 %128
%130 = load i32*, i32** %129
%131 = call i32 @fclose(i32* %130)
br label %132
132: ; preds = %126
%133 = load i32, i32* %15
%134 = add nsw i32 %133, 1
store i32 %134, i32* %15
br label %121
135: ; preds = %121
store i32 0, i32* %3
%136 = load i8*, i8** %9
br label %137
137: ; preds = %135, %60, %52
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
@.str = [5 x i8] c"aip:\00"
@EOF = global i8 0
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@.str.1 = [5 x i8] c"warn\00"
@optarg = global i8* null
@.str.2 = [12 x i8] c"warn-nopipe\00"
@.str.3 = [5 x i8] c"exit\00"
@.str.4 = [12 x i8] c"exit-nopipe\00"
@stderr = global i32* null
@.str.5 = [34 x i8] c"Unknown option for -p flag: '%s'\0A\00"
@.str.6 = [22 x i8] c"Unknown option: '%s'\0A\00"
@optind = global i32 0
@stdin = global i32 0
@.str.7 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8
%4 = alloca [80 x i8]
%5 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* @EOF
%7 = icmp eq i8 %5, %6
br i1 %7, label %41, label %8
8: ; preds = %2, %36
%9 = phi i8 [ %38, %36 ], [ %5, %2 ]
%10 = phi i8 [ %37, %36 ], [ 119, %2 ]
%11 = sext i8 %9 to i32
switch i32 %11, label %32 [
i32 97, label %36
i32 105, label %12
i32 112, label %16
]
12: ; preds = %8
%13 = load i32, i32* @SIGINT
%14 = load i32, i32* @SIG_IGN
%15 = tail call i32 @signal(i32 %13, i32 %14)
br label %36
16: ; preds = %8
%17 = load i8*, i8** @optarg
%18 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %17)
%19 = icmp eq i32 %18, 0
br i1 %19, label %36, label %20
20: ; preds = %16
%21 = tail call i32 @strcmp(i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* dereferenceable(1) %17)
%22 = icmp eq i32 %21, 0
br i1 %22, label %36, label %23
23: ; preds = %20
%24 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %17)
%25 = icmp eq i32 %24, 0
br i1 %25, label %36, label %26
26: ; preds = %23
%27 = tail call i32 @strcmp(i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* dereferenceable(1) %17)
%28 = icmp eq i32 %27, 0
br i1 %28, label %36, label %29
29: ; preds = %26
%30 = load i32*, i32** @stderr
%31 = tail call i32 @fprintf(i32* %30, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %17)
br label %95
32: ; preds = %8
%33 = load i32*, i32** @stderr
%34 = load i8*, i8** @optarg
%35 = tail call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %34)
br label %95
36: ; preds = %8, %26, %23, %20, %16, %12
%37 = phi i8 [ %10, %26 ], [ %10, %23 ], [ %10, %20 ], [ %10, %16 ], [ %10, %12 ], [ 97, %8 ]
%38 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%39 = load i8, i8* @EOF
%40 = icmp eq i8 %38, %39
br i1 %40, label %41, label %8
41: ; preds = %36, %2
%42 = phi i8 [ 119, %2 ], [ %37, %36 ]
store i8 %42, i8* %3
%43 = load i32, i32* @optind
%44 = sub i32 %0, %43
%45 = zext i32 %44 to i64
%46 = tail call i8* @llvm.stacksave()
%47 = alloca i32*, i64 %45
%48 = load i32, i32* @optind
%49 = icmp slt i32 %48, %0
br i1 %49, label %57, label %50
50: ; preds = %57, %41
%51 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%52 = load i32, i32* @stdin
%53 = call i64 @fgets(i8* %51, i32 80, i32 %52)
%54 = icmp sgt i64 %53, 0
br i1 %54, label %55, label %76
55: ; preds = %50
%56 = icmp eq i32 %44, 0
br label %78
57: ; preds = %41, %57
%58 = phi i64 [ %67, %57 ], [ 0, %41 ]
%59 = phi i32 [ %68, %57 ], [ %48, %41 ]
%60 = trunc i64 %58 to i32
%61 = add nsw i32 %59, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %1, i64 %62
%64 = load i8*, i8** %63
%65 = call i32* @fopen(i8* %64, i8* %3)
%66 = getelementptr inbounds i32*, i32** %47, i64 %58
store i32* %65, i32** %66
%67 = add nuw nsw i64 %58, 1
%68 = load i32, i32* @optind
%69 = sub nsw i32 %0, %68
%70 = sext i32 %69 to i64
%71 = icmp slt i64 %67, %70
br i1 %71, label %57, label %50
72: ; preds = %80, %78
%73 = load i32, i32* @stdin
%74 = call i64 @fgets(i8* %51, i32 80, i32 %73)
%75 = icmp sgt i64 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %72, %50
%77 = icmp eq i32 %44, 0
br i1 %77, label %87, label %88
78: ; preds = %55, %72
%79 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %51)
br i1 %56, label %72, label %80
80: ; preds = %78, %80
%81 = phi i64 [ %85, %80 ], [ 0, %78 ]
%82 = getelementptr inbounds i32*, i32** %47, i64 %81
%83 = load i32*, i32** %82
%84 = call i32 @fputs(i8* %51, i32* %83)
%85 = add nuw nsw i64 %81, 1
%86 = icmp eq i64 %85, %45
br i1 %86, label %72, label %80
87: ; preds = %88, %76
br label %95
88: ; preds = %76, %88
%89 = phi i64 [ %93, %88 ], [ 0, %76 ]
%90 = getelementptr inbounds i32*, i32** %47, i64 %89
%91 = load i32*, i32** %90
%92 = call i32 @fclose(i32* %91)
%93 = add nuw nsw i64 %89, 1
%94 = icmp eq i64 %93, %45
br i1 %94, label %87, label %88
95: ; preds = %87, %32, %29
%96 = phi i32 [ 1, %32 ], [ 1, %29 ], [ 0, %87 ]
ret i32 %96
}