#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*/ check_options_ok(int, char **);
scalar_t__ check_options_quit(int, char **);
int /*<<< orphan*/ md2sum(char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int i;
  if (argc == 1) {
    usage();
    return 0;
  }
  if (check_options_quit(argc, argv)) {
    return 0;
  }
  if (!check_options_ok(argc, argv)) {
    return 1;
  }
  for (i = 1; i < argc; i++) {
    md2sum(argv[i]);
  }
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    1173 <main+0x33>
mov    $0x0,%al
call   1050 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ef <main+0xaf>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <check_options_quit@plt>
cmp    $0x0,%rax
je     1195 <main+0x55>
movl   $0x0,-0x4(%rbp)
jmp    11ef <main+0xaf>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <check_options_ok@plt>
cmp    $0x0,%eax
jne    11b6 <main+0x76>
movl   $0x1,-0x4(%rbp)
jmp    11ef <main+0xaf>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e8 <main+0xa8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <md2sum@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bd <main+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1158 <main+0x18>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <usage@plt>
jmp    116a <main+0x2a>
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <check_options_quit@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     1178 <main+0x38>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <check_options_ok@plt>
test   %eax,%eax
je     11b4 <main+0x74>
cmp    $0x2,%ebp
jl     116a <main+0x2a>
mov    %ebp,%r15d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%rbp,8),%rdi
call   1040 <md2sum@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    11a0 <main+0x60>
jmp    116a <main+0x2a>
mov    $0x1,%r14d
jmp    116a <main+0x2a>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @usage()
store i32 0, i32* %3
br label %39
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i64 @check_options_quit(i32 %12, i8** %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %3
br label %39
17: ; preds = %11
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @check_options_ok(i32 %18, i8** %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %17
store i32 1, i32* %3
br label %39
23: ; preds = %17
store i32 1, i32* %6
br label %24
24: ; preds = %35, %23
%25 = load i32, i32* %6
%26 = load i32, i32* %4
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @md2sum(i8* %33)
br label %35
35: ; preds = %28
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %24
38: ; preds = %24
store i32 0, i32* %3
br label %39
39: ; preds = %38, %22, %16, %9
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %23
6: ; preds = %2
%7 = tail call i64 @check_options_quit(i32 %0, i8** %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = tail call i32 @check_options_ok(i32 %0, i8** %1)
%11 = icmp eq i32 %10, 0
br i1 %11, label %23, label %12
12: ; preds = %9
%13 = icmp sgt i32 %0, 1
br i1 %13, label %14, label %23
14: ; preds = %12
%15 = zext i32 %0 to i64
br label %16
16: ; preds = %14, %16
%17 = phi i64 [ 1, %14 ], [ %21, %16 ]
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i8*, i8** %18
%20 = tail call i32 @md2sum(i8* %19)
%21 = add nuw nsw i64 %17, 1
%22 = icmp eq i64 %21, %15
br i1 %22, label %23, label %16
23: ; preds = %16, %12, %9, %6, %4
%24 = phi i32 [ 0, %4 ], [ 0, %6 ], [ 1, %9 ], [ 0, %12 ], [ 0, %16 ]
ret i32 %24
}