#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*/ EXIT_FAILURE;
#define SIGINT 129
#define SIGTSTP 128
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ notify(char *);
int /*<<< orphan*/ stderr;
void signalHander(int signo) {
  switch (signo) {
  case SIGINT:
    break;
  case SIGTSTP:
    notify("Background!!");
    break;
  default:
    fprintf(stderr, "unknown signal");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<signalHander>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1169 <signalHander+0x39>
jmp    1151 <signalHander+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
jne    117a <signalHander+0x4a>
jmp    1164 <signalHander+0x34>
jmp    119d <signalHander+0x6d>
lea    0xe90(%rip),%rdi
call   1030 <notify@plt>
jmp    119d <signalHander+0x6d>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHander>:
cmp    $0x81,%edi
je     114c <signalHander+0x1c>
cmp    $0x80,%edi
jne    114d <signalHander+0x1d>
lea    0xeb9(%rip),%rdi
jmp    1030 <notify@plt>
ret
push   %rax
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Background!!\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"unknown signal\00"
@EXIT_FAILURE = global i32 0
define void @signalHander(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 129, label %4
i32 128, label %5
]
4: ; preds = %1
br label %12
5: ; preds = %1
%6 = call i32 @notify(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Background!!\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"unknown signal\00"
@EXIT_FAILURE = global i32 0
define void @signalHander(i32 %0) {
switch i32 %0, label %4 [
i32 129, label %9
i32 128, label %2
]
2: ; preds = %1
%3 = tail call i32 @notify(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2, %1
ret void
}