#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 EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *getCustom(int, char **, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char *);
int sub_date(int, char **);
int sub_day(int, char **);
int sub_from24digit(int, char **);
int sub_from24pair(int, char **);
int sub_fullmoon(int, char **);
int sub_help();
int sub_month(int, char **);
int sub_newyear(int, char **);
int sub_to24digit(int, char **);
int sub_to24pair(int, char **);
int main(int argc, char *argv[]) {
  int retval = 0;
  const char *spname = NULL;
  spname = getCustom(argc, argv, 0);
  if ((strcmp(spname, "") == 0) || (strcmp(spname, "help") == 0)) {
    retval = sub_help();
  } else if (strcmp(spname, "to24pair") == 0) {
    retval = sub_to24pair(argc, argv);
  } else if (strcmp(spname, "from24pair") == 0) {
    retval = sub_from24pair(argc, argv);
  } else if (strcmp(spname, "to24digit") == 0) {
    retval = sub_to24digit(argc, argv);
  } else if (strcmp(spname, "from24digit") == 0) {
    retval = sub_from24digit(argc, argv);
  } else if (strcmp(spname, "day") == 0) {
    retval = sub_day(argc, argv);
  } else if (strcmp(spname, "month") == 0) {
    retval = sub_month(argc, argv);
  } else if (strcmp(spname, "date") == 0) {
    retval = sub_date(argc, argv);
  } else if (strcmp(spname, "fullmoon") == 0) {
    retval = sub_fullmoon(argc, argv);
  } else if (strcmp(spname, "newyear") == 0) {
    retval = sub_newyear(argc, argv);
  } else {
    fprintf(stderr, "Unrecognized command.  Use \"help\" for help.\n");
    retval = EXIT_FAILURE;
  }
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1050 <getCustom@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     123b <main+0x6b>
mov    -0x20(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    124a <main+0x7a>
mov    $0x0,%al
call   1060 <sub_help@plt>
mov    %eax,-0x14(%rbp)
jmp    1436 <main+0x266>
mov    -0x20(%rbp),%rdi
lea    0xdb0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1278 <main+0xa8>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <sub_to24pair@plt>
mov    %eax,-0x14(%rbp)
jmp    1431 <main+0x261>
mov    -0x20(%rbp),%rdi
lea    0xd8b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12a6 <main+0xd6>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10f0 <sub_from24pair@plt>
mov    %eax,-0x14(%rbp)
jmp    142c <main+0x25c>
mov    -0x20(%rbp),%rdi
lea    0xd68(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12d4 <main+0x104>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <sub_to24digit@plt>
mov    %eax,-0x14(%rbp)
jmp    1427 <main+0x257>
mov    -0x20(%rbp),%rdi
lea    0xd44(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1302 <main+0x132>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10e0 <sub_from24digit@plt>
mov    %eax,-0x14(%rbp)
jmp    1422 <main+0x252>
mov    -0x20(%rbp),%rdi
lea    0xd22(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1330 <main+0x160>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sub_day@plt>
mov    %eax,-0x14(%rbp)
jmp    141d <main+0x24d>
mov    -0x20(%rbp),%rdi
lea    0xcf8(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    135e <main+0x18e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10d0 <sub_month@plt>
mov    %eax,-0x14(%rbp)
jmp    1418 <main+0x248>
mov    -0x20(%rbp),%rdi
lea    0xcd0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    138c <main+0x1bc>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10a0 <sub_date@plt>
mov    %eax,-0x14(%rbp)
jmp    1413 <main+0x243>
mov    -0x20(%rbp),%rdi
lea    0xca7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13ba <main+0x1ea>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10c0 <sub_fullmoon@plt>
mov    %eax,-0x14(%rbp)
jmp    140e <main+0x23e>
mov    -0x20(%rbp),%rdi
lea    0xc82(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13e8 <main+0x218>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <sub_newyear@plt>
mov    %eax,-0x14(%rbp)
jmp    1409 <main+0x239>
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
lea    0xc57(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2bd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    140e <main+0x23e>
jmp    1413 <main+0x243>
jmp    1418 <main+0x248>
jmp    141d <main+0x24d>
jmp    1422 <main+0x252>
jmp    1427 <main+0x257>
jmp    142c <main+0x25c>
jmp    1431 <main+0x261>
jmp    1436 <main+0x266>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edx,%edx
call   1050 <getCustom@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
mov    %rax,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     130e <main+0x13e>
lea    0xdfe(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     130e <main+0x13e>
lea    0xdeb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1319 <main+0x149>
lea    0xddc(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1327 <main+0x157>
lea    0xdcf(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1335 <main+0x165>
lea    0xdc1(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1343 <main+0x173>
lea    0xdb5(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1351 <main+0x181>
lea    0xda1(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     135f <main+0x18f>
lea    0xd8f(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     136d <main+0x19d>
lea    0xd7c(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     137b <main+0x1ab>
lea    0xd6d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1389 <main+0x1b9>
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
lea    0xd54(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <sub_help@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10b0 <sub_to24pair@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10f0 <sub_from24pair@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1090 <sub_to24digit@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10e0 <sub_from24digit@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sub_day@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10d0 <sub_month@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10a0 <sub_date@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10c0 <sub_fullmoon@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sub_newyear@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [9 x i8] c"to24pair\00"
@.str.3 = [11 x i8] c"from24pair\00"
@.str.4 = [10 x i8] c"to24digit\00"
@.str.5 = [12 x i8] c"from24digit\00"
@.str.6 = [4 x i8] c"day\00"
@.str.7 = [6 x i8] c"month\00"
@.str.8 = [5 x i8] c"date\00"
@.str.9 = [9 x i8] c"fullmoon\00"
@.str.10 = [8 x i8] c"newyear\00"
@stderr = global i32 0
@.str.11 = [45 x i8] c"Unrecognized command. Use \22help\22 for help.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i8* @getCustom(i32 %8, i8** %9, i32 0)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i8*, i8** %7
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14, %2
%19 = call i32 (...) @sub_help()
store i32 %19, i32* %6
br label %105
20: ; preds = %14
%21 = load i8*, i8** %7
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = call i32 @sub_to24pair(i32 %25, i8** %26)
store i32 %27, i32* %6
br label %104
28: ; preds = %20
%29 = load i8*, i8** %7
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load i32, i32* %4
%34 = load i8**, i8*** %5
%35 = call i32 @sub_from24pair(i32 %33, i8** %34)
store i32 %35, i32* %6
br label %103
36: ; preds = %28
%37 = load i8*, i8** %7
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = load i32, i32* %4
%42 = load i8**, i8*** %5
%43 = call i32 @sub_to24digit(i32 %41, i8** %42)
store i32 %43, i32* %6
br label %102
44: ; preds = %36
%45 = load i8*, i8** %7
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %44
%49 = load i32, i32* %4
%50 = load i8**, i8*** %5
%51 = call i32 @sub_from24digit(i32 %49, i8** %50)
store i32 %51, i32* %6
br label %101
52: ; preds = %44
%53 = load i8*, i8** %7
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = load i32, i32* %4
%58 = load i8**, i8*** %5
%59 = call i32 @sub_day(i32 %57, i8** %58)
store i32 %59, i32* %6
br label %100
60: ; preds = %52
%61 = load i8*, i8** %7
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %68
64: ; preds = %60
%65 = load i32, i32* %4
%66 = load i8**, i8*** %5
%67 = call i32 @sub_month(i32 %65, i8** %66)
store i32 %67, i32* %6
br label %99
68: ; preds = %60
%69 = load i8*, i8** %7
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %68
%73 = load i32, i32* %4
%74 = load i8**, i8*** %5
%75 = call i32 @sub_date(i32 %73, i8** %74)
store i32 %75, i32* %6
br label %98
76: ; preds = %68
%77 = load i8*, i8** %7
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %76
%81 = load i32, i32* %4
%82 = load i8**, i8*** %5
%83 = call i32 @sub_fullmoon(i32 %81, i8** %82)
store i32 %83, i32* %6
br label %97
84: ; preds = %76
%85 = load i8*, i8** %7
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %92
88: ; preds = %84
%89 = load i32, i32* %4
%90 = load i8**, i8*** %5
%91 = call i32 @sub_newyear(i32 %89, i8** %90)
store i32 %91, i32* %6
br label %96
92: ; preds = %84
%93 = load i32, i32* @stderr
%94 = call i32 @fprintf(i32 %93, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%95 = load i32, i32* @EXIT_FAILURE
store i32 %95, i32* %6
br label %96
96: ; preds = %92, %88
br label %97
97: ; preds = %96, %80
br label %98
98: ; preds = %97, %72
br label %99
99: ; preds = %98, %64
br label %100
100: ; preds = %99, %56
br label %101
101: ; preds = %100, %48
br label %102
102: ; preds = %101, %40
br label %103
103: ; preds = %102, %32
br label %104
104: ; preds = %103, %24
br label %105
105: ; preds = %104, %18
%106 = load i32, i32* %6
ret i32 %106
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [9 x i8] c"to24pair\00"
@.str.3 = [11 x i8] c"from24pair\00"
@.str.4 = [10 x i8] c"to24digit\00"
@.str.5 = [12 x i8] c"from24digit\00"
@.str.6 = [4 x i8] c"day\00"
@.str.7 = [6 x i8] c"month\00"
@.str.8 = [5 x i8] c"date\00"
@.str.9 = [9 x i8] c"fullmoon\00"
@.str.10 = [8 x i8] c"newyear\00"
@stderr = global i32 0
@.str.11 = [45 x i8] c"Unrecognized command. Use \22help\22 for help.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i8* @getCustom(i32 %0, i8** %1, i32 0)
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %2
%10 = tail call i32 (...) @sub_help()
br label %60
11: ; preds = %6
%12 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @sub_to24pair(i32 %0, i8** %1)
br label %60
16: ; preds = %11
%17 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @sub_from24pair(i32 %0, i8** %1)
br label %60
21: ; preds = %16
%22 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @sub_to24digit(i32 %0, i8** %1)
br label %60
26: ; preds = %21
%27 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @sub_from24digit(i32 %0, i8** %1)
br label %60
31: ; preds = %26
%32 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 @sub_day(i32 %0, i8** %1)
br label %60
36: ; preds = %31
%37 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = tail call i32 @sub_month(i32 %0, i8** %1)
br label %60
41: ; preds = %36
%42 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 @sub_date(i32 %0, i8** %1)
br label %60
46: ; preds = %41
%47 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = tail call i32 @sub_fullmoon(i32 %0, i8** %1)
br label %60
51: ; preds = %46
%52 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = tail call i32 @sub_newyear(i32 %0, i8** %1)
br label %60
56: ; preds = %51
%57 = load i32, i32* @stderr
%58 = tail call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
br label %60
60: ; preds = %14, %24, %34, %44, %54, %56, %49, %39, %29, %19, %9
%61 = phi i32 [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %24 ], [ %30, %29 ], [ %35, %34 ], [ %40, %39 ], [ %45, %44 ], [ %50, %49 ], [ %55, %54 ], [ %59, %56 ]
ret i32 %61
}