#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 */
scalar_t__ EOF;
int EXIT_SUCCESS;
int /*<<< orphan*/ err(char *);
int /*<<< orphan*/ expand();
scalar_t__ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  expand();
  if (fclose(stdin) == EOF)
    err("fclose(stdin)");
  if (fclose(stdout) == EOF)
    err("fclose(stdout)");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <expand@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
jne    1170 <main+0x40>
lea    0xe95(%rip),%rdi
call   1040 <err@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e5b(%rip),%rcx
cmp    (%rcx),%rax
jne    119a <main+0x6a>
lea    0xe79(%rip),%rdi
call   1040 <err@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <expand@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e93(%rip),%rbx
cmp    (%rbx),%rax
jne    115e <main+0x2e>
lea    0xea7(%rip),%rdi
call   1040 <err@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
cmp    (%rbx),%rax
jne    117d <main+0x4d>
lea    0xe96(%rip),%rdi
call   1040 <err@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i64 0
@.str = [14 x i8] c"fclose(stdin)\00"
@stdout = global i32 0
@.str.1 = [15 x i8] c"fclose(stdout)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @expand()
%3 = load i32, i32* @stdin
%4 = call i64 @fclose(i32 %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* @stdout
%11 = call i64 @fclose(i32 %10)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i64 0
@.str = [14 x i8] c"fclose(stdin)\00"
@stdout = global i32 0
@.str.1 = [15 x i8] c"fclose(stdout)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @expand()
%2 = load i32, i32* @stdin
%3 = tail call i64 @fclose(i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* @stdout
%10 = tail call i64 @fclose(i32 %9)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}