#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_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ stderr;
void exitError(FILE *f1, FILE *f2, const char *mes) {
  if (f1) {
    fclose(f1);
  }
  if (f2) {
    fclose(f2);
  }
  remove("temp");
  fprintf(stderr, "%s Error\n", mes);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exitError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <exitError+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x10(%rbp)
je     117c <exitError+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xe7d(%rip),%rdi
call   1030 <remove@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe69(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<exitError>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
test   %rdi,%rdi
je     1154 <exitError+0x14>
call   1040 <fclose@plt>
test   %rbx,%rbx
je     1161 <exitError+0x21>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe98(%rip),%rdi
call   1030 <remove@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
mov    %r14,%rdx
call   1050 <fprintf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"temp\00"
@stderr = global i32 0
@.str.1 = [10 x i8] c"%s Error\0A\00"
@EXIT_FAILURE = global i32 0
define void @exitError(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
br label %12
12: ; preds = %9, %3
%13 = load i32*, i32** %5
%14 = icmp ne i32* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32*, i32** %5
%17 = call i32 @fclose(i32* %16)
br label %18
18: ; preds = %15, %12
%19 = call i32 @remove(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %6
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"temp\00"
@stderr = global i32 0
@.str.1 = [10 x i8] c"%s Error\0A\00"
@EXIT_FAILURE = global i32 0
define void @exitError(i32* %0, i32* %1, i8* %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fclose(i32* %0)
br label %7
7: ; preds = %5, %3
%8 = icmp eq i32* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @fclose(i32* %1)
br label %11
11: ; preds = %9, %7
%12 = tail call i32 @remove(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
}