#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*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  freopen("input_file.in", "r", stdin);
  freopen("output_file.out", "w", stdout);
  fclose(stdin);
  fclose(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
lea    0xeb5(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edx
lea    0xecb(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e90(%rip),%rbx
mov    (%rbx),%edx
lea    0xebf(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1040 <freopen@plt>
mov    (%r14),%edi
call   1030 <fclose@plt>
mov    (%rbx),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"input_file.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [16 x i8] c"output_file.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = call i32 @freopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdin
%7 = call i32 @fclose(i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fclose(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"input_file.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [16 x i8] c"output_file.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i32 @fclose(i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fclose(i32 %7)
ret i32 0
}