#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 */

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
char **calloc(int, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exec_child(char **, char **, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ getloadavg(double *, int);
int getopt(int, char **, char *);
char *optarg;
size_t optind;
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
char *strlen(char *);
double strtod(char *, char **);
int strtoul(char *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int wait_for_child(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int maxjobs = -1;
  int curjobs = 0;
  double maxload = -1;
  int argsatonce = 1;
  int opt;
  char **command = calloc(sizeof(char *), argc);
  char **arguments = NULL;
  int argidx = 0;
  int arglen = 0;
  int cidx = 0;
  int returncode = 0;
  int replace_cb = 0;
  int n_isset = 0;
  char *t;
  while ((argv[optind] && strcmp(argv[optind], "--") != 0) &&
         (opt = getopt(argc, argv, "+hij:l:n:")) != -1) {
    switch (opt) {
    case 'h':
      usage();
      break;
    case 'i':
      replace_cb = 1;
      break;
    case 'j':
      errno = 0;
      maxjobs = strtoul(optarg, &t, 0);
      if (errno != 0 || (t - optarg) != strlen(optarg)) {
        fprintf(stderr, "option '%s' is not a number\n", optarg);
        exit(2);
      }
      break;
    case 'l':
      errno = 0;
      maxload = strtod(optarg, &t);
      if (errno != 0 || (t - optarg) != strlen(optarg)) {
        fprintf(stderr, "option '%s' is not a number\n", optarg);
        exit(2);
      }
      break;
    case 'n':
      errno = 0;
      argsatonce = strtoul(optarg, &t, 0);
      if (errno != 0 || argsatonce < 1 || (t - optarg) != strlen(optarg)) {
        fprintf(stderr, "option '%s' is not a positive number\n", optarg);
        exit(2);
      }
      n_isset = 1;
      break;
    default:
      usage();
      break;
    }
  }
  if (replace_cb && n_isset) {
    replace_cb = 2;
  }
  if (maxjobs < 0) {
    maxjobs = 1;
  }
  while (optind < argc) {
    if (strcmp(argv[optind], "--") == 0) {
      int i;
      optind++;
      arglen = argc - optind;
      arguments = calloc(sizeof(char *), arglen);
      if (!arguments) {
        exit(1);
      }
      for (i = 0; i < arglen; i++) {
        arguments[i] = strdup(argv[optind + i]);
      }
      optind += i;
    } else {
      command[cidx] = strdup(argv[optind]);
      cidx++;
    }
    optind++;
  }
  if (argsatonce > 1 && !command[0]) {
    fprintf(stderr, "option -n cannot be used without a command\n");
    exit(2);
  }
  while (argidx < arglen) {
    double load;
    getloadavg(&load, 1);
    if ((maxjobs == 0 || curjobs < maxjobs) &&
        (maxload < 0 || load < maxload)) {
      if (argsatonce > arglen - argidx)
        argsatonce = arglen - argidx;
      exec_child(command, arguments + argidx, replace_cb, argsatonce);
      argidx += argsatonce;
      curjobs++;
    }
    if (maxjobs == 0 || curjobs == maxjobs) {
      returncode |= wait_for_child(0);
      curjobs--;
    }
    if (maxload > 0 && load >= maxload) {
      int r;
      sleep(1);
      r = wait_for_child(WNOHANG);
      if (r > 0)
        returncode |= r;
      if (r != -1)
        curjobs--;
    }
  }
  while (curjobs > 0) {
    returncode |= wait_for_child(0);
    curjobs--;
  }
  return returncode;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movsd  0xdf1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x8,%edi
call   1060 <calloc@plt>
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x10(%rbp),%rcx
mov    0x2d6f(%rip),%rax
mov    (%rax),%rdx
xor    %eax,%eax
cmpq   $0x0,(%rcx,%rdx,8)
mov    %al,-0x6d(%rbp)
je     12cb <main+0xeb>
mov    -0x10(%rbp),%rax
mov    0x2d51(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd8f(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x6d(%rbp)
je     12cb <main+0xeb>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xd6d(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x6d(%rbp)
mov    -0x6d(%rbp),%al
test   $0x1,%al
jne    12db <main+0xfb>
jmp    1510 <main+0x330>
mov    -0x28(%rbp),%eax
add    $0xffffff98,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x6,%eax
ja     1504 <main+0x324>
mov    -0x78(%rbp),%rax
lea    0xd0d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10a0 <usage@plt>
jmp    150b <main+0x32b>
movl   $0x1,-0x4c(%rbp)
jmp    150b <main+0x32b>
mov    0x2c9d(%rip),%rax
movl   $0x0,(%rax)
mov    0x2cc8(%rip),%rax
mov    (%rax),%rdi
lea    -0x58(%rbp),%rsi
xor    %edx,%edx
call   10c0 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    0x2c78(%rip),%rax
cmpl   $0x0,(%rax)
jne    1385 <main+0x1a5>
mov    -0x58(%rbp),%rax
mov    0x2c9c(%rip),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    0x2c8b(%rip),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
cmp    %rcx,%rax
je     13b0 <main+0x1d0>
mov    0x2c3c(%rip),%rax
mov    (%rax),%edi
mov    0x2c63(%rip),%rax
mov    (%rax),%rdx
lea    0xc92(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
jmp    150b <main+0x32b>
mov    0x2c04(%rip),%rax
movl   $0x0,(%rax)
mov    0x2c2f(%rip),%rax
mov    (%rax),%rdi
lea    -0x58(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
mov    0x2bdf(%rip),%rax
cmpl   $0x0,(%rax)
jne    1424 <main+0x244>
mov    -0x58(%rbp),%rax
mov    0x2c03(%rip),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    0x2bef(%rip),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x88(%rbp),%rax
cmp    %rcx,%rax
je     144f <main+0x26f>
mov    0x2b9d(%rip),%rax
mov    (%rax),%edi
mov    0x2bc4(%rip),%rax
mov    (%rax),%rdx
lea    0xbf3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
jmp    150b <main+0x32b>
mov    0x2b65(%rip),%rax
movl   $0x0,(%rax)
mov    0x2b90(%rip),%rax
mov    (%rax),%rdi
lea    -0x58(%rbp),%rsi
xor    %edx,%edx
call   10c0 <strtoul@plt>
mov    %eax,-0x24(%rbp)
mov    0x2b40(%rip),%rax
cmpl   $0x0,(%rax)
jne    14cd <main+0x2ed>
cmpl   $0x1,-0x24(%rbp)
jl     14cd <main+0x2ed>
mov    -0x58(%rbp),%rax
mov    0x2b5a(%rip),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    0x2b46(%rip),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
cmp    %rcx,%rax
je     14f8 <main+0x318>
mov    0x2af4(%rip),%rax
mov    (%rax),%edi
mov    0x2b1b(%rip),%rax
mov    (%rax),%rdx
lea    0xb67(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
movl   $0x1,-0x50(%rbp)
jmp    150b <main+0x32b>
mov    $0x0,%al
call   10a0 <usage@plt>
jmp    125e <main+0x7e>
cmpl   $0x0,-0x4c(%rbp)
je     152b <main+0x34b>
cmpl   $0x0,-0x50(%rbp)
je     152b <main+0x34b>
movl   $0x2,-0x4c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    153c <main+0x35c>
movl   $0x1,-0x14(%rbp)
jmp    1541 <main+0x361>
mov    0x2a90(%rip),%rax
mov    (%rax),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1686 <main+0x4a6>
mov    -0x10(%rbp),%rax
mov    0x2a75(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xab3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    163a <main+0x45a>
mov    0x2a51(%rip),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    0x2a43(%rip),%rax
mov    %rcx,(%rax)
movslq -0x8(%rbp),%rax
mov    0x2a35(%rip),%rcx
sub    (%rcx),%rax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%esi
mov    $0x8,%edi
call   1060 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    15cf <main+0x3ef>
mov    $0x1,%edi
call   10d0 <exit@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    161d <main+0x43d>
mov    -0x10(%rbp),%rax
mov    0x29eb(%rip),%rcx
mov    (%rcx),%rcx
movslq -0x5c(%rbp),%rdx
add    %rdx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    15d6 <main+0x3f6>
movslq -0x5c(%rbp),%rcx
mov    0x29b0(%rip),%rax
add    (%rax),%rcx
mov    0x29a6(%rip),%rax
mov    %rcx,(%rax)
jmp    1669 <main+0x489>
mov    -0x10(%rbp),%rax
mov    0x2993(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    0x2968(%rip),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    0x295a(%rip),%rax
mov    %rcx,(%rax)
jmp    1541 <main+0x361>
cmpl   $0x1,-0x24(%rbp)
jle    16bf <main+0x4df>
mov    -0x30(%rbp),%rax
cmpq   $0x0,(%rax)
jne    16bf <main+0x4df>
mov    0x2923(%rip),%rax
mov    (%rax),%edi
lea    0x9c6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
jmp    16c4 <main+0x4e4>
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    17f9 <main+0x619>
lea    -0x68(%rbp),%rdi
mov    $0x1,%esi
call   1040 <getloadavg@plt>
cmpl   $0x0,-0x14(%rbp)
je     16f4 <main+0x514>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1760 <main+0x580>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     1716 <main+0x536>
movsd  -0x68(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1760 <main+0x580>
mov    -0x24(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    -0x3c(%rbp),%ecx
cmp    %ecx,%eax
jle    1730 <main+0x550>
mov    -0x40(%rbp),%eax
sub    -0x3c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x4c(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1090 <exec_child@plt>
mov    -0x24(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1776 <main+0x596>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    178c <main+0x5ac>
xor    %edi,%edi
call   10f0 <wait_for_child@plt>
or     -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    17f4 <main+0x614>
movsd  -0x68(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     17f4 <main+0x614>
mov    $0x1,%edi
call   1100 <sleep@plt>
mov    0x2821(%rip),%rax
mov    (%rax),%edi
call   10f0 <wait_for_child@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jle    17dc <main+0x5fc>
mov    -0x6c(%rbp),%eax
or     -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
cmpl   $0xffffffff,-0x6c(%rbp)
je     17ef <main+0x60f>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    17f4 <main+0x614>
jmp    16c4 <main+0x4e4>
jmp    17fe <main+0x61e>
cmpl   $0x0,-0x18(%rbp)
jle    1823 <main+0x643>
xor    %edi,%edi
call   10f0 <wait_for_child@plt>
or     -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    17fe <main+0x61e>
mov    -0x48(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r13
mov    %edi,%esi
mov    $0x8,%edi
mov    %esi,0xc(%rsp)
call   1060 <calloc@plt>
mov    %rax,0x28(%rsp)
mov    0x2dcb(%rip),%rax
mov    (%rax),%rbp
mov    0x0(%r13,%rbp,8),%rdi
test   %rdi,%rdi
je     13ac <main+0x1cc>
movl   $0x1,0x8(%rsp)
movsd  0xdd2(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0xffffffff,%r12d
lea    0xdcf(%rip),%r14
movl   $0x0,0x4(%rsp)
xor    %r15d,%r15d
jmp    127c <main+0x9c>
cmp    $0xffffffff,%eax
je     13c6 <main+0x1e6>
xor    %eax,%eax
call   10a0 <usage@plt>
mov    %r15d,%ecx
mov    0x2d70(%rip),%rdx
mov    (%rdx),%rax
mov    0x0(%r13,%rax,8),%rdi
mov    %ecx,%r15d
test   %rdi,%rdi
je     13d0 <main+0x1f0>
lea    0xda5(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13c6 <main+0x1e6>
mov    0xc(%rsp),%edi
mov    %r13,%rsi
lea    0xd8c(%rip),%rdx
call   10b0 <getopt@plt>
lea    -0x69(%rax),%edx
cmp    $0x5,%edx
ja     124e <main+0x6e>
mov    $0x1,%ecx
movslq (%r14,%rdx,4),%rax
add    %r14,%rax
jmp    *%rax
mov    0x2cff(%rip),%rbx
movl   $0x0,(%rbx)
mov    0x2d2a(%rip),%rax
mov    (%rax),%rdi
lea    0x18(%rsp),%rsi
xor    %edx,%edx
call   10c0 <strtoul@plt>
cmpl   $0x0,(%rbx)
jne    1688 <main+0x4a8>
mov    %eax,%r12d
jmp    131d <main+0x13d>
mov    0x2cce(%rip),%rbp
movl   $0x0,0x0(%rbp)
mov    0x2cf8(%rip),%rax
mov    (%rax),%rdi
lea    0x18(%rsp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,0x10(%rsp)
cmpl   $0x0,0x0(%rbp)
jne    1688 <main+0x4a8>
mov    0x18(%rsp),%rbx
mov    0x2ccf(%rip),%rax
mov    (%rax),%rdi
sub    %rdi,%rbx
call   1050 <strlen@plt>
mov    %r15d,%ecx
cmp    %rbx,%rax
je     1261 <main+0x81>
jmp    1688 <main+0x4a8>
mov    0x2c74(%rip),%rbx
movl   $0x0,(%rbx)
mov    0x2c9f(%rip),%rax
mov    (%rax),%rdi
lea    0x18(%rsp),%rsi
xor    %edx,%edx
call   10c0 <strtoul@plt>
cmpl   $0x0,(%rbx)
jne    16ae <main+0x4ce>
mov    %eax,%ebp
test   %eax,%eax
jle    16ae <main+0x4ce>
mov    0x18(%rsp),%rbx
mov    0x2c71(%rip),%rax
mov    (%rax),%rdi
sub    %rdi,%rbx
call   1050 <strlen@plt>
cmp    %rbx,%rax
jne    16ae <main+0x4ce>
mov    %ebp,0x8(%rsp)
movl   $0x1,0x4(%rsp)
jmp    125e <main+0x7e>
movl   $0x1,0x8(%rsp)
movsd  0xc44(%rip),%xmm0
movl   $0x0,0x20(%rsp)
jmp    13f4 <main+0x214>
mov    %r15d,%ecx
mov    0x2c08(%rip),%rdx
mov    (%rdx),%rbp
cmpl   $0x0,0x4(%rsp)
mov    $0x2,%eax
cmove  %ecx,%eax
test   %ecx,%ecx
cmove  %ecx,%eax
mov    %eax,0x20(%rsp)
test   %r12d,%r12d
movsd  0x10(%rsp),%xmm0
jns    13fa <main+0x21a>
mov    $0x1,%r12d
movsd  %xmm0,0x10(%rsp)
movslq 0xc(%rsp),%rbx
cmp    %rbx,%rbp
mov    %r12d,0x24(%rsp)
jae    152d <main+0x34d>
lea    0x8(%r13),%rax
mov    %rax,0x48(%rsp)
xor    %eax,%eax
mov    %rax,0x38(%rsp)
movl   $0x0,0x4(%rsp)
xor    %r14d,%r14d
mov    0x28(%rsp),%r15
mov    %r13,0x50(%rsp)
mov    %rbx,0x30(%rsp)
jmp    1475 <main+0x295>
nop
mov    0x0(%r13,%rbp,8),%rdi
call   10e0 <strdup@plt>
mov    0x2b87(%rip),%rcx
mov    0x38(%rsp),%rdx
movslq %edx,%rdx
mov    %rax,(%r15,%rdx,8)
add    $0x1,%edx
mov    %rdx,0x38(%rsp)
add    $0x1,%rbp
mov    %rbp,(%rcx)
cmp    %rbx,%rbp
jae    153d <main+0x35d>
mov    0x0(%r13,%rbp,8),%rdi
lea    0xba7(%rip),%rsi
call   1070 <strcmp@plt>
mov    0x2b4b(%rip),%rcx
mov    (%rcx),%rbp
test   %rax,%rax
jne    1440 <main+0x260>
mov    %r15,%rbx
mov    %r12d,%r15d
lea    0x1(%rbp),%r13
mov    %r13,(%rcx)
mov    0xc(%rsp),%r12d
sub    %r13d,%r12d
mov    $0x8,%edi
mov    %r12d,%esi
call   1060 <calloc@plt>
test   %rax,%rax
je     16a4 <main+0x4c4>
mov    %rax,%r14
test   %r12d,%r12d
mov    %r12d,0x4(%rsp)
jle    1507 <main+0x327>
mov    %r12d,%ebx
mov    0x48(%rsp),%rax
lea    (%rax,%rbp,8),%rbp
xor    %r12d,%r12d
nopl   0x0(%rax)
mov    0x0(%rbp,%r12,8),%rdi
call   10e0 <strdup@plt>
mov    %rax,(%r14,%r12,8)
add    $0x1,%r12
cmp    %r12,%rbx
jne    14e0 <main+0x300>
mov    0x4(%rsp),%eax
mov    0x28(%rsp),%r15
mov    0x24(%rsp),%r12d
jmp    150f <main+0x32f>
xor    %eax,%eax
mov    %r15d,%r12d
mov    %rbx,%r15
mov    0x30(%rsp),%rbx
mov    %eax,%eax
add    %rax,%r13
mov    %r13,%rbp
mov    0x50(%rsp),%r13
mov    0x2ab0(%rip),%rcx
jmp    1465 <main+0x285>
xor    %r14d,%r14d
movl   $0x0,0x4(%rsp)
mov    0x28(%rsp),%r15
cmpl   $0x2,0x8(%rsp)
jl     154e <main+0x36e>
cmpq   $0x0,(%r15)
je     16d9 <main+0x4f9>
cmpl   $0x0,0x4(%rsp)
jle    1675 <main+0x495>
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %r13d,%r13d
jmp    157b <main+0x39b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %r15d,0x4(%rsp)
jle    1652 <main+0x472>
lea    0x40(%rsp),%rdi
mov    $0x1,%esi
call   1040 <getloadavg@plt>
test   %r12d,%r12d
je     1594 <main+0x3b4>
cmp    %r12d,%r13d
jge    15e3 <main+0x403>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     15ac <main+0x3cc>
ucomisd 0x40(%rsp),%xmm0
jbe    15e3 <main+0x403>
mov    0x4(%rsp),%eax
sub    %r15d,%eax
mov    0x8(%rsp),%ebx
cmp    %eax,%ebx
cmovg  %eax,%ebx
movslq %r15d,%r15
lea    (%r14,%r15,8),%rsi
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%edx
mov    %ebx,%ecx
call   1090 <exec_child@plt>
mov    %ebx,0x8(%rsp)
add    %ebx,%r15d
mov    0x24(%rsp),%r12d
add    $0x1,%r13d
test   %r12d,%r12d
je     15ed <main+0x40d>
cmp    %r12d,%r13d
jne    15fa <main+0x41a>
xor    %edi,%edi
call   10f0 <wait_for_child@plt>
or     %eax,%ebp
add    $0xffffffff,%r13d
movsd  0x10(%rsp),%xmm1
ucomisd 0xa00(%rip),%xmm1
jbe    1570 <main+0x390>
movsd  0x40(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jb     1570 <main+0x390>
mov    $0x1,%edi
call   1100 <sleep@plt>
mov    0x29b1(%rip),%rax
mov    (%rax),%edi
call   10f0 <wait_for_child@plt>
test   %eax,%eax
mov    $0x0,%ecx
cmovns %eax,%ecx
or     %ecx,%ebp
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
sub    %ecx,%r13d
jmp    1570 <main+0x390>
test   %r13d,%r13d
jle    1677 <main+0x497>
add    $0x1,%r13d
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   10f0 <wait_for_child@plt>
or     %eax,%ebp
add    $0xffffffff,%r13d
cmp    $0x1,%r13d
ja     1660 <main+0x480>
jmp    1677 <main+0x497>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2939(%rip),%rax
mov    (%rax),%edi
mov    0x2960(%rip),%rax
mov    (%rax),%rdx
lea    0x993(%rip),%rsi
jmp    16c8 <main+0x4e8>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    0x2913(%rip),%rax
mov    (%rax),%edi
mov    0x293a(%rip),%rax
mov    (%rax),%rdx
lea    0x98a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    0x28e8(%rip),%rax
mov    (%rax),%edi
lea    0x98f(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@optind = global i64 0
@.str = [3 x i8] c"--\00"
@.str.1 = [10 x i8] c"+hij:l:n:\00"
@errno = global i32 0
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [29 x i8] c"option '%s' is not a number\0A\00"
@.str.3 = [38 x i8] c"option '%s' is not a positive number\0A\00"
@.str.4 = [44 x i8] c"option -n cannot be used without a command\0A\00"
@WNOHANG = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca double
%22 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i32 0, i32* %7
store double -1.000000e+00, double* %8
store i32 1, i32* %9
%23 = load i32, i32* %4
%24 = call i8** @calloc(i32 8, i32 %23)
store i8** %24, i8*** %11
store i8** null, i8*** %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
br label %25
25: ; preds = %118, %2
%26 = load i8**, i8*** %5
%27 = load i64, i64* @optind
%28 = getelementptr inbounds i8*, i8** %26, i64 %27
%29 = load i8*, i8** %28
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %43
31: ; preds = %25
%32 = load i8**, i8*** %5
%33 = load i64, i64* @optind
%34 = getelementptr inbounds i8*, i8** %32, i64 %33
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %31
%39 = load i32, i32* %4
%40 = load i8**, i8*** %5
%41 = call i32 @getopt(i32 %39, i8** %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 %41, i32* %10
%42 = icmp ne i32 %41, -1
br label %43
43: ; preds = %38, %31, %25
%44 = phi i1 [ false, %31 ], [ false, %25 ], [ %42, %38 ]
br i1 %44, label %45, label %119
45: ; preds = %43
%46 = load i32, i32* %10
switch i32 %46, label %116 [
i32 104, label %47
i32 105, label %49
i32 106, label %50
i32 108, label %71
i32 110, label %92
]
47: ; preds = %45
%48 = call i32 (...) @usage()
br label %118
49: ; preds = %45
store i32 1, i32* %17
br label %118
50: ; preds = %45
store i32 0, i32* @errno
%51 = load i8*, i8** @optarg
%52 = call i32 @strtoul(i8* %51, i8** %19, i32 0)
store i32 %52, i32* %6
%53 = load i32, i32* @errno
%54 = icmp ne i32 %53, 0
br i1 %54, label %65, label %55
55: ; preds = %50
%56 = load i8*, i8** %19
%57 = load i8*, i8** @optarg
%58 = ptrtoint i8* %56 to i64
%59 = ptrtoint i8* %57 to i64
%60 = sub i64 %58, %59
%61 = inttoptr i64 %60 to i8*
%62 = load i8*, i8** @optarg
%63 = call i8* @strlen(i8* %62)
%64 = icmp ne i8* %61, %63
br i1 %64, label %65, label %70
65: ; preds = %55, %50
%66 = load i32, i32* @stderr
%67 = load i8*, i8** @optarg
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %67)
%69 = call i32 @exit(i32 2)
unreachable
70: ; preds = %55
br label %118
71: ; preds = %45
store i32 0, i32* @errno
%72 = load i8*, i8** @optarg
%73 = call double @strtod(i8* %72, i8** %19)
store double %73, double* %8
%74 = load i32, i32* @errno
%75 = icmp ne i32 %74, 0
br i1 %75, label %86, label %76
76: ; preds = %71
%77 = load i8*, i8** %19
%78 = load i8*, i8** @optarg
%79 = ptrtoint i8* %77 to i64
%80 = ptrtoint i8* %78 to i64
%81 = sub i64 %79, %80
%82 = inttoptr i64 %81 to i8*
%83 = load i8*, i8** @optarg
%84 = call i8* @strlen(i8* %83)
%85 = icmp ne i8* %82, %84
br i1 %85, label %86, label %91
86: ; preds = %76, %71
%87 = load i32, i32* @stderr
%88 = load i8*, i8** @optarg
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %88)
%90 = call i32 @exit(i32 2)
unreachable
91: ; preds = %76
br label %118
92: ; preds = %45
store i32 0, i32* @errno
%93 = load i8*, i8** @optarg
%94 = call i32 @strtoul(i8* %93, i8** %19, i32 0)
store i32 %94, i32* %9
%95 = load i32, i32* @errno
%96 = icmp ne i32 %95, 0
br i1 %96, label %110, label %97
97: ; preds = %92
%98 = load i32, i32* %9
%99 = icmp slt i32 %98, 1
br i1 %99, label %110, label %100
100: ; preds = %97
%101 = load i8*, i8** %19
%102 = load i8*, i8** @optarg
%103 = ptrtoint i8* %101 to i64
%104 = ptrtoint i8* %102 to i64
%105 = sub i64 %103, %104
%106 = inttoptr i64 %105 to i8*
%107 = load i8*, i8** @optarg
%108 = call i8* @strlen(i8* %107)
%109 = icmp ne i8* %106, %108
br i1 %109, label %110, label %115
110: ; preds = %100, %97, %92
%111 = load i32, i32* @stderr
%112 = load i8*, i8** @optarg
%113 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %112)
%114 = call i32 @exit(i32 2)
unreachable
115: ; preds = %100
store i32 1, i32* %18
br label %118
116: ; preds = %45
%117 = call i32 (...) @usage()
br label %118
118: ; preds = %116, %115, %91, %70, %49, %47
br label %25
119: ; preds = %43
%120 = load i32, i32* %17
%121 = icmp ne i32 %120, 0
br i1 %121, label %122, label %126
122: ; preds = %119
%123 = load i32, i32* %18
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %126
125: ; preds = %122
store i32 2, i32* %17
br label %126
126: ; preds = %125, %122, %119
%127 = load i32, i32* %6
%128 = icmp slt i32 %127, 0
br i1 %128, label %129, label %130
129: ; preds = %126
store i32 1, i32* %6
br label %130
130: ; preds = %129, %126
br label %131
131: ; preds = %195, %130
%132 = load i64, i64* @optind
%133 = load i32, i32* %4
%134 = sext i32 %133 to i64
%135 = icmp ult i64 %132, %134
br i1 %135, label %136, label %198
136: ; preds = %131
%137 = load i8**, i8*** %5
%138 = load i64, i64* @optind
%139 = getelementptr inbounds i8*, i8** %137, i64 %138
%140 = load i8*, i8** %139
%141 = call i64 @strcmp(i8* %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%142 = icmp eq i64 %141, 0
br i1 %142, label %143, label %183
143: ; preds = %136
%144 = load i64, i64* @optind
%145 = add i64 %144, 1
store i64 %145, i64* @optind
%146 = load i32, i32* %4
%147 = sext i32 %146 to i64
%148 = load i64, i64* @optind
%149 = sub i64 %147, %148
%150 = trunc i64 %149 to i32
store i32 %150, i32* %14
%151 = load i32, i32* %14
%152 = call i8** @calloc(i32 8, i32 %151)
store i8** %152, i8*** %12
%153 = load i8**, i8*** %12
%154 = icmp ne i8** %153, null
br i1 %154, label %157, label %155
155: ; preds = %143
%156 = call i32 @exit(i32 1)
unreachable
157: ; preds = %143
store i32 0, i32* %20
br label %158
158: ; preds = %175, %157
%159 = load i32, i32* %20
%160 = load i32, i32* %14
%161 = icmp slt i32 %159, %160
br i1 %161, label %162, label %178
162: ; preds = %158
%163 = load i8**, i8*** %5
%164 = load i64, i64* @optind
%165 = load i32, i32* %20
%166 = sext i32 %165 to i64
%167 = add i64 %164, %166
%168 = getelementptr inbounds i8*, i8** %163, i64 %167
%169 = load i8*, i8** %168
%170 = call i8* @strdup(i8* %169)
%171 = load i8**, i8*** %12
%172 = load i32, i32* %20
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8*, i8** %171, i64 %173
store i8* %170, i8** %174
br label %175
175: ; preds = %162
%176 = load i32, i32* %20
%177 = add nsw i32 %176, 1
store i32 %177, i32* %20
br label %158
178: ; preds = %158
%179 = load i32, i32* %20
%180 = sext i32 %179 to i64
%181 = load i64, i64* @optind
%182 = add i64 %181, %180
store i64 %182, i64* @optind
br label %195
183: ; preds = %136
%184 = load i8**, i8*** %5
%185 = load i64, i64* @optind
%186 = getelementptr inbounds i8*, i8** %184, i64 %185
%187 = load i8*, i8** %186
%188 = call i8* @strdup(i8* %187)
%189 = load i8**, i8*** %11
%190 = load i32, i32* %15
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i8*, i8** %189, i64 %191
store i8* %188, i8** %192
%193 = load i32, i32* %15
%194 = add nsw i32 %193, 1
store i32 %194, i32* %15
br label %195
195: ; preds = %183, %178
%196 = load i64, i64* @optind
%197 = add i64 %196, 1
store i64 %197, i64* @optind
br label %131
198: ; preds = %131
%199 = load i32, i32* %9
%200 = icmp sgt i32 %199, 1
br i1 %200, label %201, label %210
201: ; preds = %198
%202 = load i8**, i8*** %11
%203 = getelementptr inbounds i8*, i8** %202, i64 0
%204 = load i8*, i8** %203
%205 = icmp ne i8* %204, null
br i1 %205, label %210, label %206
206: ; preds = %201
%207 = load i32, i32* @stderr
%208 = call i32 (i32, i8*, ...) @fprintf(i32 %207, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%209 = call i32 @exit(i32 2)
unreachable
210: ; preds = %201, %198
br label %211
211: ; preds = %291, %210
%212 = load i32, i32* %13
%213 = load i32, i32* %14
%214 = icmp slt i32 %212, %213
br i1 %214, label %215, label %292
215: ; preds = %211
%216 = call i32 @getloadavg(double* %21, i32 1)
%217 = load i32, i32* %6
%218 = icmp eq i32 %217, 0
br i1 %218, label %223, label %219
219: ; preds = %215
%220 = load i32, i32* %7
%221 = load i32, i32* %6
%222 = icmp slt i32 %220, %221
br i1 %222, label %223, label %254
223: ; preds = %219, %215
%224 = load double, double* %8
%225 = fcmp olt double %224, 0.000000e+00
br i1 %225, label %230, label %226
226: ; preds = %223
%227 = load double, double* %21
%228 = load double, double* %8
%229 = fcmp olt double %227, %228
br i1 %229, label %230, label %254
230: ; preds = %226, %223
%231 = load i32, i32* %9
%232 = load i32, i32* %14
%233 = load i32, i32* %13
%234 = sub nsw i32 %232, %233
%235 = icmp sgt i32 %231, %234
br i1 %235, label %236, label %240
236: ; preds = %230
%237 = load i32, i32* %14
%238 = load i32, i32* %13
%239 = sub nsw i32 %237, %238
store i32 %239, i32* %9
br label %240
240: ; preds = %236, %230
%241 = load i8**, i8*** %11
%242 = load i8**, i8*** %12
%243 = load i32, i32* %13
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds i8*, i8** %242, i64 %244
%246 = load i32, i32* %17
%247 = load i32, i32* %9
%248 = call i32 @exec_child(i8** %241, i8** %245, i32 %246, i32 %247)
%249 = load i32, i32* %9
%250 = load i32, i32* %13
%251 = add nsw i32 %250, %249
store i32 %251, i32* %13
%252 = load i32, i32* %7
%253 = add nsw i32 %252, 1
store i32 %253, i32* %7
br label %254
254: ; preds = %240, %226, %219
%255 = load i32, i32* %6
%256 = icmp eq i32 %255, 0
br i1 %256, label %261, label %257
257: ; preds = %254
%258 = load i32, i32* %7
%259 = load i32, i32* %6
%260 = icmp eq i32 %258, %259
br i1 %260, label %261, label %267
261: ; preds = %257, %254
%262 = call i32 @wait_for_child(i32 0)
%263 = load i32, i32* %16
%264 = or i32 %263, %262
store i32 %264, i32* %16
%265 = load i32, i32* %7
%266 = add nsw i32 %265, -1
store i32 %266, i32* %7
br label %267
267: ; preds = %261, %257
%268 = load double, double* %8
%269 = fcmp ogt double %268, 0.000000e+00
br i1 %269, label %270, label %291
270: ; preds = %267
%271 = load double, double* %21
%272 = load double, double* %8
%273 = fcmp oge double %271, %272
br i1 %273, label %274, label %291
274: ; preds = %270
%275 = call i32 @sleep(i32 1)
%276 = load i32, i32* @WNOHANG
%277 = call i32 @wait_for_child(i32 %276)
store i32 %277, i32* %22
%278 = load i32, i32* %22
%279 = icmp sgt i32 %278, 0
br i1 %279, label %280, label %284
280: ; preds = %274
%281 = load i32, i32* %22
%282 = load i32, i32* %16
%283 = or i32 %282, %281
store i32 %283, i32* %16
br label %284
284: ; preds = %280, %274
%285 = load i32, i32* %22
%286 = icmp ne i32 %285, -1
br i1 %286, label %287, label %290
287: ; preds = %284
%288 = load i32, i32* %7
%289 = add nsw i32 %288, -1
store i32 %289, i32* %7
br label %290
290: ; preds = %287, %284
br label %291
291: ; preds = %290, %270, %267
br label %211
292: ; preds = %211
br label %293
293: ; preds = %296, %292
%294 = load i32, i32* %7
%295 = icmp sgt i32 %294, 0
br i1 %295, label %296, label %302
296: ; preds = %293
%297 = call i32 @wait_for_child(i32 0)
%298 = load i32, i32* %16
%299 = or i32 %298, %297
store i32 %299, i32* %16
%300 = load i32, i32* %7
%301 = add nsw i32 %300, -1
store i32 %301, i32* %7
br label %293
302: ; preds = %293
%303 = load i32, i32* %16
ret i32 %303
}

LLVM IR (-O2):
@optind = global i64 0
@.str = [3 x i8] c"--\00"
@.str.1 = [10 x i8] c"+hij:l:n:\00"
@errno = global i32 0
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [29 x i8] c"option '%s' is not a number\0A\00"
@.str.3 = [38 x i8] c"option '%s' is not a positive number\0A\00"
@.str.4 = [44 x i8] c"option -n cannot be used without a command\0A\00"
@WNOHANG = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca double
%5 = tail call i8** @calloc(i32 8, i32 %0)
%6 = bitcast i8** %3 to i8*
%7 = load i64, i64* @optind
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %105, label %11
11: ; preds = %2, %83
%12 = phi i8* [ %91, %83 ], [ %9, %2 ]
%13 = phi i32 [ %88, %83 ], [ -1, %2 ]
%14 = phi i32 [ %87, %83 ], [ 0, %2 ]
%15 = phi i32 [ %86, %83 ], [ 0, %2 ]
%16 = phi double [ %85, %83 ], [ -1.000000e+00, %2 ]
%17 = phi i32 [ %84, %83 ], [ 1, %2 ]
%18 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %93, label %20
20: ; preds = %11
%21 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
switch i32 %21, label %81 [
i32 -1, label %93
i32 110, label %60
i32 105, label %83
i32 106, label %22
i32 108, label %41
]
22: ; preds = %20
store i32 0, i32* @errno
%23 = load i8*, i8** @optarg
%24 = call i32 @strtoul(i8* %23, i8** %3, i32 0)
%25 = load i32, i32* @errno
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %36
27: ; preds = %22
%28 = load i8*, i8** %3
%29 = load i8*, i8** @optarg
%30 = ptrtoint i8* %28 to i64
%31 = ptrtoint i8* %29 to i64
%32 = sub i64 %30, %31
%33 = inttoptr i64 %32 to i8*
%34 = tail call i8* @strlen(i8* %29)
%35 = icmp eq i8* %34, %33
br i1 %35, label %83, label %36
36: ; preds = %27, %22
%37 = load i32, i32* @stderr
%38 = load i8*, i8** @optarg
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = tail call i32 @exit(i32 2)
unreachable
41: ; preds = %20
store i32 0, i32* @errno
%42 = load i8*, i8** @optarg
%43 = call double @strtod(i8* %42, i8** %3)
%44 = load i32, i32* @errno
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %55
46: ; preds = %41
%47 = load i8*, i8** %3
%48 = load i8*, i8** @optarg
%49 = ptrtoint i8* %47 to i64
%50 = ptrtoint i8* %48 to i64
%51 = sub i64 %49, %50
%52 = inttoptr i64 %51 to i8*
%53 = tail call i8* @strlen(i8* %48)
%54 = icmp eq i8* %53, %52
br i1 %54, label %83, label %55
55: ; preds = %46, %41
%56 = load i32, i32* @stderr
%57 = load i8*, i8** @optarg
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %57)
%59 = tail call i32 @exit(i32 2)
unreachable
60: ; preds = %20
store i32 0, i32* @errno
%61 = load i8*, i8** @optarg
%62 = call i32 @strtoul(i8* %61, i8** %3, i32 0)
%63 = load i32, i32* @errno
%64 = icmp ne i32 %63, 0
%65 = icmp slt i32 %62, 1
%66 = select i1 %64, i1 true, i1 %65
br i1 %66, label %76, label %67
67: ; preds = %60
%68 = load i8*, i8** %3
%69 = load i8*, i8** @optarg
%70 = ptrtoint i8* %68 to i64
%71 = ptrtoint i8* %69 to i64
%72 = sub i64 %70, %71
%73 = inttoptr i64 %72 to i8*
%74 = tail call i8* @strlen(i8* %69)
%75 = icmp eq i8* %74, %73
br i1 %75, label %83, label %76
76: ; preds = %67, %60
%77 = load i32, i32* @stderr
%78 = load i8*, i8** @optarg
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %78)
%80 = tail call i32 @exit(i32 2)
unreachable
81: ; preds = %20
%82 = tail call i32 (...) @usage()
br label %83
83: ; preds = %81, %67, %20, %46, %27
%84 = phi i32 [ %17, %46 ], [ %17, %27 ], [ %17, %20 ], [ %62, %67 ], [ %17, %81 ]
%85 = phi double [ %43, %46 ], [ %16, %27 ], [ %16, %20 ], [ %16, %67 ], [ %16, %81 ]
%86 = phi i32 [ %15, %46 ], [ %15, %27 ], [ 1, %20 ], [ %15, %67 ], [ %15, %81 ]
%87 = phi i32 [ %14, %46 ], [ %14, %27 ], [ %14, %20 ], [ 1, %67 ], [ %14, %81 ]
%88 = phi i32 [ %13, %46 ], [ %24, %27 ], [ %13, %20 ], [ %13, %67 ], [ %13, %81 ]
%89 = load i64, i64* @optind
%90 = getelementptr inbounds i8*, i8** %1, i64 %89
%91 = load i8*, i8** %90
%92 = icmp eq i8* %91, null
br i1 %92, label %93, label %11
93: ; preds = %11, %83, %20
%94 = phi i32 [ %17, %11 ], [ %84, %83 ], [ %17, %20 ]
%95 = phi double [ %16, %11 ], [ %85, %83 ], [ %16, %20 ]
%96 = phi i32 [ %15, %11 ], [ %86, %83 ], [ %15, %20 ]
%97 = phi i32 [ %14, %11 ], [ %87, %83 ], [ %14, %20 ]
%98 = phi i32 [ %13, %11 ], [ %88, %83 ], [ %13, %20 ]
%99 = load i64, i64* @optind
%100 = icmp ne i32 %96, 0
%101 = icmp ne i32 %97, 0
%102 = select i1 %100, i1 %101, i1 false
%103 = select i1 %102, i32 2, i32 %96
%104 = icmp slt i32 %98, 0
br i1 %104, label %105, label %110
105: ; preds = %2, %93
%106 = phi i32 [ %103, %93 ], [ 0, %2 ]
%107 = phi double [ %95, %93 ], [ -1.000000e+00, %2 ]
%108 = phi i32 [ %94, %93 ], [ 1, %2 ]
%109 = phi i64 [ %99, %93 ], [ %7, %2 ]
br label %110
110: ; preds = %93, %105
%111 = phi i32 [ %106, %105 ], [ %103, %93 ]
%112 = phi double [ %107, %105 ], [ %95, %93 ]
%113 = phi i32 [ %108, %105 ], [ %94, %93 ]
%114 = phi i64 [ %109, %105 ], [ %99, %93 ]
%115 = phi i32 [ 1, %105 ], [ %98, %93 ]
%116 = sext i32 %0 to i64
%117 = icmp ult i64 %114, %116
br i1 %117, label %118, label %167
118: ; preds = %110, %160
%119 = phi i64 [ %165, %160 ], [ %114, %110 ]
%120 = phi i32 [ %164, %160 ], [ 0, %110 ]
%121 = phi i32 [ %163, %160 ], [ 0, %110 ]
%122 = phi i8** [ %162, %160 ], [ null, %110 ]
%123 = getelementptr inbounds i8*, i8** %1, i64 %119
%124 = load i8*, i8** %123
%125 = tail call i64 @strcmp(i8* %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
%127 = load i64, i64* @optind
br i1 %126, label %128, label %153
128: ; preds = %118
%129 = add i64 %127, 1
store i64 %129, i64* @optind
%130 = trunc i64 %129 to i32
%131 = sub i32 %0, %130
%132 = tail call i8** @calloc(i32 8, i32 %131)
%133 = icmp eq i8** %132, null
br i1 %133, label %138, label %134
134: ; preds = %128
%135 = icmp sgt i32 %131, 0
br i1 %135, label %136, label %149
136: ; preds = %134
%137 = zext i32 %131 to i64
br label %140
138: ; preds = %128
%139 = tail call i32 @exit(i32 1)
unreachable
140: ; preds = %136, %140
%141 = phi i64 [ 0, %136 ], [ %147, %140 ]
%142 = add i64 %129, %141
%143 = getelementptr inbounds i8*, i8** %1, i64 %142
%144 = load i8*, i8** %143
%145 = tail call i8* @strdup(i8* %144)
%146 = getelementptr inbounds i8*, i8** %132, i64 %141
store i8* %145, i8** %146
%147 = add nuw nsw i64 %141, 1
%148 = icmp eq i64 %147, %137
br i1 %148, label %149, label %140
149: ; preds = %140, %134
%150 = phi i32 [ 0, %134 ], [ %131, %140 ]
%151 = zext i32 %150 to i64
%152 = add i64 %129, %151
br label %160
153: ; preds = %118
%154 = getelementptr inbounds i8*, i8** %1, i64 %127
%155 = load i8*, i8** %154
%156 = tail call i8* @strdup(i8* %155)
%157 = sext i32 %120 to i64
%158 = getelementptr inbounds i8*, i8** %5, i64 %157
store i8* %156, i8** %158
%159 = add nsw i32 %120, 1
br label %160
160: ; preds = %153, %149
%161 = phi i64 [ %152, %149 ], [ %127, %153 ]
%162 = phi i8** [ %132, %149 ], [ %122, %153 ]
%163 = phi i32 [ %131, %149 ], [ %121, %153 ]
%164 = phi i32 [ %120, %149 ], [ %159, %153 ]
%165 = add i64 %161, 1
store i64 %165, i64* @optind
%166 = icmp ult i64 %165, %116
br i1 %166, label %118, label %167
167: ; preds = %160, %110
%168 = phi i8** [ null, %110 ], [ %162, %160 ]
%169 = phi i32 [ 0, %110 ], [ %163, %160 ]
%170 = icmp sgt i32 %113, 1
br i1 %170, label %171, label %178
171: ; preds = %167
%172 = load i8*, i8** %5
%173 = icmp eq i8* %172, null
br i1 %173, label %174, label %178
174: ; preds = %171
%175 = load i32, i32* @stderr
%176 = tail call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%177 = tail call i32 @exit(i32 2)
unreachable
178: ; preds = %171, %167
%179 = icmp sgt i32 %169, 0
br i1 %179, label %180, label %245
180: ; preds = %178
%181 = bitcast double* %4 to i8*
%182 = icmp eq i32 %115, 0
%183 = fcmp olt double %112, 0.000000e+00
%184 = fcmp ule double %112, 0.000000e+00
br label %187
185: ; preds = %234
%186 = icmp sgt i32 %235, 0
br i1 %186, label %238, label %245
187: ; preds = %180, %234
%188 = phi i32 [ 0, %180 ], [ %236, %234 ]
%189 = phi i32 [ 0, %180 ], [ %211, %234 ]
%190 = phi i32 [ 0, %180 ], [ %235, %234 ]
%191 = phi i32 [ %113, %180 ], [ %209, %234 ]
%192 = call i32 @getloadavg(double* %4, i32 1)
%193 = icmp slt i32 %190, %115
%194 = select i1 %182, i1 true, i1 %193
br i1 %194, label %195, label %208
195: ; preds = %187
%196 = load double, double* %4
%197 = fcmp olt double %196, %112
%198 = select i1 %183, i1 true, i1 %197
br i1 %198, label %199, label %208
199: ; preds = %195
%200 = sub nsw i32 %169, %189
%201 = icmp sgt i32 %191, %200
%202 = select i1 %201, i32 %200, i32 %191
%203 = sext i32 %189 to i64
%204 = getelementptr inbounds i8*, i8** %168, i64 %203
%205 = call i32 @exec_child(i8** %5, i8** %204, i32 %111, i32 %202)
%206 = add nsw i32 %202, %189
%207 = add nsw i32 %190, 1
br label %208
208: ; preds = %195, %187, %199
%209 = phi i32 [ %202, %199 ], [ %191, %187 ], [ %191, %195 ]
%210 = phi i32 [ %207, %199 ], [ %190, %187 ], [ %190, %195 ]
%211 = phi i32 [ %206, %199 ], [ %189, %187 ], [ %189, %195 ]
%212 = icmp eq i32 %210, %115
%213 = select i1 %182, i1 true, i1 %212
br i1 %213, label %214, label %218
214: ; preds = %208
%215 = call i32 @wait_for_child(i32 0)
%216 = or i32 %215, %188
%217 = add nsw i32 %210, -1
br label %218
218: ; preds = %208, %214
%219 = phi i32 [ %217, %214 ], [ %210, %208 ]
%220 = phi i32 [ %216, %214 ], [ %188, %208 ]
%221 = load double, double* %4
%222 = fcmp ult double %221, %112
%223 = select i1 %184, i1 true, i1 %222
br i1 %223, label %234, label %224
224: ; preds = %218
%225 = call i32 @sleep(i32 1)
%226 = load i32, i32* @WNOHANG
%227 = call i32 @wait_for_child(i32 %226)
%228 = icmp sgt i32 %227, 0
%229 = select i1 %228, i32 %227, i32 0
%230 = or i32 %229, %220
%231 = icmp ne i32 %227, -1
%232 = sext i1 %231 to i32
%233 = add nsw i32 %219, %232
br label %234
234: ; preds = %224, %218
%235 = phi i32 [ %233, %224 ], [ %219, %218 ]
%236 = phi i32 [ %230, %224 ], [ %220, %218 ]
%237 = icmp sgt i32 %169, %211
br i1 %237, label %187, label %185
238: ; preds = %185, %238
%239 = phi i32 [ %242, %238 ], [ %236, %185 ]
%240 = phi i32 [ %243, %238 ], [ %235, %185 ]
%241 = call i32 @wait_for_child(i32 0)
%242 = or i32 %241, %239
%243 = add nsw i32 %240, -1
%244 = icmp ugt i32 %240, 1
br i1 %244, label %238, label %245
245: ; preds = %238, %178, %185
%246 = phi i32 [ %236, %185 ], [ 0, %178 ], [ %242, %238 ]
ret i32 %246
}