#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*/ u_short;
struct stat {
  scalar_t__ st_size;
};
struct evkeyvalq {
  int dummy;
};
struct evhttp_request {
  int dummy;
};
struct evhttp_connection {
  int dummy;
};
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ HTTP_OK;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
scalar_t__ evbuffer_add_file(struct evbuffer *, int, int /*<<< orphan*/,
                             scalar_t__);
int /*<<< orphan*/ evbuffer_free(struct evbuffer *);
struct evbuffer *evbuffer_new();
scalar_t__ evhttp_add_header(struct evkeyvalq *, char *, char *);
int /*<<< orphan*/ evhttp_connection_get_peer(struct evhttp_connection *,
                                              char **, int /*<<< orphan*/ *);
struct evhttp_connection *
evhttp_request_get_connection(struct evhttp_request *);
struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *);
int /*<<< orphan*/ evhttp_send_reply(struct evhttp_request *,
                                     int /*<<< orphan*/, char *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ evhttp_send_reply_chunk(struct evhttp_request *,
                                           struct evbuffer *);
int /*<<< orphan*/ evhttp_send_reply_end(struct evhttp_request *);
int /*<<< orphan*/ evhttp_send_reply_start(struct evhttp_request *,
                                           int /*<<< orphan*/, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int, char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void sendchunkedfile(char *filename, char *type, struct evhttp_request *req,
                     void *arg) {
  int fd = -1, chunked = 1;
  struct evbuffer *buffer = NULL;
  struct stat st;
  struct evhttp_connection *client = NULL;
  char *addr = NULL;
  int port;
  if ((client = evhttp_request_get_connection(req)) != NULL) {
    evhttp_connection_get_peer(client, &addr, (u_short *)&port);
    printf("%s:%d -> /%s\n", addr, port, filename);
    ;
  }
  struct evkeyvalq *headers = evhttp_request_get_output_headers(req);
  if (evhttp_add_header(headers, "Content-Type", type) < 0) {
    fprintf(stderr, "Unable to set header: Content-Type\n");
    ;
    return;
  }
  buffer = evbuffer_new();
  if (stat(filename, &st) != -1) {
    if ((fd = open(filename, O_RDONLY)) != -1) {
      if (st.st_size > 0) {
        if (evbuffer_add_file(buffer, fd, 0, st.st_size) < 0) {
          fprintf(stderr, "Unable to read file! (%s)\n", filename);
          ;
        }
      } else {
        close(fd);
        chunked = 0;
      }
    } else {
      fprintf(stderr, "Unable to open file! (%s: %s)\n", filename,
              strerror(errno));
      ;
      chunked = 0;
    }
  } else {
    fprintf(stderr, "Unable to open file! (%s)\n", filename);
    ;
    chunked = 0;
  }
  if (chunked > 0) {
    evhttp_send_reply_start(req, HTTP_OK, "OK");
    evhttp_send_reply_chunk(req, buffer);
    evhttp_send_reply_end(req);
  } else {
    evhttp_send_reply(req, HTTP_OK, "OK", 0);
  }
  evbuffer_free(buffer);
}


x86 assembly (clang, -O0):
<sendchunkedfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <evhttp_request_get_connection@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     128d <sendchunkedfile+0x7d>
mov    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
lea    -0x4c(%rbp),%rdx
call   10b0 <evhttp_connection_get_peer@plt>
mov    -0x48(%rbp),%rsi
mov    -0x4c(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xd78(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <evhttp_request_get_output_headers@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd65(%rip),%rsi
call   10e0 <evhttp_add_header@plt>
cmp    $0x0,%rax
jge    12d4 <sendchunkedfile+0xc4>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
lea    0xd53(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1438 <sendchunkedfile+0x228>
mov    $0x0,%al
call   10d0 <evbuffer_new@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0xffffffff,%eax
je     13b4 <sendchunkedfile+0x1a4>
mov    -0x8(%rbp),%rdi
mov    0x2ce8(%rip),%rax
mov    (%rax),%esi
call   10f0 <open@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     136e <sendchunkedfile+0x15e>
cmpq   $0x0,-0x38(%rbp)
jle    135a <sendchunkedfile+0x14a>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x38(%rbp),%rcx
xor    %edx,%edx
call   1030 <evbuffer_add_file@plt>
cmp    $0x0,%rax
jge    1355 <sendchunkedfile+0x145>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1369 <sendchunkedfile+0x159>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x28(%rbp)
jmp    13af <sendchunkedfile+0x19f>
mov    0x2c5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x2c3f(%rip),%rax
mov    (%rax),%edi
call   1130 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    %rax,%rcx
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
jmp    13d6 <sendchunkedfile+0x1c6>
mov    0x2c15(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xcb1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    1414 <sendchunkedfile+0x204>
mov    -0x18(%rbp),%rdi
mov    0x2bed(%rip),%rax
mov    (%rax),%esi
lea    0xca0(%rip),%rdx
call   1100 <evhttp_send_reply_start@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1110 <evhttp_send_reply_chunk@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <evhttp_send_reply_end@plt>
jmp    142f <sendchunkedfile+0x21f>
mov    -0x18(%rbp),%rdi
mov    0x2bb9(%rip),%rax
mov    (%rax),%esi
lea    0xc6c(%rip),%rdx
xor    %ecx,%ecx
call   1120 <evhttp_send_reply@plt>
mov    -0x30(%rbp),%rdi
call   1050 <evbuffer_free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendchunkedfile>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
movq   $0x0,0x8(%rsp)
mov    %rdx,%rdi
call   1090 <evhttp_request_get_connection@plt>
test   %rax,%rax
je     1264 <sendchunkedfile+0x54>
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   10b0 <evhttp_connection_get_peer@plt>
mov    0x8(%rsp),%rsi
mov    0x4(%rsp),%edx
lea    0xda4(%rip),%rdi
mov    %r12,%rcx
call   1040 <printf@plt>
mov    %r15,%rdi
call   10c0 <evhttp_request_get_output_headers@plt>
lea    0xd9b(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   10e0 <evhttp_add_header@plt>
test   %rax,%rax
js     132a <sendchunkedfile+0x11a>
xor    %eax,%eax
call   10d0 <evbuffer_new@plt>
mov    %rax,%r14
lea    0x10(%rsp),%rsi
mov    %r12,%rdi
call   1080 <stat@plt>
cmp    $0xffffffff,%eax
je     1343 <sendchunkedfile+0x133>
mov    0x2d3a(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   10f0 <open@plt>
cmp    $0xffffffff,%eax
je     135f <sendchunkedfile+0x14f>
mov    0x10(%rsp),%rcx
test   %rcx,%rcx
jle    138e <sendchunkedfile+0x17e>
mov    %r14,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <evbuffer_add_file@plt>
test   %rax,%rax
jns    12fa <sendchunkedfile+0xea>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xd4f(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2cd7(%rip),%rax
mov    (%rax),%esi
lea    0xd8a(%rip),%rdx
mov    %r15,%rdi
call   1100 <evhttp_send_reply_start@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1110 <evhttp_send_reply_chunk@plt>
mov    %r15,%rdi
call   10a0 <evhttp_send_reply_end@plt>
jmp    13af <sendchunkedfile+0x19f>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
lea    0xce1(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    13b7 <sendchunkedfile+0x1a7>
mov    0x2c86(%rip),%rax
mov    (%rax),%edi
lea    0xd26(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1395 <sendchunkedfile+0x185>
mov    0x2c6a(%rip),%rax
mov    (%rax),%ebx
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   1130 <strerror@plt>
lea    0xcdd(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1395 <sendchunkedfile+0x185>
mov    %eax,%edi
call   1060 <close@plt>
mov    0x2c3c(%rip),%rax
mov    (%rax),%esi
lea    0xcef(%rip),%rdx
mov    %r15,%rdi
xor    %ecx,%ecx
call   1120 <evhttp_send_reply@plt>
mov    %r14,%rdi
call   1050 <evbuffer_free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.evhttp_request = type { i32 }
%struct.evbuffer = type { i32 }
%struct.stat = type { i64 }
%struct.evhttp_connection = type { i32 }
%struct.evkeyvalq = type { i32 }
@.str = [14 x i8] c"%s:%d -> /%s\0A\00"
@.str.1 = [13 x i8] c"Content-Type\00"
@stderr = global i32 0
@.str.2 = [36 x i8] c"Unable to set header: Content-Type\0A\00"
@O_RDONLY = global i32 0
@.str.3 = [27 x i8] c"Unable to read file! (%s)\0A\00"
@.str.4 = [31 x i8] c"Unable to open file! (%s: %s)\0A\00"
@errno = global i32 0
@.str.5 = [27 x i8] c"Unable to open file! (%s)\0A\00"
@HTTP_OK = global i32 0
@.str.6 = [3 x i8] c"OK\00"
define void @sendchunkedfile(i8* %0, i8* %1, %struct.evhttp_request* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.evhttp_request*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.evbuffer*
%12 = alloca %struct.stat
%13 = alloca %struct.evhttp_connection*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca %struct.evkeyvalq*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.evhttp_request* %2, %struct.evhttp_request** %7
store i8* %3, i8** %8
store i32 -1, i32* %9
store i32 1, i32* %10
store %struct.evbuffer* null, %struct.evbuffer** %11
store %struct.evhttp_connection* null, %struct.evhttp_connection** %13
store i8* null, i8** %14
%17 = load %struct.evhttp_request*, %struct.evhttp_request** %7
%18 = call %struct.evhttp_connection* @evhttp_request_get_connection(%struct.evhttp_request* %17)
store %struct.evhttp_connection* %18, %struct.evhttp_connection** %13
%19 = icmp ne %struct.evhttp_connection* %18, null
br i1 %19, label %20, label %27
20: ; preds = %4
%21 = load %struct.evhttp_connection*, %struct.evhttp_connection** %13
%22 = call i32 @evhttp_connection_get_peer(%struct.evhttp_connection* %21, i8** %14, i32* %15)
%23 = load i8*, i8** %14
%24 = load i32, i32* %15
%25 = load i8*, i8** %5
%26 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %23, i32 %24, i8* %25)
br label %27
27: ; preds = %20, %4
%28 = load %struct.evhttp_request*, %struct.evhttp_request** %7
%29 = call %struct.evkeyvalq* @evhttp_request_get_output_headers(%struct.evhttp_request* %28)
store %struct.evkeyvalq* %29, %struct.evkeyvalq** %16
%30 = load %struct.evkeyvalq*, %struct.evkeyvalq** %16
%31 = load i8*, i8** %6
%32 = call i64 @evhttp_add_header(%struct.evkeyvalq* %30, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %27
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %97
37: ; preds = %27
%38 = call %struct.evbuffer* (...) @evbuffer_new()
store %struct.evbuffer* %38, %struct.evbuffer** %11
%39 = load i8*, i8** %5
%40 = call i32 @stat(i8* %39, %struct.stat* %12)
%41 = icmp ne i32 %40, -1
br i1 %41, label %42, label %74
42: ; preds = %37
%43 = load i8*, i8** %5
%44 = load i32, i32* @O_RDONLY
%45 = call i32 @open(i8* %43, i32 %44)
store i32 %45, i32* %9
%46 = icmp ne i32 %45, -1
br i1 %46, label %47, label %67
47: ; preds = %42
%48 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%49 = load i64, i64* %48
%50 = icmp sgt i64 %49, 0
br i1 %50, label %51, label %63
51: ; preds = %47
%52 = load %struct.evbuffer*, %struct.evbuffer** %11
%53 = load i32, i32* %9
%54 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%55 = load i64, i64* %54
%56 = call i64 @evbuffer_add_file(%struct.evbuffer* %52, i32 %53, i32 0, i64 %55)
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %51
%59 = load i32, i32* @stderr
%60 = load i8*, i8** %5
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %60)
br label %62
62: ; preds = %58, %51
br label %66
63: ; preds = %47
%64 = load i32, i32* %9
%65 = call i32 @close(i32 %64)
store i32 0, i32* %10
br label %66
66: ; preds = %63, %62
br label %73
67: ; preds = %42
%68 = load i32, i32* @stderr
%69 = load i8*, i8** %5
%70 = load i32, i32* @errno
%71 = call i8* @strerror(i32 %70)
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %69, i8* %71)
store i32 0, i32* %10
br label %73
73: ; preds = %67, %66
br label %78
74: ; preds = %37
%75 = load i32, i32* @stderr
%76 = load i8*, i8** %5
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %76)
store i32 0, i32* %10
br label %78
78: ; preds = %74, %73
%79 = load i32, i32* %10
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %90
81: ; preds = %78
%82 = load %struct.evhttp_request*, %struct.evhttp_request** %7
%83 = load i32, i32* @HTTP_OK
%84 = call i32 @evhttp_send_reply_start(%struct.evhttp_request* %82, i32 %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%85 = load %struct.evhttp_request*, %struct.evhttp_request** %7
%86 = load %struct.evbuffer*, %struct.evbuffer** %11
%87 = call i32 @evhttp_send_reply_chunk(%struct.evhttp_request* %85, %struct.evbuffer* %86)
%88 = load %struct.evhttp_request*, %struct.evhttp_request** %7
%89 = call i32 @evhttp_send_reply_end(%struct.evhttp_request* %88)
br label %94
90: ; preds = %78
%91 = load %struct.evhttp_request*, %struct.evhttp_request** %7
%92 = load i32, i32* @HTTP_OK
%93 = call i32 @evhttp_send_reply(%struct.evhttp_request* %91, i32 %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %94
94: ; preds = %90, %81
%95 = load %struct.evbuffer*, %struct.evbuffer** %11
%96 = call i32 @evbuffer_free(%struct.evbuffer* %95)
br label %97
97: ; preds = %94, %34
ret void
}

LLVM IR (-O2):
%struct.evhttp_request = type { i32 }
%struct.stat = type { i64 }
%struct.evbuffer = type { i32 }
%struct.evhttp_connection = type { i32 }
%struct.evkeyvalq = type { i32 }
@.str = [14 x i8] c"%s:%d -> /%s\0A\00"
@.str.1 = [13 x i8] c"Content-Type\00"
@stderr = global i32 0
@.str.2 = [36 x i8] c"Unable to set header: Content-Type\0A\00"
@O_RDONLY = global i32 0
@.str.3 = [27 x i8] c"Unable to read file! (%s)\0A\00"
@.str.4 = [31 x i8] c"Unable to open file! (%s: %s)\0A\00"
@errno = global i32 0
@.str.5 = [27 x i8] c"Unable to open file! (%s)\0A\00"
@HTTP_OK = global i32 0
@.str.6 = [3 x i8] c"OK\00"
define void @sendchunkedfile(i8* %0, i8* %1, %struct.evhttp_request* %2, i8* nocapture readnone %3) {
%5 = alloca %struct.stat
%6 = alloca i8*
%7 = alloca i32
%8 = bitcast %struct.stat* %5 to i8*
%9 = bitcast i8** %6 to i8*
store i8* null, i8** %6
%10 = bitcast i32* %7 to i8*
%11 = tail call %struct.evhttp_connection* @evhttp_request_get_connection(%struct.evhttp_request* %2)
%12 = icmp eq %struct.evhttp_connection* %11, null
br i1 %12, label %18, label %13
13: ; preds = %4
%14 = call i32 @evhttp_connection_get_peer(%struct.evhttp_connection* %11, i8** %6, i32* %7)
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i8* %0)
br label %18
18: ; preds = %13, %4
%19 = call %struct.evkeyvalq* @evhttp_request_get_output_headers(%struct.evhttp_request* %2)
%20 = call i64 @evhttp_add_header(%struct.evkeyvalq* %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%21 = icmp slt i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %63
25: ; preds = %18
%26 = call %struct.evbuffer* (...) @evbuffer_new()
%27 = call i32 @stat(i8* %0, %struct.stat* %5)
%28 = icmp eq i32 %27, -1
br i1 %28, label %50, label %29
29: ; preds = %25
%30 = load i32, i32* @O_RDONLY
%31 = call i32 @open(i8* %0, i32 %30)
%32 = icmp eq i32 %31, -1
br i1 %32, label %45, label %33
33: ; preds = %29
%34 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%35 = load i64, i64* %34
%36 = icmp sgt i64 %35, 0
br i1 %36, label %37, label %43
37: ; preds = %33
%38 = call i64 @evbuffer_add_file(%struct.evbuffer* %26, i32 %31, i32 0, i64 %35)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %53
40: ; preds = %37
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %53
43: ; preds = %33
%44 = call i32 @close(i32 %31)
br label %58
45: ; preds = %29
%46 = load i32, i32* @stderr
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %48)
br label %58
50: ; preds = %25
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %0)
br label %58
53: ; preds = %37, %40
%54 = load i32, i32* @HTTP_OK
%55 = call i32 @evhttp_send_reply_start(%struct.evhttp_request* %2, i32 %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%56 = call i32 @evhttp_send_reply_chunk(%struct.evhttp_request* %2, %struct.evbuffer* %26)
%57 = call i32 @evhttp_send_reply_end(%struct.evhttp_request* %2)
br label %61
58: ; preds = %50, %43, %45
%59 = load i32, i32* @HTTP_OK
%60 = call i32 @evhttp_send_reply(%struct.evhttp_request* %2, i32 %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %61
61: ; preds = %58, %53
%62 = call i32 @evbuffer_free(%struct.evbuffer* %26)
br label %63
63: ; preds = %61, %22
ret void
}