#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_2__ TYPE_1__;

/* Type definitions */
struct stat {
  int st_mode;
  int st_uid;
  int st_gid;
  int /*<<< orphan*/ st_blocks;
  int /*<<< orphan*/ st_blksize;
  scalar_t__ st_size;
  int /*<<< orphan*/ st_rdev;
  int /*<<< orphan*/ st_nlink;
  int /*<<< orphan*/ st_ino;
  int /*<<< orphan*/ st_dev;
};
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ addr;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memcmp(char *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
char *ptime();
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int main() {
  int sock, listener;
  struct sockaddr_in addr;
  char buf[2048];
  int bytes_read;
  int i;
  struct stat struktura;
  FILE *fp;
  char buf2[2048];
  printf("%s Test echoserver started\n", ptime());
  listener = socket(AF_INET, SOCK_STREAM, 0);
  if (listener < 0) {
    perror("socket");
    exit(1);
  }
  addr.sin_family = AF_INET;
  addr.sin_port = htons(2222);
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  if (bind(listener, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("echoserver bind");
    exit(2);
  }
  listen(listener, 1);
  while (1) {
    sock = accept(listener, NULL, NULL);
    if (sock < 0) {
      perror("accept");
      exit(3);
    }
    while (1) {
      for (i = 0; i < 2048; i++)
        buf[i] = 0;
      bytes_read = recv(sock, buf, 2048, 0);
      if (bytes_read <= 0)
        break;
      printf("%s GET\n", ptime());
      if (!memcmp(buf, "GET ", 4)) {
        if (stat("index.html", &struktura)) {
          send(sock,
               "HTTP/1.1 404 Not Found`\nServer: proolhttpd\nDate: Sat, 27 Feb "
               "2016 21:45:06 GMT\nContent-Type: text/html\nContent-Length: "
               "144\nConnection: close\n\n<html>\n<head><title>404 Not "
               "Found</title></head>\n<body>\n<center><h1>404 Not "
               "Found</h1></center>\n<hr><center>proolhttpd</center>\n</"
               "body>\n</html>\n",
               strlen("HTTP/1.1 404 Not Found`\nServer: proolhttpd\nDate: Sat, "
                      "27 Feb 2016 21:45:06 GMT\nContent-Type: "
                      "text/html\nContent-Length: 144\nConnection: "
                      "close\n\n<html>\n<head><title>404 Not "
                      "Found</title></head>\n<body>\n<center><h1>404 Not "
                      "Found</h1></center>\n<hr><center>proolhttpd</center>\n</"
                      "body>\n</html>\n"),
               0);
        } else {
          send(sock, "HTTP/1.1 200 OK\nServer: proolhttpd/0.0.2\n",
               strlen("HTTP/1.1 200 OK\nServer: proolhttpd/0.0.2\n"), 0);
          sprintf(buf2, "Date: %s\n", ptime());
          send(sock, buf2, strlen(buf2), 0);
          send(sock, "Content-Type: text/html\n",
               strlen("Content-Type: text/html\n"), 0);
          sprintf(buf2, "Content-Length: %li\nLast-Modified: %s\n",
                  struktura.st_size + 16, ptime());
          send(sock, buf2, strlen(buf2), 0);
          send(sock,
               "Connection: close\nAccept-Ranges: bytes\n\n<!DOCTYPE html>\n\n",
               strlen("Connection: close\nAccept-Ranges: bytes\n\n<!DOCTYPE "
                      "html>\n\n"),
               0);
          fp = fopen("index.html", "r");
          if (fp) {
            while (!feof(fp)) {
              buf2[0] = 0;
              fgets(buf2, 2048, fp);
              if (buf2[0]) {
                send(sock, buf2, strlen(buf2), 0);
              }
            }
          }
          send(sock, "\n", 1, 0);
        }
        close(sock);
        if (0) {
          printf("st_dev=%li\n", struktura.st_dev);
          printf("st_ino=%li\n", struktura.st_ino);
          printf("st_mode=%i\n", struktura.st_mode);
          printf("st_nlink=%li\n", struktura.st_nlink);
          printf("st_uid=%i\n", struktura.st_uid);
          printf("st_gid=%i\n", struktura.st_gid);
          printf("st_rdev=%li\n", struktura.st_rdev);
          printf("st_size=%li\n", struktura.st_size);
          printf("st_blksize=%li\n", struktura.st_blksize);
          printf("st_blocks=%li\n", struktura.st_blocks);
        }
      } else if (!strcmp(buf, "QUIT\r\n")) {
        printf("Quit\n");
        close(sock);
        exit(0);
      } else {
        send(sock, "Unknown command\r\n", strlen("Unknown command\r\n"), 0);
        printf("%s Unknown command '%s'\n", ptime(), buf);
        for (i = 0; i < strlen(buf); i++)
          printf("%02X ", buf[i]);
        printf("\n");
        close(sock);
      }
    }
    close(sock);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10f0 <ptime@plt>
mov    %rax,%rsi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    12b6 <main+0x66>
lea    0xd75(%rip),%rdi
call   1130 <perror@plt>
mov    $0x1,%edi
call   1160 <exit@plt>
mov    0x2d2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x8ae,%edi
call   1050 <htons@plt>
mov    %eax,-0x14(%rbp)
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
call   1080 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0xc,%edx
call   1110 <bind@plt>
cmp    $0x0,%rax
jge    1311 <main+0xc1>
lea    0xd21(%rip),%rdi
call   1130 <perror@plt>
mov    $0x2,%edi
call   1160 <exit@plt>
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1100 <listen@plt>
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1140 <accept@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1350 <main+0x100>
lea    0xcf2(%rip),%rdi
call   1130 <perror@plt>
mov    $0x3,%edi
call   1160 <exit@plt>
jmp    1355 <main+0x105>
movl   $0x0,-0x828(%rbp)
cmpl   $0x800,-0x828(%rbp)
jge    1392 <main+0x142>
movslq -0x828(%rbp),%rax
movb   $0x0,-0x820(%rbp,%rax,1)
mov    -0x828(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x828(%rbp)
jmp    135f <main+0x10f>
mov    -0x8(%rbp),%edi
lea    -0x820(%rbp),%rsi
mov    $0x800,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x824(%rbp)
cmpl   $0x0,-0x824(%rbp)
jg     13c0 <main+0x170>
jmp    1792 <main+0x542>
mov    $0x0,%al
call   10f0 <ptime@plt>
mov    %rax,%rsi
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x820(%rbp),%rdi
lea    0xc5c(%rip),%rsi
mov    $0x4,%edx
call   10a0 <memcmp@plt>
cmp    $0x0,%eax
jne    168c <main+0x43c>
lea    0xc47(%rip),%rdi
lea    -0x858(%rbp),%rsi
call   10e0 <stat@plt>
cmp    $0x0,%rax
je     1446 <main+0x1f6>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1064(%rbp)
lea    0xc2c(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x1064(%rbp),%edi
mov    %eax,%edx
lea    0xc18(%rip),%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
jmp    167f <main+0x42f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10ac(%rbp)
lea    0xd1b(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x10ac(%rbp),%edi
mov    %eax,%edx
lea    0xd07(%rip),%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
lea    -0x1060(%rbp),%rax
mov    %rax,-0x10a8(%rbp)
mov    $0x0,%al
call   10f0 <ptime@plt>
mov    -0x10a8(%rbp),%rdi
mov    %rax,%rdx
lea    0xd04(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x109c(%rbp)
lea    -0x1060(%rbp),%rax
mov    %rax,-0x1098(%rbp)
lea    -0x1060(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x109c(%rbp),%edi
mov    -0x1098(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x108c(%rbp)
lea    0xcbe(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x108c(%rbp),%edi
mov    %eax,%edx
lea    0xcaa(%rip),%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
lea    -0x1060(%rbp),%rax
mov    %rax,-0x1088(%rbp)
mov    -0x840(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x1080(%rbp)
mov    $0x0,%al
call   10f0 <ptime@plt>
mov    -0x1088(%rbp),%rdi
mov    -0x1080(%rbp),%rdx
mov    %rax,%rcx
lea    0xc7d(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1074(%rbp)
lea    -0x1060(%rbp),%rax
mov    %rax,-0x1070(%rbp)
lea    -0x1060(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1074(%rbp),%edi
mov    -0x1070(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1068(%rbp)
lea    0xc54(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x1068(%rbp),%edi
mov    %eax,%edx
lea    0xc40(%rip),%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
lea    0xa94(%rip),%rdi
lea    0xc65(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x860(%rbp)
cmpq   $0x0,-0x860(%rbp)
je     1669 <main+0x419>
jmp    15d9 <main+0x389>
mov    -0x860(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    15fa <main+0x3aa>
jmp    1664 <main+0x414>
movb   $0x0,-0x1060(%rbp)
lea    -0x1060(%rbp),%rdi
mov    -0x860(%rbp),%rdx
mov    $0x800,%esi
call   10b0 <fgets@plt>
cmpb   $0x0,-0x1060(%rbp)
je     165f <main+0x40f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10bc(%rbp)
lea    -0x1060(%rbp),%rax
mov    %rax,-0x10b8(%rbp)
lea    -0x1060(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10bc(%rbp),%edi
mov    -0x10b8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
jmp    15d9 <main+0x389>
jmp    1669 <main+0x419>
mov    -0x8(%rbp),%edi
lea    0xbaa(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
jmp    178d <main+0x53d>
lea    -0x820(%rbp),%rdi
lea    0xb87(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%eax
jne    16c5 <main+0x475>
lea    0xb79(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
xor    %edi,%edi
call   1160 <exit@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10c0(%rbp)
lea    0xb59(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x10c0(%rbp),%edi
mov    %eax,%edx
lea    0xb45(%rip),%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
mov    $0x0,%al
call   10f0 <ptime@plt>
mov    %rax,%rsi
lea    -0x820(%rbp),%rdx
lea    0xb38(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x828(%rbp)
mov    -0x828(%rbp),%eax
mov    %eax,-0x10c4(%rbp)
lea    -0x820(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10c4(%rbp),%eax
cmp    %ecx,%eax
jge    1772 <main+0x522>
movslq -0x828(%rbp),%rax
movsbl -0x820(%rbp,%rax,1),%esi
ff
lea    0xb02(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x828(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x828(%rbp)
jmp    1719 <main+0x4c9>
lea    0xaa4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
jmp    178d <main+0x53d>
jmp    1355 <main+0x105>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
jmp    131e <main+0xce>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1058,%rsp
xor    %eax,%eax
call   1110 <ptime@plt>
lea    0xd71(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2d48(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d27(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1190 <socket@plt>
test   %eax,%eax
jns    12cc <main+0x5c>
lea    0xd5f(%rip),%rdi
call   1150 <perror@plt>
mov    $0x1,%edi
call   1180 <exit@plt>
mov    %eax,%ebp
mov    (%rbx),%eax
mov    %eax,0x18(%rsp)
mov    $0x8ae,%edi
call   1070 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %eax,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0xc,%edx
call   1130 <bind@plt>
test   %rax,%rax
jns    1320 <main+0xb0>
lea    0xd12(%rip),%rdi
call   1150 <perror@plt>
mov    $0x2,%edi
call   1180 <exit@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1120 <listen@plt>
mov    %ebp,0xc(%rsp)
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1160 <accept@plt>
test   %eax,%eax
jns    1355 <main+0xe5>
lea    0xced(%rip),%rdi
call   1150 <perror@plt>
mov    $0x3,%edi
call   1180 <exit@plt>
mov    %eax,%r13d
lea    0x850(%rsp),%rbx
lea    0xcd3(%rip),%r12
lea    0xcd9(%rip),%r14
lea    0xede(%rip),%r15
jmp    1399 <main+0x129>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xcb6(%rip),%r14
mov    %r13d,%edi
call   10c0 <close@plt>
mov    $0x800,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <memset@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x800,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jle    1623 <main+0x3b3>
xor    %eax,%eax
call   1110 <ptime@plt>
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
lea    0xc62(%rip),%rsi
mov    $0x4,%edx
call   10d0 <memcmp@plt>
test   %eax,%eax
je     1490 <main+0x220>
mov    $0x7,%edx
mov    %rbx,%rdi
lea    0xe20(%rip),%rsi
call   10d0 <memcmp@plt>
test   %eax,%eax
je     1648 <main+0x3d8>
lea    0xe13(%rip),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
xor    %eax,%eax
call   1110 <ptime@plt>
lea    0xe00(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    1380 <main+0x110>
xor    %ebp,%ebp
nopl   0x0(%rax)
movsbl 0x850(%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1460 <main+0x1f0>
jmp    1380 <main+0x110>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
lea    0x20(%rsp),%rsi
call   1100 <stat@plt>
test   %rax,%rax
je     14c5 <main+0x255>
lea    0xba9(%rip),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
jmp    1391 <main+0x121>
lea    0xca5(%rip),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
xor    %eax,%eax
call   1110 <ptime@plt>
lea    0x50(%rsp),%rdi
lea    0xca5(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1170 <sprintf@plt>
lea    0x50(%rsp),%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
lea    0x50(%rsp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
lea    0xc83(%rip),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
mov    0x38(%rsp),%rbp
add    $0x10,%rbp
xor    %eax,%eax
call   1110 <ptime@plt>
lea    0x50(%rsp),%rdi
lea    0xc69(%rip),%rsi
mov    %rbp,%rdx
lea    0xae8(%rip),%r14
mov    %rax,%rcx
xor    %eax,%eax
call   1170 <sprintf@plt>
lea    0x50(%rsp),%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
lea    0x50(%rsp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
lea    0xc5a(%rip),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
lea    0x50(%rsp),%rbp
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
mov    %r14,%rdi
lea    0xc6e(%rip),%rsi
call   1140 <fopen@plt>
test   %rax,%rax
je     1601 <main+0x391>
mov    %rax,%r12
xchg   %ax,%ax
mov    %r12,%rdi
call   10f0 <feof@plt>
test   %eax,%eax
jne    1601 <main+0x391>
movb   $0x0,0x50(%rsp)
mov    %rbp,%rdi
mov    $0x800,%esi
mov    %r12,%rdx
call   10e0 <fgets@plt>
cmpb   $0x0,0x50(%rsp)
je     15c0 <main+0x350>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
jmp    15c0 <main+0x350>
mov    %r13d,%edi
lea    0xc12(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
lea    0xa1c(%rip),%r12
jmp    1391 <main+0x121>
mov    %r13d,%edi
call   10c0 <close@plt>
mov    0xc(%rsp),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1160 <accept@plt>
mov    %eax,%r13d
test   %eax,%eax
jns    1399 <main+0x129>
jmp    133f <main+0xcf>
lea    0xc0a(%rip),%rdi
call   1050 <puts@plt>
mov    %r13d,%edi
call   10c0 <close@plt>
xor    %edi,%edi
call   1180 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.stat = type { i32, i32, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [28 x i8] c"%s Test echoserver started\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@INADDR_ANY = global i32 0
@.str.2 = [16 x i8] c"echoserver bind\00"
@.str.3 = [7 x i8] c"accept\00"
@.str.4 = [8 x i8] c"%s GET\0A\00"
@.str.5 = [5 x i8] c"GET \00"
@.str.6 = [11 x i8] c"index.html\00"
@.str.7 = [287 x i8] c"HTTP/1.1 404 Not Found`\0AServer: proolhttpd\0ADate: Sat, 27 Feb 2016 21:45:06 GMT\0AContent-Type: text/html\0AContent-Length: 144\0AConnection: close\0A\0A<html>\0A<head><title>404 Not Found</title></head>\0A<body>\0A<center><h1>404 Not Found</h1></center>\0A<hr><center>proolhttpd</center>\0A</body>\0A</html>\0A\00"
@.str.8 = [42 x i8] c"HTTP/1.1 200 OK\0AServer: proolhttpd/0.0.2\0A\00"
@.str.9 = [10 x i8] c"Date: %s\0A\00"
@.str.10 = [25 x i8] c"Content-Type: text/html\0A\00"
@.str.11 = [39 x i8] c"Content-Length: %li\0ALast-Modified: %s\0A\00"
@.str.12 = [58 x i8] c"Connection: close\0AAccept-Ranges: bytes\0A\0A<!DOCTYPE html>\0A\0A\00"
@.str.13 = [2 x i8] c"r\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [7 x i8] c"QUIT\0D\0A\00"
@.str.16 = [6 x i8] c"Quit\0A\00"
@.str.17 = [18 x i8] c"Unknown command\0D\0A\00"
@.str.18 = [25 x i8] c"%s Unknown command '%s'\0A\00"
@.str.19 = [6 x i8] c"%02X \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca [2048 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.stat
%9 = alloca i32*
%10 = alloca [2048 x i8]
store i32 0, i32* %1
%11 = call i8* (...) @ptime()
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_STREAM
%15 = call i32 @socket(i32 %13, i32 %14, i32 0)
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %0
%19 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %0
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 2
store i32 %22, i32* %23
%24 = call i32 @htons(i32 2222)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
store i32 %24, i32* %25
%26 = load i32, i32* @INADDR_ANY
%27 = call i32 @htonl(i32 %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %28, i32 0, i32 0
store i32 %27, i32* %29
%30 = load i32, i32* %3
%31 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%32 = call i64 @bind(i32 %30, %struct.sockaddr* %31, i32 12)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %21
%35 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 @exit(i32 2)
unreachable
37: ; preds = %21
%38 = load i32, i32* %3
%39 = call i32 @listen(i32 %38, i32 1)
br label %40
40: ; preds = %37, %178
%41 = load i32, i32* %3
%42 = call i32 @accept(i32 %41, i32* null, i32* null)
store i32 %42, i32* %2
%43 = load i32, i32* %2
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %40
%46 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%47 = call i32 @exit(i32 3)
unreachable
48: ; preds = %40
br label %49
49: ; preds = %48, %177
store i32 0, i32* %7
br label %50
50: ; preds = %57, %49
%51 = load i32, i32* %7
%52 = icmp slt i32 %51, 2048
br i1 %52, label %53, label %60
53: ; preds = %50
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 %55
store i8 0, i8* %56
br label %57
57: ; preds = %53
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %50
60: ; preds = %50
%61 = load i32, i32* %2
%62 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%63 = call i32 @recv(i32 %61, i8* %62, i32 2048, i32 0)
store i32 %63, i32* %6
%64 = load i32, i32* %6
%65 = icmp sle i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %60
br label %178
67: ; preds = %60
%68 = call i8* (...) @ptime()
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %68)
%70 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%71 = call i32 @memcmp(i8* %70, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%72 = icmp ne i32 %71, 0
br i1 %72, label %141, label %73
73: ; preds = %67
%74 = call i64 @stat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %struct.stat* %8)
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %73
%77 = load i32, i32* %2
%78 = call i32 @strlen(i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.7, i64 0, i64 0))
%79 = call i32 @send(i32 %77, i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.7, i64 0, i64 0), i32 %78, i32 0)
br label %138
80: ; preds = %73
%81 = load i32, i32* %2
%82 = call i32 @strlen(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%83 = call i32 @send(i32 %81, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i32 %82, i32 0)
%84 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%85 = call i8* (...) @ptime()
%86 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %84, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* %85)
%87 = load i32, i32* %2
%88 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%89 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%90 = call i32 @strlen(i8* %89)
%91 = call i32 @send(i32 %87, i8* %88, i32 %90, i32 0)
%92 = load i32, i32* %2
%93 = call i32 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%94 = call i32 @send(i32 %92, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %93, i32 0)
%95 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%96 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 5
%97 = load i64, i64* %96
%98 = add nsw i64 %97, 16
%99 = inttoptr i64 %98 to i8*
%100 = call i8* (...) @ptime()
%101 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %95, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i8* %99, i8* %100)
%102 = load i32, i32* %2
%103 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%104 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%105 = call i32 @strlen(i8* %104)
%106 = call i32 @send(i32 %102, i8* %103, i32 %105, i32 0)
%107 = load i32, i32* %2
%108 = call i32 @strlen(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0))
%109 = call i32 @send(i32 %107, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0), i32 %108, i32 0)
%110 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32* %110, i32** %9
%111 = load i32*, i32** %9
%112 = icmp ne i32* %111, null
br i1 %112, label %113, label %135
113: ; preds = %80
br label %114
114: ; preds = %133, %113
%115 = load i32*, i32** %9
%116 = call i32 @feof(i32* %115)
%117 = icmp ne i32 %116, 0
%118 = xor i1 %117, true
br i1 %118, label %119, label %134
119: ; preds = %114
%120 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
store i8 0, i8* %120
%121 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%122 = load i32*, i32** %9
%123 = call i32 @fgets(i8* %121, i32 2048, i32* %122)
%124 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%125 = load i8, i8* %124
%126 = icmp ne i8 %125, 0
br i1 %126, label %127, label %133
127: ; preds = %119
%128 = load i32, i32* %2
%129 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%130 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%131 = call i32 @strlen(i8* %130)
%132 = call i32 @send(i32 %128, i8* %129, i32 %131, i32 0)
br label %133
133: ; preds = %127, %119
br label %114
134: ; preds = %114
br label %135
135: ; preds = %134, %80
%136 = load i32, i32* %2
%137 = call i32 @send(i32 %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i32 1, i32 0)
br label %138
138: ; preds = %135, %76
%139 = load i32, i32* %2
%140 = call i32 @close(i32 %139)
br label %177
141: ; preds = %67
%142 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%143 = call i32 @strcmp(i8* %142, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%144 = icmp ne i32 %143, 0
br i1 %144, label %150, label %145
145: ; preds = %141
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%147 = load i32, i32* %2
%148 = call i32 @close(i32 %147)
%149 = call i32 @exit(i32 0)
unreachable
150: ; preds = %141
%151 = load i32, i32* %2
%152 = call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%153 = call i32 @send(i32 %151, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i32 %152, i32 0)
%154 = call i8* (...) @ptime()
%155 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8* %154, i8* %155)
store i32 0, i32* %7
br label %157
157: ; preds = %169, %150
%158 = load i32, i32* %7
%159 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%160 = call i32 @strlen(i8* %159)
%161 = icmp slt i32 %158, %160
br i1 %161, label %162, label %172
162: ; preds = %157
%163 = load i32, i32* %7
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 %164
%166 = load i8, i8* %165
%167 = sext i8 %166 to i32
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i32 %167)
br label %169
169: ; preds = %162
%170 = load i32, i32* %7
%171 = add nsw i32 %170, 1
store i32 %171, i32* %7
br label %157
172: ; preds = %157
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%174 = load i32, i32* %2
%175 = call i32 @close(i32 %174)
br label %176
176: ; preds = %172
br label %177
177: ; preds = %176, %138
br label %49
178: ; preds = %66
%179 = load i32, i32* %2
%180 = call i32 @close(i32 %179)
br label %40
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.stat = type { i32, i32, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [28 x i8] c"%s Test echoserver started\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@INADDR_ANY = global i32 0
@.str.2 = [16 x i8] c"echoserver bind\00"
@.str.3 = [7 x i8] c"accept\00"
@.str.4 = [8 x i8] c"%s GET\0A\00"
@.str.5 = [5 x i8] c"GET \00"
@.str.6 = [11 x i8] c"index.html\00"
@.str.7 = [287 x i8] c"HTTP/1.1 404 Not Found`\0AServer: proolhttpd\0ADate: Sat, 27 Feb 2016 21:45:06 GMT\0AContent-Type: text/html\0AContent-Length: 144\0AConnection: close\0A\0A<html>\0A<head><title>404 Not Found</title></head>\0A<body>\0A<center><h1>404 Not Found</h1></center>\0A<hr><center>proolhttpd</center>\0A</body>\0A</html>\0A\00"
@.str.8 = [42 x i8] c"HTTP/1.1 200 OK\0AServer: proolhttpd/0.0.2\0A\00"
@.str.9 = [10 x i8] c"Date: %s\0A\00"
@.str.10 = [25 x i8] c"Content-Type: text/html\0A\00"
@.str.11 = [39 x i8] c"Content-Length: %li\0ALast-Modified: %s\0A\00"
@.str.12 = [58 x i8] c"Connection: close\0AAccept-Ranges: bytes\0A\0A<!DOCTYPE html>\0A\0A\00"
@.str.13 = [2 x i8] c"r\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [7 x i8] c"QUIT\0D\0A\00"
@.str.17 = [18 x i8] c"Unknown command\0D\0A\00"
@.str.18 = [25 x i8] c"%s Unknown command '%s'\0A\00"
@.str.19 = [6 x i8] c"%02X \00"
@str = [5 x i8] c"Quit\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = alloca %struct.stat
%5 = alloca [2048 x i8]
%6 = bitcast %struct.sockaddr_in* %1 to i8*
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%8 = bitcast %struct.stat* %4 to i8*
%9 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%10 = tail call i8* (...) @ptime()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @AF_INET
%13 = load i32, i32* @SOCK_STREAM
%14 = tail call i32 @socket(i32 %12, i32 %13, i32 0)
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %0
%20 = load i32, i32* @AF_INET
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %20, i32* %21
%22 = tail call i32 @htons(i32 2222)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1
store i32 %22, i32* %23
%24 = load i32, i32* @INADDR_ANY
%25 = tail call i32 @htonl(i32 %24)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0, i32 0
store i32 %25, i32* %26
%27 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%28 = call i64 @bind(i32 %14, %struct.sockaddr* %27, i32 12)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %19
%31 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @exit(i32 2)
unreachable
33: ; preds = %19
%34 = call i32 @listen(i32 %14, i32 1)
%35 = call i32 @accept(i32 %14, i32* null, i32* null)
%36 = icmp slt i32 %35, 0
br i1 %36, label %43, label %37
37: ; preds = %33
%38 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 5
br label %39
39: ; preds = %37, %122
%40 = phi i32 [ %35, %37 ], [ %124, %122 ]
%41 = call i32 @recv(i32 %40, i8* %7, i32 2048, i32 0)
%42 = icmp slt i32 %41, 1
br i1 %42, label %122, label %46
43: ; preds = %122, %33
%44 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 @exit(i32 3)
unreachable
46: ; preds = %39, %118
%47 = call i8* (...) @ptime()
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %47)
%49 = call i32 @memcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %92
51: ; preds = %46
%52 = call i64 @stat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %struct.stat* %4)
%53 = icmp eq i64 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %51
%55 = call i32 @strlen(i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.7, i64 0, i64 0))
%56 = call i32 @send(i32 %40, i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.7, i64 0, i64 0), i32 %55, i32 0)
br label %118
57: ; preds = %51
%58 = call i32 @strlen(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%59 = call i32 @send(i32 %40, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i32 %58, i32 0)
%60 = call i8* (...) @ptime()
%61 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* %60)
%62 = call i32 @strlen(i8* %9)
%63 = call i32 @send(i32 %40, i8* %9, i32 %62, i32 0)
%64 = call i32 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%65 = call i32 @send(i32 %40, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %64, i32 0)
%66 = load i64, i64* %38
%67 = add nsw i64 %66, 16
%68 = inttoptr i64 %67 to i8*
%69 = call i8* (...) @ptime()
%70 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i8* %68, i8* %69)
%71 = call i32 @strlen(i8* %9)
%72 = call i32 @send(i32 %40, i8* %9, i32 %71, i32 0)
%73 = call i32 @strlen(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0))
%74 = call i32 @send(i32 %40, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0), i32 %73, i32 0)
%75 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %90, label %77
77: ; preds = %57
%78 = call i32 @feof(i32* %75)
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %90
80: ; preds = %77, %87
store i8 0, i8* %9
%81 = call i32 @fgets(i8* %9, i32 2048, i32* %75)
%82 = load i8, i8* %9
%83 = icmp eq i8 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %80
%85 = call i32 @strlen(i8* %9)
%86 = call i32 @send(i32 %40, i8* %9, i32 %85, i32 0)
br label %87
87: ; preds = %84, %80
%88 = call i32 @feof(i32* %75)
%89 = icmp eq i32 %88, 0
br i1 %89, label %80, label %90
90: ; preds = %87, %77, %57
%91 = call i32 @send(i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i32 1, i32 0)
br label %118
92: ; preds = %46
%93 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i64 7)
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %99
95: ; preds = %92
%96 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%97 = call i32 @close(i32 %40)
%98 = call i32 @exit(i32 0)
unreachable
99: ; preds = %92
%100 = call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%101 = call i32 @send(i32 %40, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i32 %100, i32 0)
%102 = call i8* (...) @ptime()
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8* %102, i8* %7)
%104 = call i32 @strlen(i8* %7)
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %116
106: ; preds = %99, %106
%107 = phi i64 [ %112, %106 ], [ 0, %99 ]
%108 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 %107
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i32 %110)
%112 = add nuw nsw i64 %107, 1
%113 = call i32 @strlen(i8* %7)
%114 = sext i32 %113 to i64
%115 = icmp slt i64 %112, %114
br i1 %115, label %106, label %116
116: ; preds = %106, %99
%117 = call i32 @putchar(i32 10)
br label %118
118: ; preds = %54, %90, %116
%119 = call i32 @close(i32 %40)
%120 = call i32 @recv(i32 %40, i8* %7, i32 2048, i32 0)
%121 = icmp slt i32 %120, 1
br i1 %121, label %122, label %46
122: ; preds = %118, %39
%123 = call i32 @close(i32 %40)
%124 = call i32 @accept(i32 %14, i32* null, i32* null)
%125 = icmp slt i32 %124, 0
br i1 %125, label %43, label %39
}