#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*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_FLAGS_NONCLEAR_RST;
int /*<<< orphan*/ BIO_clear_flags(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ BIO_puts(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ BIO_read(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ BIO_reset(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_s_mem();
int /*<<< orphan*/ BIO_set_flags(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ test_int_eq(char *, int, char *, char *, int /*<<< orphan*/,
                               int);
int /*<<< orphan*/ test_int_gt(char *, int, char *, char *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int /*<<< orphan*/ test_int_lt(char *, int, char *, char *, int /*<<< orphan*/,
                               int);
int /*<<< orphan*/ test_mem_eq(char *, int, char *, char *, char *, int, char *,
                               int);
int /*<<< orphan*/ test_ptr(char *, int, char *, int /*<<< orphan*/ *);
int test_bio_nonclear_rst(void) {
  int ok = 0;
  BIO *bio = NULL;
  char data[16];
  bio = BIO_new(BIO_s_mem());
  if (!test_ptr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/"
                "refs/heads/master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
                190, "bio", bio))
    goto finish;
  if (!test_int_eq(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          192, "BIO_puts(bio, \"Hello World\\n\")", "12",
          BIO_puts(bio, "Hello World\n"), 12))
    goto finish;
  BIO_set_flags(bio, BIO_FLAGS_NONCLEAR_RST);
  if (!test_int_eq(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          197, "BIO_read(bio, data, 16)", "12", BIO_read(bio, data, 16), 12))
    goto finish;
  if (!test_mem_eq(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          199, "data", "\"Hello World\\n\"", data, 12, "Hello World\n", 12))
    goto finish;
  if (!test_int_gt(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          201, "BIO_reset(bio)", "0", BIO_reset(bio), 0))
    goto finish;
  if (!test_int_eq(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          204, "BIO_read(bio, data, 16)", "12", BIO_read(bio, data, 16), 12))
    goto finish;
  if (!test_mem_eq(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          206, "data", "\"Hello World\\n\"", data, 12, "Hello World\n", 12))
    goto finish;
  BIO_clear_flags(bio, BIO_FLAGS_NONCLEAR_RST);
  if (!test_int_gt(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          210, "BIO_reset(bio)", "0", BIO_reset(bio), 0))
    goto finish;
  if (!test_int_lt(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c",
          213, "BIO_read(bio, data, 16)", "1", BIO_read(bio, data, 16), 1))
    goto finish;
  ok = 1;
finish:
  BIO_free(bio);
  return ok;
}


x86 assembly (clang, -O0):
<test_bio_nonclear_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   10e0 <BIO_s_mem@plt>
mov    %eax,%edi
call   1090 <BIO_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0xdfc(%rip),%rdi
mov    $0xbe,%esi
lea    0xea4(%rip),%rdx
call   1050 <test_ptr@plt>
cmp    $0x0,%eax
jne    1223 <test_bio_nonclear_rst+0x53>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   10c0 <BIO_puts@plt>
mov    %eax,%r8d
lea    0xdc3(%rip),%rdi
mov    $0xc0,%esi
lea    0xe6f(%rip),%rdx
lea    0xe87(%rip),%rcx
mov    $0xc,%r9d
call   1060 <test_int_eq@plt>
cmp    $0x0,%eax
jne    1269 <test_bio_nonclear_rst+0x99>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
mov    -0x10(%rbp),%rdi
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
call   1070 <BIO_set_flags@plt>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1040 <BIO_read@plt>
mov    %eax,%r8d
lea    0xd69(%rip),%rdi
mov    $0xc5,%esi
lea    0xe44(%rip),%rdx
lea    0xe2d(%rip),%rcx
mov    $0xc,%r9d
call   1060 <test_int_eq@plt>
cmp    $0x0,%eax
jne    12c3 <test_bio_nonclear_rst+0xf3>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
lea    -0x20(%rbp),%r8
lea    0xd32(%rip),%rdi
mov    $0xc7,%esi
lea    0xe25(%rip),%rdx
lea    0xe23(%rip),%rcx
mov    $0xc,%r9d
lea    0xdec(%rip),%rax
mov    %rax,(%rsp)
movl   $0xc,0x8(%rsp)
call   10b0 <test_mem_eq@plt>
cmp    $0x0,%eax
jne    130d <test_bio_nonclear_rst+0x13d>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
mov    -0x10(%rbp),%rdi
call   10d0 <BIO_reset@plt>
mov    %eax,%r8d
lea    0xce0(%rip),%rdi
mov    $0xc9,%esi
lea    0xde8(%rip),%rdx
lea    0xdf0(%rip),%rcx
xor    %r9d,%r9d
call   1030 <test_int_gt@plt>
cmp    $0x0,%eax
jne    1349 <test_bio_nonclear_rst+0x179>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1040 <BIO_read@plt>
mov    %eax,%r8d
lea    0xc9b(%rip),%rdi
mov    $0xcc,%esi
lea    0xd76(%rip),%rdx
lea    0xd5f(%rip),%rcx
mov    $0xc,%r9d
call   1060 <test_int_eq@plt>
cmp    $0x0,%eax
jne    1391 <test_bio_nonclear_rst+0x1c1>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
lea    -0x20(%rbp),%r8
lea    0xc64(%rip),%rdi
mov    $0xce,%esi
lea    0xd57(%rip),%rdx
lea    0xd55(%rip),%rcx
mov    $0xc,%r9d
lea    0xd1e(%rip),%rax
mov    %rax,(%rsp)
movl   $0xc,0x8(%rsp)
call   10b0 <test_mem_eq@plt>
cmp    $0x0,%eax
jne    13db <test_bio_nonclear_rst+0x20b>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
mov    -0x10(%rbp),%rdi
mov    0x2bfa(%rip),%rax
mov    (%rax),%esi
call   1080 <BIO_clear_flags@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <BIO_reset@plt>
mov    %eax,%r8d
lea    0xc00(%rip),%rdi
mov    $0xd2,%esi
lea    0xd08(%rip),%rdx
lea    0xd10(%rip),%rcx
xor    %r9d,%r9d
call   1030 <test_int_gt@plt>
cmp    $0x0,%eax
jne    1429 <test_bio_nonclear_rst+0x259>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1040 <BIO_read@plt>
mov    %eax,%r8d
lea    0xbbb(%rip),%rdi
mov    $0xd5,%esi
lea    0xc96(%rip),%rdx
lea    0xccd(%rip),%rcx
mov    $0x1,%r9d
call   10f0 <test_int_lt@plt>
cmp    $0x0,%eax
jne    1471 <test_bio_nonclear_rst+0x2a1>
jmp    1478 <test_bio_nonclear_rst+0x2a8>
movl   $0x1,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <BIO_free@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bio_nonclear_rst>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %ebp,%ebp
xor    %eax,%eax
call   10e0 <BIO_s_mem@plt>
mov    %eax,%edi
call   1090 <BIO_new@plt>
mov    %rax,%rbx
lea    0xe0c(%rip),%rdi
lea    0xeb9(%rip),%rdx
mov    $0xbe,%esi
mov    %rax,%rcx
call   1050 <test_ptr@plt>
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
lea    0xec3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <BIO_puts@plt>
lea    0xdd7(%rip),%rdi
lea    0xe88(%rip),%rdx
lea    0xea0(%rip),%rcx
mov    $0xc0,%esi
mov    %eax,%r8d
mov    $0xc,%r9d
call   1060 <test_int_eq@plt>
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
mov    0x2d87(%rip),%r15
mov    (%r15),%esi
mov    %rbx,%rdi
call   1070 <BIO_set_flags@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   1040 <BIO_read@plt>
lea    0xd85(%rip),%rdi
lea    0xe65(%rip),%rdx
lea    0xe4e(%rip),%rcx
mov    $0xc5,%esi
mov    %eax,%r8d
mov    $0xc,%r9d
call   1060 <test_int_eq@plt>
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
lea    0xd55(%rip),%rdi
lea    0xe4d(%rip),%rdx
lea    0xe4b(%rip),%rcx
mov    %rsp,%r8
mov    $0xc7,%esi
mov    $0xc,%r9d
push   $0xc
push   %r14
call   10b0 <test_mem_eq@plt>
add    $0x10,%rsp
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
mov    %rbx,%rdi
call   10d0 <BIO_reset@plt>
lea    0xd15(%rip),%rdi
lea    0xe22(%rip),%rdx
lea    0xe2a(%rip),%rcx
xor    %ebp,%ebp
mov    $0xc9,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <test_int_gt@plt>
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   1040 <BIO_read@plt>
lea    0xcd6(%rip),%rdi
lea    0xdb6(%rip),%rdx
lea    0xd9f(%rip),%rcx
mov    $0xcc,%esi
mov    %eax,%r8d
mov    $0xc,%r9d
call   1060 <test_int_eq@plt>
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
lea    0xca6(%rip),%rdi
lea    0xd9e(%rip),%rdx
lea    0xd9c(%rip),%rcx
mov    %rsp,%r8
mov    $0xce,%esi
mov    $0xc,%r9d
push   $0xc
push   %r14
call   10b0 <test_mem_eq@plt>
add    $0x10,%rsp
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1080 <BIO_clear_flags@plt>
mov    %rbx,%rdi
call   10d0 <BIO_reset@plt>
lea    0xc5f(%rip),%rdi
lea    0xd6c(%rip),%rdx
lea    0xd74(%rip),%rcx
xor    %ebp,%ebp
mov    $0xd2,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <test_int_gt@plt>
test   %eax,%eax
je     1405 <test_bio_nonclear_rst+0x235>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   1040 <BIO_read@plt>
lea    0xc24(%rip),%rdi
lea    0xd04(%rip),%rdx
lea    0xd3b(%rip),%rcx
mov    $0xd5,%esi
mov    %eax,%r8d
mov    $0x1,%r9d
call   10f0 <test_int_lt@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %rbx,%rdi
call   10a0 <BIO_free@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [180 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c\00"
@.str.1 = [4 x i8] c"bio\00"
@.str.2 = [31 x i8] c"BIO_puts(bio, \22Hello World\\n\22)\00"
@.str.3 = [3 x i8] c"12\00"
@.str.4 = [13 x i8] c"Hello World\0A\00"
@BIO_FLAGS_NONCLEAR_RST = global i32 0
@.str.5 = [24 x i8] c"BIO_read(bio, data, 16)\00"
@.str.6 = [5 x i8] c"data\00"
@.str.7 = [16 x i8] c"\22Hello World\\n\22\00"
@.str.8 = [15 x i8] c"BIO_reset(bio)\00"
@.str.9 = [2 x i8] c"0\00"
@.str.10 = [2 x i8] c"1\00"
define i32 @test_bio_nonclear_rst() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [16 x i8]
store i32 0, i32* %1
store i32* null, i32** %2
%4 = call i32 (...) @BIO_s_mem()
%5 = call i32* @BIO_new(i32 %4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @test_ptr(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %0
br label %66
10: ; preds = %0
%11 = load i32*, i32** %2
%12 = call i32 @BIO_puts(i32* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @test_int_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 192, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %10
br label %66
16: ; preds = %10
%17 = load i32*, i32** %2
%18 = load i32, i32* @BIO_FLAGS_NONCLEAR_RST
%19 = call i32 @BIO_set_flags(i32* %17, i32 %18)
%20 = load i32*, i32** %2
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%22 = call i32 @BIO_read(i32* %20, i8* %21, i32 16)
%23 = call i32 @test_int_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 197, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 12)
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %16
br label %66
26: ; preds = %16
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%28 = call i32 @test_mem_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 199, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %27, i32 12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %26
br label %66
31: ; preds = %26
%32 = load i32*, i32** %2
%33 = call i32 @BIO_reset(i32* %32)
%34 = call i32 @test_int_gt(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 201, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 %33, i32 0)
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %31
br label %66
37: ; preds = %31
%38 = load i32*, i32** %2
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%40 = call i32 @BIO_read(i32* %38, i8* %39, i32 16)
%41 = call i32 @test_int_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 204, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %40, i32 12)
%42 = icmp ne i32 %41, 0
br i1 %42, label %44, label %43
43: ; preds = %37
br label %66
44: ; preds = %37
%45 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%46 = call i32 @test_mem_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 206, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %45, i32 12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %44
br label %66
49: ; preds = %44
%50 = load i32*, i32** %2
%51 = load i32, i32* @BIO_FLAGS_NONCLEAR_RST
%52 = call i32 @BIO_clear_flags(i32* %50, i32 %51)
%53 = load i32*, i32** %2
%54 = call i32 @BIO_reset(i32* %53)
%55 = call i32 @test_int_gt(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 %54, i32 0)
%56 = icmp ne i32 %55, 0
br i1 %56, label %58, label %57
57: ; preds = %49
br label %66
58: ; preds = %49
%59 = load i32*, i32** %2
%60 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%61 = call i32 @BIO_read(i32* %59, i8* %60, i32 16)
%62 = call i32 @test_int_lt(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 213, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 %61, i32 1)
%63 = icmp ne i32 %62, 0
br i1 %63, label %65, label %64
64: ; preds = %58
br label %66
65: ; preds = %58
store i32 1, i32* %1
br label %66
66: ; preds = %65, %64, %57, %48, %43, %36, %30, %25, %15, %9
%67 = load i32*, i32** %2
%68 = call i32 @BIO_free(i32* %67)
%69 = load i32, i32* %1
ret i32 %69
}

LLVM IR (-O2):
@.str = [180 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/bio_memleak_test.c\00"
@.str.1 = [4 x i8] c"bio\00"
@.str.2 = [31 x i8] c"BIO_puts(bio, \22Hello World\\n\22)\00"
@.str.3 = [3 x i8] c"12\00"
@.str.4 = [13 x i8] c"Hello World\0A\00"
@BIO_FLAGS_NONCLEAR_RST = global i32 0
@.str.5 = [24 x i8] c"BIO_read(bio, data, 16)\00"
@.str.6 = [5 x i8] c"data\00"
@.str.7 = [16 x i8] c"\22Hello World\\n\22\00"
@.str.8 = [15 x i8] c"BIO_reset(bio)\00"
@.str.9 = [2 x i8] c"0\00"
@.str.10 = [2 x i8] c"1\00"
define i32 @test_bio_nonclear_rst() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @BIO_s_mem()
%4 = tail call i32* @BIO_new(i32 %3)
%5 = tail call i32 @test_ptr(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %42, label %7
7: ; preds = %0
%8 = tail call i32 @BIO_puts(i32* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @test_int_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 192, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 12)
%10 = icmp eq i32 %9, 0
br i1 %10, label %42, label %11
11: ; preds = %7
%12 = load i32, i32* @BIO_FLAGS_NONCLEAR_RST
%13 = tail call i32 @BIO_set_flags(i32* %4, i32 %12)
%14 = call i32 @BIO_read(i32* %4, i8* %2, i32 16)
%15 = call i32 @test_int_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 197, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 12)
%16 = icmp eq i32 %15, 0
br i1 %16, label %42, label %17
17: ; preds = %11
%18 = call i32 @test_mem_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 199, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %2, i32 12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%19 = icmp eq i32 %18, 0
br i1 %19, label %42, label %20
20: ; preds = %17
%21 = call i32 @BIO_reset(i32* %4)
%22 = call i32 @test_int_gt(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 201, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 %21, i32 0)
%23 = icmp eq i32 %22, 0
br i1 %23, label %42, label %24
24: ; preds = %20
%25 = call i32 @BIO_read(i32* %4, i8* %2, i32 16)
%26 = call i32 @test_int_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 204, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %25, i32 12)
%27 = icmp eq i32 %26, 0
br i1 %27, label %42, label %28
28: ; preds = %24
%29 = call i32 @test_mem_eq(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 206, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %2, i32 12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%30 = icmp eq i32 %29, 0
br i1 %30, label %42, label %31
31: ; preds = %28
%32 = load i32, i32* @BIO_FLAGS_NONCLEAR_RST
%33 = call i32 @BIO_clear_flags(i32* %4, i32 %32)
%34 = call i32 @BIO_reset(i32* %4)
%35 = call i32 @test_int_gt(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 %34, i32 0)
%36 = icmp eq i32 %35, 0
br i1 %36, label %42, label %37
37: ; preds = %31
%38 = call i32 @BIO_read(i32* %4, i8* %2, i32 16)
%39 = call i32 @test_int_lt(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 213, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 %38, i32 1)
%40 = icmp ne i32 %39, 0
%41 = zext i1 %40 to i32
br label %42
42: ; preds = %37, %31, %28, %24, %20, %17, %11, %7, %0
%43 = phi i32 [ 0, %31 ], [ 0, %28 ], [ 0, %24 ], [ 0, %20 ], [ 0, %17 ], [ 0, %11 ], [ 0, %7 ], [ 0, %0 ], [ %41, %37 ]
%44 = call i32 @BIO_free(i32* %4)
ret i32 %43
}