#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 */
typedef int /*<<< orphan*/ argv;

/* Variables and functions */
int _1n17(char *);
int _4d(char *);
int /*<<< orphan*/ free(char *);
int has_n_args(char **, int, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int returnValue = 1;
  char *action;
  if (argc < 2) {
    printf("Go fuck urself\n");
    return 1;
  }
  action = (char *)malloc(sizeof(argv[1]));
  strcpy(action, argv[1]);
  if (strcmp(action, "1n17") == 0) {
    if ((returnValue =
             has_n_args(argv, 2, "Failed to init please pass a repo name."))) {
      returnValue = _1n17(argv[2]);
    }
  } else if (strcmp(action, "4d") == 0) {
    if ((returnValue = has_n_args(argv, 2, "Need a file or directory."))) {
      returnValue = _4d(argv[2]);
    }
  } else {
    printf("No such action.");
  }
  free(action);
  return returnValue;
}


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   $0x1,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11bf <main+0x3f>
lea    0xe52(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x11e>
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    122e <main+0xae>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
lea    0xe0d(%rip),%rdx
call   1060 <has_n_args@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1229 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <_1n17@plt>
mov    %eax,-0x14(%rbp)
jmp    128f <main+0x10f>
mov    -0x20(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    127e <main+0xfe>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
lea    0xde8(%rip),%rdx
call   1060 <has_n_args@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1279 <main+0xf9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <_4d@plt>
mov    %eax,-0x14(%rbp)
jmp    128a <main+0x10a>
lea    0xdd5(%rip),%rdi
call   1050 <printf@plt>
jmp    128f <main+0x10f>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     11af <main+0x1f>
lea    0xeba(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
jmp    125a <main+0xca>
mov    %rsi,%rbx
mov    $0x8,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
lea    0xe2e(%rip),%rsi
mov    %r14,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1206 <main+0x76>
lea    0xe47(%rip),%rsi
mov    %r14,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     122b <main+0x9b>
lea    0xe50(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%ebx
jmp    1252 <main+0xc2>
lea    0xdf8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <has_n_args@plt>
test   %eax,%eax
je     1250 <main+0xc0>
mov    0x10(%rbx),%rdi
call   10a0 <_1n17@plt>
mov    %eax,%ebx
jmp    1252 <main+0xc2>
lea    0xdfe(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <has_n_args@plt>
test   %eax,%eax
je     1250 <main+0xc0>
mov    0x10(%rbx),%rdi
call   10b0 <_4d@plt>
mov    %eax,%ebx
jmp    1252 <main+0xc2>
xor    %ebx,%ebx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Go fuck urself\0A\00"
@.str.1 = [5 x i8] c"1n17\00"
@.str.2 = [40 x i8] c"Failed to init please pass a repo name.\00"
@.str.3 = [3 x i8] c"4d\00"
@.str.4 = [26 x i8] c"Need a file or directory.\00"
@.str.5 = [16 x i8] c"No such action.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %54
12: ; preds = %2
%13 = call i64 @malloc(i32 8)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcpy(i8* %15, i8* %18)
%20 = load i8*, i8** %7
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %33
23: ; preds = %12
%24 = load i8**, i8*** %5
%25 = call i32 @has_n_args(i8** %24, i32 2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
store i32 %25, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @_1n17(i8* %30)
store i32 %31, i32* %6
br label %32
32: ; preds = %27, %23
br label %50
33: ; preds = %12
%34 = load i8*, i8** %7
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %47
37: ; preds = %33
%38 = load i8**, i8*** %5
%39 = call i32 @has_n_args(i8** %38, i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
store i32 %39, i32* %6
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32 @_4d(i8* %44)
store i32 %45, i32* %6
br label %46
46: ; preds = %41, %37
br label %49
47: ; preds = %33
%48 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %49
49: ; preds = %47, %46
br label %50
50: ; preds = %49, %32
%51 = load i8*, i8** %7
%52 = call i32 @free(i8* %51)
%53 = load i32, i32* %6
store i32 %53, i32* %3
br label %54
54: ; preds = %50, %10
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"1n17\00"
@.str.2 = [40 x i8] c"Failed to init please pass a repo name.\00"
@.str.3 = [3 x i8] c"4d\00"
@.str.4 = [26 x i8] c"Need a file or directory.\00"
@.str.5 = [16 x i8] c"No such action.\00"
@str = [15 x i8] c"Go fuck urself\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %36
6: ; preds = %2
%7 = tail call i64 @malloc(i32 8)
%8 = inttoptr i64 %7 to i8*
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcpy(i8* %8, i8* %10)
%12 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %6
%15 = tail call i32 @has_n_args(i8** %1, i32 2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %33, label %17
17: ; preds = %14
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @_1n17(i8* %19)
br label %33
21: ; preds = %6
%22 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = tail call i32 @has_n_args(i8** %1, i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %33, label %27
27: ; preds = %24
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i32 @_4d(i8* %29)
br label %33
31: ; preds = %21
%32 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %31, %27, %24, %14, %17
%34 = phi i32 [ %20, %17 ], [ 0, %14 ], [ %30, %27 ], [ 0, %24 ], [ 1, %31 ]
%35 = tail call i32 @free(i8* %8)
br label %36
36: ; preds = %33, %4
%37 = phi i32 [ 1, %4 ], [ %34, %33 ]
ret i32 %37
}