#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 */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
void echo_revocation_reason(unsigned char reason) {
  switch (reason) {
  case 0x00:
    printf(
        gettext("No reason specified (key revocations or cert revocations)\n"));
    break;
  case 0x01:
    printf(gettext("Key is superceded (key revocations)\n"));
    break;
  case 0x02:
    printf(gettext("Key material has been compromised (key revocations)\n"));
    break;
  case 0x03:
    printf(gettext("Key is retired and no longer used (key revocations)\n"));
    break;
  case 0x20:
    printf(
        gettext("User id information is no longer valid (cert revocations)\n"));
    break;
  default:
    printf(
        gettext("Revocation Reason parse error. Invalid Revocation Reason.\n"));
    break;
  }
}


x86 assembly (clang, -O0):
<echo_revocation_reason>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x20,%rax
ja     11d1 <echo_revocation_reason+0xb1>
mov    -0x10(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf29(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
jmp    11e5 <echo_revocation_reason+0xc5>
lea    0xf4b(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
jmp    11e5 <echo_revocation_reason+0xc5>
lea    0xf57(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
jmp    11e5 <echo_revocation_reason+0xc5>
lea    0xf73(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
jmp    11e5 <echo_revocation_reason+0xc5>
lea    0xf8f(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
jmp    11e5 <echo_revocation_reason+0xc5>
lea    0xfb1(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_revocation_reason>:
push   %rax
mov    %edi,%eax
cmp    $0x20,%al
ja     115b <echo_revocation_reason+0x3b>
lea    0xf56(%rip),%rdi
mov    %eax,%eax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf78(%rip),%rdi
jmp    116b <echo_revocation_reason+0x4b>
lea    0xf94(%rip),%rdi
jmp    116b <echo_revocation_reason+0x4b>
lea    0xfc0(%rip),%rdi
jmp    116b <echo_revocation_reason+0x4b>
lea    0x1027(%rip),%rdi
jmp    116b <echo_revocation_reason+0x4b>
lea    0xfe3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"No reason specified (key revocations or cert revocations)\0A\00"
@.str.1 = [37 x i8] c"Key is superceded (key revocations)\0A\00"
@.str.2 = [53 x i8] c"Key material has been compromised (key revocations)\0A\00"
@.str.3 = [53 x i8] c"Key is retired and no longer used (key revocations)\0A\00"
@.str.4 = [59 x i8] c"User id information is no longer valid (cert revocations)\0A\00"
@.str.5 = [59 x i8] c"Revocation Reason parse error. Invalid Revocation Reason.\0A\00"
define void @echo_revocation_reason(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %20 [
i32 0, label %5
i32 1, label %8
i32 2, label %11
i32 3, label %14
i32 32, label %17
]
5: ; preds = %1
%6 = call i8* @gettext(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* %6)
br label %23
8: ; preds = %1
%9 = call i8* @gettext(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* %9)
br label %23
11: ; preds = %1
%12 = call i8* @gettext(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* %12)
br label %23
14: ; preds = %1
%15 = call i8* @gettext(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @printf(i8* %15)
br label %23
17: ; preds = %1
%18 = call i8* @gettext(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @printf(i8* %18)
br label %23
20: ; preds = %1
%21 = call i8* @gettext(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @printf(i8* %21)
br label %23
23: ; preds = %20, %17, %14, %11, %8, %5
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"No reason specified (key revocations or cert revocations)\0A\00"
@.str.1 = [37 x i8] c"Key is superceded (key revocations)\0A\00"
@.str.2 = [53 x i8] c"Key material has been compromised (key revocations)\0A\00"
@.str.3 = [53 x i8] c"Key is retired and no longer used (key revocations)\0A\00"
@.str.4 = [59 x i8] c"User id information is no longer valid (cert revocations)\0A\00"
@.str.5 = [59 x i8] c"Revocation Reason parse error. Invalid Revocation Reason.\0A\00"
define void @echo_revocation_reason(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %7
i8 1, label %2
i8 2, label %3
i8 3, label %4
i8 32, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i8* [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), %1 ]
%9 = tail call i8* @gettext(i8* %8)
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
ret void
}