#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_FAILURE;
int EXIT_SUCCESS;
scalar_t__ consume_cmd(int, char **);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc < 2 || strcmp("help", argv[1]) == 0) {
    usage();
    return EXIT_FAILURE;
  } else {
    if (consume_cmd(argc - 1, argv + 1) != 0)
      return EXIT_FAILURE;
    else
      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   $0x2,-0x8(%rbp)
jl     116e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea1(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1186 <main+0x56>
mov    $0x0,%al
call   1050 <usage@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11c0 <main+0x90>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <consume_cmd@plt>
cmp    $0x0,%rax
je     11b4 <main+0x84>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11c0 <main+0x90>
mov    0x2e1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1171 <main+0x41>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1171 <main+0x41>
add    $0x8,%rbx
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <consume_cmd@plt>
test   %rax,%rax
jne    1178 <main+0x48>
mov    0x2e69(%rip),%rax
jmp    117f <main+0x4f>
xor    %eax,%eax
call   1050 <usage@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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