#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 SIGSEGV;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ i8086close();
int /*<<< orphan*/ i8086errorEx(char *, int, char *, char *);
void resetAll(int signo) {
  if (SIGSEGV == signo)
    i8086errorEx("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/garvitdelhi/emulate/refs/"
                 "heads/master/extras/i8086emu-src-0.9.2/src/i8086text.c",
                 540, "Segmentation fault.", "");
  endwin();
  i8086close();
  exit(signo);
}


x86 assembly (clang, -O0):
<resetAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    117c <resetAll+0x3c>
lea    0xe9c(%rip),%rdi
mov    $0x21c,%esi
lea    0xf3a(%rip),%rdx
lea    0xf46(%rip),%rcx
call   1050 <i8086errorEx@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
mov    $0x0,%al
call   1030 <i8086close@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<resetAll>:
push   %rbx
mov    %edi,%ebx
mov    0x2e9e(%rip),%rax
cmp    %edi,(%rax)
jne    116d <resetAll+0x2d>
lea    0xeab(%rip),%rdi
lea    0xf4e(%rip),%rdx
lea    0xf5a(%rip),%rcx
mov    $0x21c,%esi
call   1050 <i8086errorEx@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %eax,%eax
call   1030 <i8086close@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIGSEGV = global i32 0
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/garvitdelhi/emulate/refs/heads/master/extras/i8086emu-src-0.9.2/src/i8086text.c\00"
@.str.1 = [20 x i8] c"Segmentation fault.\00"
@.str.2 = [1 x i8] zeroinitializer
define void @resetAll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGSEGV
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @i8086errorEx(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 (...) @endwin()
%10 = call i32 (...) @i8086close()
%11 = load i32, i32* %2
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/garvitdelhi/emulate/refs/heads/master/extras/i8086emu-src-0.9.2/src/i8086text.c\00"
@.str.1 = [20 x i8] c"Segmentation fault.\00"
@.str.2 = [1 x i8] zeroinitializer
define void @resetAll(i32 %0) {
%2 = load i32, i32* @SIGSEGV
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @i8086errorEx(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (...) @endwin()
%8 = tail call i32 (...) @i8086close()
%9 = tail call i32 @exit(i32 %0)
unreachable
}