#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef scalar_t__ time_t;
struct timeval {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
char *calloc(int, int);
int /*<<< orphan*/ close(int);
int connect(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int getopt(int, char **, char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
char *optarg;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_headers();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ send_buffer(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ stderr;
double subtractTimeOfDay(struct timeval *, struct timeval *);
scalar_t__ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int socketFd;
  int retVal;
  int c;
  int displayHeaders = 1;
  char *serverPort = "0";
  int duration = 60;
  double actual_duration;
  char *hostname = NULL;
  char *sendBuffer = NULL;
  int kilobytesBufSize = 32;
  int bytesBufSize;
  struct addrinfo hints, *servinfo, *p;
  time_t start_time;
  time_t end_time;
  unsigned int buffers_sent = 0;
  double megaBytesSent;
  double megaBytesPerSecond;
  struct timeval beginTimeDetails;
  struct timeval endTimeDetails;
  while ((c = getopt(argc, argv, "p:l:b:P:H:f:t:h")) != -1) {
    switch (c) {
    case 'p':
      serverPort = optarg;
      break;
    case 'l':
      duration = atoi(optarg);
      break;
    case 'b':
      kilobytesBufSize = atoi(optarg);
      break;
    case 'P':
      displayHeaders = atoi(optarg);
      if (displayHeaders)
        displayHeaders = 1;
      break;
    case 'H':
      hostname = optarg;
      break;
    case 'f':
      fprintf(stderr, "NOTICE: -f is deprecated, and has no effect\n");
      break;
    case 't':
      fprintf(stderr, "NOTICE: -t is deprecated, and has no effect\n");
      break;
    case 'h':
    case '?':
    default:
      usage();
      return 1;
    }
  }
  if (!serverPort) {
    fprintf(stderr, "-p port not specified\n");
    usage();
    return 1;
  }
  if (!hostname) {
    fprintf(stderr, "-H hostname not specified\n");
    usage();
    return 1;
  }
  if (duration < 5 || duration > 3600) {
    fprintf(stderr, "duration must be between 5 and 3600 seconds\n");
    return 1;
  }
  if (kilobytesBufSize < 1 || kilobytesBufSize > 10240) {
    fprintf(stderr, "buffer size for sending must be between 1 and 10240 KB\n");
    return 1;
  }
  bytesBufSize = kilobytesBufSize * 1024;
  sendBuffer = calloc(1, bytesBufSize);
  if (!sendBuffer) {
    fprintf(stderr, "buffer allocation failed\n");
    return 1;
  }
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_protocol = 0;
  retVal = getaddrinfo(hostname, serverPort, &hints, &servinfo);
  if (retVal != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retVal));
    exit(1);
  }
  for (p = servinfo; p != NULL; p = p->ai_next) {
    socketFd = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
    if (socketFd < 0) {
      fprintf(stderr, "socket call failed, trying next if available..\n");
      continue;
    }
    if (connect(socketFd, p->ai_addr, p->ai_addrlen) == -1) {
      perror("connect");
      close(socketFd);
      continue;
    }
    break;
  }
  if (p == NULL) {
    fprintf(stderr, "failed to connect\n");
    exit(1);
  }
  freeaddrinfo(servinfo);
  printf("Connected to server\n");
  start_time = time(NULL);
  end_time = start_time + duration;
  gettimeofday(&beginTimeDetails, NULL);
  while (time(NULL) < end_time) {
    send_buffer(socketFd, sendBuffer, bytesBufSize);
    buffers_sent++;
  }
  gettimeofday(&endTimeDetails, NULL);
  actual_duration = subtractTimeOfDay(&beginTimeDetails, &endTimeDetails);
  megaBytesSent = buffers_sent * (double)bytesBufSize / (1024.0 * 1024.0);
  megaBytesPerSecond = megaBytesSent / actual_duration;
  if (displayHeaders)
    print_headers();
  printf("0     0        %d       %.2f     %.2f\n", bytesBufSize,
         (double)actual_duration, megaBytesPerSecond);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
lea    0xe79(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x3c,-0x2c(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x20,-0x4c(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe41(%rip),%rdx
call   1100 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     13b2 <main+0x172>
mov    -0x1c(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0xc0(%rbp)
sub    $0x35,%eax
ja     139a <main+0x15a>
mov    -0xc0(%rbp),%rax
lea    0xd30(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d10(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    13ad <main+0x16d>
mov    0x2cfd(%rip),%rax
mov    (%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x2c(%rbp)
jmp    13ad <main+0x16d>
mov    0x2ce6(%rip),%rax
mov    (%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x4c(%rbp)
jmp    13ad <main+0x16d>
mov    0x2ccf(%rip),%rax
mov    (%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1345 <main+0x105>
movl   $0x1,-0x20(%rbp)
jmp    13ad <main+0x16d>
mov    0x2ca7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    13ad <main+0x16d>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
jmp    13ad <main+0x16d>
mov    0x2c50(%rip),%rax
mov    (%rax),%edi
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
jmp    13ad <main+0x16d>
jmp    139a <main+0x15a>
mov    $0x0,%al
call   10e0 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1759 <main+0x519>
jmp    1293 <main+0x53>
cmpq   $0x0,-0x28(%rbp)
jne    13e7 <main+0x1a7>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x0,%al
call   10e0 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1759 <main+0x519>
cmpq   $0x0,-0x40(%rbp)
jne    141c <main+0x1dc>
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
lea    0xd61(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x0,%al
call   10e0 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1759 <main+0x519>
cmpl   $0x5,-0x2c(%rbp)
jl     1433 <main+0x1f3>
cmpl   $0xe10,-0x2c(%rbp)
jle    1456 <main+0x216>
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
lea    0xd3b(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1759 <main+0x519>
cmpl   $0x1,-0x4c(%rbp)
jl     146d <main+0x22d>
cmpl   $0x2800,-0x4c(%rbp)
jle    1490 <main+0x250>
mov    0x2b5c(%rip),%rax
mov    (%rax),%edi
lea    0xd2e(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1759 <main+0x519>
mov    -0x4c(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%esi
mov    $0x1,%edi
call   10a0 <calloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    14d8 <main+0x298>
mov    0x2b14(%rip),%rax
mov    (%rax),%edi
lea    0xd1e(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1759 <main+0x519>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
mov    0x2af1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2acd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x78(%rbp),%rcx
call   1140 <getaddrinfo@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1562 <main+0x322>
mov    0x2a9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <gai_strerror@plt>
mov    -0xc4(%rbp),%edi
mov    %rax,%rdx
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    -0x78(%rbp),%rax
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     1606 <main+0x3c6>
mov    -0x80(%rbp),%rax
mov    0x14(%rax),%edi
mov    -0x80(%rbp),%rax
mov    0x10(%rax),%esi
mov    -0x80(%rbp),%rax
mov    0x8(%rax),%rdx
call   1160 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    15b9 <main+0x379>
mov    0x2a2c(%rip),%rax
mov    (%rax),%edi
lea    0xc61(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
jmp    15f5 <main+0x3b5>
mov    -0x14(%rbp),%edi
mov    -0x80(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x80(%rbp),%rax
mov    (%rax),%edx
call   1130 <connect@plt>
cmp    $0xffffffff,%eax
jne    15f0 <main+0x3b0>
lea    0xc60(%rip),%rdi
call   10f0 <perror@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
jmp    15f5 <main+0x3b5>
jmp    1606 <main+0x3c6>
mov    -0x80(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x80(%rbp)
jmp    156a <main+0x32a>
cmpq   $0x0,-0x80(%rbp)
jne    1632 <main+0x3f2>
mov    0x29b8(%rip),%rax
mov    (%rax),%edi
lea    0xc25(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    -0x78(%rbp),%rdi
call   1150 <freeaddrinfo@plt>
lea    0xc17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <time@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x2c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <time@plt>
cmp    -0x90(%rbp),%rax
jge    16b7 <main+0x477>
mov    -0x14(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%edx
call   1030 <send_buffer@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    167e <main+0x43e>
xor    %eax,%eax
mov    %eax,%esi
lea    -0xb8(%rbp),%rdi
mov    %rdi,-0xd0(%rbp)
call   1060 <gettimeofday@plt>
mov    -0xd0(%rbp),%rsi
lea    -0xb0(%rbp),%rdi
call   1090 <subtractTimeOfDay@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x94(%rbp),%eax
cvtsi2sd %rax,%xmm0
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8fe(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
cmpl   $0x0,-0x20(%rbp)
je     1734 <main+0x4f4>
mov    $0x0,%al
call   10b0 <print_headers@plt>
mov    -0x50(%rbp),%esi
movsd  -0x38(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
lea    0xb23(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x1,0x14(%rsp)
lea    0xe4a(%rip),%rax
mov    %rax,0x8(%rsp)
mov    $0x3c,%eax
mov    %rax,0x28(%rsp)
mov    $0x20,%eax
mov    %rax,0x18(%rsp)
lea    0xe2c(%rip),%r14
lea    0xd6f(%rip),%r15
mov    0x2d30(%rip),%r13
lea    0xe54(%rip),%r12
xor    %eax,%eax
mov    %rax,0x20(%rsp)
jmp    12c2 <main+0x72>
mov    0x0(%r13),%edi
lea    0xe13(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1110 <getopt@plt>
lea    -0x48(%rax),%ecx
cmp    $0x2c,%ecx
ja     135f <main+0x10f>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    0x0(%r13),%edi
mov    %r12,%rsi
jmp    12bb <main+0x6b>
mov    0x2d04(%rip),%rax
mov    (%rax),%rdi
call   1120 <atoi@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,0x14(%rsp)
jmp    12c2 <main+0x72>
mov    0x2ce8(%rip),%rax
mov    (%rax),%rdi
call   1120 <atoi@plt>
mov    %rax,0x18(%rsp)
jmp    12c2 <main+0x72>
mov    0x2cd2(%rip),%rax
mov    (%rax),%rdi
call   1120 <atoi@plt>
mov    %rax,0x28(%rsp)
jmp    12c2 <main+0x72>
mov    0x2cbc(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
jmp    12c2 <main+0x72>
nopl   0x0(%rax)
mov    0x2ca1(%rip),%rax
mov    (%rax),%rax
jmp    12a9 <main+0x59>
cmp    $0xffffffff,%eax
jne    13b5 <main+0x165>
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     1396 <main+0x146>
mov    0x20(%rsp),%r15
test   %r15,%r15
je     13a3 <main+0x153>
mov    0x28(%rsp),%rax
add    $0xfffff1ef,%eax
cmp    $0xfffff1f3,%eax
ja     13d2 <main+0x182>
mov    0x0(%r13),%edi
lea    0xdc6(%rip),%rsi
jmp    13f0 <main+0x1a0>
mov    0x0(%r13),%edi
lea    0xd87(%rip),%rsi
jmp    13ae <main+0x15e>
mov    0x0(%r13),%edi
lea    0xd91(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %eax,%eax
call   10f0 <usage@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x18(%rsp),%r14
lea    -0x2801(%r14),%eax
cmp    $0xffffd7ff,%eax
ja     13f9 <main+0x1a9>
mov    0x0(%r13),%edi
lea    0xd97(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    13bc <main+0x16c>
shl    $0xa,%r14d
mov    $0x1,%ebp
mov    $0x1,%edi
mov    %r14d,%esi
call   10b0 <calloc@plt>
test   %rax,%rax
je     15ce <main+0x37e>
mov    %rax,%r12
mov    %r14,0x18(%rsp)
lea    0x48(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
mov    0x2ba5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x5c(%rsp)
mov    0x2b80(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x58(%rsp)
movq   $0x0,0x50(%rsp)
lea    0x38(%rsp),%rcx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1150 <getaddrinfo@plt>
test   %eax,%eax
jne    1601 <main+0x3b1>
mov    0x38(%rsp),%rbx
test   %rbx,%rbx
je     15e5 <main+0x395>
lea    0xd63(%rip),%rbp
lea    0xd8c(%rip),%r15
jmp    14ab <main+0x25b>
mov    0x0(%r13),%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    0x18(%rbx),%rbx
test   %rbx,%rbx
je     15e5 <main+0x395>
mov    0x14(%rbx),%edi
mov    0x10(%rbx),%esi
mov    0x8(%rbx),%rdx
call   1170 <socket@plt>
test   %eax,%eax
js     1490 <main+0x240>
mov    %eax,%r14d
mov    (%rbx),%edx
mov    0x4(%rbx),%esi
mov    %eax,%edi
call   1140 <connect@plt>
cmp    $0xffffffff,%eax
jne    14e4 <main+0x294>
mov    %r15,%rdi
call   1100 <perror@plt>
mov    %r14d,%edi
call   1090 <close@plt>
jmp    149e <main+0x24e>
mov    0x38(%rsp),%rdi
call   1160 <freeaddrinfo@plt>
lea    0xd67(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %edi,%edi
call   10e0 <time@plt>
movslq 0x28(%rsp),%rbp
add    %rax,%rbp
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
xor    %edi,%edi
call   10e0 <time@plt>
xorpd  %xmm0,%xmm0
cmp    %rbp,%rax
mov    0x18(%rsp),%r15
jge    1557 <main+0x307>
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %r12,%rsi
mov    %r15d,%edx
call   1040 <send_buffer@plt>
add    $0x1,%ebx
xor    %edi,%edi
call   10e0 <time@plt>
cmp    %rbp,%rax
jl     1530 <main+0x2e0>
mov    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
lea    0x30(%rsp),%rdi
mov    %rbx,%rsi
call   10a0 <subtractTimeOfDay@plt>
cvtsi2sd %r15d,%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  0xa72(%rip),%xmm1
divsd  %xmm0,%xmm1
cmpl   $0x0,0x14(%rsp)
je     15b8 <main+0x368>
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
call   10c0 <print_headers@plt>
movsd  0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
lea    0xc76(%rip),%rdi
mov    %r15d,%esi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    13c1 <main+0x171>
mov    0x0(%r13),%edi
lea    0xbe6(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    13c1 <main+0x171>
mov    0x0(%r13),%edi
lea    0xc32(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    0x0(%r13),%ebx
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xbc6(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i64, i32, i32, %struct.addrinfo* }
%struct.timeval = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [16 x i8] c"p:l:b:P:H:f:t:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [45 x i8] c"NOTICE: -f is deprecated, and has no effect\0A\00"
@.str.3 = [45 x i8] c"NOTICE: -t is deprecated, and has no effect\0A\00"
@.str.4 = [23 x i8] c"-p port not specified\0A\00"
@.str.5 = [27 x i8] c"-H hostname not specified\0A\00"
@.str.6 = [45 x i8] c"duration must be between 5 and 3600 seconds\0A\00"
@.str.7 = [56 x i8] c"buffer size for sending must be between 1 and 10240 KB\0A\00"
@.str.8 = [26 x i8] c"buffer allocation failed\0A\00"
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@.str.9 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.10 = [48 x i8] c"socket call failed, trying next if available..\0A\00"
@.str.11 = [8 x i8] c"connect\00"
@.str.12 = [19 x i8] c"failed to connect\0A\00"
@.str.13 = [21 x i8] c"Connected to server\0A\00"
@.str.14 = [39 x i8] c"0 0 %d %.2f %.2f\0A\00"
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 i8*
%11 = alloca i32
%12 = alloca double
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca %struct.addrinfo
%18 = alloca %struct.addrinfo*
%19 = alloca %struct.addrinfo*
%20 = alloca i64
%21 = alloca i64
%22 = alloca i32
%23 = alloca double
%24 = alloca double
%25 = alloca %struct.timeval
%26 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %9
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %10
store i32 60, i32* %11
store i8* null, i8** %13
store i8* null, i8** %14
store i32 32, i32* %15
store i32 0, i32* %22
br label %27
27: ; preds = %60, %2
%28 = load i32, i32* %4
%29 = load i8**, i8*** %5
%30 = call i32 @getopt(i32 %28, i8** %29, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 %30, i32* %8
%31 = icmp ne i32 %30, -1
br i1 %31, label %32, label %61
32: ; preds = %27
%33 = load i32, i32* %8
switch i32 %33, label %58 [
i32 112, label %34
i32 108, label %36
i32 98, label %39
i32 80, label %42
i32 72, label %49
i32 102, label %51
i32 116, label %54
i32 104, label %57
i32 63, label %57
]
34: ; preds = %32
%35 = load i8*, i8** @optarg
store i8* %35, i8** %10
br label %60
36: ; preds = %32
%37 = load i8*, i8** @optarg
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %11
br label %60
39: ; preds = %32
%40 = load i8*, i8** @optarg
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %15
br label %60
42: ; preds = %32
%43 = load i8*, i8** @optarg
%44 = call i32 @atoi(i8* %43)
store i32 %44, i32* %9
%45 = load i32, i32* %9
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %42
store i32 1, i32* %9
br label %48
48: ; preds = %47, %42
br label %60
49: ; preds = %32
%50 = load i8*, i8** @optarg
store i8* %50, i8** %13
br label %60
51: ; preds = %32
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
br label %60
54: ; preds = %32
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
br label %60
57: ; preds = %32, %32
br label %58
58: ; preds = %32, %57
%59 = call i32 (...) @usage()
store i32 1, i32* %3
br label %210
60: ; preds = %54, %51, %49, %48, %39, %36, %34
br label %27
61: ; preds = %27
%62 = load i8*, i8** %10
%63 = icmp ne i8* %62, null
br i1 %63, label %68, label %64
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%67 = call i32 (...) @usage()
store i32 1, i32* %3
br label %210
68: ; preds = %61
%69 = load i8*, i8** %13
%70 = icmp ne i8* %69, null
br i1 %70, label %75, label %71
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%74 = call i32 (...) @usage()
store i32 1, i32* %3
br label %210
75: ; preds = %68
%76 = load i32, i32* %11
%77 = icmp slt i32 %76, 5
br i1 %77, label %81, label %78
78: ; preds = %75
%79 = load i32, i32* %11
%80 = icmp sgt i32 %79, 3600
br i1 %80, label %81, label %84
81: ; preds = %78, %75
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %210
84: ; preds = %78
%85 = load i32, i32* %15
%86 = icmp slt i32 %85, 1
br i1 %86, label %90, label %87
87: ; preds = %84
%88 = load i32, i32* %15
%89 = icmp sgt i32 %88, 10240
br i1 %89, label %90, label %93
90: ; preds = %87, %84
%91 = load i32, i32* @stderr
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %210
93: ; preds = %87
%94 = load i32, i32* %15
%95 = mul nsw i32 %94, 1024
store i32 %95, i32* %16
%96 = load i32, i32* %16
%97 = call i8* @calloc(i32 1, i32 %96)
store i8* %97, i8** %14
%98 = load i8*, i8** %14
%99 = icmp ne i8* %98, null
br i1 %99, label %103, label %100
100: ; preds = %93
%101 = load i32, i32* @stderr
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %210
103: ; preds = %93
%104 = call i32 @memset(%struct.addrinfo* %17, i32 0, i32 32)
%105 = load i32, i32* @AF_UNSPEC
%106 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %17, i32 0, i32 4
store i32 %105, i32* %106
%107 = load i32, i32* @SOCK_STREAM
%108 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %17, i32 0, i32 3
store i32 %107, i32* %108
%109 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %17, i32 0, i32 2
store i64 0, i64* %109
%110 = load i8*, i8** %13
%111 = load i8*, i8** %10
%112 = call i32 @getaddrinfo(i8* %110, i8* %111, %struct.addrinfo* %17, %struct.addrinfo** %18)
store i32 %112, i32* %7
%113 = load i32, i32* %7
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %121
115: ; preds = %103
%116 = load i32, i32* @stderr
%117 = load i32, i32* %7
%118 = call i8* @gai_strerror(i32 %117)
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %118)
%120 = call i32 @exit(i32 1)
unreachable
121: ; preds = %103
%122 = load %struct.addrinfo*, %struct.addrinfo** %18
store %struct.addrinfo* %122, %struct.addrinfo** %19
br label %123
123: ; preds = %157, %121
%124 = load %struct.addrinfo*, %struct.addrinfo** %19
%125 = icmp ne %struct.addrinfo* %124, null
br i1 %125, label %126, label %161
126: ; preds = %123
%127 = load %struct.addrinfo*, %struct.addrinfo** %19
%128 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %127, i32 0, i32 4
%129 = load i32, i32* %128
%130 = load %struct.addrinfo*, %struct.addrinfo** %19
%131 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %130, i32 0, i32 3
%132 = load i32, i32* %131
%133 = load %struct.addrinfo*, %struct.addrinfo** %19
%134 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %133, i32 0, i32 2
%135 = load i64, i64* %134
%136 = call i32 @socket(i32 %129, i32 %132, i64 %135)
store i32 %136, i32* %6
%137 = load i32, i32* %6
%138 = icmp slt i32 %137, 0
br i1 %138, label %139, label %142
139: ; preds = %126
%140 = load i32, i32* @stderr
%141 = call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0))
br label %157
142: ; preds = %126
%143 = load i32, i32* %6
%144 = load %struct.addrinfo*, %struct.addrinfo** %19
%145 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %144, i32 0, i32 1
%146 = load i32, i32* %145
%147 = load %struct.addrinfo*, %struct.addrinfo** %19
%148 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %147, i32 0, i32 0
%149 = load i32, i32* %148
%150 = call i32 @connect(i32 %143, i32 %146, i32 %149)
%151 = icmp eq i32 %150, -1
br i1 %151, label %152, label %156
152: ; preds = %142
%153 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%154 = load i32, i32* %6
%155 = call i32 @close(i32 %154)
br label %157
156: ; preds = %142
br label %161
157: ; preds = %152, %139
%158 = load %struct.addrinfo*, %struct.addrinfo** %19
%159 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %158, i32 0, i32 5
%160 = load %struct.addrinfo*, %struct.addrinfo** %159
store %struct.addrinfo* %160, %struct.addrinfo** %19
br label %123
161: ; preds = %156, %123
%162 = load %struct.addrinfo*, %struct.addrinfo** %19
%163 = icmp eq %struct.addrinfo* %162, null
br i1 %163, label %164, label %168
164: ; preds = %161
%165 = load i32, i32* @stderr
%166 = call i32 (i32, i8*, ...) @fprintf(i32 %165, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%167 = call i32 @exit(i32 1)
unreachable
168: ; preds = %161
%169 = load %struct.addrinfo*, %struct.addrinfo** %18
%170 = call i32 @freeaddrinfo(%struct.addrinfo* %169)
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
%172 = call i64 @time(i32* null)
store i64 %172, i64* %20
%173 = load i64, i64* %20
%174 = load i32, i32* %11
%175 = sext i32 %174 to i64
%176 = add nsw i64 %173, %175
store i64 %176, i64* %21
%177 = call i32 @gettimeofday(%struct.timeval* %25, i32* null)
br label %178
178: ; preds = %182, %168
%179 = call i64 @time(i32* null)
%180 = load i64, i64* %21
%181 = icmp slt i64 %179, %180
br i1 %181, label %182, label %189
182: ; preds = %178
%183 = load i32, i32* %6
%184 = load i8*, i8** %14
%185 = load i32, i32* %16
%186 = call i32 @send_buffer(i32 %183, i8* %184, i32 %185)
%187 = load i32, i32* %22
%188 = add i32 %187, 1
store i32 %188, i32* %22
br label %178
189: ; preds = %178
%190 = call i32 @gettimeofday(%struct.timeval* %26, i32* null)
%191 = call double @subtractTimeOfDay(%struct.timeval* %25, %struct.timeval* %26)
store double %191, double* %12
%192 = load i32, i32* %22
%193 = uitofp i32 %192 to double
%194 = load i32, i32* %16
%195 = sitofp i32 %194 to double
%196 = fmul double %193, %195
%197 = fdiv double %196, 0x4130000000000000
store double %197, double* %23
%198 = load double, double* %23
%199 = load double, double* %12
%200 = fdiv double %198, %199
store double %200, double* %24
%201 = load i32, i32* %9
%202 = icmp ne i32 %201, 0
br i1 %202, label %203, label %205
203: ; preds = %189
%204 = call i32 (...) @print_headers()
br label %205
205: ; preds = %203, %189
%206 = load i32, i32* %16
%207 = load double, double* %12
%208 = load double, double* %24
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0), i32 %206, double %207, double %208)
store i32 0, i32* %3
br label %210
210: ; preds = %205, %100, %90, %81, %71, %64, %58
%211 = load i32, i32* %3
ret i32 %211
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i64, i32, i32, %struct.addrinfo* }
%struct.timeval = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [16 x i8] c"p:l:b:P:H:f:t:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [45 x i8] c"NOTICE: -f is deprecated, and has no effect\0A\00"
@.str.3 = [45 x i8] c"NOTICE: -t is deprecated, and has no effect\0A\00"
@.str.4 = [23 x i8] c"-p port not specified\0A\00"
@.str.5 = [27 x i8] c"-H hostname not specified\0A\00"
@.str.6 = [45 x i8] c"duration must be between 5 and 3600 seconds\0A\00"
@.str.7 = [56 x i8] c"buffer size for sending must be between 1 and 10240 KB\0A\00"
@.str.8 = [26 x i8] c"buffer allocation failed\0A\00"
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@.str.9 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.10 = [48 x i8] c"socket call failed, trying next if available..\0A\00"
@.str.11 = [8 x i8] c"connect\00"
@.str.12 = [19 x i8] c"failed to connect\0A\00"
@.str.14 = [39 x i8] c"0 0 %d %.2f %.2f\0A\00"
@str = [20 x i8] c"Connected to server\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.addrinfo* %3 to i8*
%8 = bitcast %struct.addrinfo** %4 to i8*
%9 = bitcast %struct.timeval* %5 to i8*
%10 = bitcast %struct.timeval* %6 to i8*
br label %11
11: ; preds = %46, %2
%12 = phi i8* [ %47, %46 ], [ null, %2 ]
%13 = phi i32 [ %18, %46 ], [ 32, %2 ]
%14 = phi i32 [ %23, %46 ], [ 60, %2 ]
%15 = phi i8* [ %27, %46 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
%16 = phi i32 [ %30, %46 ], [ 1, %2 ]
br label %17
17: ; preds = %11, %38
%18 = phi i32 [ %13, %11 ], [ %40, %38 ]
%19 = phi i32 [ %14, %11 ], [ %23, %38 ]
%20 = phi i8* [ %15, %11 ], [ %27, %38 ]
%21 = phi i32 [ %16, %11 ], [ %30, %38 ]
br label %22
22: ; preds = %17, %35
%23 = phi i32 [ %19, %17 ], [ %37, %35 ]
%24 = phi i8* [ %20, %17 ], [ %27, %35 ]
%25 = phi i32 [ %21, %17 ], [ %30, %35 ]
br label %26
26: ; preds = %22, %33
%27 = phi i8* [ %24, %22 ], [ %34, %33 ]
%28 = phi i32 [ %25, %22 ], [ %30, %33 ]
br label %29
29: ; preds = %26, %41
%30 = phi i32 [ %28, %26 ], [ %45, %41 ]
br label %31
31: ; preds = %54, %29
%32 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
switch i32 %32, label %55 [
i32 -1, label %57
i32 112, label %33
i32 108, label %35
i32 98, label %38
i32 80, label %41
i32 72, label %46
i32 102, label %48
i32 116, label %51
]
33: ; preds = %31
%34 = load i8*, i8** @optarg
br label %26
35: ; preds = %31
%36 = load i8*, i8** @optarg
%37 = tail call i32 @atoi(i8* %36)
br label %22
38: ; preds = %31
%39 = load i8*, i8** @optarg
%40 = tail call i32 @atoi(i8* %39)
br label %17
41: ; preds = %31
%42 = load i8*, i8** @optarg
%43 = tail call i32 @atoi(i8* %42)
%44 = icmp ne i32 %43, 0
%45 = zext i1 %44 to i32
br label %29
46: ; preds = %31
%47 = load i8*, i8** @optarg
br label %11
48: ; preds = %31
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
br label %54
51: ; preds = %31
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
br label %54
54: ; preds = %51, %48
br label %31
55: ; preds = %31
%56 = tail call i32 (...) @usage()
br label %167
57: ; preds = %31
%58 = icmp eq i8* %27, null
br i1 %58, label %59, label %63
59: ; preds = %57
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%62 = tail call i32 (...) @usage()
br label %167
63: ; preds = %57
%64 = icmp eq i8* %12, null
br i1 %64, label %65, label %69
65: ; preds = %63
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%68 = tail call i32 (...) @usage()
br label %167
69: ; preds = %63
%70 = add i32 %23, -3601
%71 = icmp ult i32 %70, -3596
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i32, i32* @stderr
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
br label %167
75: ; preds = %69
%76 = add i32 %18, -10241
%77 = icmp ult i32 %76, -10240
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load i32, i32* @stderr
%80 = tail call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0))
br label %167
81: ; preds = %75
%82 = shl nuw nsw i32 %18, 10
%83 = tail call i8* @calloc(i32 1, i32 %82)
%84 = icmp eq i8* %83, null
br i1 %84, label %85, label %88
85: ; preds = %81
%86 = load i32, i32* @stderr
%87 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
br label %167
88: ; preds = %81
%89 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 32)
%90 = load i32, i32* @AF_UNSPEC
%91 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %90, i32* %91
%92 = load i32, i32* @SOCK_STREAM
%93 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %92, i32* %93
%94 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 2
store i64 0, i64* %94
%95 = call i32 @getaddrinfo(i8* %12, i8* %27, %struct.addrinfo* %3, %struct.addrinfo** %4)
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %88
%98 = load %struct.addrinfo*, %struct.addrinfo** %4
%99 = icmp eq %struct.addrinfo* %98, null
br i1 %99, label %132, label %105
100: ; preds = %88
%101 = load i32, i32* @stderr
%102 = call i8* @gai_strerror(i32 %95)
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %102)
%104 = call i32 @exit(i32 1)
unreachable
105: ; preds = %97, %128
%106 = phi %struct.addrinfo* [ %130, %128 ], [ %98, %97 ]
%107 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i64 0, i32 4
%108 = load i32, i32* %107
%109 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i64 0, i32 3
%110 = load i32, i32* %109
%111 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i64 0, i32 2
%112 = load i64, i64* %111
%113 = call i32 @socket(i32 %108, i32 %110, i64 %112)
%114 = icmp slt i32 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %105
%116 = load i32, i32* @stderr
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0))
br label %128
118: ; preds = %105
%119 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i64 0, i32 1
%120 = load i32, i32* %119
%121 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i64 0, i32 0
%122 = load i32, i32* %121
%123 = call i32 @connect(i32 %113, i32 %120, i32 %122)
%124 = icmp eq i32 %123, -1
br i1 %124, label %125, label %136
125: ; preds = %118
%126 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%127 = call i32 @close(i32 %113)
br label %128
128: ; preds = %125, %115
%129 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i64 0, i32 5
%130 = load %struct.addrinfo*, %struct.addrinfo** %129
%131 = icmp eq %struct.addrinfo* %130, null
br i1 %131, label %132, label %105
132: ; preds = %128, %97
%133 = load i32, i32* @stderr
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %118
%137 = load %struct.addrinfo*, %struct.addrinfo** %4
%138 = call i32 @freeaddrinfo(%struct.addrinfo* %137)
%139 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%140 = call i64 @time(i32* null)
%141 = sext i32 %23 to i64
%142 = add nsw i64 %140, %141
%143 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%144 = call i64 @time(i32* null)
%145 = icmp slt i64 %144, %142
br i1 %145, label %146, label %154
146: ; preds = %136, %146
%147 = phi i32 [ %149, %146 ], [ 0, %136 ]
%148 = call i32 @send_buffer(i32 %113, i8* %83, i32 %82)
%149 = add i32 %147, 1
%150 = call i64 @time(i32* null)
%151 = icmp slt i64 %150, %142
br i1 %151, label %146, label %152
152: ; preds = %146
%153 = uitofp i32 %149 to double
br label %154
154: ; preds = %152, %136
%155 = phi double [ 0.000000e+00, %136 ], [ %153, %152 ]
%156 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%157 = call double @subtractTimeOfDay(%struct.timeval* %5, %struct.timeval* %6)
%158 = sitofp i32 %82 to double
%159 = fmul double %155, %158
%160 = fmul double %159, 0x3EB0000000000000
%161 = fdiv double %160, %157
%162 = icmp eq i32 %30, 0
br i1 %162, label %165, label %163
163: ; preds = %154
%164 = call i32 (...) @print_headers()
br label %165
165: ; preds = %163, %154
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0), i32 %82, double %157, double %161)
br label %167
167: ; preds = %165, %85, %78, %72, %65, %59, %55
%168 = phi i32 [ 1, %55 ], [ 1, %72 ], [ 1, %78 ], [ 0, %165 ], [ 1, %85 ], [ 1, %65 ], [ 1, %59 ]
ret i32 %168
}