#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;
int command_find(int, char **);
int command_info(int, char **);
int /*<<< orphan*/ print_usage();
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char **argv) {
  if (argc < 2) {
    print_usage();
    return EXIT_FAILURE;
  }
  if (0 == strncmp("info", argv[1], 4)) {
    return command_info(argc, argv);
  }
  if (0 == strncmp("find", argv[1], 4)) {
    return command_find(argc, argv);
  }
  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)
jge    1178 <main+0x38>
mov    $0x0,%al
call   1060 <print_usage@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fa <main+0xba>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe79(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11b3 <main+0x73>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <command_info@plt>
mov    %eax,-0x4(%rbp)
jmp    11fa <main+0xba>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe43(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ee <main+0xae>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <command_find@plt>
mov    %eax,-0x4(%rbp)
jmp    11fa <main+0xba>
mov    0x2de3(%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    $0x1,%edi
jg     1158 <main+0x18>
xor    %eax,%eax
call   1060 <print_usage@plt>
mov    0x2e8a(%rip),%rax
jmp    1198 <main+0x58>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rsi
lea    0xe98(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11a1 <main+0x61>
mov    0x8(%rbx),%rsi
lea    0xe83(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11b1 <main+0x71>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <command_info@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <command_find@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"info\00"
@.str.1 = [5 x i8] c"find\00"
@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 %8, label %11
8: ; preds = %2
%9 = call i32 (...) @print_usage()
%10 = load i32, i32* @EXIT_FAILURE
store i32 %10, i32* %3
br label %33
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strncmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %14, i32 4)
%16 = icmp eq i64 0, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @command_info(i32 %18, i8** %19)
store i32 %20, i32* %3
br label %33
21: ; preds = %11
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strncmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %24, i32 4)
%26 = icmp eq i64 0, %25
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = load i32, i32* %4
%29 = load i8**, i8*** %5
%30 = call i32 @command_find(i32 %28, i8** %29)
store i32 %30, i32* %3
br label %33
31: ; preds = %21
%32 = load i32, i32* @EXIT_SUCCESS
store i32 %32, i32* %3
br label %33
33: ; preds = %31, %27, %17, %8
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"info\00"
@.str.1 = [5 x i8] c"find\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @print_usage()
%6 = load i32, i32* @EXIT_FAILURE
br label %22
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strncmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9, i32 4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 @command_info(i32 %0, i8** %1)
br label %22
14: ; preds = %7
%15 = load i8*, i8** %8
%16 = tail call i64 @strncmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 4)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 @command_find(i32 %0, i8** %1)
br label %22
20: ; preds = %14
%21 = load i32, i32* @EXIT_SUCCESS
br label %22
22: ; preds = %20, %18, %12, %4
%23 = phi i32 [ %6, %4 ], [ %13, %12 ], [ %19, %18 ], [ %21, %20 ]
ret i32 %23
}