#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fuzz_one(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *stdin;
int main(int argc, char *argv[]) {
  bool iterating = true;
  while (iterating) {
    iterating = false;
    FILE *input_fp = stdin;
    if (input_fp == NULL) {
      perror("Unable to open input file");
      return EXIT_FAILURE;
    }
    fuzz_one(input_fp);
    fclose(input_fp);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11ab <main+0x7b>
movl   $0x0,-0x14(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1194 <main+0x64>
lea    0xe82(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b7 <main+0x87>
mov    -0x20(%rbp),%rdi
call   1040 <fuzz_one@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
jmp    114d <main+0x1d>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%rbx
test   %rbx,%rbx
je     115b <main+0x2b>
mov    %rbx,%rdi
call   1040 <fuzz_one@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
lea    0xe9e(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e6a(%rip),%rax
jmp    1157 <main+0x27>

LLVM IR (-O0):
@stdin = global i32* null
@.str = [26 x i8] c"Unable to open input file\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
store i32 0, i32* %6
%12 = load i32*, i32** @stdin
store i32* %12, i32** %7
%13 = load i32*, i32** %7
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
store i32 %17, i32* %3
br label %25
18: ; preds = %11
%19 = load i32*, i32** %7
%20 = call i32 @fuzz_one(i32* %19)
%21 = load i32*, i32** %7
%22 = call i32 @fclose(i32* %21)
br label %8
23: ; preds = %8
%24 = load i32, i32* @EXIT_SUCCESS
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %15
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [26 x i8] c"Unable to open input file\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32*, i32** @stdin
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = tail call i32 @fuzz_one(i32* %3)
%9 = tail call i32 @fclose(i32* %3)
br label %10
10: ; preds = %5, %7
%11 = phi i32* [ @EXIT_SUCCESS, %7 ], [ @EXIT_FAILURE, %5 ]
%12 = load i32, i32* %11
ret i32 %12
}