#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*/ printf(char *, ...);
void dissect_packed_decimal_sign(unsigned long local_sign) {
  switch (local_sign) {
  case 0xa:
    printf("[ + ]");
    break;
  case 0xb:
    printf("[ - ]");
    break;
  case 0xc:
    printf("(+|0)");
    break;
  case 0xd:
    printf("( - )");
    break;
  case 0xe:
    printf("[ + ]");
    break;
  case 0xf:
    printf("(+|0)");
    break;
  default:
    printf("(?%02lx)", local_sign);
  }
}


x86 assembly (clang, -O0):
<dissect_packed_decimal_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff6,%rax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     11b8 <dissect_packed_decimal_sign+0xa8>
mov    -0x10(%rbp),%rax
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <dissect_packed_decimal_sign+0xba>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <dissect_packed_decimal_sign+0xba>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <dissect_packed_decimal_sign+0xba>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <dissect_packed_decimal_sign+0xba>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <dissect_packed_decimal_sign+0xba>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <dissect_packed_decimal_sign+0xba>
mov    -0x8(%rbp),%rsi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_packed_decimal_sign>:
lea    -0xa(%rdi),%rax
cmp    $0x5,%rax
ja     1146 <dissect_packed_decimal_sign+0x36>
lea    0xedf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"[ + ]\00"
@.str.1 = [6 x i8] c"[ - ]\00"
@.str.2 = [6 x i8] c"(+|0)\00"
@.str.3 = [6 x i8] c"( - )\00"
@.str.4 = [9 x i8] c"(?%02lx)\00"
define void @dissect_packed_decimal_sign(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
switch i64 %3, label %16 [
i64 10, label %4
i64 11, label %6
i64 12, label %8
i64 13, label %10
i64 14, label %12
i64 15, label %14
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %19
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %19
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %19
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %19
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %19
14: ; preds = %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %19
16: ; preds = %1
%17 = load i64, i64* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i64 %17)
br label %19
19: ; preds = %16, %14, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"[ + ]\00"
@.str.1 = [6 x i8] c"[ - ]\00"
@.str.2 = [6 x i8] c"(+|0)\00"
@.str.3 = [6 x i8] c"( - )\00"
@.str.4 = [9 x i8] c"(?%02lx)\00"
define void @dissect_packed_decimal_sign(i64 %0) {
switch i64 %0, label %14 [
i64 10, label %2
i64 11, label %4
i64 12, label %6
i64 13, label %8
i64 14, label %10
i64 15, label %12
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %16
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %16
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %16
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %16
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %16
12: ; preds = %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i64 %0)
br label %16
16: ; preds = %14, %12, %10, %8, %6, %4, %2
ret void
}