#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 otrx_check(int, char **);
int otrx_create(int, char **);
int otrx_extract(int, char **);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc > 1) {
    if (!strcmp(argv[1], "check"))
      return otrx_check(argc, argv);
    else if (!strcmp(argv[1], "create"))
      return otrx_create(argc, argv);
    else if (!strcmp(argv[1], "extract"))
      return otrx_extract(argc, argv);
  }
  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   $0x1,-0x8(%rbp)
jle    1212 <main+0xc2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11a1 <main+0x51>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <otrx_check@plt>
mov    %eax,-0x4(%rbp)
jmp    1220 <main+0xd0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe56(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d2 <main+0x82>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <otrx_create@plt>
mov    %eax,-0x4(%rbp)
jmp    1220 <main+0xd0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1203 <main+0xb3>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <otrx_extract@plt>
mov    %eax,-0x4(%rbp)
jmp    1220 <main+0xd0>
jmp    1208 <main+0xb8>
jmp    120d <main+0xbd>
jmp    1212 <main+0xc2>
mov    $0x0,%al
call   1060 <usage@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     119b <main+0x4b>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11a9 <main+0x59>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b7 <main+0x67>
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11c5 <main+0x75>
xor    %eax,%eax
call   1060 <usage@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <otrx_check@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <otrx_create@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <otrx_extract@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"check\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [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, 1
br i1 %7, label %8, label %41
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @otrx_check(i32 %15, i8** %16)
store i32 %17, i32* %3
br label %43
18: ; preds = %8
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %28, label %24
24: ; preds = %18
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = call i32 @otrx_create(i32 %25, i8** %26)
store i32 %27, i32* %3
br label %43
28: ; preds = %18
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @strcmp(i8* %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %38, label %34
34: ; preds = %28
%35 = load i32, i32* %4
%36 = load i8**, i8*** %5
%37 = call i32 @otrx_extract(i32 %35, i8** %36)
store i32 %37, i32* %3
br label %43
38: ; preds = %28
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40, %2
%42 = call i32 (...) @usage()
store i32 0, i32* %3
br label %43
43: ; preds = %41, %34, %24, %14
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [6 x i8] c"check\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [8 x i8] c"extract\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @otrx_check(i32 %0, i8** %1)
br label %23
11: ; preds = %4
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @otrx_create(i32 %0, i8** %1)
br label %23
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @otrx_extract(i32 %0, i8** %1)
br label %23
21: ; preds = %16, %2
%22 = tail call i32 (...) @usage()
br label %23
23: ; preds = %21, %19, %14, %9
%24 = phi i32 [ 0, %21 ], [ %20, %19 ], [ %15, %14 ], [ %10, %9 ]
ret i32 %24
}