#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 512:
    return (char *)"Dongle Comm.(0)";
  case 513:
    return (char *)"Dongle Comm.(1)";
  default:
    sprintf(ebuf, "%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     119a <deco_gen_err+0x8a>
jmp    112e <deco_gen_err+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11aa <deco_gen_err+0x9a>
jmp    113f <deco_gen_err+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11ba <deco_gen_err+0xaa>
jmp    1150 <deco_gen_err+0x40>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11ca <deco_gen_err+0xba>
jmp    1161 <deco_gen_err+0x51>
mov    -0x10(%rbp),%eax
sub    $0xfc,%eax
je     11ba <deco_gen_err+0xaa>
jmp    1174 <deco_gen_err+0x64>
mov    -0x10(%rbp),%eax
sub    $0x200,%eax
je     11da <deco_gen_err+0xca>
jmp    1187 <deco_gen_err+0x77>
mov    -0x10(%rbp),%eax
sub    $0x201,%eax
je     11ea <deco_gen_err+0xda>
jmp    11fa <deco_gen_err+0xea>
lea    0xe5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <deco_gen_err+0x111>
lea    0xe57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <deco_gen_err+0x111>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <deco_gen_err+0x111>
lea    0xe4e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <deco_gen_err+0x111>
lea    0xe47(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <deco_gen_err+0x111>
lea    0xe47(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <deco_gen_err+0x111>
mov    -0xc(%rbp),%edx
and    $0xffff,%edx
lea    0x2e1f(%rip),%rdi
lea    0xe37(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2e0c(%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    $0xfb,%edi
jg     1140 <deco_gen_err+0x30>
cmp    $0x3,%edi
ja     1173 <deco_gen_err+0x63>
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    1195 <deco_gen_err+0x85>
cmp    $0xfc,%edi
je     1161 <deco_gen_err+0x51>
cmp    $0x200,%edi
je     118e <deco_gen_err+0x7e>
cmp    $0x201,%edi
jne    1173 <deco_gen_err+0x63>
lea    0xee9(%rip),%rbx
jmp    1195 <deco_gen_err+0x85>
lea    0xebf(%rip),%rbx
jmp    1195 <deco_gen_err+0x85>
lea    0xebe(%rip),%rbx
jmp    1195 <deco_gen_err+0x85>
movzwl %di,%edx
lea    0x2eac(%rip),%rbx
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1195 <deco_gen_err+0x85>
lea    0xea3(%rip),%rbx
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 = [16 x i8] c"Dongle Comm.(0)\00"
@.str.5 = [16 x i8] c"Dongle Comm.(1)\00"
@.str.6 = [3 x i8] c"%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 %11 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 252, label %7
i32 3, label %8
i32 512, label %9
i32 513, label %10
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1, %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = and i32 %12, 65535
%14 = call i32 @sprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %13)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %2
ret i8* %16
}

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 = [16 x i8] c"Dongle Comm.(0)\00"
@.str.5 = [16 x i8] c"Dongle Comm.(1)\00"
@.str.6 = [3 x i8] c"%u\00"
define i8* @deco_gen_err(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %10
i32 1, label %2
i32 2, label %3
i32 252, label %3
i32 3, label %4
i32 512, label %5
i32 513, label %6
]
2: ; preds = %1
br label %10
3: ; preds = %1, %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = and i32 %0, 65535
%9 = 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 ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %1, %7, %6, %5, %4, %3, %2
%11 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @deco_gen_err.ebuf, i64 0, i64 0), %7 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([16 x i8], [16 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* %11
}