#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(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void die(int status, int errno) {
  switch (errno) {
  case 0:
    exit(status);
  case 1:
    fprintf(stderr, "getdate: The DATEMSK environment variable is not "
                    "defined,or its value is an empty string.\n");
    exit(status);
  case 2:
    fprintf(stderr, "getdate: The template file specified by DATEMSK cannot "
                    "beopened for reading.\n");
    exit(status);
  case 3:
    fprintf(stderr, "getdate: Failed to get file status information.\n");
    exit(status);
  case 4:
    fprintf(stderr, "getdate: The template file is not a regular file.\n");
    exit(status);
  case 5:
    fprintf(
        stderr,
        "getdate: An error was encountered while reading the template file.\n");
    exit(status);
  case 6:
    fprintf(
        stderr,
        "getdate: Memory allocation failed (not enough memory available).\n");
    exit(status);
  case 7:
    fprintf(stderr, "Date format is not recognized\n");
    exit(status);
  case 8:
    fprintf(stderr, "getdate: Invalid input specification.\n");
    exit(status);
  case 9:
    fprintf(stderr, "Database doesn't exist.\n");
    exit(status);
  case 10:
    fprintf(stderr, "Something is wrong with the database.\n");
    exit(status);
  case 11:
    fprintf(stderr, "Unable to open database file.\n");
    exit(status);
  case 12:
    fprintf(stderr, "Please provide a time to move the event to.\n");
    exit(status);
  case 13:
    exit(status);
  case 127:
    fprintf(stderr, "too many argument\n");
    exit(status);
  default:
    fprintf(stderr, "uncaught error, exiting\n");
    exit(status);
  }
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7f,%rax
ja     12dc <die+0x1bc>
mov    -0x10(%rbp),%rax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0x1095(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0x10d3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0x1104(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0x1118(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
lea    0x112e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
lea    0x1155(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
lea    0x117a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
lea    0x117c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    0x1186(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
lea    0x1182(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0x118c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
lea    0x118e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
lea    0x1196(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
lea    0x118c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %edi,%ebx
cmp    $0x7f,%esi
ja     121d <die+0xfd>
mov    %esi,%eax
lea    0xecb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %ebx,%edi
call   1040 <exit@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0x10ab(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0x10f1(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0x112a(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0x1146(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0x1164(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0x1193(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
lea    0x11df(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
lea    0x11f4(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0x11fb(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
lea    0x1210(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
lea    0x121d(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
lea    0x124b(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
lea    0x1226(%rip),%rsi
jmp    1251 <die+0x131>
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
lea    0x1142(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"getdate: The DATEMSK environment variable is not defined,or its value is an empty string.\0A\00"
@.str.1 = [78 x i8] c"getdate: The template file specified by DATEMSK cannot beopened for reading.\0A\00"
@.str.2 = [49 x i8] c"getdate: Failed to get file status information.\0A\00"
@.str.3 = [51 x i8] c"getdate: The template file is not a regular file.\0A\00"
@.str.4 = [68 x i8] c"getdate: An error was encountered while reading the template file.\0A\00"
@.str.5 = [66 x i8] c"getdate: Memory allocation failed (not enough memory available).\0A\00"
@.str.6 = [31 x i8] c"Date format is not recognized\0A\00"
@.str.7 = [39 x i8] c"getdate: Invalid input specification.\0A\00"
@.str.8 = [25 x i8] c"Database doesn't exist.\0A\00"
@.str.9 = [39 x i8] c"Something is wrong with the database.\0A\00"
@.str.10 = [31 x i8] c"Unable to open database file.\0A\00"
@.str.11 = [45 x i8] c"Please provide a time to move the event to.\0A\00"
@.str.12 = [19 x i8] c"too many argument\0A\00"
@.str.13 = [25 x i8] c"uncaught error, exiting\0A\00"
define void @die(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %77 [
i32 0, label %6
i32 1, label %9
i32 2, label %14
i32 3, label %19
i32 4, label %24
i32 5, label %29
i32 6, label %34
i32 7, label %39
i32 8, label %44
i32 9, label %49
i32 10, label %54
i32 11, label %59
i32 12, label %64
i32 13, label %69
i32 127, label %72
]
6: ; preds = %2
%7 = load i32, i32* %3
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%27 = load i32, i32* %3
%28 = call i32 @exit(i32 %27)
unreachable
29: ; preds = %2
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
%32 = load i32, i32* %3
%33 = call i32 @exit(i32 %32)
unreachable
34: ; preds = %2
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0))
%37 = load i32, i32* %3
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %2
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%42 = load i32, i32* %3
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %2
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%47 = load i32, i32* %3
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %2
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%52 = load i32, i32* %3
%53 = call i32 @exit(i32 %52)
unreachable
54: ; preds = %2
%55 = load i32, i32* @stderr
%56 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
%57 = load i32, i32* %3
%58 = call i32 @exit(i32 %57)
unreachable
59: ; preds = %2
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0))
%62 = load i32, i32* %3
%63 = call i32 @exit(i32 %62)
unreachable
64: ; preds = %2
%65 = load i32, i32* @stderr
%66 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%67 = load i32, i32* %3
%68 = call i32 @exit(i32 %67)
unreachable
69: ; preds = %2
%70 = load i32, i32* %3
%71 = call i32 @exit(i32 %70)
unreachable
72: ; preds = %2
%73 = load i32, i32* @stderr
%74 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%75 = load i32, i32* %3
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %2
%78 = load i32, i32* @stderr
%79 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
%80 = load i32, i32* %3
%81 = call i32 @exit(i32 %80)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"getdate: The DATEMSK environment variable is not defined,or its value is an empty string.\0A\00"
@.str.1 = [78 x i8] c"getdate: The template file specified by DATEMSK cannot beopened for reading.\0A\00"
@.str.2 = [49 x i8] c"getdate: Failed to get file status information.\0A\00"
@.str.3 = [51 x i8] c"getdate: The template file is not a regular file.\0A\00"
@.str.4 = [68 x i8] c"getdate: An error was encountered while reading the template file.\0A\00"
@.str.5 = [66 x i8] c"getdate: Memory allocation failed (not enough memory available).\0A\00"
@.str.6 = [31 x i8] c"Date format is not recognized\0A\00"
@.str.7 = [39 x i8] c"getdate: Invalid input specification.\0A\00"
@.str.8 = [25 x i8] c"Database doesn't exist.\0A\00"
@.str.9 = [39 x i8] c"Something is wrong with the database.\0A\00"
@.str.10 = [31 x i8] c"Unable to open database file.\0A\00"
@.str.11 = [45 x i8] c"Please provide a time to move the event to.\0A\00"
@.str.12 = [19 x i8] c"too many argument\0A\00"
@.str.13 = [25 x i8] c"uncaught error, exiting\0A\00"
define void @die(i32 %0, i32 %1) {
switch i32 %1, label %59 [
i32 0, label %3
i32 1, label %5
i32 2, label %9
i32 3, label %13
i32 4, label %17
i32 5, label %21
i32 6, label %25
i32 7, label %29
i32 8, label %33
i32 9, label %37
i32 10, label %41
i32 11, label %45
i32 12, label %49
i32 13, label %53
i32 127, label %55
]
3: ; preds = %2
%4 = tail call i32 @exit(i32 %0)
unreachable
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 %0)
unreachable
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @exit(i32 %0)
unreachable
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @exit(i32 %0)
unreachable
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%20 = tail call i32 @exit(i32 %0)
unreachable
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
%24 = tail call i32 @exit(i32 %0)
unreachable
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0))
%28 = tail call i32 @exit(i32 %0)
unreachable
29: ; preds = %2
%30 = load i32, i32* @stderr
%31 = tail call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%32 = tail call i32 @exit(i32 %0)
unreachable
33: ; preds = %2
%34 = load i32, i32* @stderr
%35 = tail call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%36 = tail call i32 @exit(i32 %0)
unreachable
37: ; preds = %2
%38 = load i32, i32* @stderr
%39 = tail call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%40 = tail call i32 @exit(i32 %0)
unreachable
41: ; preds = %2
%42 = load i32, i32* @stderr
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
%44 = tail call i32 @exit(i32 %0)
unreachable
45: ; preds = %2
%46 = load i32, i32* @stderr
%47 = tail call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0))
%48 = tail call i32 @exit(i32 %0)
unreachable
49: ; preds = %2
%50 = load i32, i32* @stderr
%51 = tail call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%52 = tail call i32 @exit(i32 %0)
unreachable
53: ; preds = %2
%54 = tail call i32 @exit(i32 %0)
unreachable
55: ; preds = %2
%56 = load i32, i32* @stderr
%57 = tail call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%58 = tail call i32 @exit(i32 %0)
unreachable
59: ; preds = %2
%60 = load i32, i32* @stderr
%61 = tail call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
%62 = tail call i32 @exit(i32 %0)
unreachable
}