#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 EOF;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ chop(int /*<<< orphan*/ *, int, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getchar();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int main(int argc, char *argv[]) {
  static char usage[] =
      "usage: chop [options] [input]\n"
      "  options:\n"
      "  -h         ... display this message\n"
      "  -n <lines> ... reproduce this many lines of file    [Default: to "
      "EOF]\n"
      "  -s <line>  ... start at this line number            [Default: 1]\n"
      "  -S <num>   ... skip <num> lines between each output [Default: 1]\n";
  int i, start = 1, nlines = 0, skip = 1;
  FILE *fp;
  while (--argc && **++argv == '-') {
    switch (*++argv[0]) {
    case 'h':
      fprintf(stderr, usage);
      exit(EXIT_SUCCESS);
      break;
    case 'n':
      if (*++argv[0])
        nlines = atoi(*argv);
      else {
        --argc;
        nlines = atoi(*++argv);
      }
      break;
    case 's':
      if (*++argv[0])
        start = atoi(*argv);
      else {
        --argc;
        start = atoi(*++argv);
      }
      break;
    case 'S':
      if (*++argv[0])
        skip = atoi(*argv);
      else {
        --argc;
        skip = atoi(*++argv);
      }
      break;
    default:
      fprintf(stderr, "chop: unknown arg %s\n", *argv);
      exit(EXIT_FAILURE);
    }
  }
  if (argc) {
    for (i = 0; i < argc; i++)
      if (!(fp = fopen(argv[i], "r"))) {
        fprintf(stderr, "chop: can't open %s\n", argv[i]);
        fprintf(stderr, usage);
        exit(EXIT_FAILURE);
      } else {
        chop(fp, start, nlines, skip);
        fclose(fp);
      }
  } else {
    chop(stdin, start, nlines, skip);
    while ((i = getchar()) != EOF)
      ;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
je     11d1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11e1 <main+0x71>
jmp    137a <main+0x20a>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl 0x1(%rax),%eax
add    $0xffffffad,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x20,%eax
ja     1349 <main+0x1d9>
mov    -0x38(%rbp),%rax
lea    0xded(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dad(%rip),%rax
mov    (%rax),%edi
lea    0x2e34(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
cmpb   $0x0,0x1(%rax)
je     1270 <main+0x100>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1294 <main+0x124>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1375 <main+0x205>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
cmpb   $0x0,0x1(%rax)
je     12c8 <main+0x158>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    12ec <main+0x17c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1375 <main+0x205>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
cmpb   $0x0,0x1(%rax)
je     1320 <main+0x1b0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1344 <main+0x1d4>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1375 <main+0x205>
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd24(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
jmp    119b <main+0x2b>
cmpl   $0x0,-0x8(%rbp)
je     1438 <main+0x2c8>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1433 <main+0x2c3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcf0(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1405 <main+0x295>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcc3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
lea    0x2c70(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2bca(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <chop@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1425 <main+0x2b5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    138b <main+0x21b>
jmp    1473 <main+0x303>
mov    0x2ba9(%rip),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <chop@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2b7f(%rip),%rcx
cmp    (%rcx),%eax
je     146e <main+0x2fe>
jmp    1450 <main+0x2e0>
jmp    1473 <main+0x303>
mov    0x2b46(%rip),%rax
mov    (%rax),%eax
add    $0x40,%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    %edi,%r15d
add    $0xffffffff,%r15d
je     12b1 <main+0x141>
mov    %rsi,%r14
mov    %edi,%ebx
movl   $0x0,0x14(%rsp)
movl   $0x1,0x10(%rsp)
lea    0xe59(%rip),%r13
movl   $0x1,0xc(%rsp)
jmp    11db <main+0x6b>
add    $0xfffffffe,%ebx
mov    0x10(%r14),%rdi
add    $0x10,%r14
call   1080 <atoi@plt>
mov    %eax,0x14(%rsp)
mov    %r14,%r12
mov    %ebx,%r15d
mov    %r15d,%ebx
mov    %r12,%r14
add    $0xffffffff,%r15d
je     12c9 <main+0x159>
lea    0x8(%r14),%r12
mov    0x8(%r14),%rdi
cmpb   $0x2d,(%rdi)
jne    1313 <main+0x1a3>
lea    0x1(%rdi),%rdx
mov    %rdx,(%r12)
movsbl 0x1(%rdi),%eax
add    $0xffffffad,%eax
cmp    $0x20,%eax
ja     13cc <main+0x25c>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
lea    0x2(%rdi),%rax
mov    %rax,(%r12)
cmpb   $0x0,0x2(%rdi)
je     127f <main+0x10f>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    11cb <main+0x5b>
nopw   0x0(%rax,%rax,1)
lea    0x2(%rdi),%rax
mov    %rax,(%r12)
cmpb   $0x0,0x2(%rdi)
je     11b1 <main+0x41>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,0x14(%rsp)
jmp    11cb <main+0x5b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x2(%rdi),%rax
mov    %rax,(%r12)
cmpb   $0x0,0x2(%rdi)
je     1298 <main+0x128>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,0xc(%rsp)
jmp    11cb <main+0x5b>
add    $0xfffffffe,%ebx
mov    0x10(%r14),%rdi
add    $0x10,%r14
call   1080 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    11c5 <main+0x55>
add    $0xfffffffe,%ebx
mov    0x10(%r14),%rdi
add    $0x10,%r14
call   1080 <atoi@plt>
mov    %eax,0xc(%rsp)
jmp    11c5 <main+0x55>
movl   $0x0,0x14(%rsp)
movl   $0x1,0xc(%rsp)
movl   $0x1,0x10(%rsp)
mov    0x2d18(%rip),%rax
mov    (%rax),%rdi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
call   1040 <chop@plt>
mov    0x2cf5(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    12f0 <main+0x180>
mov    0x2cbe(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r15d,%r15d
jle    12fb <main+0x18b>
lea    0xd7b(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     13f1 <main+0x281>
mov    %rax,%rbx
mov    %r15d,%r15d
add    $0xffffffffffffffff,%r15
xor    %ebp,%ebp
lea    0xd5a(%rip),%r13
mov    %rbx,%rdi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
call   1040 <chop@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
cmp    %rbp,%r15
je     12fb <main+0x18b>
mov    0x10(%r14,%rbp,8),%rdi
mov    %r13,%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
add    $0x1,%rbp
test   %rax,%rax
jne    1340 <main+0x1d0>
mov    0x2c4f(%rip),%rbx
mov    (%rbx),%edi
mov    (%r12,%rbp,8),%rdx
lea    0xd0e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0x2cc2(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    13e3 <main+0x273>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
lea    0x2ca9(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2bfb(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    0x2bfd(%rip),%rax
mov    (%rax),%edi
lea    0xca8(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2bde(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
xor    %ebp,%ebp
jmp    137a <main+0x20a>

LLVM IR (-O0):
@main.usage = internal global [286 x i8] c"usage: chop [options] [input]\0A options:\0A -h ... display this message\0A -n <lines> ... reproduce this many lines of file [Default: to EOF]\0A -s <line> ... start at this line number [Default: 1]\0A -S <num> ... skip <num> lines between each output [Default: 1]\0A\00"
@stderr = global i32 0
@EXIT_SUCCESS = global i32 0
@.str = [22 x i8] c"chop: unknown arg %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [21 x i8] c"chop: can't open %s\0A\00"
@stdin = global i32* null
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
store i32 0, i32* %8
store i32 1, i32* %9
br label %11
11: ; preds = %100, %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %5
%18 = load i8*, i8** %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 45
br label %22
22: ; preds = %15, %11
%23 = phi i1 [ false, %11 ], [ %21, %15 ]
br i1 %23, label %24, label %101
24: ; preds = %22
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %26
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
switch i32 %30, label %93 [
i32 104, label %31
i32 110, label %36
i32 115, label %55
i32 83, label %74
]
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([286 x i8], [286 x i8]* @main.usage, i64 0, i64 0))
%34 = load i32, i32* @EXIT_SUCCESS
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %24
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %38
%41 = load i8, i8* %40
%42 = icmp ne i8 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %36
%44 = load i8**, i8*** %5
%45 = load i8*, i8** %44
%46 = call i32 @atoi(i8* %45)
store i32 %46, i32* %8
br label %54
47: ; preds = %36
%48 = load i32, i32* %4
%49 = add nsw i32 %48, -1
store i32 %49, i32* %4
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i32 1
store i8** %51, i8*** %5
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
store i32 %53, i32* %8
br label %54
54: ; preds = %47, %43
br label %100
55: ; preds = %24
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %57
%60 = load i8, i8* %59
%61 = icmp ne i8 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %55
%63 = load i8**, i8*** %5
%64 = load i8*, i8** %63
%65 = call i32 @atoi(i8* %64)
store i32 %65, i32* %7
br label %73
66: ; preds = %55
%67 = load i32, i32* %4
%68 = add nsw i32 %67, -1
store i32 %68, i32* %4
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i32 1
store i8** %70, i8*** %5
%71 = load i8*, i8** %70
%72 = call i32 @atoi(i8* %71)
store i32 %72, i32* %7
br label %73
73: ; preds = %66, %62
br label %100
74: ; preds = %24
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 0
%77 = load i8*, i8** %76
%78 = getelementptr inbounds i8, i8* %77, i32 1
store i8* %78, i8** %76
%79 = load i8, i8* %78
%80 = icmp ne i8 %79, 0
br i1 %80, label %81, label %85
81: ; preds = %74
%82 = load i8**, i8*** %5
%83 = load i8*, i8** %82
%84 = call i32 @atoi(i8* %83)
store i32 %84, i32* %9
br label %92
85: ; preds = %74
%86 = load i32, i32* %4
%87 = add nsw i32 %86, -1
store i32 %87, i32* %4
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i32 1
store i8** %89, i8*** %5
%90 = load i8*, i8** %89
%91 = call i32 @atoi(i8* %90)
store i32 %91, i32* %9
br label %92
92: ; preds = %85, %81
br label %100
93: ; preds = %24
%94 = load i32, i32* @stderr
%95 = load i8**, i8*** %5
%96 = load i8*, i8** %95
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %96)
%98 = load i32, i32* @EXIT_FAILURE
%99 = call i32 @exit(i32 %98)
unreachable
100: ; preds = %92, %73, %54
br label %11
101: ; preds = %22
%102 = load i32, i32* %4
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %142
104: ; preds = %101
store i32 0, i32* %6
br label %105
105: ; preds = %138, %104
%106 = load i32, i32* %6
%107 = load i32, i32* %4
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %141
109: ; preds = %105
%110 = load i8**, i8*** %5
%111 = load i32, i32* %6
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %110, i64 %112
%114 = load i8*, i8** %113
%115 = call i32* @fopen(i8* %114, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %115, i32** %10
%116 = icmp ne i32* %115, null
br i1 %116, label %129, label %117
117: ; preds = %109
%118 = load i32, i32* @stderr
%119 = load i8**, i8*** %5
%120 = load i32, i32* %6
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8*, i8** %119, i64 %121
%123 = load i8*, i8** %122
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %123)
%125 = load i32, i32* @stderr
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([286 x i8], [286 x i8]* @main.usage, i64 0, i64 0))
%127 = load i32, i32* @EXIT_FAILURE
%128 = call i32 @exit(i32 %127)
unreachable
129: ; preds = %109
%130 = load i32*, i32** %10
%131 = load i32, i32* %7
%132 = load i32, i32* %8
%133 = load i32, i32* %9
%134 = call i32 @chop(i32* %130, i32 %131, i32 %132, i32 %133)
%135 = load i32*, i32** %10
%136 = call i32 @fclose(i32* %135)
br label %137
137: ; preds = %129
br label %138
138: ; preds = %137
%139 = load i32, i32* %6
%140 = add nsw i32 %139, 1
store i32 %140, i32* %6
br label %105
141: ; preds = %105
br label %154
142: ; preds = %101
%143 = load i32*, i32** @stdin
%144 = load i32, i32* %7
%145 = load i32, i32* %8
%146 = load i32, i32* %9
%147 = call i32 @chop(i32* %143, i32 %144, i32 %145, i32 %146)
br label %148
148: ; preds = %152, %142
%149 = call i32 (...) @getchar()
store i32 %149, i32* %6
%150 = load i32, i32* @EOF
%151 = icmp ne i32 %149, %150
br i1 %151, label %152, label %153
152: ; preds = %148
br label %148
153: ; preds = %148
br label %154
154: ; preds = %153, %141
%155 = load i32, i32* @EXIT_SUCCESS
ret i32 %155
}

LLVM IR (-O2):
@main.usage = internal global [286 x i8] c"usage: chop [options] [input]\0A options:\0A -h ... display this message\0A -n <lines> ... reproduce this many lines of file [Default: to EOF]\0A -s <line> ... start at this line number [Default: 1]\0A -S <num> ... skip <num> lines between each output [Default: 1]\0A\00"
@stderr = global i32 0
@EXIT_SUCCESS = global i32 0
@.str = [22 x i8] c"chop: unknown arg %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [21 x i8] c"chop: can't open %s\0A\00"
@stdin = global i32* null
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %102, label %5
5: ; preds = %2, %70
%6 = phi i32 [ %76, %70 ], [ %3, %2 ]
%7 = phi i32 [ %75, %70 ], [ %0, %2 ]
%8 = phi i32 [ %74, %70 ], [ 1, %2 ]
%9 = phi i32 [ %73, %70 ], [ 0, %2 ]
%10 = phi i32 [ %72, %70 ], [ 1, %2 ]
%11 = phi i8** [ %71, %70 ], [ %1, %2 ]
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 45
br i1 %15, label %22, label %16
16: ; preds = %5
%17 = icmp sgt i32 %6, 0
br i1 %17, label %18, label %112
18: ; preds = %16
%19 = zext i32 %6 to i64
%20 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %80, label %90
22: ; preds = %5
%23 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %23, i8** %12
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
switch i32 %25, label %64 [
i32 104, label %26
i32 110, label %31
i32 115, label %42
i32 83, label %53
]
26: ; preds = %22
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([286 x i8], [286 x i8]* @main.usage, i64 0, i64 0))
%29 = load i32, i32* @EXIT_SUCCESS
%30 = tail call i32 @exit(i32 %29)
unreachable
31: ; preds = %22
%32 = getelementptr inbounds i8, i8* %13, i64 2
store i8* %32, i8** %12
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %31
%36 = tail call i32 @atoi(i8* %32)
br label %70
37: ; preds = %31
%38 = add nsw i32 %7, -2
%39 = getelementptr inbounds i8*, i8** %11, i64 2
%40 = load i8*, i8** %39
%41 = tail call i32 @atoi(i8* %40)
br label %70
42: ; preds = %22
%43 = getelementptr inbounds i8, i8* %13, i64 2
store i8* %43, i8** %12
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %42
%47 = tail call i32 @atoi(i8* %43)
br label %70
48: ; preds = %42
%49 = add nsw i32 %7, -2
%50 = getelementptr inbounds i8*, i8** %11, i64 2
%51 = load i8*, i8** %50
%52 = tail call i32 @atoi(i8* %51)
br label %70
53: ; preds = %22
%54 = getelementptr inbounds i8, i8* %13, i64 2
store i8* %54, i8** %12
%55 = load i8, i8* %54
%56 = icmp eq i8 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = tail call i32 @atoi(i8* %54)
br label %70
59: ; preds = %53
%60 = add nsw i32 %7, -2
%61 = getelementptr inbounds i8*, i8** %11, i64 2
%62 = load i8*, i8** %61
%63 = tail call i32 @atoi(i8* %62)
br label %70
64: ; preds = %22
%65 = getelementptr inbounds i8, i8* %13, i64 1
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %65)
%68 = load i32, i32* @EXIT_FAILURE
%69 = tail call i32 @exit(i32 %68)
unreachable
70: ; preds = %57, %59, %46, %48, %35, %37
%71 = phi i8** [ %12, %57 ], [ %61, %59 ], [ %12, %46 ], [ %50, %48 ], [ %12, %35 ], [ %39, %37 ]
%72 = phi i32 [ %10, %57 ], [ %10, %59 ], [ %47, %46 ], [ %52, %48 ], [ %10, %35 ], [ %10, %37 ]
%73 = phi i32 [ %9, %57 ], [ %9, %59 ], [ %9, %46 ], [ %9, %48 ], [ %36, %35 ], [ %41, %37 ]
%74 = phi i32 [ %58, %57 ], [ %63, %59 ], [ %8, %46 ], [ %8, %48 ], [ %8, %35 ], [ %8, %37 ]
%75 = phi i32 [ %6, %57 ], [ %60, %59 ], [ %6, %46 ], [ %49, %48 ], [ %6, %35 ], [ %38, %37 ]
%76 = add nsw i32 %75, -1
%77 = icmp eq i32 %76, 0
br i1 %77, label %102, label %5
78: ; preds = %97
%79 = and i64 %95, 4294967295
br label %80
80: ; preds = %78, %18
%81 = phi i64 [ %79, %78 ], [ 0, %18 ]
%82 = getelementptr inbounds i8*, i8** %12, i64 %81
%83 = load i32, i32* @stderr
%84 = load i8*, i8** %82
%85 = tail call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %84)
%86 = load i32, i32* @stderr
%87 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([286 x i8], [286 x i8]* @main.usage, i64 0, i64 0))
%88 = load i32, i32* @EXIT_FAILURE
%89 = tail call i32 @exit(i32 %88)
unreachable
90: ; preds = %18, %97
%91 = phi i32* [ %100, %97 ], [ %20, %18 ]
%92 = phi i64 [ %95, %97 ], [ 0, %18 ]
%93 = tail call i32 @chop(i32* %91, i32 %10, i32 %9, i32 %8)
%94 = tail call i32 @fclose(i32* %91)
%95 = add nuw nsw i64 %92, 1
%96 = icmp eq i64 %95, %19
br i1 %96, label %112, label %97
97: ; preds = %90
%98 = getelementptr inbounds i8*, i8** %12, i64 %95
%99 = load i8*, i8** %98
%100 = tail call i32* @fopen(i8* %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%101 = icmp eq i32* %100, null
br i1 %101, label %78, label %90
102: ; preds = %70, %2
%103 = phi i32 [ 1, %2 ], [ %72, %70 ]
%104 = phi i32 [ 0, %2 ], [ %73, %70 ]
%105 = phi i32 [ 1, %2 ], [ %74, %70 ]
%106 = load i32*, i32** @stdin
%107 = tail call i32 @chop(i32* %106, i32 %103, i32 %104, i32 %105)
br label %108
108: ; preds = %108, %102
%109 = tail call i32 (...) @getchar()
%110 = load i32, i32* @EOF
%111 = icmp eq i32 %109, %110
br i1 %111, label %112, label %108
112: ; preds = %90, %108, %16
%113 = load i32, i32* @EXIT_SUCCESS
ret i32 %113
}