#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*/ databus_shutdown();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ io_shutdown();
int /*<<< orphan*/ iracc_shutdown();
int /*<<< orphan*/ log_log(char *, int, char *, char *);
int /*<<< orphan*/ log_shutdown();
void signal_handler(int sig) {
  ;
  iracc_shutdown();
  io_shutdown();
  databus_shutdown();
  log_log("INFO ", 2,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/shawnchain/HomeMaster/refs/heads/master/"
          "iracc/iracc_gate.c",
          "Gateway Shutdown OK");
  log_shutdown();
  exit(0);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1080 <iracc_shutdown@plt>
mov    $0x0,%al
call   1060 <io_shutdown@plt>
mov    $0x0,%al
call   1030 <databus_shutdown@plt>
lea    0xe79(%rip),%rdi
mov    $0x2,%esi
lea    0xe73(%rip),%rdx
lea    0xf01(%rip),%rcx
call   1070 <log_log@plt>
mov    $0x0,%al
call   1040 <log_shutdown@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
xor    %eax,%eax
call   1080 <iracc_shutdown@plt>
xor    %eax,%eax
call   1060 <io_shutdown@plt>
xor    %eax,%eax
call   1030 <databus_shutdown@plt>
lea    0xe83(%rip),%rdi
lea    0xe82(%rip),%rdx
lea    0xf10(%rip),%rcx
mov    $0x2,%esi
call   1070 <log_log@plt>
xor    %eax,%eax
call   1040 <log_shutdown@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"INFO \00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/shawnchain/HomeMaster/refs/heads/master/iracc/iracc_gate.c\00"
@.str.2 = [20 x i8] c"Gateway Shutdown OK\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @iracc_shutdown()
%4 = call i32 (...) @io_shutdown()
%5 = call i32 (...) @databus_shutdown()
%6 = call i32 @log_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @log_shutdown()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"INFO \00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/shawnchain/HomeMaster/refs/heads/master/iracc/iracc_gate.c\00"
@.str.2 = [20 x i8] c"Gateway Shutdown OK\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @iracc_shutdown()
%3 = tail call i32 (...) @io_shutdown()
%4 = tail call i32 (...) @databus_shutdown()
%5 = tail call i32 @log_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @log_shutdown()
%7 = tail call i32 @exit(i32 0)
unreachable
}