#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*/ EXIT_FAILURE;
int /*<<< orphan*/ book(char *, char *, char *);
int /*<<< orphan*/ book_any(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ guests(char *);
int /*<<< orphan*/ list(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage_error();
int main(int argc, char **argv) {
  if (argc < 2) {
    usage_error();
  }
  if (!strcmp(argv[1], "list")) {
    if (argc < 3) {
      usage_error();
    }
    list(argv[2]);
  } else if (!strcmp(argv[1], "book")) {
    if (argc < 4) {
      usage_error();
    }
    if (argc > 4) {
      book(argv[2], argv[3], argv[4]);
    } else {
      book_any(argv[2], argv[3]);
    }
  } else if (!strcmp(argv[1], "guests")) {
    if (argc < 3) {
      usage_error();
    }
    guests(argv[2]);
  } else {
    usage_error();
  }
  exit(EXIT_FAILURE);
}


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   $0x2,-0x8(%rbp)
jge    1197 <main+0x27>
mov    $0x0,%al
call   1040 <usage_error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11d7 <main+0x67>
cmpl   $0x3,-0x8(%rbp)
jge    11c5 <main+0x55>
mov    $0x0,%al
call   1040 <usage_error@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <list@plt>
jmp    129c <main+0x12c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    124b <main+0xdb>
cmpl   $0x4,-0x8(%rbp)
jge    1205 <main+0x95>
mov    $0x0,%al
call   1040 <usage_error@plt>
cmpl   $0x4,-0x8(%rbp)
jle    1231 <main+0xc1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
call   1090 <book@plt>
jmp    1246 <main+0xd6>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1030 <book_any@plt>
jmp    1297 <main+0x127>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    128b <main+0x11b>
cmpl   $0x3,-0x8(%rbp)
jge    1279 <main+0x109>
mov    $0x0,%al
call   1040 <usage_error@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <guests@plt>
jmp    1292 <main+0x122>
mov    $0x0,%al
call   1040 <usage_error@plt>
jmp    1297 <main+0x127>
jmp    129c <main+0x12c>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    $0x1,%edi
jg     1185 <main+0x15>
xor    %eax,%eax
call   1040 <usage_error@plt>
mov    0x8(%r14),%rbx
lea    0xe70(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11b3 <main+0x43>
cmp    $0x2,%ebp
jg     11a8 <main+0x38>
xor    %eax,%eax
call   1040 <usage_error@plt>
mov    0x10(%r14),%rdi
call   1060 <list@plt>
jmp    122c <main+0xbc>
lea    0xe4b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11d4 <main+0x64>
cmp    $0x3,%ebp
jg     11fe <main+0x8e>
xor    %eax,%eax
call   1040 <usage_error@plt>
jmp    1203 <main+0x93>
lea    0xe2f(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1212 <main+0xa2>
cmp    $0x2,%ebp
jg     11f3 <main+0x83>
xor    %eax,%eax
call   1040 <usage_error@plt>
mov    0x10(%r14),%rdi
call   1070 <guests@plt>
jmp    122c <main+0xbc>
cmp    $0x4,%ebp
jne    121b <main+0xab>
mov    0x10(%r14),%rdi
mov    0x18(%r14),%rsi
call   1030 <book_any@plt>
jmp    122c <main+0xbc>
xor    %eax,%eax
call   1040 <usage_error@plt>
jmp    122c <main+0xbc>
mov    0x10(%r14),%rdi
mov    0x18(%r14),%rsi
mov    0x20(%r14),%rdx
call   1090 <book@plt>
mov    0x2dad(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"list\00"
@.str.1 = [5 x i8] c"book\00"
@.str.2 = [7 x i8] c"guests\00"
@EXIT_FAILURE = global i32 0
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 (...) @usage_error()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = icmp slt i32 %0, 3
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 (...) @usage_error()
br label %15
15: ; preds = %13, %11
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @list(i8* %17)
br label %55
19: ; preds = %6
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %42
22: ; preds = %19
%23 = icmp slt i32 %0, 4
br i1 %23, label %24, label %26
24: ; preds = %22
%25 = tail call i32 (...) @usage_error()
br label %36
26: ; preds = %22
%27 = icmp eq i32 %0, 4
br i1 %27, label %36, label %28
28: ; preds = %26
%29 = getelementptr inbounds i8*, i8** %1, i64 2
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8*, i8** %1, i64 4
%34 = load i8*, i8** %33
%35 = tail call i32 @book(i8* %30, i8* %32, i8* %34)
br label %55
36: ; preds = %24, %26
%37 = getelementptr inbounds i8*, i8** %1, i64 2
%38 = load i8*, i8** %37
%39 = getelementptr inbounds i8*, i8** %1, i64 3
%40 = load i8*, i8** %39
%41 = tail call i32 @book_any(i8* %38, i8* %40)
br label %55
42: ; preds = %19
%43 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %42
%46 = icmp slt i32 %0, 3
br i1 %46, label %47, label %49
47: ; preds = %45
%48 = tail call i32 (...) @usage_error()
br label %49
49: ; preds = %47, %45
%50 = getelementptr inbounds i8*, i8** %1, i64 2
%51 = load i8*, i8** %50
%52 = tail call i32 @guests(i8* %51)
br label %55
53: ; preds = %42
%54 = tail call i32 (...) @usage_error()
br label %55
55: ; preds = %36, %28, %53, %49, %15
%56 = load i32, i32* @EXIT_FAILURE
%57 = tail call i32 @exit(i32 %56)
unreachable
}