#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 SIGHUP 132
#define SIGINT 131
#define SIGPIPE 130
#define SIGQUIT 129
#define SIGTERM 128
int /*<<< orphan*/ disp_dispthr_quit_start();
int /*<<< orphan*/ signal(int const, void (*)(int));
void sigint_handler(int sig) {
  switch (sig) {
  case SIGINT:
    (void)signal(SIGINT, sigint_handler);
    break;
  case SIGHUP:
    (void)signal(SIGHUP, sigint_handler);
    break;
  case SIGQUIT:
    (void)signal(SIGQUIT, sigint_handler);
    break;
  case SIGPIPE:
    (void)signal(SIGPIPE, sigint_handler);
    break;
  case SIGTERM:
    (void)signal(SIGTERM, sigint_handler);
    break;
  default:
    return;
  }
  disp_dispthr_quit_start();
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11c2 <sigint_handler+0xa2>
mov    -0x10(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x83,%edi
mov    0x2e80(%rip),%rsi
call   1040 <signal@plt>
jmp    11c7 <sigint_handler+0xa7>
mov    $0x84,%edi
mov    0x2e6a(%rip),%rsi
call   1040 <signal@plt>
jmp    11c7 <sigint_handler+0xa7>
mov    $0x81,%edi
mov    0x2e54(%rip),%rsi
call   1040 <signal@plt>
jmp    11c7 <sigint_handler+0xa7>
mov    $0x82,%edi
mov    0x2e3e(%rip),%rsi
call   1040 <signal@plt>
jmp    11c7 <sigint_handler+0xa7>
mov    $0x80,%edi
mov    0x2e28(%rip),%rsi
call   1040 <signal@plt>
jmp    11c7 <sigint_handler+0xa7>
jmp    11ce <sigint_handler+0xae>
mov    $0x0,%al
call   1030 <disp_dispthr_quit_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
lea    -0x80(%rdi),%eax
cmp    $0x4,%eax
ja     113d <sigint_handler+0x1d>
push   %rax
mov    0x2eb0(%rip),%rsi
call   1040 <signal@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <disp_dispthr_quit_start@plt>
ret

LLVM IR (-O0):
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %14 [
i32 131, label %4
i32 132, label %6
i32 129, label %8
i32 130, label %10
i32 128, label %12
]
4: ; preds = %1
%5 = call i32 @signal(i32 131, void (i32)* @sigint_handler)
br label %15
6: ; preds = %1
%7 = call i32 @signal(i32 132, void (i32)* @sigint_handler)
br label %15
8: ; preds = %1
%9 = call i32 @signal(i32 129, void (i32)* @sigint_handler)
br label %15
10: ; preds = %1
%11 = call i32 @signal(i32 130, void (i32)* @sigint_handler)
br label %15
12: ; preds = %1
%13 = call i32 @signal(i32 128, void (i32)* @sigint_handler)
br label %15
14: ; preds = %1
br label %17
15: ; preds = %12, %10, %8, %6, %4
%16 = call i32 (...) @disp_dispthr_quit_start()
br label %17
17: ; preds = %15, %14
ret void
}

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @signal(i32 %0, void (i32)* @sigint_handler)
%6 = tail call i32 (...) @disp_dispthr_quit_start()
br label %7
7: ; preds = %1, %4
ret void
}