#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ realbay_hashes(char const *);
int /*<<< orphan*/ stderr;
int realbay_hashes_main(int argc, const char **argv) {
  if (argc < 2) {
    fprintf(stderr, "USAGE: realbay hashes <index>\n");
    return 1;
  }
  if (!realbay_hashes(argv[2])) {
    fprintf(stderr, "ERROR: Failed to output hashes for index file\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<realbay_hashes_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115a <realbay_hashes_main+0x3a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1198 <realbay_hashes_main+0x78>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <realbay_hashes@plt>
cmp    $0x0,%eax
jne    1191 <realbay_hashes_main+0x71>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1198 <realbay_hashes_main+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realbay_hashes_main>:
push   %rax
cmp    $0x2,%edi
jge    112f <realbay_hashes_main+0xf>
lea    0xed3(%rip),%rsi
jmp    1149 <realbay_hashes_main+0x29>
mov    0x10(%rsi),%rdi
call   1040 <realbay_hashes@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1142 <realbay_hashes_main+0x22>
pop    %rcx
ret
lea    0xed6(%rip),%rsi
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"USAGE: realbay hashes <index>\0A\00"
@.str.1 = [47 x i8] c"ERROR: Failed to output hashes for index file\0A\00"
define i32 @realbay_hashes_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %21
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @realbay_hashes(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %21
20: ; preds = %11
store i32 0, i32* %3
br label %21
21: ; preds = %20, %17, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"USAGE: realbay hashes <index>\0A\00"
@.str.1 = [47 x i8] c"ERROR: Failed to output hashes for index file\0A\00"
define i32 @realbay_hashes_main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @realbay_hashes(i8* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4, %2
%10 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), %4 ]
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* %10)
br label %13
13: ; preds = %9, %4
%14 = phi i32 [ 0, %4 ], [ 1, %9 ]
ret i32 %14
}