#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*/ EXIT_FAILURE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
scalar_t__ isdigit(unsigned char);
char *malloc(size_t);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ optopt;
int /*<<< orphan*/ printf(char *, char *);
char *realloc(char *, size_t);
int /*<<< orphan*/ setprogname(char *);
scalar_t__ shell_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
size_t strlen(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  size_t clen, l;
  int ch, debug, i, magic, n, nargs, rval;
  char *c, *cmd, *p, *q, *nc;
  (void)setprogname(argv[0]);
  debug = 0;
  magic = '%';
  nargs = -1;
  while ((ch = getopt(argc, argv, "a:d0123456789")) != -1) {
    switch (ch) {
    case 'a':
      if (optarg[1] != '\0')
        errx(EXIT_FAILURE, "illegal magic character specification.");
      magic = optarg[0];
      break;
    case 'd':
      debug = 1;
      break;
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
      if (nargs != -1)
        errx(EXIT_FAILURE, "only one -# argument may be specified.");
      nargs = optopt - '0';
      break;
    default:
      usage();
    }
  }
  argc -= optind;
  argv += optind;
  if (argc < 2)
    usage();
  for (n = 0, p = argv[0]; *p != '\0'; ++p) {
    if (p[0] == magic && isdigit((unsigned char)p[1]) && p[1] != '0') {
      ++p;
      if (p[0] - '0' > n)
        n = p[0] - '0';
    }
  }
  if ((cmd = malloc(sizeof("exec ") - 1 + strlen(argv[0]) +
                    9 * (sizeof(" %1") - 1) + 1)) == NULL)
    err(EXIT_FAILURE, "malloc");
  if (n == 0) {
    if (nargs == -1)
      nargs = 1;
    p = cmd;
    p += sprintf(cmd, "exec %s", argv[0]);
    for (i = 1; i <= nargs; i++)
      p += sprintf(p, " %c%d", magic, i);
    if (nargs == 0)
      nargs = 1;
  } else {
    (void)sprintf(cmd, "exec %s", argv[0]);
    nargs = n;
  }
  if ((c = malloc(clen = 1024)) == NULL)
    err(EXIT_FAILURE, "malloc");
  for (rval = 0; argc > nargs; argc -= nargs, argv += nargs) {
    for (l = strlen(cmd), i = 0; i < nargs; i++)
      l += strlen(argv[i + 1]);
    if (l > clen) {
      nc = realloc(c, l);
      if (nc == NULL)
        err(EXIT_FAILURE, "malloc");
      c = nc;
      clen = l;
    }
    for (p = cmd, q = c; *p != '\0'; ++p) {
      if (p[0] == magic && isdigit((unsigned char)p[1]) && p[1] != '0')
        q += sprintf(q, "%s", argv[(++p)[0] - '0']);
      else
        *q++ = *p;
    }
    *q = '\0';
    if (debug)
      (void)printf("%s\n", c);
    else if (shell_system(c))
      rval = 1;
  }
  if (argc != 1)
    errx(EXIT_FAILURE, "expecting additional argument%s after \"%s\"",
         (nargs - argc) ? "s" : "", argv[argc - 1]);
  return rval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <setprogname@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x25,-0x30(%rbp)
movl   $0xffffffff,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdfb(%rip),%rdx
call   10c0 <getopt@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     12df <main+0x11f>
mov    -0x24(%rbp),%eax
mov    %eax,-0x6c(%rbp)
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     129e <main+0xde>
jmp    122d <main+0x6d>
mov    -0x6c(%rbp),%eax
sub    $0x61,%eax
je     124f <main+0x8f>
jmp    123e <main+0x7e>
mov    -0x6c(%rbp),%eax
sub    $0x64,%eax
je     1292 <main+0xd2>
jmp    12d3 <main+0x113>
mov    0x2da2(%rip),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     127d <main+0xbd>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
lea    0xd98(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
mov    0x2d74(%rip),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x30(%rbp)
jmp    12da <main+0x11a>
movl   $0x1,-0x28(%rbp)
jmp    12da <main+0x11a>
cmpl   $0xffffffff,-0x38(%rbp)
je     12bf <main+0xff>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x38(%rbp)
jmp    12da <main+0x11a>
mov    $0x0,%al
call   10b0 <usage@plt>
jmp    11f7 <main+0x37>
mov    0x2cf2(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2cde(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    131a <main+0x15a>
mov    $0x0,%al
call   10b0 <usage@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13bb <main+0x1fb>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x30(%rbp),%eax
jne    13a5 <main+0x1e5>
mov    -0x58(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     13a5 <main+0x1e5>
mov    -0x58(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
je     13a5 <main+0x1e5>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
cmp    -0x34(%rbp),%eax
jle    13a0 <main+0x1e0>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x34(%rbp)
jmp    13a5 <main+0x1e5>
jmp    13aa <main+0x1ea>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    132c <main+0x16c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x5,%rdi
add    $0x1b,%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    13fe <main+0x23e>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
lea    0xc63(%rip),%rsi
call   1070 <err@plt>
cmpl   $0x0,-0x34(%rbp)
jne    14a9 <main+0x2e9>
cmpl   $0xffffffff,-0x38(%rbp)
jne    1419 <main+0x259>
movl   $0x1,-0x38(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc30(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     1493 <main+0x2d3>
mov    -0x58(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xbfd(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1451 <main+0x291>
cmpl   $0x0,-0x38(%rbp)
jne    14a4 <main+0x2e4>
movl   $0x1,-0x38(%rbp)
jmp    14c8 <main+0x308>
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xba8(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
movq   $0x400,-0x18(%rbp)
mov    $0x400,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    14fd <main+0x33d>
mov    0x2ad9(%rip),%rax
mov    (%rax),%edi
lea    0xb64(%rip),%rsi
call   1070 <err@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x38(%rbp),%eax
jle    16e7 <main+0x527>
mov    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    155c <main+0x39c>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1524 <main+0x364>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    15ab <main+0x3eb>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <realloc@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    159b <main+0x3db>
mov    0x2a3b(%rip),%rax
mov    (%rax),%edi
lea    0xac6(%rip),%rsi
call   1070 <err@plt>
mov    -0x68(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1678 <main+0x4b8>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x30(%rbp),%eax
jne    164b <main+0x48b>
mov    -0x58(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     164b <main+0x48b>
mov    -0x58(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
je     164b <main+0x48b>
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x58(%rbp)
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xa39(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    1662 <main+0x4a2>
mov    -0x58(%rbp),%rax
mov    (%rax),%cl
mov    -0x60(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x60(%rbp)
mov    %cl,(%rax)
jmp    1667 <main+0x4a7>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    15bb <main+0x3fb>
mov    -0x60(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x28(%rbp)
je     169e <main+0x4de>
mov    -0x48(%rbp),%rsi
lea    0x9dd(%rip),%rdi
call   1060 <printf@plt>
jmp    16bd <main+0x4fd>
mov    -0x48(%rbp),%rdi
call   1090 <shell_system@plt>
cmp    $0x0,%rax
je     16b8 <main+0x4f8>
movl   $0x1,-0x3c(%rbp)
jmp    16bd <main+0x4fd>
jmp    16c2 <main+0x502>
mov    -0x38(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x38(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1504 <main+0x344>
cmpl   $0x1,-0x8(%rbp)
je     1734 <main+0x574>
mov    0x28d0(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%ecx
sub    -0x8(%rbp),%ecx
lea    0x96d(%rip),%rdx
lea    0x95b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
lea    0x948(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
mov    -0x3c(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%r12d
mov    (%rsi),%rdi
call   10f0 <setprogname@plt>
mov    $0xffffffff,%ebp
mov    $0x25,%r13d
mov    $0x1,%al
mov    %eax,0x1c(%rsp)
lea    0xf94(%rip),%r14
lea    0xdf5(%rip),%r15
jmp    1217 <main+0x47>
nopl   (%rax)
xor    %eax,%eax
call   10c0 <usage@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10d0 <getopt@plt>
add    $0x1,%eax
cmp    $0x65,%eax
ja     1210 <main+0x40>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
cmp    $0xffffffff,%ebp
je     1252 <main+0x82>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xf82(%rip),%rsi
xor    %eax,%eax
call   1060 <errx@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%ebp
add    $0xffffffd0,%ebp
jmp    1217 <main+0x47>
mov    0x2d91(%rip),%r13
mov    0x0(%r13),%rax
cmpb   $0x0,0x1(%rax)
je     128c <main+0xbc>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
lea    0xf25(%rip),%rsi
xor    %eax,%eax
call   1060 <errx@plt>
mov    0x0(%r13),%rax
movsbl (%rax),%r13d
jmp    1217 <main+0x47>
movl   $0x0,0x1c(%rsp)
jmp    1217 <main+0x47>
mov    0x2d32(%rip),%rax
mov    (%rax),%rax
sub    %eax,%r12d
lea    (%rbx,%rax,8),%r14
cmp    $0x1,%r12d
jg     12bd <main+0xed>
xor    %eax,%eax
call   10c0 <usage@plt>
mov    (%r14),%rbx
mov    (%rbx),%cl
xor    %r15d,%r15d
test   %cl,%cl
jne    12e2 <main+0x112>
jmp    1313 <main+0x143>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rax
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
mov    %rax,%rbx
test   %cl,%cl
je     1310 <main+0x140>
movsbl %cl,%eax
cmp    %eax,%r13d
jne    12d0 <main+0x100>
movzbl 0x1(%rbx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     12d0 <main+0x100>
lea    0x1(%rbx),%rax
movsbl (%rax),%ecx
cmp    $0x30,%ecx
je     12d0 <main+0x100>
add    $0xffffffd0,%ecx
cmp    %r15d,%ecx
cmovg  %ecx,%r15d
jmp    12d3 <main+0x103>
mov    (%r14),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x21(%rax),%rdi
call   1090 <malloc@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     134e <main+0x17e>
test   %r15d,%r15d
je     1368 <main+0x198>
mov    (%r14),%rdx
lea    0xebe(%rip),%rsi
mov    0x10(%rsp),%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
jmp    13f2 <main+0x222>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1080 <err@plt>
test   %r15d,%r15d
jne    1333 <main+0x163>
mov    %r12d,0x4(%rsp)
cmp    $0xffffffff,%ebp
mov    $0x1,%r15d
cmove  %r15d,%ebp
mov    (%r14),%rdx
lea    0xe77(%rip),%rsi
mov    0x10(%rsp),%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
test   %ebp,%ebp
jle    13e1 <main+0x211>
cltq
mov    0x10(%rsp),%rbx
add    %rax,%rbx
mov    %ebp,%r12d
neg    %r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
lea    0xe49(%rip),%rsi
mov    %r13d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   10e0 <sprintf@plt>
cltq
add    %rax,%rbx
lea    (%r12,%r15,1),%eax
add    $0x1,%eax
mov    %r15d,%ecx
add    $0x1,%ecx
mov    %ecx,%r15d
cmp    $0x1,%eax
jne    13b0 <main+0x1e0>
test   %ebp,%ebp
mov    $0x1,%r15d
cmovne %ebp,%r15d
mov    0x4(%rsp),%r12d
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    141e <main+0x24e>
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
lea    0xddb(%rip),%rsi
call   1080 <err@plt>
xor    %eax,%eax
mov    %rax,0x20(%rsp)
cmp    %r15d,%r12d
mov    %r15d,0x18(%rsp)
jle    15c4 <main+0x3f4>
movslq %r15d,%rax
mov    %r15d,%ebp
mov    %r15d,%r15d
shl    $0x3,%rax
mov    %rax,0x30(%rsp)
mov    $0x400,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
jmp    1499 <main+0x2c9>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
call   10a0 <shell_system@plt>
test   %rax,%rax
mov    0x20(%rsp),%rax
mov    $0x1,%ecx
cmovne %ecx,%eax
mov    %rax,0x20(%rsp)
mov    0x4(%rsp),%r12d
mov    0x18(%rsp),%ebp
sub    %ebp,%r12d
add    0x30(%rsp),%r14
cmp    %ebp,%r12d
jle    15c4 <main+0x3f4>
mov    0x10(%rsp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    14c6 <main+0x2f6>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x8(%r14,%rbp,8),%rdi
add    $0x1,%rbp
call   1050 <strlen@plt>
add    %rax,%rbx
cmp    %rbp,%r15
jne    14b0 <main+0x2e0>
cmp    0x28(%rsp),%rbx
mov    %r12d,0x4(%rsp)
jbe    1520 <main+0x350>
mov    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   10b0 <realloc@plt>
mov    %rax,%rcx
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     14f3 <main+0x323>
mov    %rbx,0x28(%rsp)
jmp    1520 <main+0x350>
mov    0x2ace(%rip),%rax
mov    (%rax),%edi
lea    0xcf1(%rip),%rsi
call   1080 <err@plt>
mov    %rbx,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x10(%rsp),%rax
mov    (%rax),%al
mov    0x8(%rsp),%rbx
test   %al,%al
je     15a0 <main+0x3d0>
mov    0x8(%rsp),%rbx
mov    0x10(%rsp),%r12
jmp    1559 <main+0x389>
nopl   0x0(%rax)
movzbl (%r12),%eax
mov    %al,(%rbx)
add    $0x1,%rbx
movzbl 0x1(%r12),%eax
add    $0x1,%r12
test   %al,%al
je     15a0 <main+0x3d0>
movsbl %al,%eax
cmp    %eax,%r13d
jne    1540 <main+0x370>
movzbl 0x1(%r12),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1540 <main+0x370>
lea    0x1(%r12),%rbp
movsbq 0x0(%rbp),%rax
cmp    $0x30,%rax
je     1540 <main+0x370>
mov    -0x180(%r14,%rax,8),%rsi
ff
mov    %rbx,%rdi
call   1040 <stpcpy@plt>
sub    %ebx,%eax
cltq
add    %rax,%rbx
mov    %rbp,%r12
jmp    154b <main+0x37b>
nopl   (%rax)
movb   $0x0,(%rbx)
testb  $0x1,0x1c(%rsp)
jne    1460 <main+0x290>
lea    0xc54(%rip),%rdi
mov    0x8(%rsp),%rsi
call   1070 <printf@plt>
jmp    147f <main+0x2af>
cmp    $0x1,%r12d
je     1600 <main+0x430>
mov    0x29f7(%rip),%rax
mov    (%rax),%edi
cmp    0x18(%rsp),%r12d
lea    0xc2d(%rip),%rax
lea    0xc1b(%rip),%rdx
cmove  %rax,%rdx
movslq %r12d,%rax
mov    -0x8(%r14,%rax,8),%rcx
lea    0xc14(%rip),%rsi
xor    %eax,%eax
call   1060 <errx@plt>
mov    0x20(%rsp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a:d0123456789\00"
@optarg = global i8* null
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"illegal magic character specification.\00"
@.str.2 = [39 x i8] c"only one -# argument may be specified.\00"
@optopt = global i32 0
@optind = global i64 0
@.str.3 = [7 x i8] c"malloc\00"
@.str.4 = [8 x i8] c"exec %s\00"
@.str.5 = [6 x i8] c" %c%d\00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [43 x i8] c"expecting additional argument%s after \22%s\22\00"
@.str.9 = [2 x i8] c"s\00"
@.str.10 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @setprogname(i8* %3)
br label %5
5: ; preds = %14, %2
%6 = phi i1 [ true, %2 ], [ false, %14 ]
%7 = phi i32 [ 37, %2 ], [ %10, %14 ]
%8 = phi i32 [ -1, %2 ], [ %13, %14 ]
br label %9
9: ; preds = %5, %25
%10 = phi i32 [ %7, %5 ], [ %28, %25 ]
%11 = phi i32 [ %8, %5 ], [ %13, %25 ]
br label %12
12: ; preds = %9, %34
%13 = phi i32 [ %11, %9 ], [ %36, %34 ]
br label %14
14: ; preds = %12, %37
%15 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
switch i32 %15, label %37 [
i32 -1, label %39
i32 97, label %16
i32 100, label %5
i32 48, label %29
i32 49, label %29
i32 50, label %29
i32 51, label %29
i32 52, label %29
i32 53, label %29
i32 54, label %29
i32 55, label %29
i32 56, label %29
i32 57, label %29
]
16: ; preds = %14
%17 = load i8*, i8** @optarg
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %16
%22 = load i32, i32* @EXIT_FAILURE
%23 = tail call i32 (i32, i8*, ...) @errx(i32 %22, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%24 = load i8*, i8** @optarg
br label %25
25: ; preds = %21, %16
%26 = phi i8* [ %24, %21 ], [ %17, %16 ]
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
br label %9
29: ; preds = %14, %14, %14, %14, %14, %14, %14, %14, %14, %14
%30 = icmp eq i32 %13, -1
br i1 %30, label %34, label %31
31: ; preds = %29
%32 = load i32, i32* @EXIT_FAILURE
%33 = tail call i32 (i32, i8*, ...) @errx(i32 %32, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %31, %29
%35 = load i32, i32* @optopt
%36 = add nsw i32 %35, -48
br label %12
37: ; preds = %14
%38 = tail call i32 (...) @usage()
br label %14
39: ; preds = %14
%40 = load i64, i64* @optind
%41 = trunc i64 %40 to i32
%42 = sub i32 %0, %41
%43 = getelementptr inbounds i8*, i8** %1, i64 %40
%44 = icmp slt i32 %42, 2
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = tail call i32 (...) @usage()
br label %47
47: ; preds = %45, %39
%48 = load i8*, i8** %43
%49 = load i8, i8* %48
%50 = icmp eq i8 %49, 0
br i1 %50, label %78, label %51
51: ; preds = %47, %70
%52 = phi i8 [ %74, %70 ], [ %49, %47 ]
%53 = phi i8* [ %73, %70 ], [ %48, %47 ]
%54 = phi i32 [ %71, %70 ], [ 0, %47 ]
%55 = sext i8 %52 to i32
%56 = icmp eq i32 %10, %55
br i1 %56, label %57, label %70
57: ; preds = %51
%58 = getelementptr inbounds i8, i8* %53, i64 1
%59 = load i8, i8* %58
%60 = tail call i64 @isdigit(i8 zeroext %59)
%61 = icmp eq i64 %60, 0
br i1 %61, label %70, label %62
62: ; preds = %57
%63 = load i8, i8* %58
%64 = icmp eq i8 %63, 48
br i1 %64, label %70, label %65
65: ; preds = %62
%66 = sext i8 %63 to i32
%67 = add nsw i32 %66, -48
%68 = icmp sgt i32 %67, %54
%69 = select i1 %68, i32 %67, i32 %54
br label %70
70: ; preds = %65, %51, %57, %62
%71 = phi i32 [ %54, %62 ], [ %54, %57 ], [ %54, %51 ], [ %69, %65 ]
%72 = phi i8* [ %53, %62 ], [ %53, %57 ], [ %53, %51 ], [ %58, %65 ]
%73 = getelementptr inbounds i8, i8* %72, i64 1
%74 = load i8, i8* %73
%75 = icmp eq i8 %74, 0
br i1 %75, label %76, label %51
76: ; preds = %70
%77 = load i8*, i8** %43
br label %78
78: ; preds = %76, %47
%79 = phi i8* [ %48, %47 ], [ %77, %76 ]
%80 = phi i32 [ 0, %47 ], [ %71, %76 ]
%81 = tail call i64 @strlen(i8* dereferenceable(1) %79)
%82 = add i64 %81, 33
%83 = tail call i8* @malloc(i64 %82)
%84 = icmp eq i8* %83, null
br i1 %84, label %85, label %88
85: ; preds = %78
%86 = load i32, i32* @EXIT_FAILURE
%87 = tail call i32 @err(i32 %86, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %88
88: ; preds = %85, %78
%89 = icmp eq i32 %80, 0
br i1 %89, label %90, label %110
90: ; preds = %88
%91 = icmp eq i32 %13, -1
%92 = select i1 %91, i32 1, i32 %13
%93 = load i8*, i8** %43
%94 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %83, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %93)
%95 = icmp slt i32 %92, 1
br i1 %95, label %107, label %96
96: ; preds = %90
%97 = sext i32 %94 to i64
%98 = getelementptr inbounds i8, i8* %83, i64 %97
br label %99
99: ; preds = %96, %99
%100 = phi i8* [ %104, %99 ], [ %98, %96 ]
%101 = phi i32 [ %105, %99 ], [ 1, %96 ]
%102 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %100, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %10, i32 %101)
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %100, i64 %103
%105 = add nuw i32 %101, 1
%106 = icmp eq i32 %101, %92
br i1 %106, label %107, label %99
107: ; preds = %99, %90
%108 = icmp eq i32 %92, 0
%109 = select i1 %108, i32 1, i32 %92
br label %113
110: ; preds = %88
%111 = load i8*, i8** %43
%112 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %83, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %111)
br label %113
113: ; preds = %110, %107
%114 = phi i32 [ %109, %107 ], [ %80, %110 ]
%115 = tail call dereferenceable_or_null(1024) i8* @malloc(i64 1024)
%116 = icmp eq i8* %115, null
br i1 %116, label %117, label %120
117: ; preds = %113
%118 = load i32, i32* @EXIT_FAILURE
%119 = tail call i32 @err(i32 %118, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %120
120: ; preds = %117, %113
%121 = icmp sgt i32 %42, %114
br i1 %121, label %122, label %204
122: ; preds = %120
%123 = icmp sgt i32 %114, 0
%124 = sext i32 %114 to i64
%125 = zext i32 %114 to i64
br label %126
126: ; preds = %122, %199
%127 = phi i32 [ %42, %122 ], [ %201, %199 ]
%128 = phi i8** [ %43, %122 ], [ %202, %199 ]
%129 = phi i8* [ %115, %122 ], [ %153, %199 ]
%130 = phi i32 [ 0, %122 ], [ %200, %199 ]
%131 = phi i64 [ 1024, %122 ], [ %152, %199 ]
%132 = tail call i64 @strlen(i8* dereferenceable(1) %83)
br i1 %123, label %133, label %142
133: ; preds = %126, %133
%134 = phi i64 [ %136, %133 ], [ 0, %126 ]
%135 = phi i64 [ %140, %133 ], [ %132, %126 ]
%136 = add nuw nsw i64 %134, 1
%137 = getelementptr inbounds i8*, i8** %128, i64 %136
%138 = load i8*, i8** %137
%139 = tail call i64 @strlen(i8* dereferenceable(1) %138)
%140 = add i64 %139, %135
%141 = icmp eq i64 %136, %125
br i1 %141, label %142, label %133
142: ; preds = %133, %126
%143 = phi i64 [ %132, %126 ], [ %140, %133 ]
%144 = icmp ugt i64 %143, %131
br i1 %144, label %145, label %151
145: ; preds = %142
%146 = tail call i8* @realloc(i8* %129, i64 %143)
%147 = icmp eq i8* %146, null
br i1 %147, label %148, label %151
148: ; preds = %145
%149 = load i32, i32* @EXIT_FAILURE
%150 = tail call i32 @err(i32 %149, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %151
151: ; preds = %145, %148, %142
%152 = phi i64 [ %131, %142 ], [ %143, %148 ], [ %143, %145 ]
%153 = phi i8* [ %129, %142 ], [ null, %148 ], [ %146, %145 ]
%154 = load i8, i8* %83
%155 = icmp eq i8 %154, 0
br i1 %155, label %191, label %156
156: ; preds = %151, %185
%157 = phi i8 [ %189, %185 ], [ %154, %151 ]
%158 = phi i8* [ %187, %185 ], [ %153, %151 ]
%159 = phi i8* [ %188, %185 ], [ %83, %151 ]
%160 = sext i8 %157 to i32
%161 = icmp eq i32 %10, %160
br i1 %161, label %162, label %182
162: ; preds = %156
%163 = getelementptr inbounds i8, i8* %159, i64 1
%164 = load i8, i8* %163
%165 = tail call i64 @isdigit(i8 zeroext %164)
%166 = icmp eq i64 %165, 0
br i1 %166, label %182, label %167
167: ; preds = %162
%168 = load i8, i8* %163
%169 = icmp eq i8 %168, 48
br i1 %169, label %182, label %170
170: ; preds = %167
%171 = sext i8 %168 to i64
%172 = add nsw i64 %171, -48
%173 = getelementptr inbounds i8*, i8** %128, i64 %172
%174 = load i8*, i8** %173
%175 = tail call i8* @stpcpy(i8* %158, i8* %174)
%176 = ptrtoint i8* %175 to i64
%177 = ptrtoint i8* %158 to i64
%178 = sub i64 %176, %177
%179 = shl i64 %178, 32
%180 = ashr exact i64 %179, 32
%181 = getelementptr inbounds i8, i8* %158, i64 %180
br label %185
182: ; preds = %167, %162, %156
%183 = load i8, i8* %159
%184 = getelementptr inbounds i8, i8* %158, i64 1
store i8 %183, i8* %158
br label %185
185: ; preds = %170, %182
%186 = phi i8* [ %163, %170 ], [ %159, %182 ]
%187 = phi i8* [ %181, %170 ], [ %184, %182 ]
%188 = getelementptr inbounds i8, i8* %186, i64 1
%189 = load i8, i8* %188
%190 = icmp eq i8 %189, 0
br i1 %190, label %191, label %156
191: ; preds = %185, %151
%192 = phi i8* [ %153, %151 ], [ %187, %185 ]
store i8 0, i8* %192
br i1 %6, label %195, label %193
193: ; preds = %191
%194 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %153)
br label %199
195: ; preds = %191
%196 = tail call i64 @shell_system(i8* %153)
%197 = icmp eq i64 %196, 0
%198 = select i1 %197, i32 %130, i32 1
br label %199
199: ; preds = %195, %193
%200 = phi i32 [ %130, %193 ], [ %198, %195 ]
%201 = sub nsw i32 %127, %114
%202 = getelementptr inbounds i8*, i8** %128, i64 %124
%203 = icmp sgt i32 %201, %114
br i1 %203, label %126, label %204
204: ; preds = %199, %120
%205 = phi i32 [ 0, %120 ], [ %200, %199 ]
%206 = phi i8** [ %43, %120 ], [ %202, %199 ]
%207 = phi i32 [ %42, %120 ], [ %201, %199 ]
%208 = icmp eq i32 %207, 1
br i1 %208, label %218, label %209
209: ; preds = %204
%210 = load i32, i32* @EXIT_FAILURE
%211 = icmp eq i32 %207, %114
%212 = select i1 %211, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%213 = add nsw i32 %207, -1
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i8*, i8** %206, i64 %214
%216 = load i8*, i8** %215
%217 = tail call i32 (i32, i8*, ...) @errx(i32 %210, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i8* %212, i8* %216)
br label %218
218: ; preds = %209, %204
ret i32 %205
}