#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*/ _njord_usage();
int atoi(char *);
int /*<<< orphan*/ njord_dict();
int /*<<< orphan*/ njord_gc(char *, int);
int /*<<< orphan*/ njord_memory_pool();
int /*<<< orphan*/ njord_set();
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  (void)argc, (void)argv;
  if (argc < 2) {
    _njord_usage();
    return 1;
  }
  if (strcmp(argv[1], "mem") == 0) {
    njord_memory_pool();
  } else if (strcmp(argv[1], "set") == 0) {
    njord_set();
  } else if (strcmp(argv[1], "dict") == 0) {
    njord_dict();
  } else if (strcmp(argv[1], "gc") == 0) {
    if (argc < 3) {
      _njord_usage();
      return 1;
    }
    int prof = 0;
    if (argc > 3)
      prof = atoi(argv[3]);
    njord_gc(argv[2], prof);
  } else {
    _njord_usage();
  }
  return 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)
cmpl   $0x2,-0x8(%rbp)
jge    11a3 <main+0x33>
mov    $0x0,%al
call   1040 <_njord_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    12af <main+0x13f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11cd <main+0x5d>
mov    $0x0,%al
call   1070 <njord_memory_pool@plt>
jmp    12a8 <main+0x138>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe28(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11f7 <main+0x87>
mov    $0x0,%al
call   1090 <njord_set@plt>
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe02(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1221 <main+0xb1>
mov    $0x0,%al
call   1050 <njord_dict@plt>
jmp    129e <main+0x12e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xddd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1292 <main+0x122>
cmpl   $0x3,-0x8(%rbp)
jge    125c <main+0xec>
mov    $0x0,%al
call   1040 <_njord_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    12af <main+0x13f>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    127d <main+0x10d>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <njord_gc@plt>
jmp    1299 <main+0x129>
mov    $0x0,%al
call   1040 <_njord_usage@plt>
jmp    129e <main+0x12e>
jmp    12a3 <main+0x133>
jmp    12a8 <main+0x138>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     118a <main+0x1a>
xor    %eax,%eax
call   1040 <_njord_usage@plt>
mov    $0x1,%ebx
jmp    1238 <main+0xc8>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe66(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11ee <main+0x7e>
mov    0x8(%r14),%rdi
lea    0xe55(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11f9 <main+0x89>
mov    0x8(%r14),%rdi
lea    0xe44(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1204 <main+0x94>
mov    0x8(%r14),%rdi
lea    0xe34(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     120f <main+0x9f>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <_njord_usage@plt>
jmp    1238 <main+0xc8>
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <njord_memory_pool@plt>
jmp    1238 <main+0xc8>
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <njord_set@plt>
jmp    1238 <main+0xc8>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <njord_dict@plt>
jmp    1238 <main+0xc8>
cmp    $0x2,%ebp
jbe    1179 <main+0x9>
xor    %ebx,%ebx
mov    $0x0,%esi
cmp    $0x3,%ebp
je     122f <main+0xbf>
mov    0x18(%r14),%rdi
call   1080 <atoi@plt>
mov    %eax,%esi
mov    0x10(%r14),%rdi
call   1030 <njord_gc@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"mem\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [5 x i8] c"dict\00"
@.str.3 = [3 x i8] c"gc\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
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @_njord_usage()
store i32 1, i32* %3
br label %68
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @njord_memory_pool()
br label %67
21: ; preds = %13
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = call i32 (...) @njord_set()
br label %66
29: ; preds = %21
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 (...) @njord_dict()
br label %65
37: ; preds = %29
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %62
43: ; preds = %37
%44 = load i32, i32* %4
%45 = icmp slt i32 %44, 3
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (...) @_njord_usage()
store i32 1, i32* %3
br label %68
48: ; preds = %43
store i32 0, i32* %6
%49 = load i32, i32* %4
%50 = icmp sgt i32 %49, 3
br i1 %50, label %51, label %56
51: ; preds = %48
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 3
%54 = load i8*, i8** %53
%55 = call i32 @atoi(i8* %54)
store i32 %55, i32* %6
br label %56
56: ; preds = %51, %48
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = load i32, i32* %6
%61 = call i32 @njord_gc(i8* %59, i32 %60)
br label %64
62: ; preds = %37
%63 = call i32 (...) @_njord_usage()
br label %64
64: ; preds = %62, %56
br label %65
65: ; preds = %64, %35
br label %66
66: ; preds = %65, %27
br label %67
67: ; preds = %66, %19
store i32 0, i32* %3
br label %68
68: ; preds = %67, %46, %11
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
@.str = [4 x i8] c"mem\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [5 x i8] c"dict\00"
@.str.3 = [3 x i8] c"gc\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @_njord_usage()
br label %46
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 (...) @njord_memory_pool()
br label %46
13: ; preds = %6
%14 = load i8*, i8** %7
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 (...) @njord_set()
br label %46
19: ; preds = %13
%20 = load i8*, i8** %7
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 (...) @njord_dict()
br label %46
25: ; preds = %19
%26 = load i8*, i8** %7
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %44
29: ; preds = %25
%30 = icmp ult i32 %0, 3
br i1 %30, label %31, label %33
31: ; preds = %29
%32 = tail call i32 (...) @_njord_usage()
br label %46
33: ; preds = %29
%34 = icmp eq i32 %0, 3
br i1 %34, label %39, label %35
35: ; preds = %33
%36 = getelementptr inbounds i8*, i8** %1, i64 3
%37 = load i8*, i8** %36
%38 = tail call i32 @atoi(i8* %37)
br label %39
39: ; preds = %35, %33
%40 = phi i32 [ %38, %35 ], [ 0, %33 ]
%41 = getelementptr inbounds i8*, i8** %1, i64 2
%42 = load i8*, i8** %41
%43 = tail call i32 @njord_gc(i8* %42, i32 %40)
br label %46
44: ; preds = %25
%45 = tail call i32 (...) @_njord_usage()
br label %46
46: ; preds = %11, %23, %44, %39, %17, %31, %4
%47 = phi i32 [ 1, %4 ], [ 1, %31 ], [ 0, %17 ], [ 0, %39 ], [ 0, %44 ], [ 0, %23 ], [ 0, %11 ]
ret i32 %47
}