#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*/ FindC3C();
int /*<<< orphan*/ atoi(char *);
int dump_bic();
int dump_city(int /*<<< orphan*/);
int dump_lead(int /*<<< orphan*/);
int dump_unit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    print_usage();
    return 1;
  }
  if (!FindC3C()) {
    return 1;
  }
  if (!strcmp("bic", argv[1])) {
    return dump_bic();
  } else if (!strcmp("city", argv[1])) {
    if (argc < 3) {
      fprintf(stderr, "City id required\n");
      print_usage();
      return 1;
    }
    return dump_city(atoi(argv[2]));
  } else if (!strcmp("leader", argv[1])) {
    if (argc < 3) {
      fprintf(stderr, "Leader id required\n");
      print_usage();
      return 1;
    }
    return dump_lead(atoi(argv[2]));
  } else if (!strcmp("unit", argv[1])) {
    if (argc < 3) {
      fprintf(stderr, "Unit id required\n");
      print_usage();
      return 1;
    }
    return dump_unit(atoi(argv[2]));
  } else {
    fprintf(stderr, "Unrecognized option: %s\n", argv[1]);
    print_usage();
    return 1;
  }
}


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    11c3 <main+0x33>
mov    $0x0,%al
call   10b0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    $0x0,%al
call   1090 <FindC3C@plt>
cmp    $0x0,%eax
jne    11df <main+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe12(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    120b <main+0x7b>
mov    $0x0,%al
call   1080 <dump_bic@plt>
mov    %eax,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdea(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1278 <main+0xe8>
cmpl   $0x3,-0x8(%rbp)
jge    125c <main+0xcc>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
lea    0xdc7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   10b0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edi
call   1050 <dump_city@plt>
mov    %eax,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd94(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12e5 <main+0x155>
cmpl   $0x3,-0x8(%rbp)
jge    12c9 <main+0x139>
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
lea    0xd73(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   10b0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edi
call   1040 <dump_lead@plt>
mov    %eax,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd42(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1352 <main+0x1c2>
cmpl   $0x3,-0x8(%rbp)
jge    1336 <main+0x1a6>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xd1f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   10b0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edi
call   1030 <dump_unit@plt>
mov    %eax,-0x4(%rbp)
jmp    137f <main+0x1ef>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xce3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   10b0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     11a2 <main+0x12>
xor    %eax,%eax
call   10b0 <print_usage@plt>
jmp    1221 <main+0x91>
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1090 <FindC3C@plt>
test   %eax,%eax
je     1221 <main+0x91>
mov    0x8(%rbx),%r14
lea    0xe43(%rip),%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     122b <main+0x9b>
lea    0xe34(%rip),%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1236 <main+0xa6>
lea    0xe38(%rip),%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     124d <main+0xbd>
lea    0xe40(%rip),%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1278 <main+0xe8>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    0xe3b(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1199 <main+0x9>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1080 <dump_bic@plt>
cmp    $0x2,%ebp
ja     1264 <main+0xd4>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
lea    0xdbe(%rip),%rsi
jmp    128d <main+0xfd>
cmp    $0x2,%ebp
ja     1299 <main+0x109>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
lea    0xdc0(%rip),%rsi
jmp    128d <main+0xfd>
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <dump_city@plt>
cmp    $0x2,%ebp
ja     12ad <main+0x11d>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1199 <main+0x9>
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <dump_lead@plt>
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <dump_unit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"bic\00"
@.str.1 = [5 x i8] c"city\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"City id required\0A\00"
@.str.3 = [7 x i8] c"leader\00"
@.str.4 = [20 x i8] c"Leader id required\0A\00"
@.str.5 = [5 x i8] c"unit\00"
@.str.6 = [18 x i8] c"Unit id required\0A\00"
@.str.7 = [25 x i8] c"Unrecognized option: %s\0A\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 slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %86
10: ; preds = %2
%11 = call i32 (...) @FindC3C()
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
store i32 1, i32* %3
br label %86
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %14
%21 = call i32 (...) @dump_bic()
store i32 %21, i32* %3
br label %86
22: ; preds = %14
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %41, label %28
28: ; preds = %22
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %86
35: ; preds = %28
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
%40 = call i32 @dump_city(i32 %39)
store i32 %40, i32* %3
br label %86
41: ; preds = %22
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %60, label %47
47: ; preds = %41
%48 = load i32, i32* %4
%49 = icmp slt i32 %48, 3
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%53 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %86
54: ; preds = %47
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 2
%57 = load i8*, i8** %56
%58 = call i32 @atoi(i8* %57)
%59 = call i32 @dump_lead(i32 %58)
store i32 %59, i32* %3
br label %86
60: ; preds = %41
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %63)
%65 = icmp ne i32 %64, 0
br i1 %65, label %79, label %66
66: ; preds = %60
%67 = load i32, i32* %4
%68 = icmp slt i32 %67, 3
br i1 %68, label %69, label %73
69: ; preds = %66
%70 = load i32, i32* @stderr
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%72 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %86
73: ; preds = %66
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 2
%76 = load i8*, i8** %75
%77 = call i32 @atoi(i8* %76)
%78 = call i32 @dump_unit(i32 %77)
store i32 %78, i32* %3
br label %86
79: ; preds = %60
%80 = load i32, i32* @stderr
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 1
%83 = load i8*, i8** %82
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %83)
%85 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %86
86: ; preds = %79, %73, %69, %54, %50, %35, %31, %20, %13, %8
%87 = load i32, i32* %3
ret i32 %87
}

LLVM IR (-O2):
@.str = [4 x i8] c"bic\00"
@.str.1 = [5 x i8] c"city\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"City id required\0A\00"
@.str.3 = [7 x i8] c"leader\00"
@.str.4 = [20 x i8] c"Leader id required\0A\00"
@.str.5 = [5 x i8] c"unit\00"
@.str.6 = [18 x i8] c"Unit id required\0A\00"
@.str.7 = [25 x i8] c"Unrecognized option: %s\0A\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 (...) @print_usage()
br label %62
6: ; preds = %2
%7 = tail call i32 (...) @FindC3C()
%8 = icmp eq i32 %7, 0
br i1 %8, label %62, label %9
9: ; preds = %6
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (...) @dump_bic()
br label %62
16: ; preds = %9
%17 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %11)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %16
%20 = icmp ult i32 %0, 3
br i1 %20, label %21, label %25
21: ; preds = %19
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%24 = tail call i32 (...) @print_usage()
br label %62
25: ; preds = %19
%26 = getelementptr inbounds i8*, i8** %1, i64 2
%27 = load i8*, i8** %26
%28 = tail call i32 @atoi(i8* %27)
%29 = tail call i32 @dump_city(i32 %28)
br label %62
30: ; preds = %16
%31 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %11)
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %44
33: ; preds = %30
%34 = icmp ult i32 %0, 3
br i1 %34, label %35, label %39
35: ; preds = %33
%36 = load i32, i32* @stderr
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%38 = tail call i32 (...) @print_usage()
br label %62
39: ; preds = %33
%40 = getelementptr inbounds i8*, i8** %1, i64 2
%41 = load i8*, i8** %40
%42 = tail call i32 @atoi(i8* %41)
%43 = tail call i32 @dump_lead(i32 %42)
br label %62
44: ; preds = %30
%45 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* dereferenceable(1) %11)
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %58
47: ; preds = %44
%48 = icmp ult i32 %0, 3
br i1 %48, label %49, label %53
49: ; preds = %47
%50 = load i32, i32* @stderr
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%52 = tail call i32 (...) @print_usage()
br label %62
53: ; preds = %47
%54 = getelementptr inbounds i8*, i8** %1, i64 2
%55 = load i8*, i8** %54
%56 = tail call i32 @atoi(i8* %55)
%57 = tail call i32 @dump_unit(i32 %56)
br label %62
58: ; preds = %44
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %11)
%61 = tail call i32 (...) @print_usage()
br label %62
62: ; preds = %6, %58, %53, %49, %39, %35, %25, %21, %14, %4
%63 = phi i32 [ 1, %4 ], [ 1, %58 ], [ 1, %49 ], [ %57, %53 ], [ 1, %35 ], [ %43, %39 ], [ 1, %21 ], [ %29, %25 ], [ %15, %14 ], [ 1, %6 ]
ret i32 %63
}