#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*/ warnx(char *);
void print_CCA_error(int return_code, int reason_code) {
  switch (return_code) {
  case 8:
    switch (reason_code) {
    case 48:
      warnx("The secure key has a CCA master key "
            "verification pattern that is not valid");
      break;
    case 90:
      warnx("The operation has been rejected due to access "
            "control checking");
      break;
    case 2143:
      warnx("The operation has been rejected due to key "
            "export restrictions of the secure key");
      break;
    }
    break;
  case 12:
    switch (reason_code) {
    case 764:
      warnx("The CCA master key is not loaded and "
            "therefore a secure key cannot be enciphered");
      break;
    }
    break;
  }
}


x86 assembly (clang, -O0):
<print_CCA_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     1143 <print_CCA_error+0x33>
jmp    1132 <print_CCA_error+0x22>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
je     11ae <print_CCA_error+0x9e>
jmp    11d2 <print_CCA_error+0xc2>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x30,%eax
je     117b <print_CCA_error+0x6b>
jmp    1157 <print_CCA_error+0x47>
mov    -0x10(%rbp),%eax
sub    $0x5a,%eax
je     118c <print_CCA_error+0x7c>
jmp    1168 <print_CCA_error+0x58>
mov    -0x10(%rbp),%eax
sub    $0x85f,%eax
je     119d <print_CCA_error+0x8d>
jmp    11a9 <print_CCA_error+0x99>
lea    0xe7e(%rip),%rdi
call   1030 <warnx@plt>
jmp    11a9 <print_CCA_error+0x99>
lea    0xeb8(%rip),%rdi
call   1030 <warnx@plt>
jmp    11a9 <print_CCA_error+0x99>
lea    0xee6(%rip),%rdi
call   1030 <warnx@plt>
jmp    11d2 <print_CCA_error+0xc2>
mov    -0x8(%rbp),%eax
sub    $0x2fc,%eax
jne    11cd <print_CCA_error+0xbd>
jmp    11c1 <print_CCA_error+0xb1>
lea    0xf13(%rip),%rdi
call   1030 <warnx@plt>
jmp    11d2 <print_CCA_error+0xc2>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_CCA_error>:
cmp    $0xc,%edi
je     1138 <print_CCA_error+0x28>
cmp    $0x8,%edi
jne    114c <print_CCA_error+0x3c>
cmp    $0x30,%esi
je     114d <print_CCA_error+0x3d>
cmp    $0x85f,%esi
je     1159 <print_CCA_error+0x49>
cmp    $0x5a,%esi
jne    114c <print_CCA_error+0x3c>
lea    0xf18(%rip),%rdi
jmp    1030 <warnx@plt>
cmp    $0x2fc,%esi
jne    114c <print_CCA_error+0x3c>
lea    0xf94(%rip),%rdi
jmp    1030 <warnx@plt>
ret
lea    0xeac(%rip),%rdi
jmp    1030 <warnx@plt>
lea    0xf2a(%rip),%rdi
jmp    1030 <warnx@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"The secure key has a CCA master key verification pattern that is not valid\00"
@.str.1 = [63 x i8] c"The operation has been rejected due to access control checking\00"
@.str.2 = [81 x i8] c"The operation has been rejected due to key export restrictions of the secure key\00"
@.str.3 = [81 x i8] c"The CCA master key is not loaded and therefore a secure key cannot be enciphered\00"
define void @print_CCA_error(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %20 [
i32 8, label %6
i32 12, label %15
]
6: ; preds = %2
%7 = load i32, i32* %4
switch i32 %7, label %14 [
i32 48, label %8
i32 90, label %10
i32 2143, label %12
]
8: ; preds = %6
%9 = call i32 @warnx(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
br label %14
10: ; preds = %6
%11 = call i32 @warnx(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %6
%13 = call i32 @warnx(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %6, %12, %10, %8
br label %20
15: ; preds = %2
%16 = load i32, i32* %4
switch i32 %16, label %19 [
i32 764, label %17
]
17: ; preds = %15
%18 = call i32 @warnx(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %15, %17
br label %20
20: ; preds = %2, %19, %14
ret void
}

LLVM IR (-O2):
@.str = [75 x i8] c"The secure key has a CCA master key verification pattern that is not valid\00"
@.str.1 = [63 x i8] c"The operation has been rejected due to access control checking\00"
@.str.2 = [81 x i8] c"The operation has been rejected due to key export restrictions of the secure key\00"
@.str.3 = [81 x i8] c"The CCA master key is not loaded and therefore a secure key cannot be enciphered\00"
define void @print_CCA_error(i32 %0, i32 %1) {
switch i32 %0, label %11 [
i32 8, label %3
i32 12, label %6
]
3: ; preds = %2
switch i32 %1, label %11 [
i32 48, label %8
i32 90, label %4
i32 2143, label %5
]
4: ; preds = %3
br label %8
5: ; preds = %3
br label %8
6: ; preds = %2
%7 = icmp eq i32 %1, 764
br i1 %7, label %8, label %11
8: ; preds = %6, %3, %5, %4
%9 = phi i8* [ getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0), %6 ]
%10 = tail call i32 @warnx(i8* %9)
br label %11
11: ; preds = %8, %6, %3, %2
ret void
}