#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*/ Input(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void read_scfout(char *argv[]) {
  static FILE *fp;
  char buf[1048576];
  if ((fp = fopen(argv[1], "r")) != NULL) {
    printf("\nRead the scfout file (%s)\n", argv[1]);
    fflush(stdout);
    Input(fp);
    fclose(fp);
  } else {
    printf("Failure of reading the scfout file (%s).\n", argv[1]);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<read_scfout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100010,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe92(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x2ed6(%rip)
cmp    $0x0,%rax
je     11c3 <read_scfout+0x73>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2ea3(%rip),%rdi
call   1050 <Input@plt>
mov    0x2e97(%rip),%rdi
call   1030 <fclose@plt>
jmp    11e5 <read_scfout+0x95>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x100010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_scfout>:
push   %rbx
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
lea    0xea1(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x2ee5(%rip)
mov    0x8(%rbx),%rsi
test   %rax,%rax
je     11a7 <read_scfout+0x57>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2ebb(%rip),%rdi
call   1050 <Input@plt>
mov    0x2eaf(%rip),%rdi
pop    %rbx
jmp    1030 <fclose@plt>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@read_scfout.fp = internal global i32* null
@.str = [2 x i8] c"r\00"
@.str.1 = [28 x i8] c"\0ARead the scfout file (%s)\0A\00"
@stdout = global i32 0
@.str.2 = [42 x i8] c"Failure of reading the scfout file (%s).\0A\00"
define void @read_scfout(i8** %0) {
%2 = alloca i8**
%3 = alloca [1048576 x i8]
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %5
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** @read_scfout.fp
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %20
9: ; preds = %1
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
%16 = load i32*, i32** @read_scfout.fp
%17 = call i32 @Input(i32* %16)
%18 = load i32*, i32** @read_scfout.fp
%19 = call i32 @fclose(i32* %18)
br label %27
20: ; preds = %1
%21 = load i8**, i8*** %2
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @stdout
%26 = call i32 @fflush(i32 %25)
br label %27
27: ; preds = %20, %9
ret void
}

LLVM IR (-O2):
@read_scfout.fp = internal unnamed_addr global i32* null
@.str = [2 x i8] c"r\00"
@.str.1 = [28 x i8] c"\0ARead the scfout file (%s)\0A\00"
@stdout = global i32 0
@.str.2 = [42 x i8] c"Failure of reading the scfout file (%s).\0A\00"
define void @read_scfout(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %4, i32** @read_scfout.fp
%5 = icmp eq i32* %4, null
%6 = load i8*, i8** %2
br i1 %5, label %15, label %7
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = load i32*, i32** @read_scfout.fp
%12 = tail call i32 @Input(i32* %11)
%13 = load i32*, i32** @read_scfout.fp
%14 = tail call i32 @fclose(i32* %13)
br label %19
15: ; preds = %1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%17 = load i32, i32* @stdout
%18 = tail call i32 @fflush(i32 %17)
br label %19
19: ; preds = %15, %7
ret void
}