#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 */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int pid_t;

/* Variables and functions */
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSIGNALED(int);
scalar_t__ WIFSTOPPED(int);
int WTERMSIG(int);
int /*<<< orphan*/ close(int);
int dup2(int, int);
int /*<<< orphan*/ execvp(char *, char **);
int fork();
int gettimeofday(struct timeval *, struct timezone *);
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
int /*<<< orphan*/ perror(char *);
int pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int const);
int wait(int *);
int main(int argc, char **argv, char **env) {
  if (argc == 1) {
    printf("Too few arguments\n");
    return -1;
  }
  struct timeval tv_start, tv_end;
  struct timezone tz;
  if (gettimeofday(&tv_start, &tz) == -1) {
    perror("Time error\n");
  }
  int pipefd[2];
  if (pipe(pipefd) == -1) {
    perror("Pipe error");
    goto end;
  }
  pid_t child_id = fork();
  if (child_id == -1) {
    perror("fork error");
    return -1;
  }
  if (child_id == 0) {
    close(1);
    if (dup2(pipefd[1], 1) == -1)
      perror("Dup2");
    char **new_argv = argv + 1;
    execvp(argv[1], new_argv);
    perror("Execv error");
    return 0;
  } else {
    int bytes = 0;
    int lines = 0;
    int words = 0;
    char last = '-';
    const int BUFF_SIZE = 1024 * 16;
    char buffer[BUFF_SIZE];
    int x = -1;
    close(pipefd[1]);
    while ((x = read(pipefd[0], buffer, BUFF_SIZE)) > 0) {
      bytes += x;
      for (int i = 0; i < x; i++)
        if (buffer[i] == '\n')
          lines++;
      for (int i = 0; i + 1 < x; i++)
        if (isalpha(buffer[i]) || isdigit(buffer[i]))
          if (!isalpha(buffer[i + 1]) && !isdigit(buffer[i + 1]))
            words++;
      last = buffer[x - 1];
    }
    close(pipefd[0]);
    if (isalpha(last) || isdigit(last))
      words++;
    if (x == -1) {
      perror("Read pipe error");
      goto end;
    }
    printf("Output size: bytes=%d, words = %d, lines=%d\n", bytes, words,
           lines);
    int status;
    pid_t wpid = wait(&status);
    if (wpid == -1) {
      perror("wait");
      goto end;
    } else {
      if (WIFEXITED(status)) {
        printf("Exited, status = %d\n", WEXITSTATUS(status));
      } else if (WIFSIGNALED(status)) {
        printf("Killed, signal = %d\n", WTERMSIG(status));
      } else if (WIFSTOPPED(status)) {
        printf("Stopped");
      } else {
        printf("Bad wait status");
        goto end;
      }
    }
  }
end:
  if (gettimeofday(&tv_end, &tz))
    perror("Stop time error\n");
  else {
    tv_end.tv_sec -= tv_start.tv_sec;
    tv_end.tv_usec -= tv_start.tv_usec;
    if (tv_end.tv_usec < 0) {
      tv_end.tv_sec -= 1;
      tv_end.tv_usec += 1000000;
    }
    printf("Work time: sec:%d msec:%d usec:%d\n", (int)tv_end.tv_sec,
           (int)tv_end.tv_usec / 1000, (int)tv_end.tv_usec % 1000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1251 <main+0x41>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    171b <main+0x50b>
lea    -0x28(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1060 <gettimeofday@plt>
cmp    $0xffffffff,%eax
jne    1273 <main+0x63>
lea    0xda5(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x48(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1296 <main+0x86>
lea    0xd93(%rip),%rdi
call   10f0 <perror@plt>
jmp    1670 <main+0x460>
mov    $0x0,%al
call   1130 <fork@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
jne    12c2 <main+0xb2>
lea    0xd79(%rip),%rdi
call   10f0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    171b <main+0x50b>
cmpl   $0x0,-0x4c(%rbp)
jne    132d <main+0x11d>
mov    $0x1,%edi
call   1070 <close@plt>
mov    -0x44(%rbp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    12f8 <main+0xe8>
lea    0xd42(%rip),%rdi
call   10f0 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x58(%rbp),%rsi
call   1100 <execvp@plt>
lea    0xd1e(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    171b <main+0x50b>
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movb   $0x2d,-0x65(%rbp)
movl   $0x4000,-0x6c(%rbp)
mov    %rsp,%rax
mov    %rax,-0x78(%rbp)
mov    %rsp,%rax
add    $0xffffffffffffc000,%rax
mov    %rax,-0x98(%rbp)
mov    %rax,%rsp
movl   $0xffffffff,-0x7c(%rbp)
mov    -0x44(%rbp),%edi
call   1070 <close@plt>
mov    -0x98(%rbp),%rsi
mov    -0x48(%rbp),%edi
mov    $0x4000,%edx
call   1090 <read@plt>
mov    %eax,-0x7c(%rbp)
cmp    $0x0,%eax
jle    14d2 <main+0x2c2>
mov    -0x7c(%rbp),%eax
add    -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jge    13e6 <main+0x1d6>
mov    -0x98(%rbp),%rax
movslq -0x80(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    13d3 <main+0x1c3>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    13d8 <main+0x1c8>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    13a6 <main+0x196>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
cmp    -0x7c(%rbp),%eax
jge    14b7 <main+0x2a7>
mov    -0x98(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   10d0 <isalpha@plt>
cmp    $0x0,%rax
jne    1444 <main+0x234>
mov    -0x98(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     149e <main+0x28e>
mov    -0x98(%rbp),%rax
mov    -0x84(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   10d0 <isalpha@plt>
cmp    $0x0,%rax
jne    1499 <main+0x289>
mov    -0x98(%rbp),%rax
mov    -0x84(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1499 <main+0x289>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    149e <main+0x28e>
jmp    14a3 <main+0x293>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    13f0 <main+0x1e0>
mov    -0x98(%rbp),%rax
mov    -0x7c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x65(%rbp)
jmp    1376 <main+0x166>
mov    -0x48(%rbp),%edi
call   1070 <close@plt>
movsbl -0x65(%rbp),%edi
call   10d0 <isalpha@plt>
cmp    $0x0,%rax
jne    1500 <main+0x2f0>
movsbl -0x65(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1509 <main+0x2f9>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
cmpl   $0xffffffff,-0x7c(%rbp)
jne    152e <main+0x31e>
lea    0xb2c(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x2,-0x90(%rbp)
jmp    1647 <main+0x437>
mov    -0x5c(%rbp),%esi
mov    -0x64(%rbp),%edx
mov    -0x60(%rbp),%ecx
lea    0xb18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x88(%rbp),%rdi
call   1120 <wait@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0xffffffff,-0x8c(%rbp)
jne    157f <main+0x36f>
lea    0xb18(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x2,-0x90(%rbp)
jmp    1647 <main+0x437>
mov    -0x88(%rbp),%edi
call   1110 <WIFEXITED@plt>
cmp    $0x0,%rax
je     15b4 <main+0x3a4>
mov    -0x88(%rbp),%edi
call   10e0 <WEXITSTATUS@plt>
mov    %eax,%esi
lea    0xae0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1638 <main+0x428>
mov    -0x88(%rbp),%edi
call   10a0 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     15e9 <main+0x3d9>
mov    -0x88(%rbp),%edi
call   10c0 <WTERMSIG@plt>
mov    %eax,%esi
lea    0xac0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1633 <main+0x423>
mov    -0x88(%rbp),%edi
call   10b0 <WIFSTOPPED@plt>
cmp    $0x0,%rax
je     1611 <main+0x401>
lea    0xaad(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    162e <main+0x41e>
lea    0xaa2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x2,-0x90(%rbp)
jmp    1647 <main+0x437>
jmp    1633 <main+0x423>
jmp    1638 <main+0x428>
jmp    163d <main+0x42d>
movl   $0x0,-0x90(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rsp
mov    -0x90(%rbp),%eax
test   %eax,%eax
je     1666 <main+0x456>
jmp    1661 <main+0x451>
jmp    1670 <main+0x460>
jmp    166b <main+0x45b>
jmp    1670 <main+0x460>
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1060 <gettimeofday@plt>
cmp    $0x0,%eax
je     1697 <main+0x487>
lea    0xa3d(%rip),%rdi
call   10f0 <perror@plt>
jmp    1714 <main+0x504>
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x38(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jge    16da <main+0x4ca>
mov    -0x30(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
add    $0xf4240,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %eax,%esi
mov    -0x38(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x9c(%rbp)
mov    -0x38(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x9c(%rbp),%edx
lea    0x9ce(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
cmp    $0x1,%edi
jne    124c <main+0x2c>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
jmp    1613 <main+0x3f3>
mov    %rsi,%rbx
lea    -0x80(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1070 <gettimeofday@plt>
cmp    $0xffffffff,%eax
je     1660 <main+0x440>
lea    -0x40(%rbp),%rdi
call   1090 <pipe@plt>
cmp    $0xffffffff,%eax
je     1671 <main+0x451>
xor    %eax,%eax
call   1140 <fork@plt>
test   %eax,%eax
je     16a1 <main+0x481>
cmp    $0xffffffff,%eax
je     1682 <main+0x462>
mov    %rsp,-0x38(%rbp)
mov    %rsp,%r13
add    $0xffffffffffffc000,%r13
mov    %r13,%rsp
mov    -0x3c(%rbp),%edi
call   1080 <close@plt>
mov    -0x40(%rbp),%edi
mov    %r13,%rsi
mov    $0x4000,%edx
call   10a0 <read@plt>
mov    %eax,%r12d
test   %eax,%eax
jle    14f8 <main+0x2d8>
xor    %r14d,%r14d
movdqa 0xd32(%rip),%xmm4
movdqa 0xd3a(%rip),%xmm5
movl   $0x0,-0x2c(%rbp)
xor    %r15d,%r15d
jmp    132c <main+0x10c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x70(%rbp),%r14
add    -0x5c(%rbp),%r14d
mov    -0x68(%rbp),%rax
mov    0x0(%r13,%rax,1),%bl
mov    -0x40(%rbp),%edi
mov    %r13,%rsi
mov    $0x4000,%edx
call   10a0 <read@plt>
mov    %eax,%r12d
test   %eax,%eax
movdqa 0xce2(%rip),%xmm4
movdqa 0xcea(%rip),%xmm5
jle    1507 <main+0x2e7>
mov    %r12d,%eax
cmp    $0x8,%r12d
jae    1340 <main+0x120>
xor    %ecx,%ecx
jmp    1450 <main+0x230>
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0xfffffff8,%ecx
movd   %r15d,%xmm0
lea    -0x8(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     14e4 <main+0x2c4>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
pxor   %xmm1,%xmm1
xor    %esi,%esi
nop
movd   0x4(%r13,%rsi,1),%xmm2
movdqa 0x0(%r13,%rsi,1),%xmm3
pcmpeqb %xmm4,%xmm3
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm0,%xmm3
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movq   0x8(%r13,%rsi,1),%xmm0
movd   0xc(%r13,%rsi,1),%xmm1
pcmpeqb %xmm4,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
pand   %xmm5,%xmm0
paddd  %xmm3,%xmm0
pcmpeqb %xmm4,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1370 <main+0x150>
test   $0x1,%dl
je     1421 <main+0x201>
movq   0x0(%r13,%rsi,1),%xmm2
movd   0x4(%r13,%rsi,1),%xmm3
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm2,%xmm0
pcmpeqb %xmm4,%xmm3
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm3,%xmm1
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%r15d
cmp    %rax,%rcx
je     1467 <main+0x247>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
cmpb   $0xa,0x0(%r13,%rcx,1)
sete   %dl
add    %edx,%r15d
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1450 <main+0x230>
mov    %r12d,-0x5c(%rbp)
mov    %r14,-0x70(%rbp)
lea    -0x1(%rax),%ecx
mov    %rcx,-0x68(%rbp)
cmp    $0x2,%eax
jl     12f0 <main+0xd0>
xor    %r12d,%r12d
jmp    149a <main+0x27a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %r12,-0x68(%rbp)
je     12f0 <main+0xd0>
mov    %r12,%rbx
add    $0x1,%r12
movsbl 0x0(%r13,%rbx,1),%r14d
mov    %r14d,%edi
call   10e0 <isalpha@plt>
test   %rax,%rax
jne    14c1 <main+0x2a1>
mov    %r14d,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1490 <main+0x270>
movsbl 0x1(%r13,%rbx,1),%ebx
mov    %ebx,%edi
call   10e0 <isalpha@plt>
test   %rax,%rax
jne    1490 <main+0x270>
mov    %ebx,%edi
call   1030 <isdigit@plt>
cmp    $0x1,%rax
adcl   $0x0,-0x2c(%rbp)
jmp    1490 <main+0x270>
pxor   %xmm1,%xmm1
xor    %esi,%esi
test   $0x1,%dl
jne    13eb <main+0x1cb>
jmp    1421 <main+0x201>
mov    $0x2d,%bl
xor    %r15d,%r15d
movl   $0x0,-0x2c(%rbp)
xor    %r14d,%r14d
mov    -0x40(%rbp),%edi
call   1080 <close@plt>
movsbl %bl,%ebx
mov    %ebx,%edi
call   10e0 <isalpha@plt>
test   %rax,%rax
jne    152e <main+0x30e>
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1624 <main+0x404>
mov    -0x2c(%rbp),%edx
add    $0x1,%edx
cmp    $0xffffffff,%r12d
je     1631 <main+0x411>
lea    0xb1e(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
lea    -0x58(%rbp),%rdi
call   1130 <wait@plt>
cmp    $0xffffffff,%eax
je     16ec <main+0x4cc>
mov    -0x58(%rbp),%edi
call   1120 <WIFEXITED@plt>
mov    -0x58(%rbp),%edi
test   %rax,%rax
je     1582 <main+0x362>
call   10f0 <WEXITSTATUS@plt>
lea    0xb15(%rip),%rdi
jmp    159f <main+0x37f>
call   10b0 <WIFSIGNALED@plt>
mov    -0x58(%rbp),%edi
test   %rax,%rax
je     1646 <main+0x426>
call   10d0 <WTERMSIG@plt>
lea    0xb0b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
lea    -0x58(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1070 <gettimeofday@plt>
test   %eax,%eax
jne    1698 <main+0x478>
mov    -0x58(%rbp),%rax
mov    -0x50(%rbp),%rsi
sub    -0x78(%rbp),%rsi
sub    -0x80(%rbp),%rax
jns    15e4 <main+0x3c4>
add    $0xffffffffffffffff,%rsi
mov    %rsi,-0x50(%rbp)
add    $0xf4240,%rax
movslq %eax,%rcx
imul   $0x10624dd3,%rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x26,%rdx
add    %eax,%edx
imul   $0x3e8,%edx,%eax
sub    %eax,%ecx
lea    0xade(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    -0x2c(%rbp),%edx
cmp    $0xffffffff,%r12d
jne    153e <main+0x31e>
lea    0xa1b(%rip),%rdi
call   1100 <perror@plt>
mov    -0x38(%rbp),%rsp
jmp    15af <main+0x38f>
call   10c0 <WIFSTOPPED@plt>
test   %rax,%rax
je     16fd <main+0x4dd>
lea    0xa64(%rip),%rdi
jmp    1704 <main+0x4e4>
lea    0x9b9(%rip),%rdi
call   1100 <perror@plt>
jmp    1265 <main+0x45>
lea    0x9b4(%rip),%rdi
call   1100 <perror@plt>
jmp    15af <main+0x38f>
lea    0x9ae(%rip),%rdi
call   1100 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1613 <main+0x3f3>
lea    0xa38(%rip),%rdi
jmp    16e0 <main+0x4c0>
mov    $0x1,%edi
call   1080 <close@plt>
mov    -0x3c(%rbp),%edi
mov    $0x1,%esi
call   1050 <dup2@plt>
cmp    $0xffffffff,%eax
jne    16c9 <main+0x4a9>
lea    0x97e(%rip),%rdi
call   1100 <perror@plt>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
call   1110 <execvp@plt>
lea    0x967(%rip),%rdi
call   1100 <perror@plt>
xor    %ebx,%ebx
jmp    1613 <main+0x3f3>
lea    0x99d(%rip),%rdi
call   1100 <perror@plt>
jmp    15a8 <main+0x388>
lea    0x9c3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    15a8 <main+0x388>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
@.str = [19 x i8] c"Too few arguments\0A\00"
@.str.1 = [12 x i8] c"Time error\0A\00"
@.str.2 = [11 x i8] c"Pipe error\00"
@.str.3 = [11 x i8] c"fork error\00"
@.str.4 = [5 x i8] c"Dup2\00"
@.str.5 = [12 x i8] c"Execv error\00"
@.str.6 = [16 x i8] c"Read pipe error\00"
@.str.7 = [45 x i8] c"Output size: bytes=%d, words = %d, lines=%d\0A\00"
@.str.8 = [5 x i8] c"wait\00"
@.str.9 = [21 x i8] c"Exited, status = %d\0A\00"
@.str.10 = [21 x i8] c"Killed, signal = %d\0A\00"
@.str.11 = [8 x i8] c"Stopped\00"
@.str.12 = [16 x i8] c"Bad wait status\00"
@.str.13 = [17 x i8] c"Stop time error\0A\00"
@.str.14 = [35 x i8] c"Work time: sec:%d msec:%d usec:%d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca %struct.timeval
%9 = alloca %struct.timeval
%10 = alloca %struct.timezone
%11 = alloca [2 x i32]
%12 = alloca i32
%13 = alloca i8**
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %252
30: ; preds = %3
%31 = call i32 @gettimeofday(%struct.timeval* %8, %struct.timezone* %10)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%37 = call i32 @pipe(i32* %36)
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %212
41: ; preds = %35
%42 = call i32 (...) @fork()
store i32 %42, i32* %12
%43 = load i32, i32* %12
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %4
br label %252
47: ; preds = %41
%48 = load i32, i32* %12
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %67
50: ; preds = %47
%51 = call i32 @close(i32 1)
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%53 = load i32, i32* %52
%54 = call i32 @dup2(i32 %53, i32 1)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %58
56: ; preds = %50
%57 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %58
58: ; preds = %56, %50
%59 = load i8**, i8*** %6
%60 = getelementptr inbounds i8*, i8** %59, i64 1
store i8** %60, i8*** %13
%61 = load i8**, i8*** %6
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = load i8**, i8*** %13
%65 = call i32 @execvp(i8* %63, i8** %64)
%66 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %4
br label %252
67: ; preds = %47
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i8 45, i8* %17
store i32 16384, i32* %18
%68 = call i8* @llvm.stacksave()
store i8* %68, i8** %19
%69 = alloca i8, i64 16384
store i32 -1, i32* %20
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%71 = load i32, i32* %70
%72 = call i32 @close(i32 %71)
br label %73
73: ; preds = %144, %67
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%75 = load i32, i32* %74
%76 = call i32 @read(i32 %75, i8* %69, i32 16384)
store i32 %76, i32* %20
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %150
78: ; preds = %73
%79 = load i32, i32* %20
%80 = load i32, i32* %14
%81 = add nsw i32 %80, %79
store i32 %81, i32* %14
store i32 0, i32* %21
br label %82
82: ; preds = %97, %78
%83 = load i32, i32* %21
%84 = load i32, i32* %20
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %100
86: ; preds = %82
%87 = load i32, i32* %21
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %69, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 10
br i1 %92, label %93, label %96
93: ; preds = %86
%94 = load i32, i32* %15
%95 = add nsw i32 %94, 1
store i32 %95, i32* %15
br label %96
96: ; preds = %93, %86
br label %97
97: ; preds = %96
%98 = load i32, i32* %21
%99 = add nsw i32 %98, 1
store i32 %99, i32* %21
br label %82
100: ; preds = %82
store i32 0, i32* %22
br label %101
101: ; preds = %141, %100
%102 = load i32, i32* %22
%103 = add nsw i32 %102, 1
%104 = load i32, i32* %20
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %144
106: ; preds = %101
%107 = load i32, i32* %22
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8, i8* %69, i64 %108
%110 = load i8, i8* %109
%111 = call i64 @isalpha(i8 signext %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %120, label %113
113: ; preds = %106
%114 = load i32, i32* %22
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %69, i64 %115
%117 = load i8, i8* %116
%118 = call i64 @isdigit(i8 signext %117)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %140
120: ; preds = %113, %106
%121 = load i32, i32* %22
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %69, i64 %123
%125 = load i8, i8* %124
%126 = call i64 @isalpha(i8 signext %125)
%127 = icmp ne i64 %126, 0
br i1 %127, label %139, label %128
128: ; preds = %120
%129 = load i32, i32* %22
%130 = add nsw i32 %129, 1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %69, i64 %131
%133 = load i8, i8* %132
%134 = call i64 @isdigit(i8 signext %133)
%135 = icmp ne i64 %134, 0
br i1 %135, label %139, label %136
136: ; preds = %128
%137 = load i32, i32* %16
%138 = add nsw i32 %137, 1
store i32 %138, i32* %16
br label %139
139: ; preds = %136, %128, %120
br label %140
140: ; preds = %139, %113
br label %141
141: ; preds = %140
%142 = load i32, i32* %22
%143 = add nsw i32 %142, 1
store i32 %143, i32* %22
br label %101
144: ; preds = %101
%145 = load i32, i32* %20
%146 = sub nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %69, i64 %147
%149 = load i8, i8* %148
store i8 %149, i8* %17
br label %73
150: ; preds = %73
%151 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%152 = load i32, i32* %151
%153 = call i32 @close(i32 %152)
%154 = load i8, i8* %17
%155 = call i64 @isalpha(i8 signext %154)
%156 = icmp ne i64 %155, 0
br i1 %156, label %161, label %157
157: ; preds = %150
%158 = load i8, i8* %17
%159 = call i64 @isdigit(i8 signext %158)
%160 = icmp ne i64 %159, 0
br i1 %160, label %161, label %164
161: ; preds = %157, %150
%162 = load i32, i32* %16
%163 = add nsw i32 %162, 1
store i32 %163, i32* %16
br label %164
164: ; preds = %161, %157
%165 = load i32, i32* %20
%166 = icmp eq i32 %165, -1
br i1 %166, label %167, label %169
167: ; preds = %164
%168 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
store i32 2, i32* %25
br label %207
169: ; preds = %164
%170 = load i32, i32* %14
%171 = load i32, i32* %16
%172 = load i32, i32* %15
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i32 %170, i32 %171, i32 %172)
%174 = call i32 @wait(i32* %23)
store i32 %174, i32* %24
%175 = load i32, i32* %24
%176 = icmp eq i32 %175, -1
br i1 %176, label %177, label %179
177: ; preds = %169
%178 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
store i32 2, i32* %25
br label %207
179: ; preds = %169
%180 = load i32, i32* %23
%181 = call i64 @WIFEXITED(i32 %180)
%182 = icmp ne i64 %181, 0
br i1 %182, label %183, label %187
183: ; preds = %179
%184 = load i32, i32* %23
%185 = call i32 @WEXITSTATUS(i32 %184)
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %185)
br label %205
187: ; preds = %179
%188 = load i32, i32* %23
%189 = call i64 @WIFSIGNALED(i32 %188)
%190 = icmp ne i64 %189, 0
br i1 %190, label %191, label %195
191: ; preds = %187
%192 = load i32, i32* %23
%193 = call i32 @WTERMSIG(i32 %192)
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %193)
br label %204
195: ; preds = %187
%196 = load i32, i32* %23
%197 = call i64 @WIFSTOPPED(i32 %196)
%198 = icmp ne i64 %197, 0
br i1 %198, label %199, label %201
199: ; preds = %195
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %203
201: ; preds = %195
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
store i32 2, i32* %25
br label %207
203: ; preds = %199
br label %204
204: ; preds = %203, %191
br label %205
205: ; preds = %204, %183
br label %206
206: ; preds = %205
store i32 0, i32* %25
br label %207
207: ; preds = %201, %177, %167, %206
%208 = load i8*, i8** %19
%209 = load i32, i32* %25
switch i32 %209, label %254 [
i32 0, label %210
i32 2, label %212
]
210: ; preds = %207
br label %211
211: ; preds = %210
br label %212
212: ; preds = %211, %207, %39
%213 = call i32 @gettimeofday(%struct.timeval* %9, %struct.timezone* %10)
%214 = icmp ne i32 %213, 0
br i1 %214, label %215, label %217
215: ; preds = %212
%216 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
br label %251
217: ; preds = %212
%218 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%219 = load i64, i64* %218
%220 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%221 = load i64, i64* %220
%222 = sub nsw i64 %221, %219
store i64 %222, i64* %220
%223 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%224 = load i64, i64* %223
%225 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%226 = load i64, i64* %225
%227 = sub nsw i64 %226, %224
store i64 %227, i64* %225
%228 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%229 = load i64, i64* %228
%230 = icmp slt i64 %229, 0
br i1 %230, label %231, label %238
231: ; preds = %217
%232 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%233 = load i64, i64* %232
%234 = sub nsw i64 %233, 1
store i64 %234, i64* %232
%235 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%236 = load i64, i64* %235
%237 = add nsw i64 %236, 1000000
store i64 %237, i64* %235
br label %238
238: ; preds = %231, %217
%239 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%240 = load i64, i64* %239
%241 = trunc i64 %240 to i32
%242 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%243 = load i64, i64* %242
%244 = trunc i64 %243 to i32
%245 = sdiv i32 %244, 1000
%246 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%247 = load i64, i64* %246
%248 = trunc i64 %247 to i32
%249 = srem i32 %248, 1000
%250 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i32 %241, i32 %245, i32 %249)
br label %251
251: ; preds = %238, %215
store i32 0, i32* %4
br label %252
252: ; preds = %251, %58, %45, %28
%253 = load i32, i32* %4
ret i32 %253
254: ; preds = %207
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
@.str.1 = [12 x i8] c"Time error\0A\00"
@.str.2 = [11 x i8] c"Pipe error\00"
@.str.3 = [11 x i8] c"fork error\00"
@.str.4 = [5 x i8] c"Dup2\00"
@.str.5 = [12 x i8] c"Execv error\00"
@.str.6 = [16 x i8] c"Read pipe error\00"
@.str.7 = [45 x i8] c"Output size: bytes=%d, words = %d, lines=%d\0A\00"
@.str.8 = [5 x i8] c"wait\00"
@.str.9 = [21 x i8] c"Exited, status = %d\0A\00"
@.str.10 = [21 x i8] c"Killed, signal = %d\0A\00"
@.str.11 = [8 x i8] c"Stopped\00"
@.str.12 = [16 x i8] c"Bad wait status\00"
@.str.13 = [17 x i8] c"Stop time error\0A\00"
@.str.14 = [35 x i8] c"Work time: sec:%d msec:%d usec:%d\0A\00"
@str = [18 x i8] c"Too few arguments\00"
define i32 @main(i32 %0, i8** %1, i8** nocapture readnone %2) {
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca %struct.timezone
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = icmp eq i32 %0, 1
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %262
12: ; preds = %3
%13 = bitcast %struct.timeval* %4 to i8*
%14 = bitcast %struct.timeval* %5 to i8*
%15 = bitcast %struct.timezone* %6 to i8*
%16 = call i32 @gettimeofday(%struct.timeval* %4, %struct.timezone* %6)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
%21 = bitcast [2 x i32]* %7 to i8*
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%23 = call i32 @pipe(i32* %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %232
27: ; preds = %20
%28 = call i32 (...) @fork()
switch i32 %28, label %44 [
i32 -1, label %29
i32 0, label %31
]
29: ; preds = %27
%30 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %260
31: ; preds = %27
%32 = call i32 @close(i32 1)
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%34 = load i32, i32* %33
%35 = call i32 @dup2(i32 %34, i32 1)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %37, %31
%40 = getelementptr inbounds i8*, i8** %1, i64 1
%41 = load i8*, i8** %40
%42 = call i32 @execvp(i8* %41, i8** %40)
%43 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %260
44: ; preds = %27
%45 = call i8* @llvm.stacksave()
%46 = alloca [16384 x i8]
%47 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 0
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%49 = load i32, i32* %48
%50 = call i32 @close(i32 %49)
%51 = load i32, i32* %22
%52 = call i32 @read(i32 %51, i8* %47, i32 16384)
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %182
54: ; preds = %44, %149
%55 = phi i32 [ %154, %149 ], [ %52, %44 ]
%56 = phi i32 [ %59, %149 ], [ 0, %44 ]
%57 = phi i32 [ %150, %149 ], [ 0, %44 ]
%58 = phi i32 [ %135, %149 ], [ 0, %44 ]
%59 = add nsw i32 %55, %56
%60 = zext i32 %55 to i64
%61 = icmp ult i32 %55, 8
br i1 %61, label %131, label %62
62: ; preds = %54
%63 = and i64 %60, 4294967288
%64 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %58, i64 0
%65 = add nsw i64 %63, -8
%66 = lshr exact i64 %65, 3
%67 = add nuw nsw i64 %66, 1
%68 = and i64 %67, 1
%69 = icmp eq i64 %65, 0
br i1 %69, label %105, label %70
70: ; preds = %62
%71 = and i64 %67, 4611686018427387902
br label %72
72: ; preds = %72, %70
%73 = phi i64 [ 0, %70 ], [ %102, %72 ]
%74 = phi <4 x i32> [ %64, %70 ], [ %100, %72 ]
%75 = phi <4 x i32> [ zeroinitializer, %70 ], [ %101, %72 ]
%76 = phi i64 [ 0, %70 ], [ %103, %72 ]
%77 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %73
%78 = bitcast i8* %77 to <4 x i8>*
%79 = load <4 x i8>, <4 x i8>* %78
%80 = getelementptr inbounds i8, i8* %77, i64 4
%81 = bitcast i8* %80 to <4 x i8>*
%82 = load <4 x i8>, <4 x i8>* %81
%83 = icmp eq <4 x i8> %79, <i8 10, i8 10, i8 10, i8 10>
%84 = icmp eq <4 x i8> %82, <i8 10, i8 10, i8 10, i8 10>
%85 = zext <4 x i1> %83 to <4 x i32>
%86 = zext <4 x i1> %84 to <4 x i32>
%87 = add <4 x i32> %74, %85
%88 = add <4 x i32> %75, %86
%89 = or i64 %73, 8
%90 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %89
%91 = bitcast i8* %90 to <4 x i8>*
%92 = load <4 x i8>, <4 x i8>* %91
%93 = getelementptr inbounds i8, i8* %90, i64 4
%94 = bitcast i8* %93 to <4 x i8>*
%95 = load <4 x i8>, <4 x i8>* %94
%96 = icmp eq <4 x i8> %92, <i8 10, i8 10, i8 10, i8 10>
%97 = icmp eq <4 x i8> %95, <i8 10, i8 10, i8 10, i8 10>
%98 = zext <4 x i1> %96 to <4 x i32>
%99 = zext <4 x i1> %97 to <4 x i32>
%100 = add <4 x i32> %87, %98
%101 = add <4 x i32> %88, %99
%102 = add nuw i64 %73, 16
%103 = add i64 %76, 2
%104 = icmp eq i64 %103, %71
br i1 %104, label %105, label %72
105: ; preds = %72, %62
%106 = phi <4 x i32> [ undef, %62 ], [ %100, %72 ]
%107 = phi <4 x i32> [ undef, %62 ], [ %101, %72 ]
%108 = phi i64 [ 0, %62 ], [ %102, %72 ]
%109 = phi <4 x i32> [ %64, %62 ], [ %100, %72 ]
%110 = phi <4 x i32> [ zeroinitializer, %62 ], [ %101, %72 ]
%111 = icmp eq i64 %68, 0
br i1 %111, label %125, label %112
112: ; preds = %105
%113 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %108
%114 = bitcast i8* %113 to <4 x i8>*
%115 = load <4 x i8>, <4 x i8>* %114
%116 = getelementptr inbounds i8, i8* %113, i64 4
%117 = bitcast i8* %116 to <4 x i8>*
%118 = load <4 x i8>, <4 x i8>* %117
%119 = icmp eq <4 x i8> %115, <i8 10, i8 10, i8 10, i8 10>
%120 = icmp eq <4 x i8> %118, <i8 10, i8 10, i8 10, i8 10>
%121 = zext <4 x i1> %119 to <4 x i32>
%122 = zext <4 x i1> %120 to <4 x i32>
%123 = add <4 x i32> %109, %121
%124 = add <4 x i32> %110, %122
br label %125
125: ; preds = %105, %112
%126 = phi <4 x i32> [ %106, %105 ], [ %123, %112 ]
%127 = phi <4 x i32> [ %107, %105 ], [ %124, %112 ]
%128 = add <4 x i32> %127, %126
%129 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %128)
%130 = icmp eq i64 %63, %60
br i1 %130, label %134, label %131
131: ; preds = %54, %125
%132 = phi i64 [ 0, %54 ], [ %63, %125 ]
%133 = phi i32 [ %58, %54 ], [ %129, %125 ]
br label %139
134: ; preds = %139, %125
%135 = phi i32 [ %129, %125 ], [ %146, %139 ]
%136 = icmp sgt i32 %55, 1
%137 = add nsw i32 %55, -1
%138 = zext i32 %137 to i64
br i1 %136, label %156, label %149
139: ; preds = %131, %139
%140 = phi i64 [ %147, %139 ], [ %132, %131 ]
%141 = phi i32 [ %146, %139 ], [ %133, %131 ]
%142 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %140
%143 = load i8, i8* %142
%144 = icmp eq i8 %143, 10
%145 = zext i1 %144 to i32
%146 = add nsw i32 %141, %145
%147 = add nuw nsw i64 %140, 1
%148 = icmp eq i64 %147, %60
br i1 %148, label %134, label %139
149: ; preds = %178, %134
%150 = phi i32 [ %57, %134 ], [ %179, %178 ]
%151 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %138
%152 = load i8, i8* %151
%153 = load i32, i32* %22
%154 = call i32 @read(i32 %153, i8* %47, i32 16384)
%155 = icmp sgt i32 %154, 0
br i1 %155, label %54, label %182
156: ; preds = %134, %178
%157 = phi i64 [ %160, %178 ], [ 0, %134 ]
%158 = phi i64 [ %180, %178 ], [ 1, %134 ]
%159 = phi i32 [ %179, %178 ], [ %57, %134 ]
%160 = add nuw nsw i64 %157, 1
%161 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %157
%162 = load i8, i8* %161
%163 = call i64 @isalpha(i8 signext %162)
%164 = icmp eq i64 %163, 0
br i1 %164, label %165, label %168
165: ; preds = %156
%166 = call i64 @isdigit(i8 signext %162)
%167 = icmp eq i64 %166, 0
br i1 %167, label %178, label %168
168: ; preds = %165, %156
%169 = getelementptr inbounds [16384 x i8], [16384 x i8]* %46, i64 0, i64 %158
%170 = load i8, i8* %169
%171 = call i64 @isalpha(i8 signext %170)
%172 = icmp eq i64 %171, 0
br i1 %172, label %173, label %178
173: ; preds = %168
%174 = call i64 @isdigit(i8 signext %170)
%175 = icmp eq i64 %174, 0
%176 = zext i1 %175 to i32
%177 = add nsw i32 %159, %176
br label %178
178: ; preds = %173, %165, %168
%179 = phi i32 [ %159, %168 ], [ %159, %165 ], [ %177, %173 ]
%180 = add nuw nsw i64 %158, 1
%181 = icmp eq i64 %160, %138
br i1 %181, label %149, label %156
182: ; preds = %149, %44
%183 = phi i32 [ 0, %44 ], [ %135, %149 ]
%184 = phi i32 [ 0, %44 ], [ %150, %149 ]
%185 = phi i8 [ 45, %44 ], [ %152, %149 ]
%186 = phi i32 [ 0, %44 ], [ %59, %149 ]
%187 = phi i32 [ %52, %44 ], [ %154, %149 ]
%188 = load i32, i32* %22
%189 = call i32 @close(i32 %188)
%190 = call i64 @isalpha(i8 signext %185)
%191 = icmp eq i64 %190, 0
br i1 %191, label %192, label %195
192: ; preds = %182
%193 = call i64 @isdigit(i8 signext %185)
%194 = icmp eq i64 %193, 0
br i1 %194, label %197, label %195
195: ; preds = %192, %182
%196 = add nsw i32 %184, 1
br label %197
197: ; preds = %195, %192
%198 = phi i32 [ %196, %195 ], [ %184, %192 ]
%199 = icmp eq i32 %187, -1
br i1 %199, label %200, label %202
200: ; preds = %197
%201 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %232
202: ; preds = %197
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i32 %186, i32 %198, i32 %183)
%204 = bitcast i32* %8 to i8*
%205 = call i32 @wait(i32* %8)
%206 = icmp eq i32 %205, -1
br i1 %206, label %207, label %209
207: ; preds = %202
%208 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %231
209: ; preds = %202
%210 = load i32, i32* %8
%211 = call i64 @WIFEXITED(i32 %210)
%212 = icmp eq i64 %211, 0
%213 = load i32, i32* %8
br i1 %212, label %217, label %214
214: ; preds = %209
%215 = call i32 @WEXITSTATUS(i32 %213)
%216 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %215)
br label %231
217: ; preds = %209
%218 = call i64 @WIFSIGNALED(i32 %213)
%219 = icmp eq i64 %218, 0
%220 = load i32, i32* %8
br i1 %219, label %224, label %221
221: ; preds = %217
%222 = call i32 @WTERMSIG(i32 %220)
%223 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %222)
br label %231
224: ; preds = %217
%225 = call i64 @WIFSTOPPED(i32 %220)
%226 = icmp eq i64 %225, 0
br i1 %226, label %229, label %227
227: ; preds = %224
%228 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %231
229: ; preds = %224
%230 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %231
231: ; preds = %207, %229, %214, %227, %221
br label %232
232: ; preds = %231, %200, %25
%233 = call i32 @gettimeofday(%struct.timeval* %5, %struct.timezone* %6)
%234 = icmp eq i32 %233, 0
br i1 %234, label %237, label %235
235: ; preds = %232
%236 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
br label %260
237: ; preds = %232
%238 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%239 = load i64, i64* %238
%240 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%241 = load i64, i64* %240
%242 = sub nsw i64 %241, %239
%243 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%244 = load i64, i64* %243
%245 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%246 = load i64, i64* %245
%247 = sub nsw i64 %246, %244
%248 = icmp slt i64 %247, 0
br i1 %248, label %249, label %252
249: ; preds = %237
%250 = add nsw i64 %242, -1
store i64 %250, i64* %240
%251 = add nsw i64 %247, 1000000
br label %252
252: ; preds = %249, %237
%253 = phi i64 [ %251, %249 ], [ %247, %237 ]
%254 = phi i64 [ %250, %249 ], [ %242, %237 ]
%255 = trunc i64 %254 to i32
%256 = trunc i64 %253 to i32
%257 = sdiv i32 %256, 1000
%258 = srem i32 %256, 1000
%259 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i32 %255, i32 %257, i32 %258)
br label %260
260: ; preds = %235, %252, %39, %29
%261 = phi i32 [ -1, %29 ], [ 0, %39 ], [ 0, %252 ], [ 0, %235 ]
br label %262
262: ; preds = %260, %10
%263 = phi i32 [ -1, %10 ], [ %261, %260 ]
ret i32 %263
}