#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 */

/* Variables and functions */
int BUFSIZ;
int atoi(char *);
int fgetl(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  if (argc != 3) {
    fprintf(stderr, "usage: %s min max < infile > outfile\n", argv[0]);
    return (-1);
  }
  int min = atoi(argv[1]);
  int max = atoi(argv[2]);
  if (min > max) {
    fprintf(stderr, "min > max\n");
    return (-1);
  }
  char line_buf[BUFSIZ];
  int line_len;
  while ((line_len = fgetl(stdin, BUFSIZ, line_buf)) != -1) {
    if (line_len == 0)
      continue;
    if (line_len < min)
      continue;
    if (line_len > max)
      continue;
    puts(line_buf);
  }
  return 0;
}


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)
cmpl   $0x3,-0x8(%rbp)
je     118a <main+0x4a>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1279 <main+0x139>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11d9 <main+0x99>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1279 <main+0x139>
mov    0x2df0(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rdx
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
call   1050 <fgetl@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     126b <main+0x12b>
cmpl   $0x0,-0x2c(%rbp)
jne    123b <main+0xfb>
jmp    1205 <main+0xc5>
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    124c <main+0x10c>
jmp    1205 <main+0xc5>
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    125d <main+0x11d>
jmp    1205 <main+0xc5>
mov    -0x38(%rbp),%rdi
call   1030 <puts@plt>
jmp    1205 <main+0xc5>
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
push   %rax
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1191 <main+0x51>
mov    0x8(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r15d
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
cmp    %eax,%r15d
jle    11b2 <main+0x72>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    1213 <main+0xd3>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe5c(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    1213 <main+0xd3>
mov    %eax,%r14d
mov    %rsp,-0x30(%rbp)
mov    0x2e10(%rip),%r13
mov    0x0(%r13),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e0c(%rip),%r12
nopl   0x0(%rax)
mov    (%r12),%edi
mov    0x0(%r13),%esi
mov    %rbx,%rdx
call   1050 <fgetl@plt>
test   %eax,%eax
je     11e0 <main+0xa0>
cmp    $0xffffffff,%eax
je     120d <main+0xcd>
cmp    %r15d,%eax
jl     11e0 <main+0xa0>
cmp    %r14d,%eax
jg     11e0 <main+0xa0>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    11e0 <main+0xa0>
mov    -0x30(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s min max < infile > outfile\0A\00"
@.str.1 = [11 x i8] c"min > max\0A\00"
@BUFSIZ = global i32 0
@stdin = 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 i8*
%9 = alloca i64
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 -1, i32* %3
br label %62
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %6
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %7
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %19
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %62
34: ; preds = %19
%35 = load i32, i32* @BUFSIZ
%36 = zext i32 %35 to i64
%37 = call i8* @llvm.stacksave()
store i8* %37, i8** %8
%38 = alloca i8, i64 %36
store i64 %36, i64* %9
br label %39
39: ; preds = %58, %57, %52, %47, %34
%40 = load i32, i32* @stdin
%41 = load i32, i32* @BUFSIZ
%42 = call i32 @fgetl(i32 %40, i32 %41, i8* %38)
store i32 %42, i32* %10
%43 = icmp ne i32 %42, -1
br i1 %43, label %44, label %60
44: ; preds = %39
%45 = load i32, i32* %10
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %44
br label %39
48: ; preds = %44
%49 = load i32, i32* %10
%50 = load i32, i32* %6
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %53
52: ; preds = %48
br label %39
53: ; preds = %48
%54 = load i32, i32* %10
%55 = load i32, i32* %7
%56 = icmp sgt i32 %54, %55
br i1 %56, label %57, label %58
57: ; preds = %53
br label %39
58: ; preds = %53
%59 = call i32 @puts(i8* %38)
br label %39
60: ; preds = %39
store i32 0, i32* %3
%61 = load i8*, i8** %8
br label %62
62: ; preds = %60, %31, %13
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s min max < infile > outfile\0A\00"
@.str.1 = [11 x i8] c"min > max\0A\00"
@BUFSIZ = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %36
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = icmp sgt i32 %11, %14
br i1 %15, label %16, label %19
16: ; preds = %8
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %36
19: ; preds = %8
%20 = load i32, i32* @BUFSIZ
%21 = zext i32 %20 to i64
%22 = tail call i8* @llvm.stacksave()
%23 = alloca i8, i64 %21
br label %24
24: ; preds = %34, %19
%25 = load i32, i32* @stdin
%26 = load i32, i32* @BUFSIZ
%27 = call i32 @fgetl(i32 %25, i32 %26, i8* %23)
switch i32 %27, label %28 [
i32 -1, label %35
i32 0, label %34
]
28: ; preds = %24
%29 = icmp slt i32 %27, %11
%30 = icmp sgt i32 %27, %14
%31 = select i1 %29, i1 true, i1 %30
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = call i32 @puts(i8* %23)
br label %34
34: ; preds = %32, %28, %24
br label %24
35: ; preds = %24
br label %36
36: ; preds = %16, %35, %4
%37 = phi i32 [ -1, %4 ], [ -1, %16 ], [ 0, %35 ]
ret i32 %37
}