#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*/ agent_main(int, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char **opt_strip_first(int, char **);
int /*<<< orphan*/ storagegroup_main(int, char **);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char **stripped = NULL;
  if (argc < 2) {
    usage(argv[0]);
  }
  stripped = opt_strip_first(argc, argv);
  if (strcmp(argv[1], "--agent") == 0) {
    agent_main(argc - 1, stripped);
  } else if (strcmp(argv[1], "--storagegroup") == 0) {
    storagegroup_main(argc - 1, stripped);
  } else {
    usage(argv[0]);
  }
  exit(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)
movq   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1194 <main+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <opt_strip_first@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d6 <main+0x76>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x18(%rbp),%rsi
call   1070 <agent_main@plt>
jmp    1219 <main+0xb9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe23(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1208 <main+0xa8>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x18(%rbp),%rsi
call   1060 <storagegroup_main@plt>
jmp    1214 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    1219 <main+0xb9>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
cmp    $0x1,%edi
jg     1177 <main+0x17>
mov    (%r14),%rdi
call   1050 <usage@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <opt_strip_first@plt>
mov    %rax,%r15
mov    0x8(%r14),%rdi
lea    0xe71(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11ad <main+0x4d>
add    $0xffffffff,%ebx
mov    %ebx,%edi
mov    %r15,%rsi
call   1070 <agent_main@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    0x8(%r14),%rdi
lea    0xe50(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11d6 <main+0x76>
add    $0xffffffff,%ebx
mov    %ebx,%edi
mov    %r15,%rsi
call   1060 <storagegroup_main@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    (%r14),%rdi
call   1050 <usage@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"--agent\00"
@.str.1 = [15 x i8] c"--storagegroup\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** null, i8*** %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @usage(i8* %12)
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i8** @opt_strip_first(i32 %15, i8** %16)
store i8** %17, i8*** %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %14
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = load i8**, i8*** %6
%27 = call i32 @agent_main(i32 %25, i8** %26)
br label %45
28: ; preds = %14
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %28
%35 = load i32, i32* %4
%36 = sub nsw i32 %35, 1
%37 = load i8**, i8*** %6
%38 = call i32 @storagegroup_main(i32 %36, i8** %37)
br label %44
39: ; preds = %28
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i32 @usage(i8* %42)
br label %44
44: ; preds = %39, %34
br label %45
45: ; preds = %44, %23
%46 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"--agent\00"
@.str.1 = [15 x i8] c"--storagegroup\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = tail call i8** @opt_strip_first(i32 %0, i8** %1)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = add nsw i32 %0, -1
%15 = tail call i32 @agent_main(i32 %14, i8** %8)
br label %26
16: ; preds = %7
%17 = load i8*, i8** %9
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = add nsw i32 %0, -1
%22 = tail call i32 @storagegroup_main(i32 %21, i8** %8)
br label %26
23: ; preds = %16
%24 = load i8*, i8** %1
%25 = tail call i32 @usage(i8* %24)
br label %26
26: ; preds = %20, %23, %13
%27 = tail call i32 @exit(i32 0)
unreachable
}