#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*/ sprintf(char *, char *, unsigned char);
char *clear_code(unsigned char code) {
  static char buffer[25];
  if (code == 0x00 || (code & 0x80) == 0x80)
    return "DTE Originated";
  if (code == 0x01)
    return "Number Busy";
  if (code == 0x09)
    return "Out Of Order";
  if (code == 0x11)
    return "Remote Procedure Error";
  if (code == 0x19)
    return "Reverse Charging Acceptance Not Sudirribed";
  if (code == 0x21)
    return "Incompatible Destination";
  if (code == 0x29)
    return "Fast Select Acceptance Not Sudirribed";
  if (code == 0x39)
    return "Destination Absent";
  if (code == 0x03)
    return "Invalid Facility Requested";
  if (code == 0x0B)
    return "Access Barred";
  if (code == 0x13)
    return "Local Procedure Error";
  if (code == 0x05)
    return "Network Congestion";
  if (code == 0x0D)
    return "Not Obtainable";
  if (code == 0x15)
    return "RPOA Out Of Order";
  sprintf(buffer, "Unknown %02X", code);
  return buffer;
}


x86 assembly (clang, -O0):
<clear_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     113f <clear_code+0x2f>
movzbl -0x9(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    114f <clear_code+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    116c <clear_code+0x5c>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jne    1189 <clear_code+0x79>
lea    0xf95(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x11,%eax
jne    11a6 <clear_code+0x96>
lea    0xe7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x19,%eax
jne    11c3 <clear_code+0xb3>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x21,%eax
jne    11e0 <clear_code+0xd0>
lea    0xe86(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x29,%eax
jne    11fd <clear_code+0xed>
lea    0xe82(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x39,%eax
jne    121a <clear_code+0x10a>
lea    0xe8b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x3,%eax
jne    1237 <clear_code+0x127>
lea    0xe81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0xb,%eax
jne    1254 <clear_code+0x144>
lea    0xe7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x13,%eax
jne    1271 <clear_code+0x161>
lea    0xe70(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x5,%eax
jne    128e <clear_code+0x17e>
lea    0xe69(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0xd,%eax
jne    12ab <clear_code+0x19b>
lea    0xe5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
movzbl -0x9(%rbp),%eax
cmp    $0x15,%eax
jne    12c8 <clear_code+0x1b8>
lea    0xe51(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ea <clear_code+0x1da>
lea    0x2d71(%rip),%rdi
lea    0xe4c(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
lea    0x2d5a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_code>:
push   %rbx
test   %dil,%dil
jle    1148 <clear_code+0x38>
lea    -0x1(%rdi),%eax
ror    %al
cmp    $0x1d,%al
jae    112c <clear_code+0x1c>
movzbl %al,%ecx
mov    $0x10111777,%edx
bt     %ecx,%edx
jb     1151 <clear_code+0x41>
movzbl %dil,%edx
lea    0x2f09(%rip),%rbx
lea    0xfe4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1163 <clear_code+0x53>
lea    0xeb1(%rip),%rbx
jmp    1163 <clear_code+0x53>
movsbq %al,%rax
lea    0xfd4(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@clear_code.buffer = internal global [25 x i8] zeroinitializer
@.str = [15 x i8] c"DTE Originated\00"
@.str.1 = [12 x i8] c"Number Busy\00"
@.str.2 = [13 x i8] c"Out Of Order\00"
@.str.3 = [23 x i8] c"Remote Procedure Error\00"
@.str.4 = [43 x i8] c"Reverse Charging Acceptance Not Sudirribed\00"
@.str.5 = [25 x i8] c"Incompatible Destination\00"
@.str.6 = [38 x i8] c"Fast Select Acceptance Not Sudirribed\00"
@.str.7 = [19 x i8] c"Destination Absent\00"
@.str.8 = [27 x i8] c"Invalid Facility Requested\00"
@.str.9 = [14 x i8] c"Access Barred\00"
@.str.10 = [22 x i8] c"Local Procedure Error\00"
@.str.11 = [19 x i8] c"Network Congestion\00"
@.str.12 = [15 x i8] c"Not Obtainable\00"
@.str.13 = [18 x i8] c"RPOA Out Of Order\00"
@.str.14 = [13 x i8] c"Unknown %02X\00"
define i8* @clear_code(i8 zeroext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = and i32 %9, 128
%11 = icmp eq i32 %10, 128
br i1 %11, label %12, label %13
12: ; preds = %7, %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %81
13: ; preds = %7
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %13
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %81
18: ; preds = %13
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br i1 %21, label %22, label %23
22: ; preds = %18
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %81
23: ; preds = %18
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 17
br i1 %26, label %27, label %28
27: ; preds = %23
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %81
28: ; preds = %23
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = icmp eq i32 %30, 25
br i1 %31, label %32, label %33
32: ; preds = %28
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %81
33: ; preds = %28
%34 = load i8, i8* %3
%35 = zext i8 %34 to i32
%36 = icmp eq i32 %35, 33
br i1 %36, label %37, label %38
37: ; preds = %33
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %81
38: ; preds = %33
%39 = load i8, i8* %3
%40 = zext i8 %39 to i32
%41 = icmp eq i32 %40, 41
br i1 %41, label %42, label %43
42: ; preds = %38
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %81
43: ; preds = %38
%44 = load i8, i8* %3
%45 = zext i8 %44 to i32
%46 = icmp eq i32 %45, 57
br i1 %46, label %47, label %48
47: ; preds = %43
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %81
48: ; preds = %43
%49 = load i8, i8* %3
%50 = zext i8 %49 to i32
%51 = icmp eq i32 %50, 3
br i1 %51, label %52, label %53
52: ; preds = %48
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %81
53: ; preds = %48
%54 = load i8, i8* %3
%55 = zext i8 %54 to i32
%56 = icmp eq i32 %55, 11
br i1 %56, label %57, label %58
57: ; preds = %53
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %81
58: ; preds = %53
%59 = load i8, i8* %3
%60 = zext i8 %59 to i32
%61 = icmp eq i32 %60, 19
br i1 %61, label %62, label %63
62: ; preds = %58
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %81
63: ; preds = %58
%64 = load i8, i8* %3
%65 = zext i8 %64 to i32
%66 = icmp eq i32 %65, 5
br i1 %66, label %67, label %68
67: ; preds = %63
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %81
68: ; preds = %63
%69 = load i8, i8* %3
%70 = zext i8 %69 to i32
%71 = icmp eq i32 %70, 13
br i1 %71, label %72, label %73
72: ; preds = %68
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %81
73: ; preds = %68
%74 = load i8, i8* %3
%75 = zext i8 %74 to i32
%76 = icmp eq i32 %75, 21
br i1 %76, label %77, label %78
77: ; preds = %73
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %81
78: ; preds = %73
%79 = load i8, i8* %3
%80 = call i32 @sprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @clear_code.buffer, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i8 zeroext %79)
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @clear_code.buffer, i64 0, i64 0), i8** %2
br label %81
81: ; preds = %78, %77, %72, %67, %62, %57, %52, %47, %42, %37, %32, %27, %22, %17, %12
%82 = load i8*, i8** %2
ret i8* %82
}

LLVM IR (-O2):
@clear_code.buffer = internal global [25 x i8] zeroinitializer
@.str = [15 x i8] c"DTE Originated\00"
@.str.1 = [12 x i8] c"Number Busy\00"
@.str.2 = [13 x i8] c"Out Of Order\00"
@.str.3 = [23 x i8] c"Remote Procedure Error\00"
@.str.4 = [43 x i8] c"Reverse Charging Acceptance Not Sudirribed\00"
@.str.5 = [25 x i8] c"Incompatible Destination\00"
@.str.6 = [38 x i8] c"Fast Select Acceptance Not Sudirribed\00"
@.str.7 = [19 x i8] c"Destination Absent\00"
@.str.8 = [27 x i8] c"Invalid Facility Requested\00"
@.str.9 = [14 x i8] c"Access Barred\00"
@.str.10 = [22 x i8] c"Local Procedure Error\00"
@.str.11 = [19 x i8] c"Network Congestion\00"
@.str.12 = [15 x i8] c"Not Obtainable\00"
@.str.13 = [18 x i8] c"RPOA Out Of Order\00"
@.str.14 = [13 x i8] c"Unknown %02X\00"
@reltable.clear_code = [29 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.8 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.11 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.2 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.9 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.12 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.3 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.10 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.13 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @.str.4 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.5 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([38 x i8]* @.str.6 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.7 to i64), i64 ptrtoint ([29 x i32]* @reltable.clear_code to i64)) to i32)]
define i8* @clear_code(i8 zeroext %0) {
%2 = icmp sgt i8 %0, 0
br i1 %2, label %3, label %18
3: ; preds = %1
%4 = add nsw i8 %0, -1
%5 = tail call i8 @llvm.fshl.i8(i8 %4, i8 %4, i8 7)
%6 = icmp ult i8 %5, 29
br i1 %6, label %9, label %7
7: ; preds = %9, %3
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @clear_code.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i8 zeroext %0)
br label %18
9: ; preds = %3
%10 = zext i8 %5 to i32
%11 = lshr i32 269555575, %10
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %9
%15 = sext i8 %5 to i64
%16 = shl i64 %15, 2
%17 = call i8* @llvm.load.relative.i64(i8* bitcast ([29 x i32]* @reltable.clear_code to i8*), i64 %16)
br label %18
18: ; preds = %14, %1, %7
%19 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @clear_code.buffer, i64 0, i64 0), %7 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ], [ %17, %14 ]
ret i8* %19
}