#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*/ extract(char *, char *);
int /*<<< orphan*/ license();
int /*<<< orphan*/ list(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc > 4 || argc < 2)
    usage();
  if (argc == 2) {
    if (strcmp("--help", argv[1]) == 0 || strcmp("/?", argv[1]) == 0) {
      usage();
    } else if (strcmp("-L", argv[1]) == 0) {
      license();
    } else {
      list(argv[1]);
    }
  } else if (argc == 3) {
    usage();
  } else if (strcmp("x", argv[1]) == 0 || strcmp("extract", argv[1]) == 0) {
    extract(argv[2], argv[3]);
  } else {
    usage();
  }
  return 0;
}


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   $0x4,-0x8(%rbp)
jg     117a <main+0x2a>
cmpl   $0x2,-0x8(%rbp)
jge    1181 <main+0x31>
mov    $0x0,%al
call   1050 <usage@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1214 <main+0xc4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe66(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11c7 <main+0x77>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe4f(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d3 <main+0x83>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    120f <main+0xbf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe28(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11fd <main+0xad>
mov    $0x0,%al
call   1060 <license@plt>
jmp    120a <main+0xba>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <list@plt>
jmp    120f <main+0xbf>
jmp    1291 <main+0x141>
cmpl   $0x3,-0x8(%rbp)
jne    122a <main+0xda>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    128c <main+0x13c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdd4(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1266 <main+0x116>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdb8(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1280 <main+0x130>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1070 <extract@plt>
jmp    1287 <main+0x137>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    128c <main+0x13c>
jmp    1291 <main+0x141>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    -0x5(%rbx),%eax
cmp    $0xfffffffc,%eax
ja     1168 <main+0x18>
xor    %eax,%eax
call   1050 <usage@plt>
cmp    $0x3,%ebx
je     11e6 <main+0x96>
cmp    $0x2,%ebx
jne    11bc <main+0x6c>
mov    0x8(%r14),%rsi
lea    0xe83(%rip),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e6 <main+0x96>
mov    0x8(%r14),%rsi
lea    0xe75(%rip),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e6 <main+0x96>
mov    0x8(%r14),%rsi
lea    0xe63(%rip),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11fe <main+0xae>
mov    0x8(%r14),%rdi
call   1040 <list@plt>
jmp    1205 <main+0xb5>
mov    0x8(%r14),%rsi
lea    0xe46(%rip),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ef <main+0x9f>
mov    0x8(%r14),%rsi
lea    0xe33(%rip),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ef <main+0x9f>
xor    %eax,%eax
call   1050 <usage@plt>
jmp    1205 <main+0xb5>
mov    0x10(%r14),%rdi
mov    0x18(%r14),%rsi
call   1070 <extract@plt>
jmp    1205 <main+0xb5>
xor    %eax,%eax
call   1060 <license@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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