#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 */
#define SIGABRT 155
#define SIGALRM 154
#define SIGBUS 153
#define SIGCHLD 152
#define SIGCONT 151
#define SIGFPE 150
#define SIGHUP 149
#define SIGILL 148
#define SIGINT 147
#define SIGKILL 146
#define SIGPIPE 145
#define SIGPOLL 144
#define SIGPROF 143
#define SIGQUIT 142
#define SIGSEGV 141
#define SIGSTOP 140
#define SIGSYS 139
#define SIGTERM 138
#define SIGTRAP 137
#define SIGTSTP 136
#define SIGTTIN 135
#define SIGTTOU 134
#define SIGURG 133
#define SIGUSR1 132
#define SIGUSR2 131
#define SIGVTALRM 130
#define SIGXCPU 129
#define SIGXFSZ 128
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *translate_signal(int sig) {
  switch (sig) {
  case SIGHUP:
    return "SIGHUP";
  case SIGINT:
    return "SIGINT";
  case SIGQUIT:
    return "SIGQUIT";
  case SIGILL:
    return "SIGILL";
  case SIGABRT:
    return "SIGABRT";
  case SIGFPE:
    return "SIGFPE";
  case SIGKILL:
    return "SIGKILL";
  case SIGSEGV:
    return "SIGSEGV";
  case SIGPIPE:
    return "SIGPIPE";
  case SIGALRM:
    return "SIGALRM";
  case SIGTERM:
    return "SIGTERM";
  case SIGUSR1:
    return "SIGUSR1";
  case SIGUSR2:
    return "SIGUSR2";
  case SIGCHLD:
    return "SIGCHLD";
  case SIGCONT:
    return "SIGCONT";
  case SIGSTOP:
    return "SIGSTOP";
  case SIGTSTP:
    return "SIGTSTP";
  case SIGTTIN:
    return "SIGTTIN";
  case SIGTTOU:
    return "SIGTTOU";
  case SIGBUS:
    return "SIGBUS";
  case SIGPOLL:
    return "SIGPOLL";
  case SIGPROF:
    return "SIGPROF";
  case SIGSYS:
    return "SIGSYS";
  case SIGTRAP:
    return "SIGTRAP";
  case SIGURG:
    return "SIGURG";
  case SIGVTALRM:
    return "SIGVTALRM";
  case SIGXCPU:
    return "SIGXCPU";
  case SIGXFSZ:
    return "SIGXFSZ";
  default: {
    static char buffer[50];
    sprintf(buffer, "signal %d", sig);
    return buffer;
  }
  }
}


x86 assembly (clang, -O0):
<translate_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x1b,%eax
ja     1304 <translate_signal+0x1f4>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf25(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xf1c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xf13(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xf0b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xf02(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xefa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xea9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe99(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe89(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe70(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe50(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
lea    0xe48(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1325 <translate_signal+0x215>
mov    -0xc(%rbp),%edx
lea    0x2d32(%rip),%rdi
lea    0xe36(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2d1f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_signal>:
push   %rbx
mov    %edi,%edx
lea    -0x80(%rdx),%eax
cmp    $0x1c,%eax
jae    112d <translate_signal+0x1d>
cltq
lea    0xfc4(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
jmp    1143 <translate_signal+0x33>
lea    0x2f0c(%rip),%rbx
lea    0xfa0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"SIGHUP\00"
@.str.1 = [7 x i8] c"SIGINT\00"
@.str.2 = [8 x i8] c"SIGQUIT\00"
@.str.3 = [7 x i8] c"SIGILL\00"
@.str.4 = [8 x i8] c"SIGABRT\00"
@.str.5 = [7 x i8] c"SIGFPE\00"
@.str.6 = [8 x i8] c"SIGKILL\00"
@.str.7 = [8 x i8] c"SIGSEGV\00"
@.str.8 = [8 x i8] c"SIGPIPE\00"
@.str.9 = [8 x i8] c"SIGALRM\00"
@.str.10 = [8 x i8] c"SIGTERM\00"
@.str.11 = [8 x i8] c"SIGUSR1\00"
@.str.12 = [8 x i8] c"SIGUSR2\00"
@.str.13 = [8 x i8] c"SIGCHLD\00"
@.str.14 = [8 x i8] c"SIGCONT\00"
@.str.15 = [8 x i8] c"SIGSTOP\00"
@.str.16 = [8 x i8] c"SIGTSTP\00"
@.str.17 = [8 x i8] c"SIGTTIN\00"
@.str.18 = [8 x i8] c"SIGTTOU\00"
@.str.19 = [7 x i8] c"SIGBUS\00"
@.str.20 = [8 x i8] c"SIGPOLL\00"
@.str.21 = [8 x i8] c"SIGPROF\00"
@.str.22 = [7 x i8] c"SIGSYS\00"
@.str.23 = [8 x i8] c"SIGTRAP\00"
@.str.24 = [7 x i8] c"SIGURG\00"
@.str.25 = [10 x i8] c"SIGVTALRM\00"
@.str.26 = [8 x i8] c"SIGXCPU\00"
@.str.27 = [8 x i8] c"SIGXFSZ\00"
@translate_signal.buffer = internal global [50 x i8] zeroinitializer
@.str.28 = [10 x i8] c"signal %d\00"
define i8* @translate_signal(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %33 [
i32 149, label %5
i32 147, label %6
i32 142, label %7
i32 148, label %8
i32 155, label %9
i32 150, label %10
i32 146, label %11
i32 141, label %12
i32 145, label %13
i32 154, label %14
i32 138, label %15
i32 132, label %16
i32 131, label %17
i32 152, label %18
i32 151, label %19
i32 140, label %20
i32 136, label %21
i32 135, label %22
i32 134, label %23
i32 153, label %24
i32 144, label %25
i32 143, label %26
i32 139, label %27
i32 137, label %28
i32 133, label %29
i32 130, label %30
i32 129, label %31
i32 128, label %32
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %36
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %36
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %36
8: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %36
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %36
10: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %36
11: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %36
12: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %36
13: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %36
14: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %36
15: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %36
16: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %36
17: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %36
18: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %36
19: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %36
20: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %36
21: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %36
22: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %36
23: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %36
24: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %36
25: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %36
26: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %36
27: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %36
28: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.23, i64 0, i64 0), i8** %2
br label %36
29: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %36
30: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.25, i64 0, i64 0), i8** %2
br label %36
31: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), i8** %2
br label %36
32: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.27, i64 0, i64 0), i8** %2
br label %36
33: ; preds = %1
%34 = load i32, i32* %3
%35 = call i32 @sprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @translate_signal.buffer, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0), i32 %34)
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @translate_signal.buffer, i64 0, i64 0), i8** %2
br label %36
36: ; preds = %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%37 = load i8*, i8** %2
ret i8* %37
}

LLVM IR (-O2):
@.str = [7 x i8] c"SIGHUP\00"
@.str.1 = [7 x i8] c"SIGINT\00"
@.str.2 = [8 x i8] c"SIGQUIT\00"
@.str.3 = [7 x i8] c"SIGILL\00"
@.str.4 = [8 x i8] c"SIGABRT\00"
@.str.5 = [7 x i8] c"SIGFPE\00"
@.str.6 = [8 x i8] c"SIGKILL\00"
@.str.7 = [8 x i8] c"SIGSEGV\00"
@.str.8 = [8 x i8] c"SIGPIPE\00"
@.str.9 = [8 x i8] c"SIGALRM\00"
@.str.10 = [8 x i8] c"SIGTERM\00"
@.str.11 = [8 x i8] c"SIGUSR1\00"
@.str.12 = [8 x i8] c"SIGUSR2\00"
@.str.13 = [8 x i8] c"SIGCHLD\00"
@.str.14 = [8 x i8] c"SIGCONT\00"
@.str.15 = [8 x i8] c"SIGSTOP\00"
@.str.16 = [8 x i8] c"SIGTSTP\00"
@.str.17 = [8 x i8] c"SIGTTIN\00"
@.str.18 = [8 x i8] c"SIGTTOU\00"
@.str.19 = [7 x i8] c"SIGBUS\00"
@.str.20 = [8 x i8] c"SIGPOLL\00"
@.str.21 = [8 x i8] c"SIGPROF\00"
@.str.22 = [7 x i8] c"SIGSYS\00"
@.str.23 = [8 x i8] c"SIGTRAP\00"
@.str.24 = [7 x i8] c"SIGURG\00"
@.str.25 = [10 x i8] c"SIGVTALRM\00"
@.str.26 = [8 x i8] c"SIGXCPU\00"
@.str.27 = [8 x i8] c"SIGXFSZ\00"
@translate_signal.buffer = internal global [50 x i8] zeroinitializer
@.str.28 = [10 x i8] c"signal %d\00"
@reltable.translate_signal = [28 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.27 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.26 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.25 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.12 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.11 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.24 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.18 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.16 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.23 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.10 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.22 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.15 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.7 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.21 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.20 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.8 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.6 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.14 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.13 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.19 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([28 x i32]* @reltable.translate_signal to i64)) to i32)]
define i8* @translate_signal(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 28
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @translate_signal.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0), i32 %0)
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([28 x i32]* @reltable.translate_signal to i8*), i64 %8)
br label %10
10: ; preds = %6, %4
%11 = phi i8* [ getelementptr inbounds ([50 x i8], [50 x i8]* @translate_signal.buffer, i64 0, i64 0), %4 ], [ %9, %6 ]
ret i8* %11
}