#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
void FatalError(void) {
  FILE *fd;
  printf("\n");
  printf(" ***   Fatal Error!!!   *** \n");
  printf(" *** Processing Stopped *** \n");
  printf("\n");
  fd = fopen("_die_", "w");
  fclose(fd);
  exit(2);
}


x86 assembly (clang, -O0):
<FatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<FatalError>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea6(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7c(%rip),%rdi
lea    0xe7b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rdi
call   1050 <fclose@plt>
mov    $0x2,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [30 x i8] c" *** Fatal Error!!! *** \0A\00"
@.str.2 = [30 x i8] c" *** Processing Stopped *** \0A\00"
@.str.3 = [6 x i8] c"_die_\00"
@.str.4 = [2 x i8] c"w\00"
define void @FatalError() {
%1 = alloca i32*
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
%9 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str.3 = [6 x i8] c"_die_\00"
@.str.4 = [2 x i8] c"w\00"
@str = [29 x i8] c" *** Fatal Error!!! *** \00"
@str.5 = [29 x i8] c" *** Processing Stopped *** \00"
define void @FatalError() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @fclose(i32* %5)
%7 = tail call i32 @exit(i32 2)
unreachable
}