#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 */
scalar_t__ find_aes_keys_in_file(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ self_test();
int main(int argc, char **argv) {
  int i;
  bool found_key = false;
  self_test();
  if (argc < 2) {
    printf("Usage: %s FILE [FILE...]\n", argv[0]);
    return 0;
  }
  for (i = 1; i < argc; i++) {
    if (find_aes_keys_in_file(argv[i])) {
      found_key = true;
    }
  }
  return found_key ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <self_test@plt>
cmpl   $0x2,-0x8(%rbp)
jge    117d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d8 <main+0xa8>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c5 <main+0x95>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <find_aes_keys_in_file@plt>
cmp    $0x0,%rax
je     11b2 <main+0x82>
movl   $0x1,-0x18(%rbp)
jmp    11b7 <main+0x87>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1184 <main+0x54>
mov    -0x18(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <self_test@plt>
cmp    $0x2,%r14d
jge    1160 <main+0x30>
mov    (%r15),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
jmp    1190 <main+0x60>
mov    %r14d,%r14d
mov    $0x1,%ebx
mov    $0x1,%r12d
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rdi
call   1050 <find_aes_keys_in_file@plt>
test   %rax,%rax
cmovne %r12d,%ebp
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1170 <main+0x40>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s FILE [FILE...]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = call i32 (...) @self_test()
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 0, i32* %3
br label %39
16: ; preds = %2
store i32 1, i32* %6
br label %17
17: ; preds = %31, %16
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @find_aes_keys_in_file(i8* %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 1, i32* %7
br label %30
30: ; preds = %29, %21
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %17
34: ; preds = %17
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i64
%38 = select i1 %36, i32 0, i32 1
store i32 %38, i32* %3
br label %39
39: ; preds = %34, %11
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s FILE [FILE...]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @self_test()
%4 = icmp slt i32 %0, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %10
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %23
10: ; preds = %5, %10
%11 = phi i64 [ 1, %5 ], [ %18, %10 ]
%12 = phi i32 [ 0, %5 ], [ %17, %10 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %11
%14 = load i8*, i8** %13
%15 = tail call i64 @find_aes_keys_in_file(i8* %14)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i32 %12, i32 1
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %10
20: ; preds = %10
%21 = icmp eq i32 %17, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %20, %7
%24 = phi i32 [ 0, %7 ], [ %22, %20 ]
ret i32 %24
}