#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 EXIT_SUCCESS;
int /*<<< orphan*/ sha_hash_file_output(char *);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    while (argc > 1) {
      sha_hash_file_output(argv[1]);
      argc--;
      argv++;
    }
  } else {
    sha_hash_file_output(NULL);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116b <main+0x5b>
jmp    1135 <main+0x25>
cmpl   $0x1,-0x8(%rbp)
jle    1166 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <sha_hash_file_output@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <main+0x25>
jmp    1174 <main+0x64>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <sha_hash_file_output@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1146 <main+0x36>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <sha_hash_file_output@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1130 <main+0x20>
jmp    114d <main+0x3d>
xor    %edi,%edi
call   1030 <sha_hash_file_output@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %22
8: ; preds = %2
br label %9
9: ; preds = %12, %8
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @sha_hash_file_output(i8* %15)
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
br label %9
21: ; preds = %9
br label %24
22: ; preds = %2
%23 = call i32 @sha_hash_file_output(i8* null)
br label %24
24: ; preds = %22, %21
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8** [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %10, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8*, i8** %5, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @sha_hash_file_output(i8* %8)
%10 = add nsw i32 %6, -1
%11 = icmp ugt i32 %6, 2
br i1 %11, label %4, label %14
12: ; preds = %2
%13 = tail call i32 @sha_hash_file_output(i8* null)
br label %14
14: ; preds = %4, %12
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}