main(argc, argv) int argc;
char *argv[];
{
  int scr, position, mpw = 0;
  char pass[20];
  char pw[100];
  if (argc < 2) {
    printf("Usage: %s screen1 screen2 ...\n", argv[0]);
    exit(-1);
  }
  position = 0;
  while (++position < argc) {
    if (atoi(argv[position]) < 1) {
      printf("Option not known: %s.\n", argv[position]);
      continue;
    }
    scr = atoi(argv[position]);
    if ((scr < 100) && (mpw == 0)) {
      printf("You need clearance to see passwords below 100.\n");
      printf("Enter master password:");
      scanf("%s", pw);
      if (strncmp(pw, "poppycrash", strlen("poppycrash"))) {
        printf("Foo, charlatan!\n");
        exit(-1);
      }
      mpw = 1;
    }
    if (!scrn_passwd((scr - 1), pass)) {
      printf("%s: Cannot access %s.\n", argv[0], "/usr/share/dict/words");
      exit(-1);
    }
    printf("Screen %d password is '%s'.\n", scr, pass);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a9 <main+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmp    -0x8(%rbp),%eax
jge    12f2 <main+0x192>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1070 <atoi@plt>
cmp    $0x1,%eax
jge    11fd <main+0x9d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b0 <main+0x50>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1070 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1298 <main+0x138>
cmpl   $0x0,-0x1c(%rbp)
jne    1298 <main+0x138>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe1a(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1291 <main+0x131>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1050 <scrn_passwd@plt>
cmp    $0x0,%eax
jne    12d8 <main+0x178>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xddc(%rip),%rdi
lea    0xdec(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x14(%rbp),%esi
lea    -0x30(%rbp),%rdx
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b0 <main+0x50>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     129e <main+0x13e>
mov    %edi,%r15d
mov    %edi,%r13d
mov    $0x1,%r12d
lea    0xe8f(%rip),%r14
movl   $0x0,0x8(%rsp)
movslq %r12d,%rbp
lea    0x1(%rbp),%r12d
nop
mov    (%rbx,%rbp,8),%rdi
xor    %eax,%eax
call   1070 <atoi@plt>
test   %eax,%eax
jg     11d0 <main+0x70>
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
add    $0x1,%r12d
cmp    %r13,%rbp
jl     11a0 <main+0x40>
jmp    128a <main+0x12a>
nop
mov    %r15d,0xc(%rsp)
mov    (%rbx,%rbp,8),%rdi
xor    %eax,%eax
call   1070 <atoi@plt>
mov    %eax,%r15d
cmp    $0x63,%eax
jg     1251 <main+0xf1>
cmpl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbp
jne    1256 <main+0xf6>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xe2f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe38(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x30(%rsp),%rax
movabs $0x6172637970706f70,%rcx
63 72 61
xor    %rcx,%rax
movzwl 0x38(%rsp),%ecx
xor    $0x6873,%rcx
movl   $0x1,0x8(%rsp)
or     %rax,%rcx
je     1256 <main+0xf6>
jmp    12db <main+0x17b>
lea    0x10(%rsp),%rbp
lea    -0x1(%r15),%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scrn_passwd@plt>
test   %eax,%eax
je     12b9 <main+0x159>
lea    0xe19(%rip),%rdi
mov    %r15d,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%r15d
cmp    %r15d,%r12d
jl     1198 <main+0x38>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xd58(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    (%rbx),%rsi
lea    0xd98(%rip),%rdi
lea    0xda8(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
lea    0xdf2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s screen1 screen2 ...\0A\00"
@.str.1 = [23 x i8] c"Option not known: %s.\0A\00"
@.str.2 = [48 x i8] c"You need clearance to see passwords below 100.\0A\00"
@.str.3 = [23 x i8] c"Enter master password:\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [11 x i8] c"poppycrash\00"
@.str.6 = [17 x i8] c"Foo, charlatan!\0A\00"
@.str.7 = [23 x i8] c"%s: Cannot access %s.\0A\00"
@.str.8 = [22 x i8] c"/usr/share/dict/words\00"
@.str.9 = [29 x i8] c"Screen %d password is '%s'.\0A\00"
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 [20 x i8]
%10 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %16)
unreachable
18: ; preds = %2
store i32 0, i32* %7
br label %19
19: ; preds = %73, %32, %18
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %77
24: ; preds = %19
%25 = load i8**, i8*** %5
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %29)
%31 = icmp slt i32 %30, 1
br i1 %31, label %32, label %39
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %37)
br label %19
39: ; preds = %24
%40 = load i8**, i8*** %5
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %44)
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = icmp slt i32 %46, 100
br i1 %47, label %48, label %62
48: ; preds = %39
%49 = load i32, i32* %8
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %62
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%55 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %54)
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%57 = call i32 @strncmp(i8* %56, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i64 10)
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %51
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
unreachable
61: ; preds = %51
store i32 1, i32* %8
br label %62
62: ; preds = %61, %48, %39
%63 = load i32, i32* %6
%64 = sub nsw i32 %63, 1
%65 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%66 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @scrn_passwd to i32 (i32, i8*, ...)*)(i32 %64, i8* %65)
%67 = icmp ne i32 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %62
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 0
%71 = load i8*, i8** %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %71, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
unreachable
73: ; preds = %62
%74 = load i32, i32* %6
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %74, i8* %75)
br label %19
77: ; preds = %19
%78 = load i32, i32* %3
ret i32 %78
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s screen1 screen2 ...\0A\00"
@.str.1 = [23 x i8] c"Option not known: %s.\0A\00"
@.str.3 = [23 x i8] c"Enter master password:\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [11 x i8] c"poppycrash\00"
@.str.7 = [23 x i8] c"%s: Cannot access %s.\0A\00"
@.str.8 = [22 x i8] c"/usr/share/dict/words\00"
@.str.9 = [29 x i8] c"Screen %d password is '%s'.\0A\00"
@str = [47 x i8] c"You need clearance to see passwords below 100.\00"
@str.10 = [16 x i8] c"Foo, charlatan!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [20 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = zext i32 %0 to i64
br label %51
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %11)
tail call void @exit(i32 -1)
unreachable
13: ; preds = %51, %19
%14 = phi i64 [ %54, %51 ], [ %22, %19 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %16)
%18 = icmp slt i32 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %13
%20 = load i8*, i8** %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = add nsw i64 %14, 1
%23 = icmp slt i64 %22, %9
br i1 %23, label %13, label %55
24: ; preds = %13
%25 = trunc i64 %14 to i32
%26 = load i8*, i8** %15
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %26)
%28 = icmp slt i32 %27, 100
%29 = icmp eq i32 %53, 0
%30 = select i1 %28, i1 %29, i1 false
br i1 %30, label %31, label %39
31: ; preds = %24
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%35 = call i32 @bcmp(i8* dereferenceable(10) %6, i8* dereferenceable(10) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i64 10)
%36 = icmp eq i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %31
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.10, i64 0, i64 0))
unreachable
39: ; preds = %31, %24
%40 = phi i32 [ %53, %24 ], [ 1, %31 ]
%41 = add nsw i32 %27, -1
%42 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @scrn_passwd to i32 (i32, i8*, ...)*)(i32 %41, i8* %5)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %39
%45 = load i8*, i8** %1
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %45, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
unreachable
47: ; preds = %39
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %27, i8* %5)
%49 = add nsw i32 %25, 1
%50 = icmp slt i32 %49, %0
br i1 %50, label %51, label %55
51: ; preds = %8, %47
%52 = phi i32 [ %49, %47 ], [ 1, %8 ]
%53 = phi i32 [ %40, %47 ], [ 0, %8 ]
%54 = sext i32 %52 to i64
br label %13
55: ; preds = %47, %19
ret i32 0
}