#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*/ ddb_capture(int, char **);
int /*<<< orphan*/ ddb_script(int, char **);
int /*<<< orphan*/ ddb_scripts(int, char **);
int /*<<< orphan*/ ddb_unscript(int, char **);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
void ddb_main(int argc, char *argv[]) {
  if (argc < 1)
    usage();
  if (strcmp(argv[0], "capture") == 0)
    ddb_capture(argc, argv);
  else if (strcmp(argv[0], "script") == 0)
    ddb_script(argc, argv);
  else if (strcmp(argv[0], "scripts") == 0)
    ddb_scripts(argc, argv);
  else if (strcmp(argv[0], "unscript") == 0)
    ddb_unscript(argc, argv);
  else
    usage();
}


x86 assembly (clang, -O0):
<ddb_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1180 <ddb_main+0x20>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe72(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ae <ddb_main+0x4e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ddb_capture@plt>
jmp    124e <ddb_main+0xee>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe56(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11dc <ddb_main+0x7c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <ddb_script@plt>
jmp    1249 <ddb_main+0xe9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe1e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    120a <ddb_main+0xaa>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <ddb_scripts@plt>
jmp    1244 <ddb_main+0xe4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdf8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1238 <ddb_main+0xd8>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <ddb_unscript@plt>
jmp    123f <ddb_main+0xdf>
mov    $0x0,%al
call   1040 <usage@plt>
jmp    1244 <ddb_main+0xe4>
jmp    1249 <ddb_main+0xe9>
jmp    124e <ddb_main+0xee>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddb_main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %edi,%edi
jg     1173 <ddb_main+0x13>
xor    %eax,%eax
call   1040 <usage@plt>
mov    (%rbx),%rdi
lea    0xe83(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d0 <ddb_main+0x70>
mov    (%rbx),%rdi
lea    0xe81(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e0 <ddb_main+0x80>
mov    (%rbx),%rdi
lea    0xe63(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11f0 <ddb_main+0x90>
mov    (%rbx),%rdi
lea    0xe57(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1200 <ddb_main+0xa0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ddb_capture@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <ddb_script@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <ddb_scripts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <ddb_unscript@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"capture\00"
@.str.1 = [7 x i8] c"script\00"
@.str.2 = [8 x i8] c"scripts\00"
@.str.3 = [9 x i8] c"unscript\00"
define void @ddb_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @usage()
br label %9
9: ; preds = %7, %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i32, i32* %3
%17 = load i8**, i8*** %4
%18 = call i32 @ddb_capture(i32 %16, i8** %17)
br label %54
19: ; preds = %9
%20 = load i8**, i8*** %4
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i32, i32* %3
%27 = load i8**, i8*** %4
%28 = call i32 @ddb_script(i32 %26, i8** %27)
br label %53
29: ; preds = %19
%30 = load i8**, i8*** %4
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = load i32, i32* %3
%37 = load i8**, i8*** %4
%38 = call i32 @ddb_scripts(i32 %36, i8** %37)
br label %52
39: ; preds = %29
%40 = load i8**, i8*** %4
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %39
%46 = load i32, i32* %3
%47 = load i8**, i8*** %4
%48 = call i32 @ddb_unscript(i32 %46, i8** %47)
br label %51
49: ; preds = %39
%50 = call i32 (...) @usage()
br label %51
51: ; preds = %49, %45
br label %52
52: ; preds = %51, %35
br label %53
53: ; preds = %52, %25
br label %54
54: ; preds = %53, %15
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"capture\00"
@.str.1 = [7 x i8] c"script\00"
@.str.2 = [8 x i8] c"scripts\00"
@.str.3 = [9 x i8] c"unscript\00"
define void @ddb_main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = load i8*, i8** %1
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @ddb_capture(i32 %0, i8** %1)
br label %32
12: ; preds = %6
%13 = load i8*, i8** %1
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 @ddb_script(i32 %0, i8** %1)
br label %32
18: ; preds = %12
%19 = load i8*, i8** %1
%20 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = tail call i32 @ddb_scripts(i32 %0, i8** %1)
br label %32
24: ; preds = %18
%25 = load i8*, i8** %1
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = tail call i32 @ddb_unscript(i32 %0, i8** %1)
br label %32
30: ; preds = %24
%31 = tail call i32 (...) @usage()
br label %32
32: ; preds = %16, %28, %30, %22, %10
ret void
}