#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct evbuffer {
  int dummy;
};
struct bufferevent {
  int dummy;
};
typedef int evutil_socket_t;
struct TYPE_3__ {
  char *data;
  int /*<<< orphan*/ length;
};
typedef TYPE_1__ BUF_MEM;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_f_base64();
int /*<<< orphan*/ BIO_flush(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_free_all(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_get_mem_ptr(int /*<<< orphan*/ *, TYPE_1__ **);
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ *BIO_push(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_s_mem();
int /*<<< orphan*/ BIO_write(int /*<<< orphan*/ *, char *, int);
int bufferevent_getfd(struct bufferevent *);
int bufferevent_read_buffer(struct bufferevent *, struct evbuffer *);
int bufferevent_write(struct bufferevent *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ evbuffer_free(struct evbuffer *);
struct evbuffer *evbuffer_new();
int evbuffer_remove(struct evbuffer *, char *, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, ...);
int /*<<< orphan*/ memset(char **, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void bev_data_read_cb(struct bufferevent *bev, void *ctx) {
  int ret = 0;
  evutil_socket_t fd = bufferevent_getfd(bev);
  if (fd == -1) {
    ret = -5;
    fprintf(stderr, "fd: %d\n", fd);
    return;
  }
  fprintf(stdout, "fd: %d\n", fd);
  struct evbuffer *buf = evbuffer_new();
  if (buf == NULL) {
    ret = -6;
    fprintf(stdout, "ret: %d\n", ret);
    return;
  }
  ret = bufferevent_read_buffer(bev, buf);
  if (ret == -1) {
    ret = -7;
    fprintf(stdout, "ret: %d\n", ret);
    return;
  }
  char data[5];
  size_t datlen = 5 - 1;
  while (1) {
    static int i = 0;
    memset(&data, 0, sizeof data);
    int ss = evbuffer_remove(buf, data, datlen);
    fprintf(stdout, "data[%d]: %s\n", i, data);
    BIO *b64 = BIO_new(BIO_f_base64());
    BIO *bmem = BIO_new(BIO_s_mem());
    b64 = BIO_push(b64, bmem);
    BIO_write(b64, data, ss);
    BIO_flush(b64);
    BUF_MEM *bptr = NULL;
    BIO_get_mem_ptr(b64, &bptr);
    fprintf(stdout, "data base64[%d]: %s\n", i, bptr->data);
    ret = bufferevent_write(bev, bptr->data, bptr->length);
    BIO_free_all(b64);
    if (ret == -1) {
      ret = -13;
      fprintf(stdout, "ret: %d\n", ret);
      break;
    }
    if (ss < datlen) {
      break;
    }
    i++;
  }
  evbuffer_free(buf);
  buf = NULL;
}


x86 assembly (clang, -O0):
<bev_data_read_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   10a0 <bufferevent_getfd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1253 <bev_data_read_cb+0x53>
movl   $0xfffffffb,-0x14(%rbp)
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1448 <bev_data_read_cb+0x248>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xd9a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   10b0 <evbuffer_new@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12a9 <bev_data_read_cb+0xa9>
movl   $0xfffffffa,-0x14(%rbp)
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xd6b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1448 <bev_data_read_cb+0x248>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1110 <bufferevent_read_buffer@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    12e9 <bev_data_read_cb+0xe9>
movl   $0xfffffff9,-0x14(%rbp)
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xd2b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1448 <bev_data_read_cb+0x248>
movq   $0x4,-0x30(%rbp)
lea    -0x25(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1070 <memset@plt>
mov    -0x20(%rbp),%rdi
lea    -0x25(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <evbuffer_remove@plt>
mov    %eax,-0x34(%rbp)
mov    0x2cbc(%rip),%rax
mov    (%rax),%edi
mov    0x2d88(%rip),%edx
lea    -0x25(%rbp),%rcx
lea    0xce2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1050 <BIO_f_base64@plt>
mov    %eax,%edi
call   1090 <BIO_new@plt>
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   1100 <BIO_s_mem@plt>
mov    %eax,%edi
call   1090 <BIO_new@plt>
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1040 <BIO_push@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    -0x25(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   10f0 <BIO_write@plt>
mov    -0x40(%rbp),%rdi
call   1120 <BIO_flush@plt>
movq   $0x0,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   10d0 <BIO_get_mem_ptr@plt>
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
mov    0x2d04(%rip),%edx
mov    -0x50(%rbp),%rax
mov    (%rax),%rcx
lea    0xc69(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x50(%rbp),%rax
mov    (%rax),%rsi
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%edx
call   10e0 <bufferevent_write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x40(%rbp),%rdi
call   10c0 <BIO_free_all@plt>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1410 <bev_data_read_cb+0x210>
movl   $0xfffffff3,-0x14(%rbp)
mov    0x2be0(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xc04(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1437 <bev_data_read_cb+0x237>
movslq -0x34(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1423 <bev_data_read_cb+0x223>
jmp    1437 <bev_data_read_cb+0x237>
mov    0x2c83(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c7a(%rip)
jmp    12f1 <bev_data_read_cb+0xf1>
mov    -0x20(%rbp),%rdi
call   1060 <evbuffer_free@plt>
movq   $0x0,-0x20(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bev_data_read_cb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
call   10a0 <bufferevent_getfd@plt>
cmp    $0xffffffff,%eax
je     1362 <bev_data_read_cb+0x162>
mov    0x2db0(%rip),%rbx
mov    (%rbx),%edi
lea    0xdcf(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   10b0 <evbuffer_new@plt>
test   %rax,%rax
je     1379 <bev_data_read_cb+0x179>
mov    %rax,%rbp
mov    0x8(%rsp),%rdi
mov    %rax,%rsi
call   1110 <bufferevent_read_buffer@plt>
cmp    $0xffffffff,%eax
je     1389 <bev_data_read_cb+0x189>
lea    0x13(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1070 <memset@plt>
mov    $0x4,%edx
mov    %rbp,%r15
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <evbuffer_remove@plt>
mov    %eax,%r12d
mov    0x2d3c(%rip),%r14
mov    (%r14),%edi
mov    0x2e07(%rip),%edx
lea    0xd65(%rip),%rsi
mov    %rbx,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1050 <BIO_f_base64@plt>
mov    %eax,%edi
call   1090 <BIO_new@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1100 <BIO_s_mem@plt>
mov    %eax,%edi
call   1090 <BIO_new@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1040 <BIO_push@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
call   10f0 <BIO_write@plt>
mov    %r13,%rdi
call   1120 <BIO_flush@plt>
movq   $0x0,(%rsp)
mov    %r13,%rdi
mov    %rsp,%rsi
call   10d0 <BIO_get_mem_ptr@plt>
mov    (%r14),%edi
mov    0x2d97(%rip),%edx
mov    (%rsp),%rax
mov    (%rax),%rcx
lea    0xcfc(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rsp),%rax
mov    (%rax),%rsi
mov    0x8(%rax),%edx
mov    0x8(%rsp),%rdi
call   10e0 <bufferevent_write@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   10c0 <BIO_free_all@plt>
cmp    $0xffffffff,%ebp
je     13ac <bev_data_read_cb+0x1ac>
cmp    $0x4,%r12d
jb     13c8 <bev_data_read_cb+0x1c8>
addl   $0x1,0x2d52(%rip)
mov    %r15,%rbp
jmp    1270 <bev_data_read_cb+0x70>
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
lea    0xc8e(%rip),%rsi
mov    $0xffffffff,%edx
jmp    1397 <bev_data_read_cb+0x197>
mov    (%rbx),%edi
lea    0xc86(%rip),%rsi
mov    $0xfffffffa,%edx
jmp    1397 <bev_data_read_cb+0x197>
mov    (%rbx),%edi
lea    0xc76(%rip),%rsi
mov    $0xfffffff9,%edx
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <fprintf@plt>
mov    0x2c25(%rip),%rax
mov    (%rax),%edi
lea    0xc4c(%rip),%rsi
mov    $0xfffffff3,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15,%rdi
call   1060 <evbuffer_free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
%struct.TYPE_3__ = type { i8*, i32 }
@stderr = global i32 0
@.str = [8 x i8] c"fd: %d\0A\00"
@stdout = global i32 0
@.str.1 = [9 x i8] c"ret: %d\0A\00"
@bev_data_read_cb.i = internal global i32 0
@.str.2 = [14 x i8] c"data[%d]: %s\0A\00"
@.str.3 = [21 x i8] c"data base64[%d]: %s\0A\00"
define void @bev_data_read_cb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.evbuffer*
%8 = alloca [5 x i8]
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca %struct.TYPE_3__*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%14 = load %struct.bufferevent*, %struct.bufferevent** %3
%15 = call i32 @bufferevent_getfd(%struct.bufferevent* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %22
18: ; preds = %2
store i32 -5, i32* %5
%19 = load i32, i32* @stderr
%20 = load i32, i32* %6
%21 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %104
22: ; preds = %2
%23 = load i32, i32* @stdout
%24 = load i32, i32* %6
%25 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = call %struct.evbuffer* (...) @evbuffer_new()
store %struct.evbuffer* %26, %struct.evbuffer** %7
%27 = load %struct.evbuffer*, %struct.evbuffer** %7
%28 = icmp eq %struct.evbuffer* %27, null
br i1 %28, label %29, label %33
29: ; preds = %22
store i32 -6, i32* %5
%30 = load i32, i32* @stdout
%31 = load i32, i32* %5
%32 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %31)
br label %104
33: ; preds = %22
%34 = load %struct.bufferevent*, %struct.bufferevent** %3
%35 = load %struct.evbuffer*, %struct.evbuffer** %7
%36 = call i32 @bufferevent_read_buffer(%struct.bufferevent* %34, %struct.evbuffer* %35)
store i32 %36, i32* %5
%37 = load i32, i32* %5
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %43
39: ; preds = %33
store i32 -7, i32* %5
%40 = load i32, i32* @stdout
%41 = load i32, i32* %5
%42 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %41)
br label %104
43: ; preds = %33
store i64 4, i64* %9
br label %44
44: ; preds = %43, %98
%45 = bitcast [5 x i8]* %8 to i8**
%46 = call i32 @memset(i8** %45, i32 0, i32 5)
%47 = load %struct.evbuffer*, %struct.evbuffer** %7
%48 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%49 = load i64, i64* %9
%50 = call i32 @evbuffer_remove(%struct.evbuffer* %47, i8* %48, i64 %49)
store i32 %50, i32* %10
%51 = load i32, i32* @stdout
%52 = load i32, i32* @bev_data_read_cb.i
%53 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%54 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %52, i8* %53)
%55 = call i32 (...) @BIO_f_base64()
%56 = call i32* @BIO_new(i32 %55)
store i32* %56, i32** %11
%57 = call i32 (...) @BIO_s_mem()
%58 = call i32* @BIO_new(i32 %57)
store i32* %58, i32** %12
%59 = load i32*, i32** %11
%60 = load i32*, i32** %12
%61 = call i32* @BIO_push(i32* %59, i32* %60)
store i32* %61, i32** %11
%62 = load i32*, i32** %11
%63 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%64 = load i32, i32* %10
%65 = call i32 @BIO_write(i32* %62, i8* %63, i32 %64)
%66 = load i32*, i32** %11
%67 = call i32 @BIO_flush(i32* %66)
store %struct.TYPE_3__* null, %struct.TYPE_3__** %13
%68 = load i32*, i32** %11
%69 = call i32 @BIO_get_mem_ptr(i32* %68, %struct.TYPE_3__** %13)
%70 = load i32, i32* @stdout
%71 = load i32, i32* @bev_data_read_cb.i
%72 = load %struct.TYPE_3__*, %struct.TYPE_3__** %13
%73 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %72, i32 0, i32 0
%74 = load i8*, i8** %73
%75 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %71, i8* %74)
%76 = load %struct.bufferevent*, %struct.bufferevent** %3
%77 = load %struct.TYPE_3__*, %struct.TYPE_3__** %13
%78 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %77, i32 0, i32 0
%79 = load i8*, i8** %78
%80 = load %struct.TYPE_3__*, %struct.TYPE_3__** %13
%81 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %80, i32 0, i32 1
%82 = load i32, i32* %81
%83 = call i32 @bufferevent_write(%struct.bufferevent* %76, i8* %79, i32 %82)
store i32 %83, i32* %5
%84 = load i32*, i32** %11
%85 = call i32 @BIO_free_all(i32* %84)
%86 = load i32, i32* %5
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %92
88: ; preds = %44
store i32 -13, i32* %5
%89 = load i32, i32* @stdout
%90 = load i32, i32* %5
%91 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %90)
br label %101
92: ; preds = %44
%93 = load i32, i32* %10
%94 = sext i32 %93 to i64
%95 = load i64, i64* %9
%96 = icmp ult i64 %94, %95
br i1 %96, label %97, label %98
97: ; preds = %92
br label %101
98: ; preds = %92
%99 = load i32, i32* @bev_data_read_cb.i
%100 = add nsw i32 %99, 1
store i32 %100, i32* @bev_data_read_cb.i
br label %44
101: ; preds = %97, %88
%102 = load %struct.evbuffer*, %struct.evbuffer** %7
%103 = call i32 @evbuffer_free(%struct.evbuffer* %102)
store %struct.evbuffer* null, %struct.evbuffer** %7
br label %104
104: ; preds = %101, %39, %29, %18
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.TYPE_3__ = type { i8*, i32 }
%struct.evbuffer = type { i32 }
@stderr = global i32 0
@.str = [8 x i8] c"fd: %d\0A\00"
@stdout = global i32 0
@.str.1 = [9 x i8] c"ret: %d\0A\00"
@bev_data_read_cb.i = internal unnamed_addr global i32 0
@.str.2 = [14 x i8] c"data[%d]: %s\0A\00"
@.str.3 = [21 x i8] c"data base64[%d]: %s\0A\00"
define void @bev_data_read_cb(%struct.bufferevent* %0, i8* nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = alloca %struct.TYPE_3__*
%5 = tail call i32 @bufferevent_getfd(%struct.bufferevent* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 -1)
br label %66
10: ; preds = %2
%11 = load i32, i32* @stdout
%12 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%13 = tail call %struct.evbuffer* (...) @evbuffer_new()
%14 = icmp eq %struct.evbuffer* %13, null
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* @stdout
%17 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -6)
br label %66
18: ; preds = %10
%19 = tail call i32 @bufferevent_read_buffer(%struct.bufferevent* %0, %struct.evbuffer* %13)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* @stdout
%23 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -7)
br label %66
24: ; preds = %18
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%26 = bitcast [5 x i8]* %3 to i8**
%27 = bitcast %struct.TYPE_3__** %4 to i8*
br label %28
28: ; preds = %61, %24
%29 = call i32 @memset(i8** %26, i32 0, i32 5)
%30 = call i32 @evbuffer_remove(%struct.evbuffer* %13, i8* %25, i64 4)
%31 = load i32, i32* @stdout
%32 = load i32, i32* @bev_data_read_cb.i
%33 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %32, i8* %25)
%34 = call i32 (...) @BIO_f_base64()
%35 = call i32* @BIO_new(i32 %34)
%36 = call i32 (...) @BIO_s_mem()
%37 = call i32* @BIO_new(i32 %36)
%38 = call i32* @BIO_push(i32* %35, i32* %37)
%39 = call i32 @BIO_write(i32* %38, i8* %25, i32 %30)
%40 = call i32 @BIO_flush(i32* %38)
store %struct.TYPE_3__* null, %struct.TYPE_3__** %4
%41 = call i32 @BIO_get_mem_ptr(i32* %38, %struct.TYPE_3__** %4)
%42 = load i32, i32* @stdout
%43 = load i32, i32* @bev_data_read_cb.i
%44 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%45 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %44, i64 0, i32 0
%46 = load i8*, i8** %45
%47 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %43, i8* %46)
%48 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%49 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %48, i64 0, i32 0
%50 = load i8*, i8** %49
%51 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %48, i64 0, i32 1
%52 = load i32, i32* %51
%53 = call i32 @bufferevent_write(%struct.bufferevent* %0, i8* %50, i32 %52)
%54 = call i32 @BIO_free_all(i32* %38)
%55 = icmp eq i32 %53, -1
br i1 %55, label %56, label %59
56: ; preds = %28
%57 = load i32, i32* @stdout
%58 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -13)
br label %64
59: ; preds = %28
%60 = icmp ult i32 %30, 4
br i1 %60, label %64, label %61
61: ; preds = %59
%62 = load i32, i32* @bev_data_read_cb.i
%63 = add nsw i32 %62, 1
store i32 %63, i32* @bev_data_read_cb.i
br label %28
64: ; preds = %59, %56
%65 = call i32 @evbuffer_free(%struct.evbuffer* %13)
br label %66
66: ; preds = %15, %21, %64, %7
ret void
}