#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*/ dohelp(int /*<<< orphan*/);
int /*<<< orphan*/ hexdump(char *);
scalar_t__ strcmp(char *, char *);
int main(int argn, char *argv[]) {
  int retCode = 0;
  for (int i = 1; i < argn; i++) {
    char *arg = argv[i];
    if (strcmp(arg, "--help") == 0) {
      dohelp(0);
    } else {
      hexdump(arg);
    }
  }
  return retCode;
}


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,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b2 <main+0x82>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1196 <main+0x66>
xor    %edi,%edi
call   1030 <dohelp@plt>
jmp    119f <main+0x6f>
mov    -0x20(%rbp),%rdi
call   1050 <hexdump@plt>
jmp    11a4 <main+0x74>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <main+0x24>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     118e <main+0x5e>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
jmp    1171 <main+0x41>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
call   1050 <hexdump@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
je     118e <main+0x5e>
mov    (%r15,%rbx,8),%r13
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %edi,%edi
call   1030 <dohelp@plt>
jmp    1168 <main+0x38>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\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 i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
br label %9
9: ; preds = %28, %2
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %31
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
store i8* %18, i8** %8
%19 = load i8*, i8** %8
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %13
%23 = call i32 @dohelp(i32 0)
br label %27
24: ; preds = %13
%25 = load i8*, i8** %8
%26 = call i32 @hexdump(i8* %25)
br label %27
27: ; preds = %24, %22
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %9
31: ; preds = %9
%32 = load i32, i32* %6
ret i32 %32
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %17, %2
ret i32 0
7: ; preds = %4, %17
%8 = phi i64 [ 1, %4 ], [ %18, %17 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = tail call i32 @dohelp(i32 0)
br label %17
15: ; preds = %7
%16 = tail call i32 @hexdump(i8* %10)
br label %17
17: ; preds = %15, %13
%18 = add nuw nsw i64 %8, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %6, label %7
}