#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*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  if (freopen("yoursister.txt", "r", stdin) == NULL) {
    printf("0");
    freopen("yoursister.txt", "w", stdout);
    printf("0");
  } else {
    printf("1");
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <freopen@plt>
cmp    $0x0,%rax
jne    119e <main+0x6e>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edx
lea    0xe7f(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
jmp    11aa <main+0x7a>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e19(%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    0x2ead(%rip),%r14
mov    (%r14),%edx
lea    0xebb(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <freopen@plt>
mov    $0x31,%ebx
test   %rax,%rax
jne    1186 <main+0x56>
mov    $0x30,%ebx
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
lea    0xe86(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1050 <freopen@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    (%r14),%edi
call   1040 <fclose@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"yoursister.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [2 x i8] c"1\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32* @freopen(i8* getelementptr inbounds ([15 x i8], [15 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 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32* @freopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
%13 = load i32, i32* @stdin
%14 = call i32 @fclose(i32 %13)
%15 = load i32, i32* @stdout
%16 = call i32 @fclose(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"yoursister.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.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 ([15 x i8], [15 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 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i32 @putchar(i32 48)
%6 = load i32, i32* @stdout
%7 = tail call i32* @freopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 48, %4 ], [ 49, %0 ]
%10 = tail call i32 @putchar(i32 %9)
%11 = load i32, i32* @stdin
%12 = tail call i32 @fclose(i32 %11)
%13 = load i32, i32* @stdout
%14 = tail call i32 @fclose(i32 %13)
ret i32 0
}