#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*/ ft_putstr(char *);
void show_stop(int sig) {
  if (sig == 4)
    ft_putstr("Illegal instruction");
  else if (sig == 3)
    ft_putstr("Quit");
  else if (sig == 6)
    ft_putstr("Abort.");
  else if (sig == 8)
    ft_putstr("Floating point exception");
  else if (sig == 9 || sig == 15)
    ft_putstr("Kill");
  else if (sig == 11)
    ft_putstr("Segmentation fault");
  else if (sig == 13)
    ft_putstr("Broken pipe");
  else if (sig == 10 || sig == 7)
    ft_putstr("Bus error");
}


x86 assembly (clang, -O0):
<show_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    1136 <show_stop+0x26>
lea    0xed4(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1225 <show_stop+0x115>
cmpl   $0x3,-0x4(%rbp)
jne    1151 <show_stop+0x41>
lea    0xecd(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1220 <show_stop+0x110>
cmpl   $0x6,-0x4(%rbp)
jne    116c <show_stop+0x5c>
lea    0xeb7(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    121b <show_stop+0x10b>
cmpl   $0x8,-0x4(%rbp)
jne    1187 <show_stop+0x77>
lea    0xea3(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1216 <show_stop+0x106>
cmpl   $0x9,-0x4(%rbp)
je     119b <show_stop+0x8b>
cmpl   $0xf,-0x4(%rbp)
jne    11ac <show_stop+0x9c>
lea    0xe97(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1211 <show_stop+0x101>
cmpl   $0xb,-0x4(%rbp)
jne    11c7 <show_stop+0xb7>
lea    0xe81(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    120c <show_stop+0xfc>
cmpl   $0xd,-0x4(%rbp)
jne    11e2 <show_stop+0xd2>
lea    0xe79(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1207 <show_stop+0xf7>
cmpl   $0xa,-0x4(%rbp)
je     11f6 <show_stop+0xe6>
cmpl   $0x7,-0x4(%rbp)
jne    1202 <show_stop+0xf2>
lea    0xe60(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1207 <show_stop+0xf7>
jmp    120c <show_stop+0xfc>
jmp    1211 <show_stop+0x101>
jmp    1216 <show_stop+0x106>
jmp    121b <show_stop+0x10b>
jmp    1220 <show_stop+0x110>
jmp    1225 <show_stop+0x115>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_stop>:
add    $0xfffffffd,%edi
cmp    $0xc,%edi
ja     1122 <show_stop+0x12>
mov    $0x15fb,%eax
bt     %edi,%eax
jb     1123 <show_stop+0x13>
ret
movslq %edi,%rax
lea    0xf3b(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Illegal instruction\00"
@.str.1 = [5 x i8] c"Quit\00"
@.str.2 = [7 x i8] c"Abort.\00"
@.str.3 = [25 x i8] c"Floating point exception\00"
@.str.4 = [5 x i8] c"Kill\00"
@.str.5 = [19 x i8] c"Segmentation fault\00"
@.str.6 = [12 x i8] c"Broken pipe\00"
@.str.7 = [10 x i8] c"Bus error\00"
define void @show_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @ft_putstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %55
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %54
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 6
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %53
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 8
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @ft_putstr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %52
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 9
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 15
br i1 %27, label %28, label %30
28: ; preds = %25, %22
%29 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %51
30: ; preds = %25
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 11
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @ft_putstr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
br label %50
35: ; preds = %30
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 13
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 @ft_putstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %49
40: ; preds = %35
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 10
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 7
br i1 %45, label %46, label %48
46: ; preds = %43, %40
%47 = call i32 @ft_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
br label %49
49: ; preds = %48, %38
br label %50
50: ; preds = %49, %33
br label %51
51: ; preds = %50, %28
br label %52
52: ; preds = %51, %20
br label %53
53: ; preds = %52, %15
br label %54
54: ; preds = %53, %10
br label %55
55: ; preds = %54, %5
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Illegal instruction\00"
@.str.1 = [5 x i8] c"Quit\00"
@.str.2 = [7 x i8] c"Abort.\00"
@.str.3 = [25 x i8] c"Floating point exception\00"
@.str.4 = [5 x i8] c"Kill\00"
@.str.5 = [19 x i8] c"Segmentation fault\00"
@.str.6 = [12 x i8] c"Broken pipe\00"
@.str.7 = [10 x i8] c"Bus error\00"
@reltable.show_stop = [13 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.7 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.3 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.7 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.5 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.6 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([13 x i32]* @reltable.show_stop to i64)) to i32)]
define void @show_stop(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 13
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = trunc i32 %2 to i16
%6 = lshr i16 5627, %5
%7 = and i16 %6, 1
%8 = icmp eq i16 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = sext i32 %2 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([13 x i32]* @reltable.show_stop to i8*), i64 %11)
%13 = tail call i32 @ft_putstr(i8* %12)
br label %14
14: ; preds = %4, %1, %9
ret void
}