#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*/ HonggfuzzPersistentLoop();
int HonggfuzzRunFromFile(int, char **);
int /*<<< orphan*/ LLVMFuzzerInitialize(int *, char ***);
int /*<<< orphan*/ fetchIsInputAvailable();
int /*<<< orphan*/ instrumentClearNewCov();
int HonggfuzzMain(int argc, char **argv) {
  LLVMFuzzerInitialize(&argc, &argv);
  instrumentClearNewCov();
  if (!fetchIsInputAvailable()) {
    return HonggfuzzRunFromFile(argc, argv);
  }
  HonggfuzzPersistentLoop();
  return 0;
}


x86 assembly (clang, -O0):
<HonggfuzzMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <LLVMFuzzerInitialize@plt>
mov    $0x0,%al
call   1060 <instrumentClearNewCov@plt>
mov    $0x0,%al
call   1050 <fetchIsInputAvailable@plt>
cmp    $0x0,%eax
jne    1197 <HonggfuzzMain+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <HonggfuzzRunFromFile@plt>
mov    %eax,-0x4(%rbp)
jmp    11a5 <HonggfuzzMain+0x55>
mov    $0x0,%al
call   1030 <HonggfuzzPersistentLoop@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HonggfuzzMain>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x4(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1070 <LLVMFuzzerInitialize@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <instrumentClearNewCov@plt>
xor    %eax,%eax
call   1050 <fetchIsInputAvailable@plt>
test   %eax,%eax
je     118a <HonggfuzzMain+0x3a>
xor    %eax,%eax
call   1030 <HonggfuzzPersistentLoop@plt>
jmp    119a <HonggfuzzMain+0x4a>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%rsi
call   1040 <HonggfuzzRunFromFile@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HonggfuzzMain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @LLVMFuzzerInitialize(i32* %4, i8*** %5)
%7 = call i32 (...) @instrumentClearNewCov()
%8 = call i32 (...) @fetchIsInputAvailable()
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @HonggfuzzRunFromFile(i32 %11, i8** %12)
store i32 %13, i32* %3
br label %16
14: ; preds = %2
%15 = call i32 (...) @HonggfuzzPersistentLoop()
store i32 0, i32* %3
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @HonggfuzzMain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @LLVMFuzzerInitialize(i32* %3, i8*** %4)
%6 = call i32 (...) @instrumentClearNewCov()
%7 = call i32 (...) @fetchIsInputAvailable()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i8**, i8*** %4
%12 = call i32 @HonggfuzzRunFromFile(i32 %10, i8** %11)
br label %15
13: ; preds = %2
%14 = call i32 (...) @HonggfuzzPersistentLoop()
br label %15
15: ; preds = %13, %9
%16 = phi i32 [ 0, %13 ], [ %12, %9 ]
ret i32 %16
}