#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 */
struct stat {
  long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ err(int, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ help(char *);
char *malloc(long);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
long read(int, char *, long);
scalar_t__ stat(char *, struct stat *);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
int main(int argc, char **argv) {
  char *buf, *F1, *F2, *ptr, *ptr1;
  int file1, file2, n = 0, Vflag = 0;
  long size1, size2;
  struct stat St;
  if (argc < 3 || strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)
    help(argv[0]);
  if (strcmp(argv[1], "-v") == 0) {
    Vflag = 1;
    n = 1;
  }
  if (stat(argv[n + 1], &St) < 0)
    err(1, "\n\tCan't stat %s", argv[n + 1]);
  size1 = St.st_size;
  if (stat(argv[n + 2], &St) < 0)
    err(2, "\n\tCan't stat %s", argv[n + 2]);
  size2 = St.st_size;
  file1 = open(argv[n + 1], O_RDONLY);
  if (file1 < 0)
    err(3, "\n\tCan't open %s", argv[n + 1]);
  file2 = open(argv[n + 2], O_RDONLY);
  if (file2 < 0)
    err(4, "\n\tCan't open %s", argv[n + 2]);
  buf = malloc(16385);
  F1 = malloc(size1 + 1);
  ptr1 = F1;
  F2 = malloc(size2 + 1);
  if (read(file1, F1, size1) != size1)
    err(5, "\n\tCan't read %s", argv[n + 1]);
  F1[size1] = 0;
  close(file1);
  if (read(file2, F2, size2) != size2)
    err(6, "\n\tCan't read %s", argv[n + 2]);
  F2[size2] = 0;
  close(file2);
  while (ptr1) {
    ptr = strchr(ptr1, '\n');
    if (ptr)
      *ptr = 0;
    strncpy(buf, ptr1, 16384);
    if (strstr(F2, buf) == NULL) {
      if (Vflag == 0)
        printf("%s\n", buf);
    } else if (Vflag == 1)
      printf("%s\n", buf);
    if (ptr)
      ptr1 = ptr + 1;
    else
      ptr1 = NULL;
  }
  free(buf);
  free(F1);
  free(F2);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     124a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     124a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc8(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1256 <main+0x76>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <help@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda5(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1282 <main+0xa2>
movl   $0x1,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x60(%rbp),%rsi
call   10a0 <stat@plt>
cmp    $0x0,%rax
jge    12c8 <main+0xe8>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x1,%edi
lea    0xd4a(%rip),%rsi
call   10b0 <err@plt>
mov    -0x60(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x60(%rbp),%rsi
call   10a0 <stat@plt>
cmp    $0x0,%rax
jge    1316 <main+0x136>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x2,%edi
lea    0xcfc(%rip),%rsi
call   10b0 <err@plt>
mov    -0x60(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2cb2(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    136c <main+0x18c>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x3,%edi
lea    0xcb6(%rip),%rsi
call   10b0 <err@plt>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2c64(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jge    13ba <main+0x1da>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x4,%edi
lea    0xc68(%rip),%rsi
call   10b0 <err@plt>
mov    $0x4001,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
call   10c0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x1,%rdi
call   10c0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x50(%rbp),%rdx
call   1080 <read@plt>
cmp    -0x50(%rbp),%rax
je     142e <main+0x24e>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x5,%edi
lea    0xc04(%rip),%rsi
call   10b0 <err@plt>
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
mov    -0x40(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   1080 <read@plt>
cmp    -0x58(%rbp),%rax
je     147e <main+0x29e>
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x6,%edi
lea    0xbb4(%rip),%rsi
call   10b0 <err@plt>
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x40(%rbp),%edi
call   1070 <close@plt>
cmpq   $0x0,-0x38(%rbp)
je     1551 <main+0x371>
mov    -0x38(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     14c1 <main+0x2e1>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x4000,%edx
call   1040 <strncpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
jne    1509 <main+0x329>
cmpl   $0x0,-0x48(%rbp)
jne    1504 <main+0x324>
mov    -0x18(%rbp),%rsi
lea    0xb3e(%rip),%rdi
call   1060 <printf@plt>
jmp    1528 <main+0x348>
cmpl   $0x1,-0x48(%rbp)
jne    1523 <main+0x343>
mov    -0x18(%rbp),%rsi
lea    0xb1f(%rip),%rdi
call   1060 <printf@plt>
jmp    1528 <main+0x348>
cmpq   $0x0,-0x30(%rbp)
je     1544 <main+0x364>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    154c <main+0x36c>
movq   $0x0,-0x38(%rbp)
jmp    1492 <main+0x2b2>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jl     1220 <main+0x40>
mov    0x8(%rbx),%rdi
lea    0xdff(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1220 <main+0x40>
mov    0x8(%rbx),%rdi
lea    0xded(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1228 <main+0x48>
mov    (%rbx),%rdi
call   10e0 <help@plt>
mov    0x8(%rbx),%rdi
lea    0xdd7(%rip),%rsi
call   1090 <strcmp@plt>
mov    %rax,%r15
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
lea    0x1(%rbp),%r14
mov    0x8(%rbx,%rbp,8),%rdi
lea    0x18(%rsp),%rsi
call   10a0 <stat@plt>
test   %rax,%rax
jns    1271 <main+0x91>
mov    (%rbx,%r14,8),%rdx
lea    0xda6(%rip),%rsi
mov    $0x1,%edi
call   10b0 <err@plt>
mov    0x18(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x10(%rbx,%rbp,8),%rdi
or     $0x2,%rbp
lea    0x18(%rsp),%rsi
call   10a0 <stat@plt>
test   %rax,%rax
jns    12a8 <main+0xc8>
mov    (%rbx,%rbp,8),%rdx
lea    0xd6f(%rip),%rsi
mov    $0x2,%edi
call   10b0 <err@plt>
mov    0x18(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    (%rbx,%r14,8),%rdi
mov    0x2d2b(%rip),%r12
mov    (%r12),%esi
call   10d0 <open@plt>
mov    %eax,(%rsp)
test   %eax,%eax
jns    12e2 <main+0x102>
mov    (%rbx,%r14,8),%rdx
lea    0xd45(%rip),%rsi
mov    $0x3,%edi
call   10b0 <err@plt>
mov    %r14,0x28(%rsp)
mov    (%rbx,%rbp,8),%rdi
mov    (%r12),%esi
call   10d0 <open@plt>
mov    %eax,0x4(%rsp)
test   %eax,%eax
jns    1311 <main+0x131>
mov    (%rbx,%rbp,8),%rdx
lea    0xd16(%rip),%rsi
mov    $0x4,%edi
call   10b0 <err@plt>
mov    $0x4001,%edi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    %rbx,0x30(%rsp)
mov    0x20(%rsp),%rbx
lea    0x1(%rbx),%rdi
call   10c0 <malloc@plt>
mov    %rax,%r14
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rdi
call   10c0 <malloc@plt>
mov    %rax,%r13
mov    (%rsp),%edi
mov    %r14,0x10(%rsp)
mov    %r14,%rsi
mov    %rbx,%rdx
call   1080 <read@plt>
cmp    %rbx,%rax
mov    0x30(%rsp),%r14
je     137c <main+0x19c>
mov    0x28(%rsp),%rax
mov    (%r14,%rax,8),%rdx
lea    0xcbb(%rip),%rsi
mov    $0x5,%edi
call   10b0 <err@plt>
mov    0x10(%rsp),%rax
mov    0x20(%rsp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    (%rsp),%edi
call   1070 <close@plt>
mov    0x4(%rsp),%edi
mov    %r13,%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
call   1080 <read@plt>
cmp    %rbx,%rax
je     13c0 <main+0x1e0>
mov    (%r14,%rbp,8),%rdx
lea    0xc77(%rip),%rsi
mov    $0x6,%edi
call   10b0 <err@plt>
mov    0x8(%rsp),%rax
movb   $0x0,0x0(%r13,%rax,1)
mov    0x4(%rsp),%edi
call   1070 <close@plt>
lea    0xc62(%rip),%r14
mov    0x10(%rsp),%rbx
jmp    1409 <main+0x229>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %r15,%r15
je     1400 <main+0x220>
mov    %r14,%rdi
mov    %r12,%rsi
call   1060 <printf@plt>
lea    0x1(%rbp),%rbx
test   %rbp,%rbp
je     1449 <main+0x269>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,%rbp
test   %rax,%rax
je     1422 <main+0x242>
movb   $0x0,0x0(%rbp)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x4000,%edx
call   1040 <strncpy@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1100 <strstr@plt>
test   %rax,%rax
je     13f0 <main+0x210>
test   %r15,%r15
jne    1400 <main+0x220>
jmp    13f5 <main+0x215>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [16 x i8] c"\0A\09Can't stat %s\00"
@O_RDONLY = global i32 0
@.str.4 = [16 x i8] c"\0A\09Can't open %s\00"
@.str.5 = [16 x i8] c"\0A\09Can't read %s\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
%16 = alloca i64
%17 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
store i32 0, i32* %14
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 3
br i1 %19, label %32, label %20
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %20
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %26, %20, %2
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 @help(i8* %35)
br label %37
37: ; preds = %32, %26
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %37
store i32 1, i32* %14
store i32 1, i32* %13
br label %44
44: ; preds = %43, %37
%45 = load i8**, i8*** %5
%46 = load i32, i32* %13
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %45, i64 %48
%50 = load i8*, i8** %49
%51 = call i64 @stat(i8* %50, %struct.stat* %17)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %61
53: ; preds = %44
%54 = load i8**, i8*** %5
%55 = load i32, i32* %13
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %54, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %59)
br label %61
61: ; preds = %53, %44
%62 = getelementptr inbounds %struct.stat, %struct.stat* %17, i32 0, i32 0
%63 = load i64, i64* %62
store i64 %63, i64* %15
%64 = load i8**, i8*** %5
%65 = load i32, i32* %13
%66 = add nsw i32 %65, 2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %64, i64 %67
%69 = load i8*, i8** %68
%70 = call i64 @stat(i8* %69, %struct.stat* %17)
%71 = icmp slt i64 %70, 0
br i1 %71, label %72, label %80
72: ; preds = %61
%73 = load i8**, i8*** %5
%74 = load i32, i32* %13
%75 = add nsw i32 %74, 2
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %73, i64 %76
%78 = load i8*, i8** %77
%79 = call i32 @err(i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %78)
br label %80
80: ; preds = %72, %61
%81 = getelementptr inbounds %struct.stat, %struct.stat* %17, i32 0, i32 0
%82 = load i64, i64* %81
store i64 %82, i64* %16
%83 = load i8**, i8*** %5
%84 = load i32, i32* %13
%85 = add nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %83, i64 %86
%88 = load i8*, i8** %87
%89 = load i32, i32* @O_RDONLY
%90 = call i32 @open(i8* %88, i32 %89)
store i32 %90, i32* %11
%91 = load i32, i32* %11
%92 = icmp slt i32 %91, 0
br i1 %92, label %93, label %101
93: ; preds = %80
%94 = load i8**, i8*** %5
%95 = load i32, i32* %13
%96 = add nsw i32 %95, 1
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8*, i8** %94, i64 %97
%99 = load i8*, i8** %98
%100 = call i32 @err(i32 3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %93, %80
%102 = load i8**, i8*** %5
%103 = load i32, i32* %13
%104 = add nsw i32 %103, 2
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %102, i64 %105
%107 = load i8*, i8** %106
%108 = load i32, i32* @O_RDONLY
%109 = call i32 @open(i8* %107, i32 %108)
store i32 %109, i32* %12
%110 = load i32, i32* %12
%111 = icmp slt i32 %110, 0
br i1 %111, label %112, label %120
112: ; preds = %101
%113 = load i8**, i8*** %5
%114 = load i32, i32* %13
%115 = add nsw i32 %114, 2
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8*, i8** %113, i64 %116
%118 = load i8*, i8** %117
%119 = call i32 @err(i32 4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %118)
br label %120
120: ; preds = %112, %101
%121 = call i8* @malloc(i64 16385)
store i8* %121, i8** %6
%122 = load i64, i64* %15
%123 = add nsw i64 %122, 1
%124 = call i8* @malloc(i64 %123)
store i8* %124, i8** %7
%125 = load i8*, i8** %7
store i8* %125, i8** %10
%126 = load i64, i64* %16
%127 = add nsw i64 %126, 1
%128 = call i8* @malloc(i64 %127)
store i8* %128, i8** %8
%129 = load i32, i32* %11
%130 = load i8*, i8** %7
%131 = load i64, i64* %15
%132 = call i64 @read(i32 %129, i8* %130, i64 %131)
%133 = load i64, i64* %15
%134 = icmp ne i64 %132, %133
br i1 %134, label %135, label %143
135: ; preds = %120
%136 = load i8**, i8*** %5
%137 = load i32, i32* %13
%138 = add nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %136, i64 %139
%141 = load i8*, i8** %140
%142 = call i32 @err(i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %141)
br label %143
143: ; preds = %135, %120
%144 = load i8*, i8** %7
%145 = load i64, i64* %15
%146 = getelementptr inbounds i8, i8* %144, i64 %145
store i8 0, i8* %146
%147 = load i32, i32* %11
%148 = call i32 @close(i32 %147)
%149 = load i32, i32* %12
%150 = load i8*, i8** %8
%151 = load i64, i64* %16
%152 = call i64 @read(i32 %149, i8* %150, i64 %151)
%153 = load i64, i64* %16
%154 = icmp ne i64 %152, %153
br i1 %154, label %155, label %163
155: ; preds = %143
%156 = load i8**, i8*** %5
%157 = load i32, i32* %13
%158 = add nsw i32 %157, 2
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8*, i8** %156, i64 %159
%161 = load i8*, i8** %160
%162 = call i32 @err(i32 6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %161)
br label %163
163: ; preds = %155, %143
%164 = load i8*, i8** %8
%165 = load i64, i64* %16
%166 = getelementptr inbounds i8, i8* %164, i64 %165
store i8 0, i8* %166
%167 = load i32, i32* %12
%168 = call i32 @close(i32 %167)
br label %169
169: ; preds = %208, %163
%170 = load i8*, i8** %10
%171 = icmp ne i8* %170, null
br i1 %171, label %172, label %209
172: ; preds = %169
%173 = load i8*, i8** %10
%174 = call i8* @strchr(i8* %173, i8 signext 10)
store i8* %174, i8** %9
%175 = load i8*, i8** %9
%176 = icmp ne i8* %175, null
br i1 %176, label %177, label %179
177: ; preds = %172
%178 = load i8*, i8** %9
store i8 0, i8* %178
br label %179
179: ; preds = %177, %172
%180 = load i8*, i8** %6
%181 = load i8*, i8** %10
%182 = call i32 @strncpy(i8* %180, i8* %181, i32 16384)
%183 = load i8*, i8** %8
%184 = load i8*, i8** %6
%185 = call i32* @strstr(i8* %183, i8* %184)
%186 = icmp eq i32* %185, null
br i1 %186, label %187, label %194
187: ; preds = %179
%188 = load i32, i32* %14
%189 = icmp eq i32 %188, 0
br i1 %189, label %190, label %193
190: ; preds = %187
%191 = load i8*, i8** %6
%192 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %191)
br label %193
193: ; preds = %190, %187
br label %201
194: ; preds = %179
%195 = load i32, i32* %14
%196 = icmp eq i32 %195, 1
br i1 %196, label %197, label %200
197: ; preds = %194
%198 = load i8*, i8** %6
%199 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %198)
br label %200
200: ; preds = %197, %194
br label %201
201: ; preds = %200, %193
%202 = load i8*, i8** %9
%203 = icmp ne i8* %202, null
br i1 %203, label %204, label %207
204: ; preds = %201
%205 = load i8*, i8** %9
%206 = getelementptr inbounds i8, i8* %205, i64 1
store i8* %206, i8** %10
br label %208
207: ; preds = %201
store i8* null, i8** %10
br label %208
208: ; preds = %207, %204
br label %169
209: ; preds = %169
%210 = load i8*, i8** %6
%211 = call i32 @free(i8* %210)
%212 = load i8*, i8** %7
%213 = call i32 @free(i8* %212)
%214 = load i8*, i8** %8
%215 = call i32 @free(i8* %214)
%216 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [16 x i8] c"\0A\09Can't stat %s\00"
@O_RDONLY = global i32 0
@.str.4 = [16 x i8] c"\0A\09Can't open %s\00"
@.str.5 = [16 x i8] c"\0A\09Can't read %s\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = icmp slt i32 %0, 3
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11, %6, %2
%16 = load i8*, i8** %1
%17 = tail call i32 @help(i8* %16)
br label %18
18: ; preds = %15, %11
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i64 2, i64 1
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @stat(i8* %26, %struct.stat* %3)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %18
%30 = load i8*, i8** %25
%31 = call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %29, %18
%33 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%34 = load i64, i64* %33
%35 = or i64 %23, 2
%36 = getelementptr inbounds i8*, i8** %1, i64 %35
%37 = load i8*, i8** %36
%38 = call i64 @stat(i8* %37, %struct.stat* %3)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %32
%41 = load i8*, i8** %36
%42 = call i32 @err(i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %41)
br label %43
43: ; preds = %40, %32
%44 = load i64, i64* %33
%45 = load i8*, i8** %25
%46 = load i32, i32* @O_RDONLY
%47 = call i32 @open(i8* %45, i32 %46)
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %43
%50 = load i8*, i8** %25
%51 = call i32 @err(i32 3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %49, %43
%53 = load i8*, i8** %36
%54 = load i32, i32* @O_RDONLY
%55 = call i32 @open(i8* %53, i32 %54)
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = load i8*, i8** %36
%59 = call i32 @err(i32 4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %57, %52
%61 = call dereferenceable_or_null(16385) i8* @malloc(i64 16385)
%62 = add nsw i64 %34, 1
%63 = call i8* @malloc(i64 %62)
%64 = add nsw i64 %44, 1
%65 = call i8* @malloc(i64 %64)
%66 = call i64 @read(i32 %47, i8* %63, i64 %34)
%67 = icmp eq i64 %66, %34
br i1 %67, label %71, label %68
68: ; preds = %60
%69 = load i8*, i8** %25
%70 = call i32 @err(i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %68, %60
%72 = getelementptr inbounds i8, i8* %63, i64 %34
store i8 0, i8* %72
%73 = call i32 @close(i32 %47)
%74 = call i64 @read(i32 %55, i8* %65, i64 %44)
%75 = icmp eq i64 %74, %44
br i1 %75, label %79, label %76
76: ; preds = %71
%77 = load i8*, i8** %36
%78 = call i32 @err(i32 6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %71, %76
%80 = getelementptr inbounds i8, i8* %65, i64 %44
store i8 0, i8* %80
%81 = call i32 @close(i32 %55)
br label %82
82: ; preds = %79, %95
%83 = phi i8* [ %96, %95 ], [ %63, %79 ]
%84 = call i8* @strchr(i8* %83, i8 signext 10)
%85 = icmp eq i8* %84, null
br i1 %85, label %87, label %86
86: ; preds = %82
store i8 0, i8* %84
br label %87
87: ; preds = %86, %82
%88 = call i32 @strncpy(i8* %61, i8* %83, i32 16384)
%89 = call i32* @strstr(i8* dereferenceable(1) %65, i8* dereferenceable(1) %61)
%90 = icmp eq i32* %89, null
br i1 %90, label %91, label %92
91: ; preds = %87
br i1 %22, label %95, label %93
92: ; preds = %87
br i1 %22, label %93, label %95
93: ; preds = %92, %91
%94 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %61)
br label %95
95: ; preds = %93, %92, %91
%96 = getelementptr inbounds i8, i8* %84, i64 1
br i1 %85, label %97, label %82
97: ; preds = %95
%98 = call i32 @free(i8* %61)
%99 = call i32 @free(i8* %63)
%100 = call i32 @free(i8* %65)
%101 = call i32 @exit(i32 0)
unreachable
}