#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 */
typedef int /*<<< orphan*/ yes;
typedef int uint32_t;
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int int32_t;
typedef scalar_t__ clock_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
double CLOCKS_PER_SEC;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ MSG_DONTWAIT;
int /*<<< orphan*/ MSG_NOSIGNAL;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ _SC_PAGESIZE;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ bind(int, struct sockaddr *, int);
scalar_t__ clock();
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
void *mmap(int /*<<< orphan*/ *, int /*<<< orphan*/, int, int /*<<< orphan*/,
           int, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              void *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd, j, sock_server, sock_client, size, yes = 1, nsmpl, navg, rx;
  void *cfg, *dat;
  char *name = "/dev/mem";
  uint32_t naverages = 0, nsamples = 0, timing = 0;
  struct sockaddr_in addr;
  uint32_t command, value, tmp;
  uint32_t buffer[8192];
  clock_t time_begin;
  double time_spent;
  int measuring = 0;
  if ((fd = open(name, O_RDWR)) < 0) {
    perror("open");
    return EXIT_FAILURE;
  }
  dat = mmap(NULL, sysconf(_SC_PAGESIZE), PROT_READ | PROT_WRITE, MAP_SHARED,
             fd, 0x40000000);
  cfg = mmap(NULL, sysconf(_SC_PAGESIZE), PROT_READ | PROT_WRITE, MAP_SHARED,
             fd, 0x42000000);
  if ((sock_server = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("socket");
    return EXIT_FAILURE;
  }
  setsockopt(sock_server, SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
  memset(&addr, 0, sizeof(addr));
  addr.sin_family = AF_INET;
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addr.sin_port = htons(1001);
  if (bind(sock_server, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("bind");
    return EXIT_FAILURE;
  }
  listen(sock_server, 1024);
  printf("Listening on port 1001 ...\n");
  while (1) {
    if ((sock_client = accept(sock_server, NULL, NULL)) < 0) {
      perror("accept");
      return EXIT_FAILURE;
    }
    while (1) {
      rx = recv(sock_client, (char *)&command, 4, MSG_DONTWAIT);
      if (rx == 0) {
        break;
        measuring = 0;
      }
      if (rx > 0) {
        value = command & 0xfffffff;
        switch (command >> 28) {
        case 1:
          timing = command & 0xff;
          break;
        case 2:
          if ((command & 0xff) < 14)
            nsamples = (command & 0xff);
          else
            nsamples = 13;
          break;
        case 3:
          naverages = command & 0xff;
          break;
        case 0:
          *((int32_t *)(cfg + 0)) =
              (1) + (timing << 8) + (nsamples << 16) + (naverages << 24);
          time_begin = clock();
          *((int32_t *)(cfg + 0)) ^= 1;
          measuring = 1;
          break;
        }
      }
      if (measuring == 1 && (*((uint32_t *)(cfg + 8)) & 1) != 0) {
        time_spent = ((double)(clock() - time_begin)) / CLOCKS_PER_SEC;
        nsmpl = (1 << nsamples);
        for (j = 0; j < nsmpl; ++j)
          buffer[j] = (*((uint32_t *)(dat + 4 * j)));
        send(sock_client, buffer, 4 * nsmpl, MSG_NOSIGNAL);
        printf("%d samples measured in %f s\n", nsmpl, time_spent);
        measuring = 0;
        break;
      }
    }
    close(sock_client);
  }
  close(sock_server);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x28(%rbp)
lea    0xdd9(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x8094(%rbp)
mov    -0x50(%rbp),%rdi
mov    0x2d73(%rip),%rax
mov    (%rax),%esi
call   10f0 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1295 <main+0x85>
lea    0xd9a(%rip),%rdi
call   1100 <perror@plt>
mov    0x2d05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1634 <main+0x424>
mov    0x2d14(%rip),%rax
mov    (%rax),%edi
call   1110 <sysconf@plt>
mov    %eax,%esi
mov    0x2d4c(%rip),%rax
mov    (%rax),%edx
mov    0x2cd3(%rip),%rax
or     (%rax),%edx
mov    0x2d2a(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x40000000,%r9d
call   1060 <mmap@plt>
mov    %rax,-0x48(%rbp)
mov    0x2cd2(%rip),%rax
mov    (%rax),%edi
call   1110 <sysconf@plt>
mov    %eax,%esi
mov    0x2d0a(%rip),%rax
mov    (%rax),%edx
mov    0x2c91(%rip),%rax
or     (%rax),%edx
mov    0x2ce8(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x42000000,%r9d
call   1060 <mmap@plt>
mov    %rax,-0x40(%rbp)
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
mov    0x2c77(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    135b <main+0x14b>
lea    0xcd9(%rip),%rdi
call   1100 <perror@plt>
mov    0x2c3f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1634 <main+0x424>
mov    -0x1c(%rbp),%edi
mov    0x2c6b(%rip),%rax
mov    (%rax),%esi
mov    0x2c0a(%rip),%rax
mov    (%rax),%edx
lea    -0x28(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
lea    -0x68(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10b0 <memset@plt>
mov    0x2c32(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %eax,-0x64(%rbp)
mov    $0x3e9,%edi
call   1070 <htons@plt>
mov    %eax,-0x68(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x68(%rbp),%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
cmp    $0x0,%rax
jge    13f1 <main+0x1e1>
lea    0xc4a(%rip),%rdi
call   1100 <perror@plt>
mov    0x2ba9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1634 <main+0x424>
mov    -0x1c(%rbp),%edi
mov    $0x400,%esi
call   10d0 <listen@plt>
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1120 <accept@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    1444 <main+0x234>
lea    0xc18(%rip),%rdi
call   1100 <perror@plt>
mov    0x2b56(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1634 <main+0x424>
jmp    1449 <main+0x239>
mov    -0x20(%rbp),%edi
lea    -0x6c(%rbp),%rsi
mov    0x2b41(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%edx
call   1030 <recv@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    1475 <main+0x265>
jmp    1627 <main+0x417>
cmpl   $0x0,-0x34(%rbp)
jle    154d <main+0x33d>
mov    -0x6c(%rbp),%eax
and    $0xfffffff,%eax
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%eax
sar    $0x1c,%eax
mov    %eax,%ecx
mov    %rcx,-0x80a0(%rbp)
sub    $0x3,%eax
ja     1548 <main+0x338>
mov    -0x80a0(%rbp),%rax
lea    0xb50(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x6c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x5c(%rbp)
jmp    1548 <main+0x338>
mov    -0x6c(%rbp),%eax
and    $0xff,%eax
cmp    $0xe,%eax
jge    14ea <main+0x2da>
mov    -0x6c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x58(%rbp)
jmp    14f1 <main+0x2e1>
movl   $0xd,-0x58(%rbp)
jmp    1548 <main+0x338>
mov    -0x6c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x54(%rbp)
jmp    1548 <main+0x338>
mov    -0x5c(%rbp),%ecx
shl    $0x8,%ecx
add    $0x1,%ecx
mov    -0x58(%rbp),%eax
shl    $0x10,%eax
add    %eax,%ecx
mov    -0x54(%rbp),%eax
shl    $0x18,%eax
add    %eax,%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,-0x8088(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%ecx
xor    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x8094(%rbp)
jmp    154d <main+0x33d>
cmpl   $0x1,-0x8094(%rbp)
jne    1622 <main+0x412>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1622 <main+0x412>
mov    $0x0,%al
call   1050 <clock@plt>
sub    -0x8088(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2a39(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x8090(%rbp)
ff
mov    -0x58(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15dc <main+0x3cc>
mov    -0x48(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0x8080(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    15a7 <main+0x397>
mov    -0x20(%rbp),%edi
lea    -0x8080(%rbp),%rsi
mov    -0x2c(%rbp),%edx
shl    $0x2,%edx
mov    0x298d(%rip),%rax
mov    (%rax),%ecx
call   1080 <send@plt>
mov    -0x2c(%rbp),%esi
movsd  -0x8090(%rbp),%xmm0
ff
lea    0xa41(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movl   $0x0,-0x8094(%rbp)
jmp    1627 <main+0x417>
jmp    1449 <main+0x239>
mov    -0x20(%rbp),%edi
call   10c0 <close@plt>
jmp    140c <main+0x1fc>
mov    -0x4(%rbp),%eax
add    $0x80a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8048,%rsp
movl   $0x1,0x14(%rsp)
mov    0x2d98(%rip),%rax
mov    (%rax),%esi
lea    0xdc7(%rip),%rdi
call   1100 <open@plt>
test   %eax,%eax
jns    125e <main+0x3e>
lea    0xdc0(%rip),%rdi
jmp    1699 <main+0x479>
mov    %eax,%ebp
mov    0x2d49(%rip),%r14
mov    (%r14),%edi
call   1120 <sysconf@plt>
mov    0x2d82(%rip),%r15
mov    0x2d0b(%rip),%r12
mov    (%r12),%edx
or     (%r15),%edx
mov    0x2d5d(%rip),%r13
mov    0x0(%r13),%ecx
xor    %edi,%edi
mov    %eax,%esi
mov    %ebp,%r8d
mov    $0x40000000,%r9d
call   1070 <mmap@plt>
mov    %rax,%rbx
mov    (%r14),%edi
call   1120 <sysconf@plt>
mov    (%r12),%edx
or     (%r15),%edx
mov    0x0(%r13),%ecx
xor    %edi,%edi
mov    %eax,%esi
mov    %ebp,%r8d
mov    $0x42000000,%r9d
call   1070 <mmap@plt>
mov    %rax,%r14
mov    0x2cf5(%rip),%r12
mov    (%r12),%edi
mov    0x2cc2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
test   %eax,%eax
jns    12f7 <main+0xd7>
lea    0xd2c(%rip),%rdi
jmp    1699 <main+0x479>
mov    %eax,%ebp
mov    0x2cd0(%rip),%rax
mov    (%rax),%esi
mov    0x2c6f(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
lea    0x18(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10c0 <memset@plt>
mov    (%r12),%eax
mov    %eax,0x20(%rsp)
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
call   10b0 <htonl@plt>
mov    %eax,0x1c(%rsp)
mov    $0x3e9,%edi
call   1080 <htons@plt>
mov    %eax,0x18(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   10f0 <bind@plt>
test   %rax,%rax
jns    1379 <main+0x159>
lea    0xcb1(%rip),%rdi
jmp    1699 <main+0x479>
mov    %ebp,%edi
mov    $0x400,%esi
call   10e0 <listen@plt>
lea    0xcc2(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,0xc(%rsp)
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1130 <accept@plt>
test   %eax,%eax
js     1692 <main+0x472>
mov    %eax,%ebp
lea    0x10(%rbx),%rax
mov    %rax,0x28(%rsp)
lea    0x10(%rsp),%r12
xor    %r15d,%r15d
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
xor    %r13d,%r13d
jmp    140b <main+0x1eb>
mov    0x4(%rsp),%eax
shl    $0x8,%eax
mov    %r13d,%ecx
shl    $0x10,%ecx
add    %eax,%ecx
mov    0x8(%rsp),%eax
shl    $0x18,%eax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,(%r14)
xor    %eax,%eax
call   1060 <clock@plt>
mov    %rax,0x38(%rsp)
xorb   $0x1,(%r14)
mov    $0x1,%r15d
testb  $0x1,0x8(%r14)
jne    148a <main+0x26a>
mov    0x2b86(%rip),%rax
mov    (%rax),%ecx
mov    %ebp,%edi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <recv@plt>
test   %eax,%eax
je     1674 <main+0x454>
test   %eax,%eax
jle    1470 <main+0x250>
mov    0x10(%rsp),%eax
mov    %eax,%ecx
sar    $0x1c,%ecx
cmp    $0x3,%ecx
ja     1470 <main+0x250>
lea    0xbbc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
movzbl %al,%eax
mov    %eax,0x4(%rsp)
cmp    $0x1,%r15d
jne    140b <main+0x1eb>
jmp    13fe <main+0x1de>
movzbl %al,%r13d
cmp    $0xd,%r13d
mov    $0xd,%eax
cmovae %eax,%r13d
nopl   (%rax)
cmp    $0x1,%r15d
jne    140b <main+0x1eb>
jmp    13fe <main+0x1de>
movzbl %al,%eax
mov    %eax,0x8(%rsp)
cmp    $0x1,%r15d
jne    140b <main+0x1eb>
jmp    13fe <main+0x1de>
xor    %eax,%eax
call   1060 <clock@plt>
sub    0x38(%rsp),%rax
mov    $0x1,%r15d
mov    %r13d,%ecx
shl    %cl,%r15d
cmp    $0x1f,%r13d
je     1624 <main+0x404>
cmp    $0x2,%r15d
mov    $0x1,%r9d
cmovge %r15d,%r9d
cmp    $0x8,%r9d
jb     14db <main+0x2bb>
lea    (%rbx,%r9,4),%rcx
lea    0x40(%rsp),%rdx
cmp    %rdx,%rcx
jbe    153d <main+0x31d>
lea    (%rsp,%r9,4),%rcx
add    $0x40,%rcx
cmp    %rcx,%rbx
jae    153d <main+0x31d>
xor    %edx,%edx
mov    %rdx,%rsi
not    %rsi
add    %r9,%rsi
mov    %r9,%rdi
and    $0x3,%rdi
je     1501 <main+0x2e1>
nop
mov    (%rbx,%rdx,4),%ecx
mov    %ecx,0x40(%rsp,%rdx,4)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rdi
jne    14f0 <main+0x2d0>
cmp    $0x3,%rsi
jb     1624 <main+0x404>
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rdx,4),%ecx
mov    %ecx,0x40(%rsp,%rdx,4)
mov    0x4(%rbx,%rdx,4),%ecx
mov    %ecx,0x44(%rsp,%rdx,4)
mov    0x8(%rbx,%rdx,4),%ecx
mov    %ecx,0x48(%rsp,%rdx,4)
mov    0xc(%rbx,%rdx,4),%ecx
mov    %ecx,0x4c(%rsp,%rdx,4)
add    $0x4,%rdx
cmp    %rdx,%r9
jne    1510 <main+0x2f0>
jmp    1624 <main+0x404>
mov    %r9d,%edx
and    $0x7ffffff8,%edx
lea    -0x8(%rdx),%rcx
mov    %rcx,%rdi
shr    $0x3,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x3,%r8d
cmp    $0x18,%rcx
jae    1566 <main+0x346>
xor    %esi,%esi
jmp    15d5 <main+0x3b5>
and    $0xfffffffffffffffc,%rdi
xor    %esi,%esi
nopl   0x0(%rax)
movups (%rbx,%rsi,4),%xmm0
movups 0x10(%rbx,%rsi,4),%xmm1
movaps %xmm0,0x40(%rsp,%rsi,4)
movaps %xmm1,0x50(%rsp,%rsi,4)
movups 0x20(%rbx,%rsi,4),%xmm0
movups 0x30(%rbx,%rsi,4),%xmm1
movaps %xmm0,0x60(%rsp,%rsi,4)
movaps %xmm1,0x70(%rsp,%rsi,4)
movups 0x40(%rbx,%rsi,4),%xmm0
movups 0x50(%rbx,%rsi,4),%xmm1
movaps %xmm0,0x80(%rsp,%rsi,4)
movaps %xmm1,0x90(%rsp,%rsi,4)
movups 0x60(%rbx,%rsi,4),%xmm0
movups 0x70(%rbx,%rsi,4),%xmm1
movaps %xmm0,0xa0(%rsp,%rsi,4)
movaps %xmm1,0xb0(%rsp,%rsi,4)
add    $0x20,%rsi
add    $0xfffffffffffffffc,%rdi
jne    1570 <main+0x350>
test   %r8,%r8
je     161b <main+0x3fb>
lea    0x50(%rsp),%rcx
lea    (%rcx,%rsi,4),%rdi
mov    0x28(%rsp),%rcx
lea    (%rcx,%rsi,4),%rsi
shl    $0x5,%r8
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups -0x10(%rsi,%rcx,1),%xmm0
movups (%rsi,%rcx,1),%xmm1
movaps %xmm0,-0x10(%rdi,%rcx,1)
movaps %xmm1,(%rdi,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r8
jne    1600 <main+0x3e0>
cmp    %r9,%rdx
jne    14dd <main+0x2bd>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x298d(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0x0(,%r15,4),%edx
mov    0x2934(%rip),%rax
mov    (%rax),%ecx
mov    %ebp,%edi
lea    0x40(%rsp),%rsi
call   1090 <send@plt>
lea    0x9d0(%rip),%rdi
mov    %r15d,%esi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   10a0 <printf@plt>
xor    %r15d,%r15d
mov    %ebp,%edi
call   10d0 <close@plt>
mov    0xc(%rsp),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1130 <accept@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    140b <main+0x1eb>
lea    0x991(%rip),%rdi
call   1110 <perror@plt>
mov    0x28eb(%rip),%rax
mov    (%rax),%eax
add    $0x8048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@.str.1 = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
@_SC_PAGESIZE = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@INADDR_ANY = global i32 0
@.str.3 = [5 x i8] c"bind\00"
@.str.4 = [28 x i8] c"Listening on port 1001 ...\0A\00"
@.str.5 = [7 x i8] c"accept\00"
@MSG_DONTWAIT = global i32 0
@CLOCKS_PER_SEC = global double 0.000000e+00
@MSG_NOSIGNAL = global i32 0
@.str.6 = [29 x i8] c"%d samples measured in %f s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca %struct.sockaddr_in
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca [8192 x i32]
%26 = alloca i64
%27 = alloca double
%28 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %11
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %17
store i32 0, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %28
%29 = load i8*, i8** %17
%30 = load i32, i32* @O_RDWR
%31 = call i32 @open(i8* %29, i32 %30)
store i32 %31, i32* %6
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %2
%34 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%35 = load i32, i32* @EXIT_FAILURE
store i32 %35, i32* %3
br label %196
36: ; preds = %2
%37 = load i32, i32* @_SC_PAGESIZE
%38 = call i32 @sysconf(i32 %37)
%39 = load i32, i32* @PROT_READ
%40 = load i32, i32* @PROT_WRITE
%41 = or i32 %39, %40
%42 = load i32, i32* @MAP_SHARED
%43 = load i32, i32* %6
%44 = call i8* @mmap(i32* null, i32 %38, i32 %41, i32 %42, i32 %43, i32 1073741824)
store i8* %44, i8** %16
%45 = load i32, i32* @_SC_PAGESIZE
%46 = call i32 @sysconf(i32 %45)
%47 = load i32, i32* @PROT_READ
%48 = load i32, i32* @PROT_WRITE
%49 = or i32 %47, %48
%50 = load i32, i32* @MAP_SHARED
%51 = load i32, i32* %6
%52 = call i8* @mmap(i32* null, i32 %46, i32 %49, i32 %50, i32 %51, i32 1107296256)
store i8* %52, i8** %15
%53 = load i32, i32* @AF_INET
%54 = load i32, i32* @SOCK_STREAM
%55 = call i32 @socket(i32 %53, i32 %54, i32 0)
store i32 %55, i32* %8
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %36
%58 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
store i32 %59, i32* %3
br label %196
60: ; preds = %36
%61 = load i32, i32* %8
%62 = load i32, i32* @SOL_SOCKET
%63 = load i32, i32* @SO_REUSEADDR
%64 = bitcast i32* %11 to i8*
%65 = call i32 @setsockopt(i32 %61, i32 %62, i32 %63, i8* %64, i32 4)
%66 = call i32 @memset(%struct.sockaddr_in* %21, i32 0, i32 12)
%67 = load i32, i32* @AF_INET
%68 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %21, i32 0, i32 2
store i32 %67, i32* %68
%69 = load i32, i32* @INADDR_ANY
%70 = call i32 @htonl(i32 %69)
%71 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %21, i32 0, i32 1
%72 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %71, i32 0, i32 0
store i32 %70, i32* %72
%73 = call i32 @htons(i32 1001)
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %21, i32 0, i32 0
store i32 %73, i32* %74
%75 = load i32, i32* %8
%76 = bitcast %struct.sockaddr_in* %21 to %struct.sockaddr*
%77 = call i64 @bind(i32 %75, %struct.sockaddr* %76, i32 12)
%78 = icmp slt i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %60
%80 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%81 = load i32, i32* @EXIT_FAILURE
store i32 %81, i32* %3
br label %196
82: ; preds = %60
%83 = load i32, i32* %8
%84 = call i32 @listen(i32 %83, i32 1024)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %86
86: ; preds = %82, %193
%87 = load i32, i32* %8
%88 = call i32 @accept(i32 %87, i32* null, i32* null)
store i32 %88, i32* %9
%89 = icmp slt i32 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%92 = load i32, i32* @EXIT_FAILURE
store i32 %92, i32* %3
br label %196
93: ; preds = %86
br label %94
94: ; preds = %93, %192
%95 = load i32, i32* %9
%96 = bitcast i32* %22 to i8*
%97 = load i32, i32* @MSG_DONTWAIT
%98 = call i32 @recv(i32 %95, i8* %96, i32 4, i32 %97)
store i32 %98, i32* %14
%99 = load i32, i32* %14
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %102
101: ; preds = %94
br label %193
102: ; preds = %94
%103 = load i32, i32* %14
%104 = icmp sgt i32 %103, 0
br i1 %104, label %105, label %145
105: ; preds = %102
%106 = load i32, i32* %22
%107 = and i32 %106, 268435455
store i32 %107, i32* %23
%108 = load i32, i32* %22
%109 = ashr i32 %108, 28
switch i32 %109, label %144 [
i32 1, label %110
i32 2, label %113
i32 3, label %122
i32 0, label %125
]
110: ; preds = %105
%111 = load i32, i32* %22
%112 = and i32 %111, 255
store i32 %112, i32* %20
br label %144
113: ; preds = %105
%114 = load i32, i32* %22
%115 = and i32 %114, 255
%116 = icmp slt i32 %115, 14
br i1 %116, label %117, label %120
117: ; preds = %113
%118 = load i32, i32* %22
%119 = and i32 %118, 255
store i32 %119, i32* %19
br label %121
120: ; preds = %113
store i32 13, i32* %19
br label %121
121: ; preds = %120, %117
br label %144
122: ; preds = %105
%123 = load i32, i32* %22
%124 = and i32 %123, 255
store i32 %124, i32* %18
br label %144
125: ; preds = %105
%126 = load i32, i32* %20
%127 = shl i32 %126, 8
%128 = add nsw i32 1, %127
%129 = load i32, i32* %19
%130 = shl i32 %129, 16
%131 = add nsw i32 %128, %130
%132 = load i32, i32* %18
%133 = shl i32 %132, 24
%134 = add nsw i32 %131, %133
%135 = load i8*, i8** %15
%136 = getelementptr i8, i8* %135, i64 0
%137 = bitcast i8* %136 to i32*
store i32 %134, i32* %137
%138 = call i64 (...) @clock()
store i64 %138, i64* %26
%139 = load i8*, i8** %15
%140 = getelementptr i8, i8* %139, i64 0
%141 = bitcast i8* %140 to i32*
%142 = load i32, i32* %141
%143 = xor i32 %142, 1
store i32 %143, i32* %141
store i32 1, i32* %28
br label %144
144: ; preds = %105, %125, %122, %121, %110
br label %145
145: ; preds = %144, %102
%146 = load i32, i32* %28
%147 = icmp eq i32 %146, 1
br i1 %147, label %148, label %192
148: ; preds = %145
%149 = load i8*, i8** %15
%150 = getelementptr i8, i8* %149, i64 8
%151 = bitcast i8* %150 to i32*
%152 = load i32, i32* %151
%153 = and i32 %152, 1
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %192
155: ; preds = %148
%156 = call i64 (...) @clock()
%157 = load i64, i64* %26
%158 = sub nsw i64 %156, %157
%159 = sitofp i64 %158 to double
%160 = load double, double* @CLOCKS_PER_SEC
%161 = fdiv double %159, %160
store double %161, double* %27
%162 = load i32, i32* %19
%163 = shl i32 1, %162
store i32 %163, i32* %12
store i32 0, i32* %7
br label %164
164: ; preds = %179, %155
%165 = load i32, i32* %7
%166 = load i32, i32* %12
%167 = icmp slt i32 %165, %166
br i1 %167, label %168, label %182
168: ; preds = %164
%169 = load i8*, i8** %16
%170 = load i32, i32* %7
%171 = mul nsw i32 4, %170
%172 = sext i32 %171 to i64
%173 = getelementptr i8, i8* %169, i64 %172
%174 = bitcast i8* %173 to i32*
%175 = load i32, i32* %174
%176 = load i32, i32* %7
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [8192 x i32], [8192 x i32]* %25, i64 0, i64 %177
store i32 %175, i32* %178
br label %179
179: ; preds = %168
%180 = load i32, i32* %7
%181 = add nsw i32 %180, 1
store i32 %181, i32* %7
br label %164
182: ; preds = %164
%183 = load i32, i32* %9
%184 = getelementptr inbounds [8192 x i32], [8192 x i32]* %25, i64 0, i64 0
%185 = load i32, i32* %12
%186 = mul nsw i32 4, %185
%187 = load i32, i32* @MSG_NOSIGNAL
%188 = call i32 @send(i32 %183, i32* %184, i32 %186, i32 %187)
%189 = load i32, i32* %12
%190 = load double, double* %27
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %189, double %190)
store i32 0, i32* %28
br label %193
192: ; preds = %148, %145
br label %94
193: ; preds = %182, %101
%194 = load i32, i32* %9
%195 = call i32 @close(i32 %194)
br label %86
196: ; preds = %90, %79, %57, %33
%197 = load i32, i32* %3
ret i32 %197
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@.str.1 = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
@_SC_PAGESIZE = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@INADDR_ANY = global i32 0
@.str.3 = [5 x i8] c"bind\00"
@.str.5 = [7 x i8] c"accept\00"
@MSG_DONTWAIT = global i32 0
@CLOCKS_PER_SEC = global double 0.000000e+00
@MSG_NOSIGNAL = global i32 0
@.str.6 = [29 x i8] c"%d samples measured in %f s\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [27 x i8] c"Listening on port 1001 ...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [8192 x i32]
%7 = bitcast [8192 x i32]* %6 to i8*
%8 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%9 = bitcast %struct.sockaddr_in* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast [8192 x i32]* %6 to i8*
%12 = load i32, i32* @O_RDWR
%13 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %293
17: ; preds = %2
%18 = load i32, i32* @_SC_PAGESIZE
%19 = tail call i32 @sysconf(i32 %18)
%20 = load i32, i32* @PROT_READ
%21 = load i32, i32* @PROT_WRITE
%22 = or i32 %21, %20
%23 = load i32, i32* @MAP_SHARED
%24 = tail call i8* @mmap(i32* null, i32 %19, i32 %22, i32 %23, i32 %13, i32 1073741824)
%25 = load i32, i32* @_SC_PAGESIZE
%26 = tail call i32 @sysconf(i32 %25)
%27 = load i32, i32* @PROT_READ
%28 = load i32, i32* @PROT_WRITE
%29 = or i32 %28, %27
%30 = load i32, i32* @MAP_SHARED
%31 = tail call i8* @mmap(i32* null, i32 %26, i32 %29, i32 %30, i32 %13, i32 1107296256)
%32 = load i32, i32* @AF_INET
%33 = load i32, i32* @SOCK_STREAM
%34 = tail call i32 @socket(i32 %32, i32 %33, i32 0)
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %17
%37 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %293
38: ; preds = %17
%39 = load i32, i32* @SOL_SOCKET
%40 = load i32, i32* @SO_REUSEADDR
%41 = call i32 @setsockopt(i32 %34, i32 %39, i32 %40, i8* %8, i32 4)
%42 = call i32 @memset(%struct.sockaddr_in* %4, i32 0, i32 12)
%43 = load i32, i32* @AF_INET
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %43, i32* %44
%45 = load i32, i32* @INADDR_ANY
%46 = call i32 @htonl(i32 %45)
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
store i32 %46, i32* %47
%48 = call i32 @htons(i32 1001)
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %48, i32* %49
%50 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%51 = call i64 @bind(i32 %34, %struct.sockaddr* %50, i32 12)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %38
%54 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %293
55: ; preds = %38
%56 = call i32 @listen(i32 %34, i32 1024)
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%58 = call i32 @accept(i32 %34, i32* null, i32* null)
%59 = icmp slt i32 %58, 0
br i1 %59, label %75, label %60
60: ; preds = %55
%61 = bitcast i8* %31 to i32*
%62 = getelementptr i8, i8* %31, i64 8
%63 = bitcast i8* %62 to i32*
%64 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 0
br label %65
65: ; preds = %60, %284
%66 = phi i32 [ %58, %60 ], [ %291, %284 ]
%67 = phi i32 [ 0, %60 ], [ %289, %284 ]
%68 = phi i64 [ undef, %60 ], [ %288, %284 ]
%69 = phi i32 [ 0, %60 ], [ %287, %284 ]
%70 = phi i32 [ 0, %60 ], [ %286, %284 ]
%71 = phi i32 [ 0, %60 ], [ %285, %284 ]
%72 = load i32, i32* @MSG_DONTWAIT
%73 = call i32 @recv(i32 %66, i8* %10, i32 4, i32 %72)
%74 = icmp eq i32 %73, 0
br i1 %74, label %284, label %77
75: ; preds = %284, %55
%76 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %293
77: ; preds = %65, %275
%78 = phi i32 [ %282, %275 ], [ %73, %65 ]
%79 = phi i32 [ %276, %275 ], [ %67, %65 ]
%80 = phi i64 [ %277, %275 ], [ %68, %65 ]
%81 = phi i32 [ %278, %275 ], [ %69, %65 ]
%82 = phi i32 [ %279, %275 ], [ %70, %65 ]
%83 = phi i32 [ %280, %275 ], [ %71, %65 ]
%84 = icmp sgt i32 %78, 0
br i1 %84, label %85, label %106
85: ; preds = %77
%86 = load i32, i32* %5
%87 = ashr i32 %86, 28
switch i32 %87, label %106 [
i32 1, label %88
i32 2, label %90
i32 3, label %94
i32 0, label %96
]
88: ; preds = %85
%89 = and i32 %86, 255
br label %106
90: ; preds = %85
%91 = and i32 %86, 255
%92 = icmp ult i32 %91, 13
%93 = select i1 %92, i32 %91, i32 13
br label %106
94: ; preds = %85
%95 = and i32 %86, 255
br label %106
96: ; preds = %85
%97 = shl i32 %82, 8
%98 = shl i32 %83, 16
%99 = shl i32 %81, 24
%100 = or i32 %98, 1
%101 = add i32 %100, %97
%102 = add i32 %101, %99
store i32 %102, i32* %61
%103 = call i64 (...) @clock()
%104 = load i32, i32* %61
%105 = xor i32 %104, 1
store i32 %105, i32* %61
br label %111
106: ; preds = %90, %88, %94, %85, %77
%107 = phi i32 [ %83, %85 ], [ %83, %94 ], [ %83, %88 ], [ %83, %77 ], [ %93, %90 ]
%108 = phi i32 [ %82, %85 ], [ %82, %94 ], [ %89, %88 ], [ %82, %77 ], [ %82, %90 ]
%109 = phi i32 [ %81, %85 ], [ %95, %94 ], [ %81, %88 ], [ %81, %77 ], [ %81, %90 ]
%110 = icmp eq i32 %79, 1
br i1 %110, label %111, label %275
111: ; preds = %96, %106
%112 = phi i64 [ %103, %96 ], [ %80, %106 ]
%113 = phi i32 [ %81, %96 ], [ %109, %106 ]
%114 = phi i32 [ %82, %96 ], [ %108, %106 ]
%115 = phi i32 [ %83, %96 ], [ %107, %106 ]
%116 = load i32, i32* %63
%117 = and i32 %116, 1
%118 = icmp eq i32 %117, 0
br i1 %118, label %275, label %119
119: ; preds = %111
%120 = call i64 (...) @clock()
%121 = sub nsw i64 %120, %112
%122 = sitofp i64 %121 to double
%123 = load double, double* @CLOCKS_PER_SEC
%124 = fdiv double %122, %123
%125 = shl nuw i32 1, %115
%126 = icmp eq i32 %115, 31
br i1 %126, label %270, label %127
127: ; preds = %119
%128 = call i32 @llvm.smax.i32(i32 %125, i32 1)
%129 = zext i32 %128 to i64
%130 = icmp ult i32 %128, 8
br i1 %130, label %223, label %131
131: ; preds = %127
%132 = getelementptr [8192 x i32], [8192 x i32]* %6, i64 0, i64 %129
%133 = bitcast i32* %132 to i8*
%134 = shl nuw nsw i64 %129, 2
%135 = getelementptr i8, i8* %24, i64 %134
%136 = icmp ugt i8* %135, %7
%137 = icmp ult i8* %24, %133
%138 = and i1 %136, %137
br i1 %138, label %223, label %139
139: ; preds = %131
%140 = and i64 %129, 2147483640
%141 = add nsw i64 %140, -8
%142 = lshr exact i64 %141, 3
%143 = add nuw nsw i64 %142, 1
%144 = and i64 %143, 3
%145 = icmp ult i64 %141, 24
br i1 %145, label %201, label %146
146: ; preds = %139
%147 = and i64 %143, 4611686018427387900
br label %148
148: ; preds = %148, %146
%149 = phi i64 [ 0, %146 ], [ %198, %148 ]
%150 = phi i64 [ 0, %146 ], [ %199, %148 ]
%151 = shl nsw i64 %149, 2
%152 = getelementptr i8, i8* %24, i64 %151
%153 = bitcast i8* %152 to <4 x i32>*
%154 = load <4 x i32>, <4 x i32>* %153
%155 = getelementptr i8, i8* %152, i64 16
%156 = bitcast i8* %155 to <4 x i32>*
%157 = load <4 x i32>, <4 x i32>* %156
%158 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %149
%159 = bitcast i32* %158 to <4 x i32>*
store <4 x i32> %154, <4 x i32>* %159
%160 = getelementptr inbounds i32, i32* %158, i64 4
%161 = bitcast i32* %160 to <4 x i32>*
store <4 x i32> %157, <4 x i32>* %161
%162 = or i64 %149, 8
%163 = shl nsw i64 %162, 2
%164 = getelementptr i8, i8* %24, i64 %163
%165 = bitcast i8* %164 to <4 x i32>*
%166 = load <4 x i32>, <4 x i32>* %165
%167 = getelementptr i8, i8* %164, i64 16
%168 = bitcast i8* %167 to <4 x i32>*
%169 = load <4 x i32>, <4 x i32>* %168
%170 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %162
%171 = bitcast i32* %170 to <4 x i32>*
store <4 x i32> %166, <4 x i32>* %171
%172 = getelementptr inbounds i32, i32* %170, i64 4
%173 = bitcast i32* %172 to <4 x i32>*
store <4 x i32> %169, <4 x i32>* %173
%174 = or i64 %149, 16
%175 = shl nsw i64 %174, 2
%176 = getelementptr i8, i8* %24, i64 %175
%177 = bitcast i8* %176 to <4 x i32>*
%178 = load <4 x i32>, <4 x i32>* %177
%179 = getelementptr i8, i8* %176, i64 16
%180 = bitcast i8* %179 to <4 x i32>*
%181 = load <4 x i32>, <4 x i32>* %180
%182 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %174
%183 = bitcast i32* %182 to <4 x i32>*
store <4 x i32> %178, <4 x i32>* %183
%184 = getelementptr inbounds i32, i32* %182, i64 4
%185 = bitcast i32* %184 to <4 x i32>*
store <4 x i32> %181, <4 x i32>* %185
%186 = or i64 %149, 24
%187 = shl nsw i64 %186, 2
%188 = getelementptr i8, i8* %24, i64 %187
%189 = bitcast i8* %188 to <4 x i32>*
%190 = load <4 x i32>, <4 x i32>* %189
%191 = getelementptr i8, i8* %188, i64 16
%192 = bitcast i8* %191 to <4 x i32>*
%193 = load <4 x i32>, <4 x i32>* %192
%194 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %186
%195 = bitcast i32* %194 to <4 x i32>*
store <4 x i32> %190, <4 x i32>* %195
%196 = getelementptr inbounds i32, i32* %194, i64 4
%197 = bitcast i32* %196 to <4 x i32>*
store <4 x i32> %193, <4 x i32>* %197
%198 = add nuw i64 %149, 32
%199 = add i64 %150, 4
%200 = icmp eq i64 %199, %147
br i1 %200, label %201, label %148
201: ; preds = %148, %139
%202 = phi i64 [ 0, %139 ], [ %198, %148 ]
%203 = icmp eq i64 %144, 0
br i1 %203, label %221, label %204
204: ; preds = %201, %204
%205 = phi i64 [ %218, %204 ], [ %202, %201 ]
%206 = phi i64 [ %219, %204 ], [ 0, %201 ]
%207 = shl nsw i64 %205, 2
%208 = getelementptr i8, i8* %24, i64 %207
%209 = bitcast i8* %208 to <4 x i32>*
%210 = load <4 x i32>, <4 x i32>* %209
%211 = getelementptr i8, i8* %208, i64 16
%212 = bitcast i8* %211 to <4 x i32>*
%213 = load <4 x i32>, <4 x i32>* %212
%214 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %205
%215 = bitcast i32* %214 to <4 x i32>*
store <4 x i32> %210, <4 x i32>* %215
%216 = getelementptr inbounds i32, i32* %214, i64 4
%217 = bitcast i32* %216 to <4 x i32>*
store <4 x i32> %213, <4 x i32>* %217
%218 = add nuw i64 %205, 8
%219 = add i64 %206, 1
%220 = icmp eq i64 %219, %144
br i1 %220, label %221, label %204
221: ; preds = %204, %201
%222 = icmp eq i64 %140, %129
br i1 %222, label %270, label %223
223: ; preds = %131, %127, %221
%224 = phi i64 [ 0, %131 ], [ 0, %127 ], [ %140, %221 ]
%225 = xor i64 %224, -1
%226 = add nsw i64 %225, %129
%227 = and i64 %129, 3
%228 = icmp eq i64 %227, 0
br i1 %228, label %240, label %229
229: ; preds = %223, %229
%230 = phi i64 [ %237, %229 ], [ %224, %223 ]
%231 = phi i64 [ %238, %229 ], [ 0, %223 ]
%232 = shl nsw i64 %230, 2
%233 = getelementptr i8, i8* %24, i64 %232
%234 = bitcast i8* %233 to i32*
%235 = load i32, i32* %234
%236 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %230
store i32 %235, i32* %236
%237 = add nuw nsw i64 %230, 1
%238 = add i64 %231, 1
%239 = icmp eq i64 %238, %227
br i1 %239, label %240, label %229
240: ; preds = %229, %223
%241 = phi i64 [ %224, %223 ], [ %237, %229 ]
%242 = icmp ult i64 %226, 3
br i1 %242, label %270, label %243
243: ; preds = %240, %243
%244 = phi i64 [ %268, %243 ], [ %241, %240 ]
%245 = shl nsw i64 %244, 2
%246 = getelementptr i8, i8* %24, i64 %245
%247 = bitcast i8* %246 to i32*
%248 = load i32, i32* %247
%249 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %244
store i32 %248, i32* %249
%250 = add nuw nsw i64 %244, 1
%251 = shl nsw i64 %250, 2
%252 = getelementptr i8, i8* %24, i64 %251
%253 = bitcast i8* %252 to i32*
%254 = load i32, i32* %253
%255 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %250
store i32 %254, i32* %255
%256 = add nuw nsw i64 %244, 2
%257 = shl nsw i64 %256, 2
%258 = getelementptr i8, i8* %24, i64 %257
%259 = bitcast i8* %258 to i32*
%260 = load i32, i32* %259
%261 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %256
store i32 %260, i32* %261
%262 = add nuw nsw i64 %244, 3
%263 = shl nsw i64 %262, 2
%264 = getelementptr i8, i8* %24, i64 %263
%265 = bitcast i8* %264 to i32*
%266 = load i32, i32* %265
%267 = getelementptr inbounds [8192 x i32], [8192 x i32]* %6, i64 0, i64 %262
store i32 %266, i32* %267
%268 = add nuw nsw i64 %244, 4
%269 = icmp eq i64 %268, %129
br i1 %269, label %270, label %243
270: ; preds = %240, %243, %221, %119
%271 = shl nsw i32 %125, 2
%272 = load i32, i32* @MSG_NOSIGNAL
%273 = call i32 @send(i32 %66, i32* %64, i32 %271, i32 %272)
%274 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %125, double %124)
br label %284
275: ; preds = %111, %106
%276 = phi i32 [ 1, %111 ], [ %79, %106 ]
%277 = phi i64 [ %112, %111 ], [ %80, %106 ]
%278 = phi i32 [ %113, %111 ], [ %109, %106 ]
%279 = phi i32 [ %114, %111 ], [ %108, %106 ]
%280 = phi i32 [ %115, %111 ], [ %107, %106 ]
%281 = load i32, i32* @MSG_DONTWAIT
%282 = call i32 @recv(i32 %66, i8* %10, i32 4, i32 %281)
%283 = icmp eq i32 %282, 0
br i1 %283, label %284, label %77
284: ; preds = %275, %65, %270
%285 = phi i32 [ %115, %270 ], [ %71, %65 ], [ %280, %275 ]
%286 = phi i32 [ %114, %270 ], [ %70, %65 ], [ %279, %275 ]
%287 = phi i32 [ %113, %270 ], [ %69, %65 ], [ %278, %275 ]
%288 = phi i64 [ %112, %270 ], [ %68, %65 ], [ %277, %275 ]
%289 = phi i32 [ 0, %270 ], [ %67, %65 ], [ %276, %275 ]
%290 = call i32 @close(i32 %66)
%291 = call i32 @accept(i32 %34, i32* null, i32* null)
%292 = icmp slt i32 %291, 0
br i1 %292, label %75, label %65
293: ; preds = %75, %53, %36, %15
%294 = load i32, i32* @EXIT_FAILURE
ret i32 %294
}