#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*/ conn_close();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gen_err_msg(char *, char *, char *, int);
int /*<<< orphan*/ mbox_close_app();
int /*<<< orphan*/ put_info(int /*<<< orphan*/);
int /*<<< orphan*/ ssl_app_destroy();
void exit_sig_handler(int signr) {
  put_info(
      gen_err_msg("[1;32mINFO:[0m  ", "Signal recived, exit!",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/janLo/"
                  "htw-computer-networks-mailserver/refs/heads/master/main.c",
                  142));
  conn_close();
  ssl_app_destroy();
  mbox_close_app();
  exit(0);
}


x86 assembly (clang, -O0):
<exit_sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe8e(%rip),%rdi
lea    0xe9a(%rip),%rsi
lea    0xea9(%rip),%rdx
mov    $0x8e,%ecx
call   1040 <gen_err_msg@plt>
mov    %eax,%edi
call   1070 <put_info@plt>
mov    $0x0,%al
call   1080 <conn_close@plt>
mov    $0x0,%al
call   1050 <ssl_app_destroy@plt>
mov    $0x0,%al
call   1030 <mbox_close_app@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<exit_sig_handler>:
push   %rax
lea    0xe98(%rip),%rdi
lea    0xea4(%rip),%rsi
lea    0xeb3(%rip),%rdx
mov    $0x8e,%ecx
call   1040 <gen_err_msg@plt>
mov    %eax,%edi
call   1070 <put_info@plt>
xor    %eax,%eax
call   1080 <conn_close@plt>
xor    %eax,%eax
call   1050 <ssl_app_destroy@plt>
xor    %eax,%eax
call   1030 <mbox_close_app@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[1;32mINFO:\1B[0m \00"
@.str.1 = [22 x i8] c"Signal recived, exit!\00"
@.str.2 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janLo/htw-computer-networks-mailserver/refs/heads/master/main.c\00"
define void @exit_sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @gen_err_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 142)
%4 = call i32 @put_info(i32 %3)
%5 = call i32 (...) @conn_close()
%6 = call i32 (...) @ssl_app_destroy()
%7 = call i32 (...) @mbox_close_app()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[1;32mINFO:\1B[0m \00"
@.str.1 = [22 x i8] c"Signal recived, exit!\00"
@.str.2 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janLo/htw-computer-networks-mailserver/refs/heads/master/main.c\00"
define void @exit_sig_handler(i32 %0) {
%2 = tail call i32 @gen_err_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.2, i64 0, i64 0), i32 142)
%3 = tail call i32 @put_info(i32 %2)
%4 = tail call i32 (...) @conn_close()
%5 = tail call i32 (...) @ssl_app_destroy()
%6 = tail call i32 (...) @mbox_close_app()
%7 = tail call i32 @exit(i32 0)
unreachable
}