#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*/ uint8_t;
typedef int /*<<< orphan*/ CONF;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ BIO_s_mem();
scalar_t__ BIO_write(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, size_t);
int /*<<< orphan*/ ERR_clear_error();
int /*<<< orphan*/ NCONF_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ NCONF_load_bio(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  long *);
int /*<<< orphan*/ *NCONF_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ OPENSSL_assert(int);
int FuzzerTestOneInput(const uint8_t *buf, size_t len) {
  CONF *conf;
  BIO *in;
  long eline;
  if (len == 0)
    return 0;
  conf = NCONF_new(NULL);
  in = BIO_new(BIO_s_mem());
  OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
  NCONF_load_bio(conf, in, &eline);
  NCONF_free(conf);
  BIO_free(in);
  ERR_clear_error();
  return 0;
}


x86 assembly (clang, -O0):
<FuzzerTestOneInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11b7 <FuzzerTestOneInput+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1229 <FuzzerTestOneInput+0x99>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <NCONF_new@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   10b0 <BIO_s_mem@plt>
mov    %eax,%edi
call   1070 <BIO_new@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1090 <BIO_write@plt>
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <OPENSSL_assert@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <NCONF_load_bio@plt>
mov    -0x20(%rbp),%rdi
call   10a0 <NCONF_free@plt>
mov    -0x28(%rbp),%rdi
call   1080 <BIO_free@plt>
mov    $0x0,%al
call   1060 <ERR_clear_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FuzzerTestOneInput>:
test   %rsi,%rsi
je     120a <FuzzerTestOneInput+0x7a>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
call   1040 <NCONF_new@plt>
mov    %rax,%r14
xor    %eax,%eax
call   10b0 <BIO_s_mem@plt>
mov    %eax,%edi
call   1070 <BIO_new@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1090 <BIO_write@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1030 <OPENSSL_assert@plt>
mov    %rsp,%rdx
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <NCONF_load_bio@plt>
mov    %r14,%rdi
call   10a0 <NCONF_free@plt>
mov    %r12,%rdi
call   1080 <BIO_free@plt>
xor    %eax,%eax
call   1060 <ERR_clear_error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @FuzzerTestOneInput(i32* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %32
12: ; preds = %2
%13 = call i32* @NCONF_new(i32* null)
store i32* %13, i32** %6
%14 = call i32 (...) @BIO_s_mem()
%15 = call i32* @BIO_new(i32 %14)
store i32* %15, i32** %7
%16 = load i32*, i32** %7
%17 = load i32*, i32** %4
%18 = load i64, i64* %5
%19 = call i64 @BIO_write(i32* %16, i32* %17, i64 %18)
%20 = load i64, i64* %5
%21 = icmp eq i64 %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @OPENSSL_assert(i32 %22)
%24 = load i32*, i32** %6
%25 = load i32*, i32** %7
%26 = call i32 @NCONF_load_bio(i32* %24, i32* %25, i64* %8)
%27 = load i32*, i32** %6
%28 = call i32 @NCONF_free(i32* %27)
%29 = load i32*, i32** %7
%30 = call i32 @BIO_free(i32* %29)
%31 = call i32 (...) @ERR_clear_error()
store i32 0, i32* %3
br label %32
32: ; preds = %12, %11
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @FuzzerTestOneInput(i32* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = icmp eq i64 %1, 0
br i1 %5, label %18, label %6
6: ; preds = %2
%7 = tail call i32* @NCONF_new(i32* null)
%8 = tail call i32 (...) @BIO_s_mem()
%9 = tail call i32* @BIO_new(i32 %8)
%10 = tail call i64 @BIO_write(i32* %9, i32* %0, i64 %1)
%11 = icmp eq i64 %10, %1
%12 = zext i1 %11 to i32
%13 = tail call i32 @OPENSSL_assert(i32 %12)
%14 = call i32 @NCONF_load_bio(i32* %7, i32* %9, i64* %3)
%15 = call i32 @NCONF_free(i32* %7)
%16 = call i32 @BIO_free(i32* %9)
%17 = call i32 (...) @ERR_clear_error()
br label %18
18: ; preds = %2, %6
ret i32 0
}