#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 int);
char *deco_gen_err(unsigned int erro) {
  static char ebuf[6];
  switch (erro) {
  case 0:
    return (char *)"NoValue";
  case 1:
    return (char *)"NoIndexedValue";
  case 2:
  case 0xfc:
    return (char *)"NoReply";
  case 3:
    return (char *)"NoSignal";
  case 255:
    return (char *)"Remote";
  case 512:
    return (char *)"Dongle Comm.(0)";
  case 513:
    return (char *)"Dongle Comm.(1)";
  case 65534:
    return (char *)"EndOfFile";
  case 65535:
    return (char *)"NaN";
  default:
    sprintf(ebuf, "Err %u", erro & 65535);
    return ebuf;
  }
}


x86 assembly (clang, -O0):
<deco_gen_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     11d3 <deco_gen_err+0xc3>
jmp    112e <deco_gen_err+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11e3 <deco_gen_err+0xd3>
jmp    113f <deco_gen_err+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11f3 <deco_gen_err+0xe3>
jmp    1150 <deco_gen_err+0x40>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     1203 <deco_gen_err+0xf3>
jmp    1161 <deco_gen_err+0x51>
mov    -0x10(%rbp),%eax
sub    $0xfc,%eax
je     11f3 <deco_gen_err+0xe3>
jmp    1174 <deco_gen_err+0x64>
mov    -0x10(%rbp),%eax
sub    $0xff,%eax
je     1213 <deco_gen_err+0x103>
jmp    1187 <deco_gen_err+0x77>
mov    -0x10(%rbp),%eax
sub    $0x200,%eax
je     1223 <deco_gen_err+0x113>
jmp    119a <deco_gen_err+0x8a>
mov    -0x10(%rbp),%eax
sub    $0x201,%eax
je     1233 <deco_gen_err+0x123>
jmp    11ad <deco_gen_err+0x9d>
mov    -0x10(%rbp),%eax
sub    $0xfffe,%eax
je     1243 <deco_gen_err+0x133>
jmp    11c0 <deco_gen_err+0xb0>
mov    -0x10(%rbp),%eax
sub    $0xffff,%eax
je     1253 <deco_gen_err+0x143>
jmp    1263 <deco_gen_err+0x153>
lea    0xe26(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe1e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe1d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe15(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe0e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe05(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe05(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xe05(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
lea    0xdff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128a <deco_gen_err+0x17a>
mov    -0xc(%rbp),%edx
and    $0xffff,%edx
lea    0x2db6(%rip),%rdi
lea    0xde3(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2da3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deco_gen_err>:
push   %rbx
cmp    $0xfe,%edi
jg     1143 <deco_gen_err+0x33>
cmp    $0x3,%edi
ja     1185 <deco_gen_err+0x75>
lea    0xeeb(%rip),%rbx
mov    %edi,%eax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeda(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
cmp    $0x200,%edi
jle    116c <deco_gen_err+0x5c>
cmp    $0x201,%edi
je     119f <deco_gen_err+0x8f>
cmp    $0xfffe,%edi
je     11a8 <deco_gen_err+0x98>
cmp    $0xffff,%edi
jne    11ba <deco_gen_err+0xaa>
lea    0xeff(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
cmp    $0xff,%edi
je     11b1 <deco_gen_err+0xa1>
cmp    $0x200,%edi
jne    11ba <deco_gen_err+0xaa>
lea    0xebc(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
cmp    $0xfc,%edi
jne    11ba <deco_gen_err+0xaa>
lea    0xe93(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
lea    0xe92(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
lea    0xea9(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
lea    0xeb0(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
lea    0xe80(%rip),%rbx
jmp    11d3 <deco_gen_err+0xc3>
movzwl %di,%edx
lea    0x2e65(%rip),%rbx
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@deco_gen_err.ebuf = internal global [6 x i8] zeroinitializer
@.str = [8 x i8] c"NoValue\00"
@.str.1 = [15 x i8] c"NoIndexedValue\00"
@.str.2 = [8 x i8] c"NoReply\00"
@.str.3 = [9 x i8] c"NoSignal\00"
@.str.4 = [7 x i8] c"Remote\00"
@.str.5 = [16 x i8] c"Dongle Comm.(0)\00"
@.str.6 = [16 x i8] c"Dongle Comm.(1)\00"
@.str.7 = [10 x i8] c"EndOfFile\00"
@.str.8 = [4 x i8] c"NaN\00"
@.str.9 = [7 x i8] c"Err %u\00"
define i8* @deco_gen_err(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 252, label %7
i32 3, label %8
i32 255, label %9
i32 512, label %10
i32 513, label %11
i32 65534, label %12
i32 65535, label %13
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
6: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %18
7: ; preds = %1, %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %18
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %18
9: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %18
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %18
11: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %18
12: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %18
13: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %18
14: ; preds = %1
%15 = load i32, i32* %3
%16 = and i32 %15, 65535
%17 = call i32 @sprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %16)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), i8** %2
br label %18
18: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@deco_gen_err.ebuf = internal global [6 x i8] zeroinitializer
@.str = [8 x i8] c"NoValue\00"
@.str.1 = [15 x i8] c"NoIndexedValue\00"
@.str.2 = [8 x i8] c"NoReply\00"
@.str.3 = [9 x i8] c"NoSignal\00"
@.str.4 = [7 x i8] c"Remote\00"
@.str.5 = [16 x i8] c"Dongle Comm.(0)\00"
@.str.6 = [16 x i8] c"Dongle Comm.(1)\00"
@.str.7 = [10 x i8] c"EndOfFile\00"
@.str.8 = [4 x i8] c"NaN\00"
@.str.9 = [7 x i8] c"Err %u\00"
define i8* @deco_gen_err(i32 %0) {
switch i32 %0, label %10 [
i32 0, label %13
i32 1, label %2
i32 2, label %3
i32 252, label %3
i32 3, label %4
i32 255, label %5
i32 512, label %6
i32 513, label %7
i32 65534, label %8
i32 65535, label %9
]
2: ; preds = %1
br label %13
3: ; preds = %1, %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
%11 = and i32 %0, 65535
%12 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%14 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), %10 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %14
}