#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 timespec {
  int tv_sec;
  int tv_nsec;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
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;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ serv_addr;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ TIMER_ABSTIME;
void *atoi(char *);
int /*<<< orphan*/ bcopy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                                   struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
struct hostent *gethostbyname(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ printf(char *, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int strlen(char *);
int /*<<< orphan*/ usleep(int);
int write(int, char *, int);
int main(int argc, char *argv[]) {
  unsigned int burst_i;
  unsigned long counter = 0;
  unsigned long eventCounter = 0;
  unsigned long time = 0;
  int sockfd, portno, n;
  struct sockaddr_in serv_addr;
  struct hostent *server;
  unsigned int eventsPerSec;
  unsigned long sleeptimeNanosec;
  int slow = 0;
  char terminate = 0;
  char buffer[256];
  if (argc < 7) {
    fprintf(
        stderr,
        "usage %s hostname port filename numBursts BurstSize EventsPerSec\n",
        argv[0]);
    exit(0);
  }
  portno = atoi(argv[2]);
  unsigned long numBursts = atoi(argv[4]);
  unsigned long burstSize = atoi(argv[5]);
  eventsPerSec = atoi(argv[6]);
  sleeptimeNanosec = 1000000000 / eventsPerSec;
  printf("sending %f events/sec\n", 1000000000.0 / sleeptimeNanosec);
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("ERROR opening socket");
  server = gethostbyname(argv[1]);
  if (server == NULL) {
    fprintf(stderr, "ERROR, no such host\n");
    exit(0);
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
        server->h_length);
  serv_addr.sin_port = htons(portno);
  while (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) <
         0) {
    error("ERROR connecting");
    usleep(500000);
  }
  printf("connection established\n");
  struct timespec tsbeginSend = {0, 0}, tsendSend = {0, 0};
  {
    FILE *fp;
    char *line = NULL;
    size_t len = 0;
    ssize_t read;
    unsigned long endtime;
    fp = fopen(argv[3], "r");
    if (fp == NULL)
      exit(EXIT_FAILURE);
    struct timespec tstart = {0, 0}, tend = {0, 0};
    clock_gettime(CLOCK_MONOTONIC, &tsbeginSend);
    clock_gettime(CLOCK_MONOTONIC, &tstart);
    long gesEvents = numBursts * burstSize;
    endtime = (tstart.tv_sec * 1000000000 + tstart.tv_nsec) + sleeptimeNanosec;
    tend.tv_sec = endtime / 1000000000;
    tend.tv_nsec = endtime % 1000000000;
    while (gesEvents > eventCounter &&
           (read = getline(&line, &len, fp)) != -1) {
      n = write(sockfd, line, strlen(line));
      eventCounter++;
      counter++;
      endtime = (tend.tv_sec * 1000000000 + tend.tv_nsec) + sleeptimeNanosec;
      tend.tv_sec = endtime / 1000000000;
      tend.tv_nsec = endtime % 1000000000;
      clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &tend, NULL);
    }
    n = write(sockfd, &terminate, 1);
    fclose(fp);
    if (line)
      free(line);
  }
  clock_gettime(CLOCK_MONOTONIC, &tsendSend);
  time = (tsendSend.tv_sec - tsbeginSend.tv_sec) * 1000000000 +
         tsendSend.tv_nsec - tsbeginSend.tv_nsec;
  printf("time: %f\n", ((double)time / 1000000000));
  printf("events: %lu\n", eventCounter);
  printf("average events/sec: %f\n",
         (double)eventCounter / ((double)time / 1000000000));
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x0,-0x64(%rbp)
movb   $0x0,-0x65(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    12cb <main+0x6b>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd73(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1120 <atoi@plt>
mov    %rax,-0x178(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1120 <atoi@plt>
mov    %rax,-0x180(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%ecx
xor    %edx,%edx
mov    $0x3b9aca00,%eax
div    %ecx
mov    %rax,-0x60(%rbp)
movaps 0xce6(%rip),%xmm0
movq   -0x60(%rbp),%xmm1
punpckldq %xmm0,%xmm1
movapd 0xce5(%rip),%xmm0
subpd  %xmm0,%xmm1
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcae(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xd15(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    0x2c7d(%rip),%rax
mov    (%rax),%edi
mov    0x2c4c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    1396 <main+0x136>
lea    0xcf8(%rip),%rdi
call   10f0 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <gethostbyname@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    13d0 <main+0x170>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
lea    0xcdc(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
lea    -0x48(%rbp),%rdi
mov    $0xc,%esi
call   1110 <bzero@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x48(%rbp),%rsi
add    $0x4,%rsi
mov    -0x50(%rbp),%rax
mov    (%rax),%edx
call   10e0 <bcopy@plt>
mov    -0x38(%rbp),%edi
call   1080 <htons@plt>
mov    %eax,-0x48(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x48(%rbp),%rsi
mov    $0xc,%edx
call   1150 <connect@plt>
cmp    $0x0,%rax
jge    1446 <main+0x1e6>
lea    0xc81(%rip),%rdi
call   10f0 <error@plt>
mov    $0x7a120,%edi
call   1170 <usleep@plt>
jmp    1410 <main+0x1b0>
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
movq   $0x0,-0x1b0(%rbp)
movq   $0x0,-0x1b8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xc3d(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x1a8(%rbp)
cmpq   $0x0,-0x1a8(%rbp)
jne    14c7 <main+0x267>
mov    0x2af8(%rip),%rax
mov    (%rax),%edi
call   1140 <exit@plt>
lea    -0x1d8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
lea    -0x1e8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
mov    0x2ae4(%rip),%rax
mov    (%rax),%edi
lea    -0x190(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    0x2acf(%rip),%rax
mov    (%rax),%edi
lea    -0x1d8(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x178(%rbp),%rax
imul   -0x180(%rbp),%rax
ff
mov    %rax,-0x1f0(%rbp)
imul   $0x3b9aca00,-0x1d8(%rbp),%eax
ca 9a 3b
add    -0x1d4(%rbp),%eax
cltq
add    -0x60(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
mov    -0x1c8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x1e8(%rbp)
mov    -0x1c8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x1e4(%rbp)
mov    -0x1f0(%rbp),%rcx
xor    %eax,%eax
cmp    -0x28(%rbp),%rcx
mov    %al,-0x1f1(%rbp)
jbe    15bf <main+0x35f>
mov    -0x1a8(%rbp),%rdx
lea    -0x1b0(%rbp),%rdi
lea    -0x1b8(%rbp),%rsi
call   1130 <getline@plt>
mov    %eax,-0x1bc(%rbp)
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x1f1(%rbp)
mov    -0x1f1(%rbp),%al
test   $0x1,%al
jne    15d2 <main+0x372>
jmp    1698 <main+0x438>
mov    -0x34(%rbp),%eax
mov    %eax,-0x204(%rbp)
mov    -0x1b0(%rbp),%rax
mov    %rax,-0x200(%rbp)
mov    -0x1b0(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x204(%rbp),%edi
mov    -0x200(%rbp),%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
imul   $0x3b9aca00,-0x1e8(%rbp),%eax
ca 9a 3b
add    -0x1e4(%rbp),%eax
cltq
add    -0x60(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
mov    -0x1c8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x1e8(%rbp)
mov    -0x1c8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x1e4(%rbp)
mov    0x2960(%rip),%rax
mov    (%rax),%edi
mov    0x295f(%rip),%rax
mov    (%rax),%esi
lea    -0x1e8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1160 <clock_nanosleep@plt>
jmp    157a <main+0x31a>
mov    -0x34(%rbp),%edi
lea    -0x65(%rbp),%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x1a8(%rbp),%rdi
call   1060 <fclose@plt>
cmpq   $0x0,-0x1b0(%rbp)
je     16d2 <main+0x472>
mov    -0x1b0(%rbp),%rdi
call   1030 <free@plt>
mov    0x28ff(%rip),%rax
mov    (%rax),%edi
lea    -0x1a0(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x1a0(%rbp),%eax
mov    -0x19c(%rbp),%edx
mov    -0x190(%rbp),%esi
mov    -0x18c(%rbp),%ecx
sub    %esi,%eax
imul   $0x3b9aca00,%eax,%eax
add    %edx,%eax
sub    %ecx,%eax
cltq
mov    %rax,-0x30(%rbp)
movq   -0x30(%rbp),%xmm0
movaps 0x8f3(%rip),%xmm1
movaps %xmm1,-0x230(%rbp)
punpckldq %xmm1,%xmm0
movapd 0x8f0(%rip),%xmm1
movaps %xmm1,-0x220(%rbp)
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x8b2(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0x985(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0x97d(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
movaps -0x230(%rbp),%xmm3
movaps -0x220(%rbp),%xmm2
movq   -0x28(%rbp),%xmm0
punpckldq %xmm3,%xmm0
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x30(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x848(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
lea    0x92e(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x34(%rbp),%edi
call   10b0 <close@plt>
xor    %eax,%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%r13
movb   $0x0,0x7(%rsp)
cmp    $0x6,%edi
jle    1629 <main+0x3c9>
mov    0x10(%r13),%rdi
call   1120 <atoi@plt>
mov    %rax,%r15
mov    0x20(%r13),%rdi
call   1120 <atoi@plt>
mov    %rax,0x70(%rsp)
mov    0x28(%r13),%rdi
call   1120 <atoi@plt>
mov    %rax,0x78(%rsp)
mov    0x30(%r13),%rdi
call   1120 <atoi@plt>
mov    %rax,%rcx
mov    $0x3b9aca00,%eax
xor    %edx,%edx
div    %ecx
mov    %rax,0x30(%rsp)
cvtsi2sd %eax,%xmm1
movsd  0xd30(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xda7(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    0x2cff(%rip),%r14
mov    (%r14),%edi
mov    0x2ccd(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,%r12d
test   %eax,%eax
jns    130f <main+0xaf>
lea    0xd8f(%rip),%rdi
call   10f0 <error@plt>
mov    0x8(%r13),%rdi
call   10c0 <gethostbyname@plt>
test   %rax,%rax
je     164b <main+0x3eb>
mov    %rax,%rbx
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xc,%esi
call   1110 <bzero@plt>
mov    (%r14),%eax
mov    %eax,0x28(%rsp)
mov    0x8(%rbx),%rsi
lea    0x24(%rsp),%rdi
mov    (%rbx),%edx
call   10e0 <memmove@plt>
mov    %r15d,%edi
call   1090 <htons@plt>
mov    %eax,0x20(%rsp)
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0xc,%edx
call   1150 <connect@plt>
test   %rax,%rax
jns    13a7 <main+0x147>
lea    0xd4e(%rip),%rbp
lea    0x20(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   10f0 <error@plt>
mov    $0x7a120,%edi
call   1170 <usleep@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1150 <connect@plt>
test   %rax,%rax
js     1380 <main+0x120>
lea    0xd57(%rip),%rdi
call   1040 <puts@plt>
xorpd  %xmm0,%xmm0
movapd %xmm0,0x60(%rsp)
movapd %xmm0,0x50(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x80(%rsp)
mov    0x18(%r13),%rdi
lea    0xcf1(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     1669 <main+0x409>
mov    %rax,%rbp
xorpd  %xmm0,%xmm0
movapd %xmm0,0x40(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2bca(%rip),%rbx
mov    (%rbx),%edi
lea    0x60(%rsp),%rsi
call   1050 <clock_gettime@plt>
mov    (%rbx),%edi
lea    0x40(%rsp),%rsi
call   1050 <clock_gettime@plt>
mov    0x78(%rsp),%rsi
imul   0x70(%rsp),%rsi
movslq 0x40(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
movslq 0x44(%rsp),%rcx
add    %rax,%rcx
add    0x30(%rsp),%rcx
mov    %rcx,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rdx
mul    %rdx
shr    $0xb,%rdx
mov    %edx,0x8(%rsp)
imul   $0x3b9aca00,%edx,%eax
sub    %eax,%ecx
mov    %ecx,0xc(%rsp)
test   %rsi,%rsi
je     1534 <main+0x2d4>
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0x80(%rsp),%r15
nopl   0x0(%rax,%rax,1)
lea    0x18(%rsp),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1130 <getline@plt>
cmp    $0xffffffff,%eax
je     1536 <main+0x2d6>
mov    0x18(%rsp),%r13
mov    %r13,%rdi
call   1080 <strlen@plt>
mov    %r12d,%edi
mov    %r13,%rsi
mov    %eax,%edx
call   1060 <write@plt>
movslq 0x8(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
movslq 0xc(%rsp),%rcx
add    %rax,%rcx
add    0x30(%rsp),%rcx
mov    %rcx,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rdx
mul    %rdx
add    $0x1,%rbx
shr    $0xb,%rdx
mov    %edx,0x8(%rsp)
imul   $0x3b9aca00,%edx,%eax
sub    %eax,%ecx
mov    %ecx,0xc(%rsp)
mov    0x2ac9(%rip),%rax
mov    (%rax),%edi
mov    0x2ac8(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
xor    %ecx,%ecx
call   1160 <clock_nanosleep@plt>
cmp    %rbx,%r14
jne    1490 <main+0x230>
mov    %r14,%rbx
jmp    1536 <main+0x2d6>
xor    %ebx,%ebx
lea    0x7(%rsp),%rsi
mov    %r12d,%edi
mov    $0x1,%edx
call   1060 <write@plt>
mov    %rbp,%rdi
call   1070 <fclose@plt>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     155f <main+0x2ff>
call   1030 <free@plt>
mov    0x2a72(%rip),%rax
mov    (%rax),%edi
lea    0x50(%rsp),%rsi
call   1050 <clock_gettime@plt>
mov    0x50(%rsp),%eax
sub    0x60(%rsp),%eax
imul   $0x3b9aca00,%eax,%eax
add    0x54(%rsp),%eax
sub    0x64(%rsp),%eax
cltq
movq   %rax,%xmm1
punpckldq 0xa79(%rip),%xmm1
subpd  0xa81(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  0xa4d(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
lea    0xb16(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
lea    0xb12(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
movq   %rbx,%xmm1
punpckldq 0xa2b(%rip),%xmm1
subpd  0xa33(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  0x30(%rsp),%xmm0
lea    0xae7(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    %r12d,%edi
call   10b0 <close@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2998(%rip),%rax
mov    (%rax),%edi
mov    0x0(%r13),%rdx
lea    0xa03(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
mov    0x2976(%rip),%rax
mov    (%rax),%edi
lea    0xa53(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
mov    0x2948(%rip),%rax
mov    (%rax),%edi
call   1140 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.timespec = type { i32, i32, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [66 x i8] c"usage %s hostname port filename numBursts BurstSize EventsPerSec\0A\00"
@.str.1 = [23 x i8] c"sending %f events/sec\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [21 x i8] c"ERROR opening socket\00"
@.str.3 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.4 = [17 x i8] c"ERROR connecting\00"
@.str.5 = [24 x i8] c"connection established\0A\00"
@.str.6 = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@CLOCK_MONOTONIC = global i32 0
@TIMER_ABSTIME = global i32 0
@.str.7 = [10 x i8] c"time: %f\0A\00"
@.str.8 = [13 x i8] c"events: %lu\0A\00"
@.str.9 = [24 x i8] c"average events/sec: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca %struct.sockaddr_in
%14 = alloca %struct.hostent*
%15 = alloca i32
%16 = alloca i64
%17 = alloca i32
%18 = alloca i8
%19 = alloca [256 x i8]
%20 = alloca i64
%21 = alloca i64
%22 = alloca %struct.timespec
%23 = alloca %struct.timespec
%24 = alloca i32*
%25 = alloca i8*
%26 = alloca i64
%27 = alloca i32
%28 = alloca i64
%29 = alloca %struct.timespec
%30 = alloca %struct.timespec
%31 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %7
store i64 0, i64* %8
store i64 0, i64* %9
store i32 0, i32* %17
store i8 0, i8* %18
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 7
br i1 %33, label %34, label %41
34: ; preds = %2
%35 = load i32, i32* @stderr
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %38)
%40 = call i32 @exit(i32 0)
unreachable
41: ; preds = %2
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i8* @atoi(i8* %44)
%46 = ptrtoint i8* %45 to i32
store i32 %46, i32* %11
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 4
%49 = load i8*, i8** %48
%50 = call i8* @atoi(i8* %49)
%51 = ptrtoint i8* %50 to i64
store i64 %51, i64* %20
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 5
%54 = load i8*, i8** %53
%55 = call i8* @atoi(i8* %54)
%56 = ptrtoint i8* %55 to i64
store i64 %56, i64* %21
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 6
%59 = load i8*, i8** %58
%60 = call i8* @atoi(i8* %59)
%61 = ptrtoint i8* %60 to i32
store i32 %61, i32* %15
%62 = load i32, i32* %15
%63 = udiv i32 1000000000, %62
%64 = zext i32 %63 to i64
store i64 %64, i64* %16
%65 = load i64, i64* %16
%66 = uitofp i64 %65 to double
%67 = fdiv double 1.000000e+09, %66
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %67)
%69 = load i32, i32* @AF_INET
%70 = load i32, i32* @SOCK_STREAM
%71 = call i32 @socket(i32 %69, i32 %70, i32 0)
store i32 %71, i32* %10
%72 = load i32, i32* %10
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %41
%75 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %76
76: ; preds = %74, %41
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 1
%79 = load i8*, i8** %78
%80 = call %struct.hostent* @gethostbyname(i8* %79)
store %struct.hostent* %80, %struct.hostent** %14
%81 = load %struct.hostent*, %struct.hostent** %14
%82 = icmp eq %struct.hostent* %81, null
br i1 %82, label %83, label %87
83: ; preds = %76
%84 = load i32, i32* @stderr
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%86 = call i32 @exit(i32 0)
unreachable
87: ; preds = %76
%88 = bitcast %struct.sockaddr_in* %13 to i8*
%89 = call i32 @bzero(i8* %88, i32 12)
%90 = load i32, i32* @AF_INET
%91 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i32 %90, i32* %91
%92 = load %struct.hostent*, %struct.hostent** %14
%93 = getelementptr inbounds %struct.hostent, %struct.hostent* %92, i32 0, i32 1
%94 = load i64, i64* %93
%95 = inttoptr i64 %94 to i8*
%96 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
%97 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %96, i32 0, i32 0
%98 = bitcast i32* %97 to i8*
%99 = load %struct.hostent*, %struct.hostent** %14
%100 = getelementptr inbounds %struct.hostent, %struct.hostent* %99, i32 0, i32 0
%101 = load i32, i32* %100
%102 = call i32 @bcopy(i8* %95, i8* %98, i32 %101)
%103 = load i32, i32* %11
%104 = call i32 @htons(i32 %103)
%105 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i32 %104, i32* %105
br label %106
106: ; preds = %111, %87
%107 = load i32, i32* %10
%108 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%109 = call i64 @connect(i32 %107, %struct.sockaddr* %108, i32 12)
%110 = icmp slt i64 %109, 0
br i1 %110, label %111, label %114
111: ; preds = %106
%112 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%113 = call i32 @usleep(i32 500000)
br label %106
114: ; preds = %106
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%116 = bitcast %struct.timespec* %22 to i8*
%117 = bitcast %struct.timespec* %23 to i8*
store i8* null, i8** %25
store i64 0, i64* %26
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 3
%120 = load i8*, i8** %119
%121 = call i32* @fopen(i8* %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %121, i32** %24
%122 = load i32*, i32** %24
%123 = icmp eq i32* %122, null
br i1 %123, label %124, label %127
124: ; preds = %114
%125 = load i32, i32* @EXIT_FAILURE
%126 = call i32 @exit(i32 %125)
unreachable
127: ; preds = %114
%128 = bitcast %struct.timespec* %29 to i8*
%129 = bitcast %struct.timespec* %30 to i8*
%130 = load i32, i32* @CLOCK_MONOTONIC
%131 = call i32 @clock_gettime(i32 %130, %struct.timespec* %22)
%132 = load i32, i32* @CLOCK_MONOTONIC
%133 = call i32 @clock_gettime(i32 %132, %struct.timespec* %29)
%134 = load i64, i64* %20
%135 = load i64, i64* %21
%136 = mul i64 %134, %135
store i64 %136, i64* %31
%137 = getelementptr inbounds %struct.timespec, %struct.timespec* %29, i32 0, i32 0
%138 = load i32, i32* %137
%139 = mul nsw i32 %138, 1000000000
%140 = getelementptr inbounds %struct.timespec, %struct.timespec* %29, i32 0, i32 1
%141 = load i32, i32* %140
%142 = add nsw i32 %139, %141
%143 = sext i32 %142 to i64
%144 = load i64, i64* %16
%145 = add i64 %143, %144
store i64 %145, i64* %28
%146 = load i64, i64* %28
%147 = udiv i64 %146, 1000000000
%148 = trunc i64 %147 to i32
%149 = getelementptr inbounds %struct.timespec, %struct.timespec* %30, i32 0, i32 0
store i32 %148, i32* %149
%150 = load i64, i64* %28
%151 = urem i64 %150, 1000000000
%152 = trunc i64 %151 to i32
%153 = getelementptr inbounds %struct.timespec, %struct.timespec* %30, i32 0, i32 1
store i32 %152, i32* %153
br label %154
154: ; preds = %164, %127
%155 = load i64, i64* %31
%156 = load i64, i64* %8
%157 = icmp ugt i64 %155, %156
br i1 %157, label %158, label %162
158: ; preds = %154
%159 = load i32*, i32** %24
%160 = call i32 @getline(i8** %25, i64* %26, i32* %159)
store i32 %160, i32* %27
%161 = icmp ne i32 %160, -1
br label %162
162: ; preds = %158, %154
%163 = phi i1 [ false, %154 ], [ %161, %158 ]
br i1 %163, label %164, label %194
164: ; preds = %162
%165 = load i32, i32* %10
%166 = load i8*, i8** %25
%167 = load i8*, i8** %25
%168 = call i32 @strlen(i8* %167)
%169 = call i32 @write(i32 %165, i8* %166, i32 %168)
store i32 %169, i32* %12
%170 = load i64, i64* %8
%171 = add i64 %170, 1
store i64 %171, i64* %8
%172 = load i64, i64* %7
%173 = add i64 %172, 1
store i64 %173, i64* %7
%174 = getelementptr inbounds %struct.timespec, %struct.timespec* %30, i32 0, i32 0
%175 = load i32, i32* %174
%176 = mul nsw i32 %175, 1000000000
%177 = getelementptr inbounds %struct.timespec, %struct.timespec* %30, i32 0, i32 1
%178 = load i32, i32* %177
%179 = add nsw i32 %176, %178
%180 = sext i32 %179 to i64
%181 = load i64, i64* %16
%182 = add i64 %180, %181
store i64 %182, i64* %28
%183 = load i64, i64* %28
%184 = udiv i64 %183, 1000000000
%185 = trunc i64 %184 to i32
%186 = getelementptr inbounds %struct.timespec, %struct.timespec* %30, i32 0, i32 0
store i32 %185, i32* %186
%187 = load i64, i64* %28
%188 = urem i64 %187, 1000000000
%189 = trunc i64 %188 to i32
%190 = getelementptr inbounds %struct.timespec, %struct.timespec* %30, i32 0, i32 1
store i32 %189, i32* %190
%191 = load i32, i32* @CLOCK_MONOTONIC
%192 = load i32, i32* @TIMER_ABSTIME
%193 = call i32 @clock_nanosleep(i32 %191, i32 %192, %struct.timespec* %30, i32* null)
br label %154
194: ; preds = %162
%195 = load i32, i32* %10
%196 = call i32 @write(i32 %195, i8* %18, i32 1)
store i32 %196, i32* %12
%197 = load i32*, i32** %24
%198 = call i32 @fclose(i32* %197)
%199 = load i8*, i8** %25
%200 = icmp ne i8* %199, null
br i1 %200, label %201, label %204
201: ; preds = %194
%202 = load i8*, i8** %25
%203 = call i32 @free(i8* %202)
br label %204
204: ; preds = %201, %194
%205 = load i32, i32* @CLOCK_MONOTONIC
%206 = call i32 @clock_gettime(i32 %205, %struct.timespec* %23)
%207 = getelementptr inbounds %struct.timespec, %struct.timespec* %23, i32 0, i32 0
%208 = load i32, i32* %207
%209 = getelementptr inbounds %struct.timespec, %struct.timespec* %22, i32 0, i32 0
%210 = load i32, i32* %209
%211 = sub nsw i32 %208, %210
%212 = mul nsw i32 %211, 1000000000
%213 = getelementptr inbounds %struct.timespec, %struct.timespec* %23, i32 0, i32 1
%214 = load i32, i32* %213
%215 = add nsw i32 %212, %214
%216 = getelementptr inbounds %struct.timespec, %struct.timespec* %22, i32 0, i32 1
%217 = load i32, i32* %216
%218 = sub nsw i32 %215, %217
%219 = sext i32 %218 to i64
store i64 %219, i64* %9
%220 = load i64, i64* %9
%221 = uitofp i64 %220 to double
%222 = fdiv double %221, 1.000000e+09
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %222)
%224 = load i64, i64* %8
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i64 %224)
%226 = load i64, i64* %8
%227 = uitofp i64 %226 to double
%228 = load i64, i64* %9
%229 = uitofp i64 %228 to double
%230 = fdiv double %229, 1.000000e+09
%231 = fdiv double %227, %230
%232 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), double %231)
%233 = load i32, i32* %10
%234 = call i32 @close(i32 %233)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.timespec = type { i32, i32, i32, i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [66 x i8] c"usage %s hostname port filename numBursts BurstSize EventsPerSec\0A\00"
@.str.1 = [23 x i8] c"sending %f events/sec\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [21 x i8] c"ERROR opening socket\00"
@.str.3 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.4 = [17 x i8] c"ERROR connecting\00"
@.str.6 = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@CLOCK_MONOTONIC = global i32 0
@TIMER_ABSTIME = global i32 0
@.str.7 = [10 x i8] c"time: %f\0A\00"
@.str.8 = [13 x i8] c"events: %lu\0A\00"
@.str.9 = [24 x i8] c"average events/sec: %f\0A\00"
@str = [23 x i8] c"connection established\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i8
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca i8*
%8 = alloca i64
%9 = alloca %struct.timespec
%10 = alloca %struct.timespec
%11 = bitcast %struct.sockaddr_in* %3 to i8*
store i8 0, i8* %4
%12 = icmp slt i32 %0, 7
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i8* @atoi(i8* %20)
%22 = ptrtoint i8* %21 to i64
%23 = trunc i64 %22 to i32
%24 = getelementptr inbounds i8*, i8** %1, i64 4
%25 = load i8*, i8** %24
%26 = tail call i8* @atoi(i8* %25)
%27 = ptrtoint i8* %26 to i64
%28 = getelementptr inbounds i8*, i8** %1, i64 5
%29 = load i8*, i8** %28
%30 = tail call i8* @atoi(i8* %29)
%31 = ptrtoint i8* %30 to i64
%32 = getelementptr inbounds i8*, i8** %1, i64 6
%33 = load i8*, i8** %32
%34 = tail call i8* @atoi(i8* %33)
%35 = ptrtoint i8* %34 to i64
%36 = trunc i64 %35 to i32
%37 = udiv i32 1000000000, %36
%38 = zext i32 %37 to i64
%39 = uitofp i32 %37 to double
%40 = fdiv double 1.000000e+09, %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %40)
%42 = load i32, i32* @AF_INET
%43 = load i32, i32* @SOCK_STREAM
%44 = tail call i32 @socket(i32 %42, i32 %43, i32 0)
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %18
%47 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %18
%49 = getelementptr inbounds i8*, i8** %1, i64 1
%50 = load i8*, i8** %49
%51 = tail call %struct.hostent* @gethostbyname(i8* %50)
%52 = icmp eq %struct.hostent* %51, null
br i1 %52, label %53, label %57
53: ; preds = %48
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%56 = tail call i32 @exit(i32 0)
unreachable
57: ; preds = %48
%58 = call i32 @bzero(i8* %11, i32 12)
%59 = load i32, i32* @AF_INET
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %59, i32* %60
%61 = getelementptr inbounds %struct.hostent, %struct.hostent* %51, i64 0, i32 1
%62 = load i64, i64* %61
%63 = inttoptr i64 %62 to i8*
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%65 = bitcast i32* %64 to i8*
%66 = getelementptr inbounds %struct.hostent, %struct.hostent* %51, i64 0, i32 0
%67 = load i32, i32* %66
%68 = tail call i32 @htons(i32 %23)
%69 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %68, i32* %69
%70 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%71 = call i64 @connect(i32 %44, %struct.sockaddr* %70, i32 12)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %78
73: ; preds = %57, %73
%74 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%75 = call i32 @usleep(i32 500000)
%76 = call i64 @connect(i32 %44, %struct.sockaddr* %70, i32 12)
%77 = icmp slt i64 %76, 0
br i1 %77, label %73, label %78
78: ; preds = %73, %57
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%80 = bitcast %struct.timespec* %5 to i8*
%81 = bitcast %struct.timespec* %6 to i8*
%82 = bitcast i8** %7 to i8*
store i8* null, i8** %7
%83 = bitcast i64* %8 to i8*
store i64 0, i64* %8
%84 = getelementptr inbounds i8*, i8** %1, i64 3
%85 = load i8*, i8** %84
%86 = call i32* @fopen(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%87 = icmp eq i32* %86, null
br i1 %87, label %88, label %91
88: ; preds = %78
%89 = load i32, i32* @EXIT_FAILURE
%90 = call i32 @exit(i32 %89)
unreachable
91: ; preds = %78
%92 = bitcast %struct.timespec* %9 to i8*
%93 = bitcast %struct.timespec* %10 to i8*
%94 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 2
%95 = bitcast i32* %94 to i64*
store i64 0, i64* %95
%96 = load i32, i32* @CLOCK_MONOTONIC
%97 = call i32 @clock_gettime(i32 %96, %struct.timespec* %5)
%98 = load i32, i32* @CLOCK_MONOTONIC
%99 = call i32 @clock_gettime(i32 %98, %struct.timespec* %9)
%100 = mul i64 %31, %27
%101 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i64 0, i32 0
%102 = load i32, i32* %101
%103 = mul nsw i32 %102, 1000000000
%104 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i64 0, i32 1
%105 = load i32, i32* %104
%106 = add nsw i32 %103, %105
%107 = sext i32 %106 to i64
%108 = add nsw i64 %107, %38
%109 = udiv i64 %108, 1000000000
%110 = trunc i64 %109 to i32
%111 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 0
store i32 %110, i32* %111
%112 = urem i64 %108, 1000000000
%113 = trunc i64 %112 to i32
%114 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i64 0, i32 1
store i32 %113, i32* %114
%115 = icmp eq i64 %100, 0
br i1 %115, label %139, label %116
116: ; preds = %91, %120
%117 = phi i64 [ %124, %120 ], [ 0, %91 ]
%118 = call i32 @getline(i8** %7, i64* %8, i32* %86)
%119 = icmp eq i32 %118, -1
br i1 %119, label %139, label %120
120: ; preds = %116
%121 = load i8*, i8** %7
%122 = call i32 @strlen(i8* %121)
%123 = call i32 @write(i32 %44, i8* %121, i32 %122)
%124 = add nuw i64 %117, 1
%125 = load i32, i32* %111
%126 = mul nsw i32 %125, 1000000000
%127 = load i32, i32* %114
%128 = add nsw i32 %126, %127
%129 = sext i32 %128 to i64
%130 = add nsw i64 %129, %38
%131 = udiv i64 %130, 1000000000
%132 = trunc i64 %131 to i32
store i32 %132, i32* %111
%133 = urem i64 %130, 1000000000
%134 = trunc i64 %133 to i32
store i32 %134, i32* %114
%135 = load i32, i32* @CLOCK_MONOTONIC
%136 = load i32, i32* @TIMER_ABSTIME
%137 = call i32 @clock_nanosleep(i32 %135, i32 %136, %struct.timespec* %10, i32* null)
%138 = icmp eq i64 %124, %100
br i1 %138, label %139, label %116
139: ; preds = %116, %120, %91
%140 = phi i64 [ 0, %91 ], [ %100, %120 ], [ %117, %116 ]
%141 = call i32 @write(i32 %44, i8* %4, i32 1)
%142 = call i32 @fclose(i32* %86)
%143 = load i8*, i8** %7
%144 = icmp eq i8* %143, null
br i1 %144, label %147, label %145
145: ; preds = %139
%146 = call i32 @free(i8* %143)
br label %147
147: ; preds = %145, %139
%148 = load i32, i32* @CLOCK_MONOTONIC
%149 = call i32 @clock_gettime(i32 %148, %struct.timespec* %6)
%150 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 0
%151 = load i32, i32* %150
%152 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 0
%153 = load i32, i32* %152
%154 = sub nsw i32 %151, %153
%155 = mul nsw i32 %154, 1000000000
%156 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 1
%157 = load i32, i32* %156
%158 = add nsw i32 %155, %157
%159 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 1
%160 = load i32, i32* %159
%161 = sub i32 %158, %160
%162 = sext i32 %161 to i64
%163 = uitofp i64 %162 to double
%164 = fdiv double %163, 1.000000e+09
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %164)
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i64 %140)
%167 = uitofp i64 %140 to double
%168 = fdiv double %167, %164
%169 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), double %168)
%170 = call i32 @close(i32 %44)
ret i32 0
}