#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*/ printf(char *, int, char *);
void JV_ErrorHandle(int code) {
  char *msg = NULL;
  switch (code) {
  case 1:
    msg = "ErrorMessage : JVERR_PRIVATE_KEY_NOT_EXIST\n"
          "NPKI private key argument doesn't exist!\n";
    break;
  case 10:
    msg = "ErrorMessage : JVERR_PW_MIN_LENGTH_NOT_EXIST\n"
          "Please specify password's minimum length.\n";
    break;
  case 12:
    msg = "ErrorMessage : JVERR_PW_MAX_LENGTH_NOT_EXIST\n"
          "Please specify password's maximum length.\n";
    break;
  case 20:
    msg = "ErrorMessage : JVERR_PW_CHARSET_NOT_EXIST\n"
          "Please specify valid charset file's path.\n";
    break;
  case 21:
    msg = "ErrorMessage : JVERR_PW_CHARSET_TOO_LONG\n"
          "Password Charset is too long. Cannot be over MAX_PW_CHARSET\n";
    break;
  case 30:
    msg = "ErrorMessage : JVERR_PW_INITIAL_NOT_EXIST\n"
          "Initial password argument doesn't exist!\n";
    break;
  case 31:
    msg = "ErrorMessage : JVERR_PW_INITIAL_NOT_VALID\n"
          "Initial password is not valid with charset\n";
    break;
  case 22:
    msg = "ErrorMessage : JVERR_PW_CHARSET_DUPLICATE\n"
          "There are duplicated character in charset.\n";
    break;
  case 32:
    msg = "ErrorMessage : JVERR_PW_INITIAL_TOO_SHORT\n"
          "Initial password is shorter than min password length.\n";
    break;
  case 33:
    msg = "ErrorMessage : JVERR_PW_INITIAL_TOO_LONG\n"
          "Initial password is longer than max password length.\n";
    break;
  case 40:
    msg = "ErrorMessage : JVERR_PRINT_INTERVAL_NOT_EXIST\n"
          "Print Interval arg is not after -p.\n";
    break;
  case 41:
    msg = "ErrorMessage : JVERR_PRINT_INTERVAL_TOO_SHORT\n"
          "Print interval must be positive number.\n";
    break;
  case 42:
    msg = "ErrorMessage : JVERR_PRINT_INTERVAL_TOO_SHORT\n"
          "Print interval is longer than 1 hour.\n";
    break;
  case 11:
    msg = "ErrorMessage : JVERR_PW_MIN_LENGTH_TOO_SHORT\n"
          "Minimum password length must be positive number.\n";
    break;
  case 13:
    msg = "ErrorMessage : JVERR_PW_MAX_LENGTH_TOO_SHORT\n"
          "Maximum password length cannot be shorter than minimum password "
          "length.\n";
    break;
  case 14:
    msg = "ErrorMessage : JVERR_PW_MAX_LENGTH_TOO_LONG\n"
          "Maximum password length cannot be longer than 48.\n";
    break;
  case 50:
    msg = "ErrorMessage : JVERR_SEED_ASSERT_FAILED\n"
          "SEED assert for variables failed.\n";
    break;
  default:
    msg = "ErrorMessage : UNDEFINDED ERROR\n"
          "Undefined Error\n";
    break;
  }
  printf("ErrorCode : %d\n%s", code, msg);
  exit(code);
}


x86 assembly (clang, -O0):
<JV_ErrorHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x31,%eax
ja     126c <JV_ErrorHandle+0x14c>
mov    -0x18(%rbp),%rax
lea    0xead(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf65(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0xfaa(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0xff2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x103a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x107f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x10d5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1119(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x115f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x11a5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x11f6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1245(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1288(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x12cf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1314(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1363(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x13c9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1418(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1277 <JV_ErrorHandle+0x157>
lea    0x1453(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0x1472(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<JV_ErrorHandle>:
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%eax
cmp    $0x31,%eax
ja     114e <JV_ErrorHandle+0x2e>
lea    0xf96(%rip),%rdx
lea    0xec7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfd4(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x1571(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x13e6(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x100b(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x1433(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x14a0(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x1048(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x1094(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x119b(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x10e8(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x1133(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x11d6(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x122e(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x1284(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x12ce(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x131c(%rip),%rdx
jmp    11df <JV_ErrorHandle+0xbf>
lea    0x149c(%rip),%rdx
lea    0x1511(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [85 x i8] c"ErrorMessage : JVERR_PRIVATE_KEY_NOT_EXIST\0ANPKI private key argument doesn't exist!\0A\00"
@.str.1 = [88 x i8] c"ErrorMessage : JVERR_PW_MIN_LENGTH_NOT_EXIST\0APlease specify password's minimum length.\0A\00"
@.str.2 = [88 x i8] c"ErrorMessage : JVERR_PW_MAX_LENGTH_NOT_EXIST\0APlease specify password's maximum length.\0A\00"
@.str.3 = [85 x i8] c"ErrorMessage : JVERR_PW_CHARSET_NOT_EXIST\0APlease specify valid charset file's path.\0A\00"
@.str.4 = [102 x i8] c"ErrorMessage : JVERR_PW_CHARSET_TOO_LONG\0APassword Charset is too long. Cannot be over MAX_PW_CHARSET\0A\00"
@.str.5 = [84 x i8] c"ErrorMessage : JVERR_PW_INITIAL_NOT_EXIST\0AInitial password argument doesn't exist!\0A\00"
@.str.6 = [86 x i8] c"ErrorMessage : JVERR_PW_INITIAL_NOT_VALID\0AInitial password is not valid with charset\0A\00"
@.str.7 = [86 x i8] c"ErrorMessage : JVERR_PW_CHARSET_DUPLICATE\0AThere are duplicated character in charset.\0A\00"
@.str.8 = [97 x i8] c"ErrorMessage : JVERR_PW_INITIAL_TOO_SHORT\0AInitial password is shorter than min password length.\0A\00"
@.str.9 = [95 x i8] c"ErrorMessage : JVERR_PW_INITIAL_TOO_LONG\0AInitial password is longer than max password length.\0A\00"
@.str.10 = [83 x i8] c"ErrorMessage : JVERR_PRINT_INTERVAL_NOT_EXIST\0APrint Interval arg is not after -p.\0A\00"
@.str.11 = [87 x i8] c"ErrorMessage : JVERR_PRINT_INTERVAL_TOO_SHORT\0APrint interval must be positive number.\0A\00"
@.str.12 = [85 x i8] c"ErrorMessage : JVERR_PRINT_INTERVAL_TOO_SHORT\0APrint interval is longer than 1 hour.\0A\00"
@.str.13 = [95 x i8] c"ErrorMessage : JVERR_PW_MIN_LENGTH_TOO_SHORT\0AMinimum password length must be positive number.\0A\00"
@.str.14 = [118 x i8] c"ErrorMessage : JVERR_PW_MAX_LENGTH_TOO_SHORT\0AMaximum password length cannot be shorter than minimum password length.\0A\00"
@.str.15 = [95 x i8] c"ErrorMessage : JVERR_PW_MAX_LENGTH_TOO_LONG\0AMaximum password length cannot be longer than 48.\0A\00"
@.str.16 = [75 x i8] c"ErrorMessage : JVERR_SEED_ASSERT_FAILED\0ASEED assert for variables failed.\0A\00"
@.str.17 = [49 x i8] c"ErrorMessage : UNDEFINDED ERROR\0AUndefined Error\0A\00"
@.str.18 = [18 x i8] c"ErrorCode : %d\0A%s\00"
define void @JV_ErrorHandle(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %22 [
i32 1, label %5
i32 10, label %6
i32 12, label %7
i32 20, label %8
i32 21, label %9
i32 30, label %10
i32 31, label %11
i32 22, label %12
i32 32, label %13
i32 33, label %14
i32 40, label %15
i32 41, label %16
i32 42, label %17
i32 11, label %18
i32 13, label %19
i32 14, label %20
i32 50, label %21
]
5: ; preds = %1
store i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8** %3
br label %23
6: ; preds = %1
store i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %23
7: ; preds = %1
store i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %23
8: ; preds = %1
store i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %23
9: ; preds = %1
store i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %23
10: ; preds = %1
store i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %23
11: ; preds = %1
store i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %23
12: ; preds = %1
store i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %23
16: ; preds = %1
store i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %23
17: ; preds = %1
store i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %23
18: ; preds = %1
store i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %23
19: ; preds = %1
store i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %23
20: ; preds = %1
store i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %23
21: ; preds = %1
store i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %23
22: ; preds = %1
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.17, i64 0, i64 0), i8** %3
br label %23
23: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%24 = load i32, i32* %2
%25 = load i8*, i8** %3
%26 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0), i32 %24, i8* %25)
%27 = load i32, i32* %2
%28 = call i32 @exit(i32 %27)
unreachable
}

LLVM IR (-O2):
@.str = [85 x i8] c"ErrorMessage : JVERR_PRIVATE_KEY_NOT_EXIST\0ANPKI private key argument doesn't exist!\0A\00"
@.str.1 = [88 x i8] c"ErrorMessage : JVERR_PW_MIN_LENGTH_NOT_EXIST\0APlease specify password's minimum length.\0A\00"
@.str.2 = [88 x i8] c"ErrorMessage : JVERR_PW_MAX_LENGTH_NOT_EXIST\0APlease specify password's maximum length.\0A\00"
@.str.3 = [85 x i8] c"ErrorMessage : JVERR_PW_CHARSET_NOT_EXIST\0APlease specify valid charset file's path.\0A\00"
@.str.4 = [102 x i8] c"ErrorMessage : JVERR_PW_CHARSET_TOO_LONG\0APassword Charset is too long. Cannot be over MAX_PW_CHARSET\0A\00"
@.str.5 = [84 x i8] c"ErrorMessage : JVERR_PW_INITIAL_NOT_EXIST\0AInitial password argument doesn't exist!\0A\00"
@.str.6 = [86 x i8] c"ErrorMessage : JVERR_PW_INITIAL_NOT_VALID\0AInitial password is not valid with charset\0A\00"
@.str.7 = [86 x i8] c"ErrorMessage : JVERR_PW_CHARSET_DUPLICATE\0AThere are duplicated character in charset.\0A\00"
@.str.8 = [97 x i8] c"ErrorMessage : JVERR_PW_INITIAL_TOO_SHORT\0AInitial password is shorter than min password length.\0A\00"
@.str.9 = [95 x i8] c"ErrorMessage : JVERR_PW_INITIAL_TOO_LONG\0AInitial password is longer than max password length.\0A\00"
@.str.10 = [83 x i8] c"ErrorMessage : JVERR_PRINT_INTERVAL_NOT_EXIST\0APrint Interval arg is not after -p.\0A\00"
@.str.11 = [87 x i8] c"ErrorMessage : JVERR_PRINT_INTERVAL_TOO_SHORT\0APrint interval must be positive number.\0A\00"
@.str.12 = [85 x i8] c"ErrorMessage : JVERR_PRINT_INTERVAL_TOO_SHORT\0APrint interval is longer than 1 hour.\0A\00"
@.str.13 = [95 x i8] c"ErrorMessage : JVERR_PW_MIN_LENGTH_TOO_SHORT\0AMinimum password length must be positive number.\0A\00"
@.str.14 = [118 x i8] c"ErrorMessage : JVERR_PW_MAX_LENGTH_TOO_SHORT\0AMaximum password length cannot be shorter than minimum password length.\0A\00"
@.str.15 = [95 x i8] c"ErrorMessage : JVERR_PW_MAX_LENGTH_TOO_LONG\0AMaximum password length cannot be longer than 48.\0A\00"
@.str.16 = [75 x i8] c"ErrorMessage : JVERR_SEED_ASSERT_FAILED\0ASEED assert for variables failed.\0A\00"
@.str.17 = [49 x i8] c"ErrorMessage : UNDEFINDED ERROR\0AUndefined Error\0A\00"
@.str.18 = [18 x i8] c"ErrorCode : %d\0A%s\00"
define void @JV_ErrorHandle(i32 %0) {
switch i32 %0, label %18 [
i32 1, label %19
i32 10, label %2
i32 12, label %3
i32 20, label %4
i32 21, label %5
i32 30, label %6
i32 31, label %7
i32 22, label %8
i32 32, label %9
i32 33, label %10
i32 40, label %11
i32 41, label %12
i32 42, label %13
i32 11, label %14
i32 13, label %15
i32 14, label %16
i32 50, label %17
]
2: ; preds = %1
br label %19
3: ; preds = %1
br label %19
4: ; preds = %1
br label %19
5: ; preds = %1
br label %19
6: ; preds = %1
br label %19
7: ; preds = %1
br label %19
8: ; preds = %1
br label %19
9: ; preds = %1
br label %19
10: ; preds = %1
br label %19
11: ; preds = %1
br label %19
12: ; preds = %1
br label %19
13: ; preds = %1
br label %19
14: ; preds = %1
br label %19
15: ; preds = %1
br label %19
16: ; preds = %1
br label %19
17: ; preds = %1
br label %19
18: ; preds = %1
br label %19
19: ; preds = %1, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%20 = phi i8* [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([75 x i8], [75 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([95 x i8], [95 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([118 x i8], [118 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([95 x i8], [95 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([85 x i8], [85 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([87 x i8], [87 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([83 x i8], [83 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([95 x i8], [95 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([97 x i8], [97 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([84 x i8], [84 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([102 x i8], [102 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([85 x i8], [85 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([88 x i8], [88 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), %1 ]
%21 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0), i32 %0, i8* %20)
%22 = tail call i32 @exit(i32 %0)
unreachable
}