#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int lupkg_build(int, char **);
int lupkg_init(int, char **);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int status = 0;
  if (argc < 2) {
    fprintf(stderr, "%s\n", "Usage: lupkg [build|init]");
    exit(1);
  }
  if (!strcmp(argv[1], "build")) {
    status = lupkg_build(argc, argv);
  } else if (!strcmp(argv[1], "init")) {
    status = lupkg_init(argc, argv);
  } else {
    fprintf(stderr, "%s\n", "Usage: lupkg [build|init]");
    exit(1);
  }
  printf("%s complete!\n", argv[1]);
  return status;
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    11ad <main+0x4d>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
lea    0xe69(%rip),%rsi
lea    0xe66(%rip),%rdx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe62(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11de <main+0x7e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <lupkg_build@plt>
mov    %eax,-0x14(%rbp)
jmp    123a <main+0xda>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe37(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    120f <main+0xaf>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <lupkg_init@plt>
mov    %eax,-0x14(%rbp)
jmp    1235 <main+0xd5>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    0xde1(%rip),%rsi
lea    0xdde(%rip),%rdx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    123a <main+0xda>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jle    11c7 <main+0x67>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11a4 <main+0x44>
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11c7 <main+0x67>
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <lupkg_init@plt>
jmp    11ae <main+0x4e>
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <lupkg_build@plt>
mov    %eax,%ebp
mov    0x8(%r14),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xe29(%rip),%rsi
lea    0xe26(%rip),%rdx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [26 x i8] c"Usage: lupkg [build|init]\00"
@.str.2 = [6 x i8] c"build\00"
@.str.3 = [5 x i8] c"init\00"
@.str.4 = [14 x i8] c"%s complete!\0A\00"
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
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %13
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @lupkg_build(i32 %20, i8** %21)
store i32 %22, i32* %6
br label %38
23: ; preds = %13
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %23
%30 = load i32, i32* %4
%31 = load i8**, i8*** %5
%32 = call i32 @lupkg_init(i32 %30, i8** %31)
store i32 %32, i32* %6
br label %37
33: ; preds = %23
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %29
br label %38
38: ; preds = %37, %19
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %41)
%43 = load i32, i32* %6
ret i32 %43
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [26 x i8] c"Usage: lupkg [build|init]\00"
@.str.2 = [6 x i8] c"build\00"
@.str.3 = [5 x i8] c"init\00"
@.str.4 = [14 x i8] c"%s complete!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @lupkg_build(i32 %0, i8** %1)
br label %24
15: ; preds = %8
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @lupkg_init(i32 %0, i8** %1)
br label %24
20: ; preds = %15
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %18, %13
%25 = phi i32 [ %19, %18 ], [ %14, %13 ]
%26 = load i8*, i8** %9
%27 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %26)
ret i32 %25
}