#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_zoned_decimal_sign(unsigned long local_sign, int ps) {
  if (ps == 0) {
    switch (local_sign) {
    case 0x0:
    case 0x1:
    case 0x2:
    case 0x3:
    case 0x8:
    case 0x9:
    case 0xa:
    case 0xb:
      printf("( + )");
      break;
    case 0x4:
    case 0x5:
    case 0x6:
    case 0x7:
    case 0xc:
    case 0xd:
    case 0xe:
    case 0xf:
      printf("( - )");
      break;
    default:
      printf("zoned decimal (ps=%d). Unhandled sign value: %lx", ps,
             local_sign);
    }
  }
  if (ps == 1) {
    switch (local_sign) {
    case 0xa:
    case 0xc:
    case 0xe:
    case 0xf:
      printf("( + )");
      break;
    case 0xb:
    case 0xd:
      printf("( - )");
      break;
    default:
      printf("zoned decimal (ps=%d). Unhandled sign value: %lx", ps,
             local_sign);
    }
  }
}


x86 assembly (clang, -O0):
<dissect_zoned_decimal_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11c5 <dissect_zoned_decimal_sign+0xb5>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x4,%rax
jb     1185 <dissect_zoned_decimal_sign+0x75>
jmp    1140 <dissect_zoned_decimal_sign+0x30>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
sub    $0x4,%rax
jb     1198 <dissect_zoned_decimal_sign+0x88>
jmp    1157 <dissect_zoned_decimal_sign+0x47>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
sub    $0x4,%rax
jb     1185 <dissect_zoned_decimal_sign+0x75>
jmp    116e <dissect_zoned_decimal_sign+0x5e>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff4,%rax
sub    $0x4,%rax
jb     1198 <dissect_zoned_decimal_sign+0x88>
jmp    11ab <dissect_zoned_decimal_sign+0x9b>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c0 <dissect_zoned_decimal_sign+0xb0>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c0 <dissect_zoned_decimal_sign+0xb0>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <dissect_zoned_decimal_sign+0xb5>
cmpl   $0x1,-0xc(%rbp)
jne    1276 <dissect_zoned_decimal_sign+0x166>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
sub    $0xa,%rax
je     1236 <dissect_zoned_decimal_sign+0x126>
jmp    11e6 <dissect_zoned_decimal_sign+0xd6>
mov    -0x20(%rbp),%rax
sub    $0xb,%rax
je     1249 <dissect_zoned_decimal_sign+0x139>
jmp    11f9 <dissect_zoned_decimal_sign+0xe9>
mov    -0x20(%rbp),%rax
sub    $0xc,%rax
je     1236 <dissect_zoned_decimal_sign+0x126>
jmp    120c <dissect_zoned_decimal_sign+0xfc>
mov    -0x20(%rbp),%rax
sub    $0xd,%rax
je     1249 <dissect_zoned_decimal_sign+0x139>
jmp    121f <dissect_zoned_decimal_sign+0x10f>
mov    -0x20(%rbp),%rax
add    $0xfffffffffffffff2,%rax
sub    $0x1,%rax
ja     125c <dissect_zoned_decimal_sign+0x14c>
jmp    1236 <dissect_zoned_decimal_sign+0x126>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1271 <dissect_zoned_decimal_sign+0x161>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1271 <dissect_zoned_decimal_sign+0x161>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1276 <dissect_zoned_decimal_sign+0x166>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_zoned_decimal_sign>:
mov    %rdi,%rdx
cmp    $0x1,%esi
je     112f <dissect_zoned_decimal_sign+0x1f>
test   %esi,%esi
jne    114e <dissect_zoned_decimal_sign+0x3e>
cmp    $0xf,%rdx
ja     117b <dissect_zoned_decimal_sign+0x6b>
mov    $0xf0f,%eax
bt     %rdx,%rax
jb     1140 <dissect_zoned_decimal_sign+0x30>
jmp    115a <dissect_zoned_decimal_sign+0x4a>
cmp    $0xf,%rdx
ja     1168 <dissect_zoned_decimal_sign+0x58>
mov    $0xd400,%eax
bt     %rdx,%rax
jae    114f <dissect_zoned_decimal_sign+0x3f>
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
ret
mov    $0x2800,%eax
bt     %rdx,%rax
jae    1168 <dissect_zoned_decimal_sign+0x58>
lea    0xea5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe8a(%rip),%rdi
xor    %esi,%esi
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 = [49 x i8] c"zoned decimal (ps=%d). Unhandled sign value: %lx\00"
define void @dissect_zoned_decimal_sign(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i64, i64* %3
switch i64 %8, label %13 [
i64 0, label %9
i64 1, label %9
i64 2, label %9
i64 3, label %9
i64 8, label %9
i64 9, label %9
i64 10, label %9
i64 11, label %9
i64 4, label %11
i64 5, label %11
i64 6, label %11
i64 7, label %11
i64 12, label %11
i64 13, label %11
i64 14, label %11
i64 15, label %11
]
9: ; preds = %7, %7, %7, %7, %7, %7, %7, %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %17
11: ; preds = %7, %7, %7, %7, %7, %7, %7, %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %17
13: ; preds = %7
%14 = load i32, i32* %4
%15 = load i64, i64* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 %14, i64 %15)
br label %17
17: ; preds = %13, %11, %9
br label %18
18: ; preds = %17, %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = load i64, i64* %3
switch i64 %22, label %27 [
i64 10, label %23
i64 12, label %23
i64 14, label %23
i64 15, label %23
i64 11, label %25
i64 13, label %25
]
23: ; preds = %21, %21, %21, %21
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %31
25: ; preds = %21, %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %31
27: ; preds = %21
%28 = load i32, i32* %4
%29 = load i64, i64* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 %28, i64 %29)
br label %31
31: ; preds = %27, %25, %23
br label %32
32: ; preds = %31, %18
ret void
}

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