#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*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ harnessTlsServerAccept();
int /*<<< orphan*/ harnessTlsServerClose();
int /*<<< orphan*/ harnessTlsServerExpect(char *);
int /*<<< orphan*/ harnessTlsServerInitDefault();
int /*<<< orphan*/ harnessTlsServerReply(char *);
void testHttpServer(void) {
  if (fork() == 0) {
    harnessTlsServerInitDefault();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.0 200 OK\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200OK\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "header-value\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "transfer-encoding:bogus\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "transfer-encoding:chunked\r\n"
                          "content-length:777\r\n"
                          "\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 503 Slow Down\r\n"
                          "\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect(
        "GET /?name=%2Fpath%2FA%20Z.txt&type=test HTTP/1.1\r\n"
        "host:myhost.com\r\n"
        "\r\n");
    harnessTlsServerReply("HTTP/1.1 500 Internal Error\r\n"
                          "Connection:close\r\n"
                          "\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect(
        "GET /?name=%2Fpath%2FA%20Z.txt&type=test HTTP/1.1\r\n"
        "host:myhost.com\r\n"
        "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "key1:0\r\n"
                          " key2 : value2\r\n"
                          "Connection:ack\r\n"
                          "\r\n");
    harnessTlsServerExpect("HEAD / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "content-length:380\r\n"
                          "\r\n");
    harnessTlsServerExpect("HEAD / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "Transfer-Encoding: chunked\r\n"
                          "\r\n");
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 503 Slow Down\r\n"
                          "Connection:close\r\n"
                          "\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 503 Slow Down\r\n"
                          "Connection:close\r\n"
                          "\r\n");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 404 Not Found\r\n"
                          "content-length:0\r\n"
                          "\r\n");
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 403 Auth Error\r\n"
                          "content-length:7\r\n"
                          "\r\n"
                          "CONTENT");
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET /path/file%201.txt HTTP/1.1\r\n"
                           "content-length:30\r\n"
                           "\r\n"
                           "012345678901234567890123456789");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "content-length:32\r\n"
                          "Connection:close\r\n"
                          "\r\n"
                          "01234567890123456789012345678901");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET /path/file%201.txt HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "content-length:32\r\n"
                          "\r\n"
                          "0123456789012345678901234567890");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET /path/file%201.txt HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "content-length:32\r\n"
                          "\r\n"
                          "01234567890123456789012345678901");
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET /path/file%201.txt HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "content-length:32\r\n"
                          "\r\n"
                          "0123456789012345678901234567890");
    harnessTlsServerClose();
    harnessTlsServerAccept();
    harnessTlsServerExpect("GET / HTTP/1.1\r\n"
                           "\r\n");
    harnessTlsServerReply("HTTP/1.1 200 OK\r\n"
                          "Transfer-Encoding:chunked\r\n"
                          "\r\n"
                          "20\r\n"
                          "01234567890123456789012345678901\r\n"
                          "10\r\n"
                          "0123456789012345\r\n"
                          "0\r\n"
                          "\r\n");
    harnessTlsServerClose();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<testHttpServer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <fork@plt>
cmp    $0x0,%rax
jne    145f <testHttpServer+0x2ef>
mov    $0x0,%al
call   1050 <harnessTlsServerInitDefault@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xe66(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xe53(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe5a(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xe2d(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe46(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xe07(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe31(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xde1(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe1d(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xdbb(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe17(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xd95(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe1c(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xd6f(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe39(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xe3a(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe75(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xe14(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe81(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
lea    0xeb1(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xeb9(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
lea    0xe99(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xec9(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
lea    0xcdb(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xee1(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xcb5(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xebb(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xc8f(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xec2(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xc70(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xed0(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xef2(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xf3b(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xf7a(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xf92(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xf54(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xfb2(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xf35(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xf4d(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
mov    $0x0,%al
call   1040 <harnessTlsServerAccept@plt>
lea    0xbc0(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xfb4(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    $0x0,%al
call   1060 <harnessTlsServerClose@plt>
xor    %edi,%edi
call   1080 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHttpServer>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1090 <fork@plt>
test   %rax,%rax
je     1187 <testHttpServer+0x17>
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
call   1050 <harnessTlsServerInitDefault@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
lea    0xe64(%rip),%r14
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe59(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe49(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe38(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe28(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe26(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe2f(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe50(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
lea    0xe51(%rip),%rbx
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe89(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xe99(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xece(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xee2(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xefe(%rip),%rbx
mov    %rbx,%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
mov    %rbx,%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xee8(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xefa(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
lea    0xf1c(%rip),%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xf65(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
lea    0xfa4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xfb9(%rip),%r15
mov    %r15,%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xfda(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %rbx,%rdi
call   1030 <harnessTlsServerExpect@plt>
mov    %r15,%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %eax,%eax
call   1040 <harnessTlsServerAccept@plt>
mov    %r14,%rdi
call   1030 <harnessTlsServerExpect@plt>
lea    0xfe8(%rip),%rdi
call   1070 <harnessTlsServerReply@plt>
xor    %eax,%eax
call   1060 <harnessTlsServerClose@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"GET / HTTP/1.1\0D\0A\0D\0A\00"
@.str.1 = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
@.str.2 = [17 x i8] c"HTTP/1.1 200OK\0D\0A\00"
@.str.3 = [18 x i8] c"HTTP/1.1 200 OK\0D\0A\00"
@.str.4 = [32 x i8] c"HTTP/1.1 200 OK\0D\0Aheader-value\0D\0A\00"
@.str.5 = [43 x i8] c"HTTP/1.1 200 OK\0D\0Atransfer-encoding:bogus\0D\0A\00"
@.str.6 = [67 x i8] c"HTTP/1.1 200 OK\0D\0Atransfer-encoding:chunked\0D\0Acontent-length:777\0D\0A\0D\0A\00"
@.str.7 = [27 x i8] c"HTTP/1.1 503 Slow Down\0D\0A\0D\0A\00"
@.str.8 = [71 x i8] c"GET /?name=%2Fpath%2FA%20Z.txt&type=test HTTP/1.1\0D\0Ahost:myhost.com\0D\0A\0D\0A\00"
@.str.9 = [50 x i8] c"HTTP/1.1 500 Internal Error\0D\0AConnection:close\0D\0A\0D\0A\00"
@.str.10 = [60 x i8] c"HTTP/1.1 200 OK\0D\0Akey1:0\0D\0A key2 : value2\0D\0AConnection:ack\0D\0A\0D\0A\00"
@.str.11 = [20 x i8] c"HEAD / HTTP/1.1\0D\0A\0D\0A\00"
@.str.12 = [40 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:380\0D\0A\0D\0A\00"
@.str.13 = [48 x i8] c"HTTP/1.1 200 OK\0D\0ATransfer-Encoding: chunked\0D\0A\0D\0A\00"
@.str.14 = [45 x i8] c"HTTP/1.1 503 Slow Down\0D\0AConnection:close\0D\0A\0D\0A\00"
@.str.15 = [45 x i8] c"HTTP/1.1 404 Not Found\0D\0Acontent-length:0\0D\0A\0D\0A\00"
@.str.16 = [53 x i8] c"HTTP/1.1 403 Auth Error\0D\0Acontent-length:7\0D\0A\0D\0ACONTENT\00"
@.str.17 = [85 x i8] c"GET /path/file%201.txt HTTP/1.1\0D\0Acontent-length:30\0D\0A\0D\0A012345678901234567890123456789\00"
@.str.18 = [89 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:32\0D\0AConnection:close\0D\0A\0D\0A01234567890123456789012345678901\00"
@.str.19 = [36 x i8] c"GET /path/file%201.txt HTTP/1.1\0D\0A\0D\0A\00"
@.str.20 = [70 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:32\0D\0A\0D\0A0123456789012345678901234567890\00"
@.str.21 = [71 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:32\0D\0A\0D\0A01234567890123456789012345678901\00"
@.str.22 = [112 x i8] c"HTTP/1.1 200 OK\0D\0ATransfer-Encoding:chunked\0D\0A\0D\0A20\0D\0A01234567890123456789012345678901\0D\0A10\0D\0A0123456789012345\0D\0A0\0D\0A\0D\0A\00"
define void @testHttpServer() {
%1 = call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %79
3: ; preds = %0
%4 = call i32 (...) @harnessTlsServerInitDefault()
%5 = call i32 (...) @harnessTlsServerAccept()
%6 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @harnessTlsServerAccept()
%8 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @harnessTlsServerClose()
%11 = call i32 (...) @harnessTlsServerAccept()
%12 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (...) @harnessTlsServerClose()
%15 = call i32 (...) @harnessTlsServerAccept()
%16 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (...) @harnessTlsServerClose()
%19 = call i32 (...) @harnessTlsServerAccept()
%20 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (...) @harnessTlsServerClose()
%23 = call i32 (...) @harnessTlsServerAccept()
%24 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%26 = call i32 (...) @harnessTlsServerClose()
%27 = call i32 (...) @harnessTlsServerAccept()
%28 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 (...) @harnessTlsServerClose()
%31 = call i32 (...) @harnessTlsServerAccept()
%32 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%33 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (...) @harnessTlsServerClose()
%35 = call i32 (...) @harnessTlsServerAccept()
%36 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.8, i64 0, i64 0))
%37 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
%38 = call i32 (...) @harnessTlsServerClose()
%39 = call i32 (...) @harnessTlsServerAccept()
%40 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.8, i64 0, i64 0))
%41 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%42 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%43 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0))
%44 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%45 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0))
%46 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%47 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%48 = call i32 (...) @harnessTlsServerClose()
%49 = call i32 (...) @harnessTlsServerAccept()
%50 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%51 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%52 = call i32 (...) @harnessTlsServerClose()
%53 = call i32 (...) @harnessTlsServerAccept()
%54 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%55 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%56 = call i32 (...) @harnessTlsServerAccept()
%57 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%58 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.16, i64 0, i64 0))
%59 = call i32 (...) @harnessTlsServerAccept()
%60 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.17, i64 0, i64 0))
%61 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.18, i64 0, i64 0))
%62 = call i32 (...) @harnessTlsServerClose()
%63 = call i32 (...) @harnessTlsServerAccept()
%64 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0))
%65 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.20, i64 0, i64 0))
%66 = call i32 (...) @harnessTlsServerClose()
%67 = call i32 (...) @harnessTlsServerAccept()
%68 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0))
%69 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.21, i64 0, i64 0))
%70 = call i32 (...) @harnessTlsServerAccept()
%71 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0))
%72 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.20, i64 0, i64 0))
%73 = call i32 (...) @harnessTlsServerClose()
%74 = call i32 (...) @harnessTlsServerAccept()
%75 = call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%76 = call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.22, i64 0, i64 0))
%77 = call i32 (...) @harnessTlsServerClose()
%78 = call i32 @exit(i32 0)
unreachable
79: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"GET / HTTP/1.1\0D\0A\0D\0A\00"
@.str.1 = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
@.str.2 = [17 x i8] c"HTTP/1.1 200OK\0D\0A\00"
@.str.3 = [18 x i8] c"HTTP/1.1 200 OK\0D\0A\00"
@.str.4 = [32 x i8] c"HTTP/1.1 200 OK\0D\0Aheader-value\0D\0A\00"
@.str.5 = [43 x i8] c"HTTP/1.1 200 OK\0D\0Atransfer-encoding:bogus\0D\0A\00"
@.str.6 = [67 x i8] c"HTTP/1.1 200 OK\0D\0Atransfer-encoding:chunked\0D\0Acontent-length:777\0D\0A\0D\0A\00"
@.str.7 = [27 x i8] c"HTTP/1.1 503 Slow Down\0D\0A\0D\0A\00"
@.str.8 = [71 x i8] c"GET /?name=%2Fpath%2FA%20Z.txt&type=test HTTP/1.1\0D\0Ahost:myhost.com\0D\0A\0D\0A\00"
@.str.9 = [50 x i8] c"HTTP/1.1 500 Internal Error\0D\0AConnection:close\0D\0A\0D\0A\00"
@.str.10 = [60 x i8] c"HTTP/1.1 200 OK\0D\0Akey1:0\0D\0A key2 : value2\0D\0AConnection:ack\0D\0A\0D\0A\00"
@.str.11 = [20 x i8] c"HEAD / HTTP/1.1\0D\0A\0D\0A\00"
@.str.12 = [40 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:380\0D\0A\0D\0A\00"
@.str.13 = [48 x i8] c"HTTP/1.1 200 OK\0D\0ATransfer-Encoding: chunked\0D\0A\0D\0A\00"
@.str.14 = [45 x i8] c"HTTP/1.1 503 Slow Down\0D\0AConnection:close\0D\0A\0D\0A\00"
@.str.15 = [45 x i8] c"HTTP/1.1 404 Not Found\0D\0Acontent-length:0\0D\0A\0D\0A\00"
@.str.16 = [53 x i8] c"HTTP/1.1 403 Auth Error\0D\0Acontent-length:7\0D\0A\0D\0ACONTENT\00"
@.str.17 = [85 x i8] c"GET /path/file%201.txt HTTP/1.1\0D\0Acontent-length:30\0D\0A\0D\0A012345678901234567890123456789\00"
@.str.18 = [89 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:32\0D\0AConnection:close\0D\0A\0D\0A01234567890123456789012345678901\00"
@.str.19 = [36 x i8] c"GET /path/file%201.txt HTTP/1.1\0D\0A\0D\0A\00"
@.str.20 = [70 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:32\0D\0A\0D\0A0123456789012345678901234567890\00"
@.str.21 = [71 x i8] c"HTTP/1.1 200 OK\0D\0Acontent-length:32\0D\0A\0D\0A01234567890123456789012345678901\00"
@.str.22 = [112 x i8] c"HTTP/1.1 200 OK\0D\0ATransfer-Encoding:chunked\0D\0A\0D\0A20\0D\0A01234567890123456789012345678901\0D\0A10\0D\0A0123456789012345\0D\0A0\0D\0A\0D\0A\00"
define void @testHttpServer() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %79
3: ; preds = %0
%4 = tail call i32 (...) @harnessTlsServerInitDefault()
%5 = tail call i32 (...) @harnessTlsServerAccept()
%6 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @harnessTlsServerAccept()
%8 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (...) @harnessTlsServerClose()
%11 = tail call i32 (...) @harnessTlsServerAccept()
%12 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 (...) @harnessTlsServerClose()
%15 = tail call i32 (...) @harnessTlsServerAccept()
%16 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%18 = tail call i32 (...) @harnessTlsServerClose()
%19 = tail call i32 (...) @harnessTlsServerAccept()
%20 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%22 = tail call i32 (...) @harnessTlsServerClose()
%23 = tail call i32 (...) @harnessTlsServerAccept()
%24 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%25 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%26 = tail call i32 (...) @harnessTlsServerClose()
%27 = tail call i32 (...) @harnessTlsServerAccept()
%28 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%29 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%30 = tail call i32 (...) @harnessTlsServerClose()
%31 = tail call i32 (...) @harnessTlsServerAccept()
%32 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%33 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%34 = tail call i32 (...) @harnessTlsServerClose()
%35 = tail call i32 (...) @harnessTlsServerAccept()
%36 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.8, i64 0, i64 0))
%37 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
%38 = tail call i32 (...) @harnessTlsServerClose()
%39 = tail call i32 (...) @harnessTlsServerAccept()
%40 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.8, i64 0, i64 0))
%41 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%42 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%43 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0))
%44 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%45 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0))
%46 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%47 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%48 = tail call i32 (...) @harnessTlsServerClose()
%49 = tail call i32 (...) @harnessTlsServerAccept()
%50 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%51 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%52 = tail call i32 (...) @harnessTlsServerClose()
%53 = tail call i32 (...) @harnessTlsServerAccept()
%54 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%55 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%56 = tail call i32 (...) @harnessTlsServerAccept()
%57 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%58 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.16, i64 0, i64 0))
%59 = tail call i32 (...) @harnessTlsServerAccept()
%60 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.17, i64 0, i64 0))
%61 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.18, i64 0, i64 0))
%62 = tail call i32 (...) @harnessTlsServerClose()
%63 = tail call i32 (...) @harnessTlsServerAccept()
%64 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0))
%65 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.20, i64 0, i64 0))
%66 = tail call i32 (...) @harnessTlsServerClose()
%67 = tail call i32 (...) @harnessTlsServerAccept()
%68 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0))
%69 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.21, i64 0, i64 0))
%70 = tail call i32 (...) @harnessTlsServerAccept()
%71 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0))
%72 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.20, i64 0, i64 0))
%73 = tail call i32 (...) @harnessTlsServerClose()
%74 = tail call i32 (...) @harnessTlsServerAccept()
%75 = tail call i32 @harnessTlsServerExpect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%76 = tail call i32 @harnessTlsServerReply(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.22, i64 0, i64 0))
%77 = tail call i32 (...) @harnessTlsServerClose()
%78 = tail call i32 @exit(i32 0)
unreachable
79: ; preds = %0
ret void
}