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

/* Forward declarations */

/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ BUFSIZ;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
int open(char *, int /*<<< orphan*/);
scalar_t__ read(int, char *, scalar_t__);
char *realloc(char *, scalar_t__);
int /*<<< orphan*/ snprintf(char *, size_t, char *, ...);
char *strchr(char *, char);
char *strdup(char *);
int strlen(char *);
char *strrchr(char *, char);
char *read_cmdline(int pid, int isshort) {
  char *rv = NULL;
  char path[30];
  int fd;
  snprintf(path, sizeof path, "/proc/%d/cmdline", pid);
  fd = open(path, O_RDONLY);
  if (fd != -1) {
    char *dbuf = malloc(BUFSIZ + 1);
    ssize_t n, p = 0, sz = BUFSIZ;
    if (!dbuf) {
      close(fd);
      return NULL;
    }
    do {
      n = read(fd, dbuf + p, sz - p);
      if (n == sz - p) {
        char *t = realloc(dbuf, sz + BUFSIZ + 1);
        if (!t) {
          close(fd);
          free(dbuf);
          return NULL;
        }
        dbuf = t;
        sz += BUFSIZ;
      }
      if (n > 0)
        p += n;
    } while (n > 0);
    if (p > 0) {
      dbuf[p] = 0;
      if (isshort &&
          (dbuf[0] == '/' || (p > 1 && dbuf[0] == '.' && dbuf[1] == '/') ||
           (p > 2 && dbuf[0] == '.' && dbuf[1] == '.' && dbuf[2] == '/'))) {
        char *ep;
        ep = strrchr(dbuf, '/');
        if (ep && ep[1]) {
          char *t = strdup(ep + 1);
          if (t) {
            free(dbuf);
            dbuf = t;
            p = strlen(t) + 1;
          }
        }
      }
      if (!isshort) {
        ssize_t k;
        for (k = 0; k < p; k++)
          dbuf[k] = dbuf[k] ? dbuf[k] : ' ';
      }
      rv = dbuf;
    } else
      free(dbuf);
    close(fd);
  }
  if (rv)
    return rv;
  snprintf(path, sizeof path, "/proc/%d/status", pid);
  fd = open(path, O_RDONLY);
  if (fd != -1) {
    char buf[BUFSIZ + 1];
    ssize_t n = read(fd, buf, BUFSIZ);
    close(fd);
    if (n > 0) {
      char *eol, *tab;
      buf[n] = 0;
      eol = strchr(buf, '\n');
      tab = strchr(buf, '\t');
      if (eol && tab && eol > tab) {
        size_t rvlen;
        eol[0] = 0;
        rvlen = strlen(tab + 1) + 3;
        rv = malloc(rvlen);
        if (rv)
          snprintf(rv, rvlen, !isshort ? "[%s]" : "%s", tab + 1);
      }
    }
  }
  return rv;
}


x86 assembly (clang, -O0):
<read_cmdline>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x1e,%esi
lea    0xe24(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0x40(%rbp),%rdi
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
je     14d7 <read_cmdline+0x327>
mov    0x2dcf(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x60(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    124f <read_cmdline+0x9f>
mov    -0x44(%rbp),%edi
call   1080 <close@plt>
movq   $0x0,-0x8(%rbp)
jmp    1695 <read_cmdline+0x4e5>
jmp    1254 <read_cmdline+0xa4>
mov    -0x44(%rbp),%edi
mov    -0x50(%rbp),%rsi
add    -0x60(%rbp),%rsi
mov    -0x68(%rbp),%rdx
sub    -0x60(%rbp),%rdx
call   1090 <read@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    -0x68(%rbp),%rcx
sub    -0x60(%rbp),%rcx
cmp    %rcx,%rax
jne    12e7 <read_cmdline+0x137>
mov    -0x50(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    0x2d44(%rip),%rax
add    (%rax),%rsi
add    $0x1,%rsi
call   10b0 <realloc@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    12cd <read_cmdline+0x11d>
mov    -0x44(%rbp),%edi
call   1080 <close@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1695 <read_cmdline+0x4e5>
mov    -0x70(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    0x2cfc(%rip),%rax
mov    (%rax),%rax
add    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x58(%rbp)
jle    12fe <read_cmdline+0x14e>
mov    -0x58(%rbp),%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x60(%rbp)
jmp    1303 <read_cmdline+0x153>
cmpq   $0x0,-0x58(%rbp)
jg     1254 <read_cmdline+0xa4>
cmpq   $0x0,-0x60(%rbp)
jle    14c6 <read_cmdline+0x316>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpl   $0x0,-0x10(%rbp)
je     141f <read_cmdline+0x26f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     13a8 <read_cmdline+0x1f8>
cmpq   $0x1,-0x60(%rbp)
jle    136b <read_cmdline+0x1bb>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    136b <read_cmdline+0x1bb>
mov    -0x50(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
je     13a8 <read_cmdline+0x1f8>
cmpq   $0x2,-0x60(%rbp)
jle    141f <read_cmdline+0x26f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    141f <read_cmdline+0x26f>
mov    -0x50(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    141f <read_cmdline+0x26f>
mov    -0x50(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x2f,%eax
jne    141f <read_cmdline+0x26f>
mov    -0x50(%rbp),%rdi
mov    $0x2f,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
je     141a <read_cmdline+0x26a>
mov    -0x78(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     141a <read_cmdline+0x26a>
mov    -0x78(%rbp),%rdi
add    $0x1,%rdi
call   10d0 <strdup@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     1415 <read_cmdline+0x265>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x60(%rbp)
jmp    141a <read_cmdline+0x26a>
jmp    141f <read_cmdline+0x26f>
cmpl   $0x0,-0x10(%rbp)
jne    14b9 <read_cmdline+0x309>
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x60(%rbp),%rax
jge    14b4 <read_cmdline+0x304>
mov    -0x50(%rbp),%rax
mov    -0x88(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1477 <read_cmdline+0x2c7>
mov    -0x50(%rbp),%rax
mov    -0x88(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xbc(%rbp)
jmp    1487 <read_cmdline+0x2d7>
mov    $0x20,%eax
mov    %eax,-0xbc(%rbp)
jmp    1487 <read_cmdline+0x2d7>
mov    -0xbc(%rbp),%eax
mov    %al,%dl
mov    -0x50(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1434 <read_cmdline+0x284>
jmp    14b9 <read_cmdline+0x309>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    14cf <read_cmdline+0x31f>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x44(%rbp),%edi
call   1080 <close@plt>
cmpq   $0x0,-0x18(%rbp)
je     14ef <read_cmdline+0x33f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1695 <read_cmdline+0x4e5>
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x1e,%esi
lea    0xb0f(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0x40(%rbp),%rdi
mov    0x2ad4(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
je     168d <read_cmdline+0x4dd>
mov    0x2aa9(%rip),%rax
mov    (%rax),%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rsp,%rdx
mov    %rdx,-0x90(%rbp)
add    $0x10,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0xc8(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x98(%rbp)
mov    -0x44(%rbp),%edi
mov    0x2a6c(%rip),%rax
mov    (%rax),%rdx
call   1090 <read@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x44(%rbp),%edi
call   1080 <close@plt>
cmpq   $0x0,-0xa0(%rbp)
jle    1683 <read_cmdline+0x4d3>
mov    -0xc8(%rbp),%rdi
mov    -0xa0(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    -0xc8(%rbp),%rdi
mov    %rax,-0xa8(%rbp)
mov    $0x9,%esi
call   1050 <strchr@plt>
mov    %rax,-0xb0(%rbp)
cmpq   $0x0,-0xa8(%rbp)
je     167e <read_cmdline+0x4ce>
cmpq   $0x0,-0xb0(%rbp)
je     167e <read_cmdline+0x4ce>
mov    -0xa8(%rbp),%rax
cmp    -0xb0(%rbp),%rax
jbe    167e <read_cmdline+0x4ce>
mov    -0xa8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xb0(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strlen@plt>
add    $0x3,%eax
cltq
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1679 <read_cmdline+0x4c9>
mov    -0x18(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
cmpl   $0x0,-0x10(%rbp)
setne  %cl
xor    $0xff,%cl
lea    0x9cd(%rip),%rdx
lea    0x9c1(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdx
mov    -0xb0(%rbp),%rcx
add    $0x1,%rcx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    167e <read_cmdline+0x4ce>
jmp    1683 <read_cmdline+0x4d3>
mov    -0x90(%rbp),%rax
mov    %rax,%rsp
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cmdline>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%r15d
mov    %edi,%r12d
lea    0xe52(%rip),%rdx
lea    -0x60(%rbp),%r14
mov    $0x1e,%esi
mov    %r14,%rdi
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    0x2dfd(%rip),%rbx
mov    (%rbx),%esi
mov    %r14,%rdi
call   10c0 <open@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     1340 <read_cmdline+0x190>
mov    0x2dd0(%rip),%rax
mov    (%rax),%r14
lea    0x1(%r14),%rdi
call   10a0 <malloc@plt>
test   %rax,%rax
je     12f9 <read_cmdline+0x149>
mov    %rax,%r13
mov    %r12d,-0x34(%rbp)
mov    %r15d,-0x30(%rbp)
xor    %eax,%eax
jmp    1239 <read_cmdline+0x89>
nopl   0x0(%rax)
lea    (%rbx,%r12,1),%rax
test   %rbx,%rbx
jle    1284 <read_cmdline+0xd4>
mov    %rax,%r12
lea    (%rax,%r13,1),%rsi
mov    %r14,%r15
sub    %rax,%r15
mov    -0x2c(%rbp),%edi
mov    %r15,%rdx
call   1090 <read@plt>
mov    %rax,%rbx
cmp    %r15,%rax
jne    1230 <read_cmdline+0x80>
mov    0x2d78(%rip),%r15
mov    (%r15),%rax
lea    (%r14,%rax,1),%rsi
add    $0x1,%rsi
mov    %r13,%rdi
call   10b0 <realloc@plt>
test   %rax,%rax
je     1309 <read_cmdline+0x159>
add    (%r15),%r14
mov    %rax,%r13
jmp    1230 <read_cmdline+0x80>
test   %r12,%r12
jle    1321 <read_cmdline+0x171>
movb   $0x0,0x0(%r13,%r12,1)
cmpl   $0x0,-0x30(%rbp)
je     144b <read_cmdline+0x29b>
mov    0x0(%r13),%al
cmp    $0x2f,%al
jne    1458 <read_cmdline+0x2a8>
mov    %r13,%rdi
mov    $0x2f,%esi
call   1070 <strrchr@plt>
test   %rax,%rax
je     1669 <read_cmdline+0x4b9>
cmpb   $0x0,0x1(%rax)
je     1669 <read_cmdline+0x4b9>
add    $0x1,%rax
mov    %rax,%rdi
call   10d0 <strdup@plt>
test   %rax,%rax
je     1669 <read_cmdline+0x4b9>
mov    %rax,%rbx
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%r13
jmp    1669 <read_cmdline+0x4b9>
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
xor    %r13d,%r13d
jmp    1671 <read_cmdline+0x4c1>
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %r13d,%r13d
jmp    1671 <read_cmdline+0x4c1>
mov    %r13,%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    -0x30(%rbp),%r15d
mov    -0x34(%rbp),%r12d
mov    0x2ca8(%rip),%rbx
lea    0xcea(%rip),%rdx
xor    %r13d,%r13d
lea    -0x60(%rbp),%r14
mov    $0x1e,%esi
mov    %r14,%rdi
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   10c0 <open@plt>
cmp    $0xffffffff,%eax
je     1671 <read_cmdline+0x4c1>
mov    %eax,%r14d
mov    %r15d,-0x30(%rbp)
mov    %rsp,%r15
mov    0x2c54(%rip),%rax
mov    (%rax),%rcx
mov    %rsp,%rbx
add    $0x10,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    (%rax),%rdx
mov    %r14d,%edi
mov    %rbx,%rsi
call   1090 <read@plt>
mov    %rax,%r12
mov    %r14d,%edi
call   1080 <close@plt>
test   %r12,%r12
jle    1440 <read_cmdline+0x290>
movb   $0x0,(%rbx,%r12,1)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <strchr@plt>
xor    %r13d,%r13d
test   %r12,%r12
je     1443 <read_cmdline+0x293>
mov    %rax,%r14
test   %rax,%rax
je     1443 <read_cmdline+0x293>
cmp    %r14,%r12
jbe    1443 <read_cmdline+0x293>
movb   $0x0,(%r12)
add    $0x1,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0x3,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   10a0 <malloc@plt>
test   %rax,%rax
je     1440 <read_cmdline+0x290>
mov    %rax,%r13
cmpl   $0x0,-0x30(%rbp)
lea    0xc1e(%rip),%rax
lea    0xc1c(%rip),%rdx
cmove  %rax,%rdx
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
jmp    1443 <read_cmdline+0x293>
xor    %r13d,%r13d
mov    %r15,%rsp
jmp    1671 <read_cmdline+0x4c1>
cmp    $0x8,%r12
jae    149a <read_cmdline+0x2ea>
xor    %eax,%eax
jmp    1644 <read_cmdline+0x494>
cmp    $0x2,%r12
jb     146d <read_cmdline+0x2bd>
cmp    $0x2e,%al
jne    146d <read_cmdline+0x2bd>
cmpb   $0x2f,0x1(%r13)
je     12a9 <read_cmdline+0xf9>
cmp    $0x3,%r12
jb     1669 <read_cmdline+0x4b9>
cmp    $0x2e,%al
jne    1669 <read_cmdline+0x4b9>
cmpb   $0x2e,0x1(%r13)
jne    1669 <read_cmdline+0x4b9>
cmpb   $0x2f,0x2(%r13)
je     12a9 <read_cmdline+0xf9>
jmp    1669 <read_cmdline+0x4b9>
cmp    $0x20,%r12
jae    14a7 <read_cmdline+0x2f7>
xor    %eax,%eax
jmp    15f6 <read_cmdline+0x446>
mov    %r12,%rax
and    $0xffffffffffffffe0,%rax
lea    -0x20(%rax),%rcx
mov    %rcx,%rdx
shr    $0x5,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     158c <read_cmdline+0x3dc>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
pxor   %xmm8,%xmm8
movdqa 0xb24(%rip),%xmm1
nopl   0x0(%rax)
movdqu 0x0(%r13,%rcx,1),%xmm2
movdqu 0x10(%r13,%rcx,1),%xmm3
movdqu 0x20(%r13,%rcx,1),%xmm4
movdqu 0x30(%r13,%rcx,1),%xmm5
movdqa %xmm2,%xmm6
pcmpeqb %xmm8,%xmm6
movdqa %xmm3,%xmm7
pcmpeqb %xmm8,%xmm7
movdqa %xmm6,%xmm0
pandn  %xmm2,%xmm0
pand   %xmm1,%xmm6
por    %xmm0,%xmm6
movdqa %xmm7,%xmm0
pandn  %xmm3,%xmm0
pand   %xmm1,%xmm7
por    %xmm0,%xmm7
movdqu %xmm6,0x0(%r13,%rcx,1)
movdqu %xmm7,0x10(%r13,%rcx,1)
movdqa %xmm4,%xmm0
pcmpeqb %xmm8,%xmm0
movdqa %xmm5,%xmm2
pcmpeqb %xmm8,%xmm2
movdqa %xmm0,%xmm3
pandn  %xmm4,%xmm3
pand   %xmm1,%xmm0
por    %xmm3,%xmm0
movdqa %xmm2,%xmm3
pandn  %xmm5,%xmm3
pand   %xmm1,%xmm2
por    %xmm3,%xmm2
movdqu %xmm0,0x20(%r13,%rcx,1)
movdqu %xmm2,0x30(%r13,%rcx,1)
add    $0x40,%rcx
add    $0xfffffffffffffffe,%rsi
jne    14e0 <read_cmdline+0x330>
jmp    158e <read_cmdline+0x3de>
xor    %ecx,%ecx
test   $0x1,%dl
je     15e7 <read_cmdline+0x437>
movdqu 0x0(%r13,%rcx,1),%xmm0
movdqu 0x10(%r13,%rcx,1),%xmm1
pxor   %xmm2,%xmm2
movdqa %xmm0,%xmm3
pcmpeqb %xmm2,%xmm3
pcmpeqb %xmm1,%xmm2
movdqa %xmm3,%xmm4
pandn  %xmm0,%xmm4
movdqa 0xa3f(%rip),%xmm0
pand   %xmm0,%xmm3
por    %xmm4,%xmm3
movdqa %xmm2,%xmm4
pandn  %xmm1,%xmm4
pand   %xmm0,%xmm2
por    %xmm4,%xmm2
movdqu %xmm3,0x0(%r13,%rcx,1)
movdqu %xmm2,0x10(%r13,%rcx,1)
cmp    %rax,%r12
je     1669 <read_cmdline+0x4b9>
test   $0x18,%r12b
je     1644 <read_cmdline+0x494>
mov    %rax,%rcx
mov    %r12,%rax
and    $0xfffffffffffffff8,%rax
pxor   %xmm0,%xmm0
movdqa 0xa04(%rip),%xmm1
nopl   0x0(%rax)
movq   0x0(%r13,%rcx,1),%xmm2
movdqa %xmm2,%xmm3
pcmpeqb %xmm0,%xmm3
movdqa %xmm3,%xmm4
pandn  %xmm2,%xmm4
pand   %xmm1,%xmm3
por    %xmm4,%xmm3
movq   %xmm3,0x0(%r13,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rax
jne    1610 <read_cmdline+0x460>
cmp    %rax,%r12
je     1669 <read_cmdline+0x4b9>
mov    $0x20,%ecx
nopl   0x0(%rax)
movzbl 0x0(%r13,%rax,1),%edx
test   %dl,%dl
cmove  %ecx,%edx
mov    %dl,0x0(%r13,%rax,1)
add    $0x1,%rax
cmp    %rax,%r12
jne    1650 <read_cmdline+0x4a0>
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    %r13,%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/proc/%d/cmdline\00"
@O_RDONLY = global i32 0
@BUFSIZ = global i64 0
@.str.1 = [16 x i8] c"/proc/%d/status\00"
@.str.2 = [5 x i8] c"[%s]\00"
@.str.3 = [3 x i8] c"%s\00"
define i8* @read_cmdline(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [30 x i8]
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
%19 = alloca i64
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* null, i8** %6
%23 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%24 = load i32, i32* %4
%25 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %23, i64 30, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%27 = load i32, i32* @O_RDONLY
%28 = call i32 @open(i8* %26, i32 %27)
store i32 %28, i32* %8
%29 = load i32, i32* %8
%30 = icmp ne i32 %29, -1
br i1 %30, label %31, label %204
31: ; preds = %2
%32 = load i64, i64* @BUFSIZ
%33 = add nsw i64 %32, 1
%34 = call i8* @malloc(i64 %33)
store i8* %34, i8** %9
store i64 0, i64* %11
%35 = load i64, i64* @BUFSIZ
store i64 %35, i64* %12
%36 = load i8*, i8** %9
%37 = icmp ne i8* %36, null
br i1 %37, label %41, label %38
38: ; preds = %31
%39 = load i32, i32* %8
%40 = call i32 @close(i32 %39)
store i8* null, i8** %3
br label %273
41: ; preds = %31
br label %42
42: ; preds = %83, %41
%43 = load i32, i32* %8
%44 = load i8*, i8** %9
%45 = load i64, i64* %11
%46 = getelementptr inbounds i8, i8* %44, i64 %45
%47 = load i64, i64* %12
%48 = load i64, i64* %11
%49 = sub nsw i64 %47, %48
%50 = call i64 @read(i32 %43, i8* %46, i64 %49)
store i64 %50, i64* %10
%51 = load i64, i64* %10
%52 = load i64, i64* %12
%53 = load i64, i64* %11
%54 = sub nsw i64 %52, %53
%55 = icmp eq i64 %51, %54
br i1 %55, label %56, label %75
56: ; preds = %42
%57 = load i8*, i8** %9
%58 = load i64, i64* %12
%59 = load i64, i64* @BUFSIZ
%60 = add nsw i64 %58, %59
%61 = add nsw i64 %60, 1
%62 = call i8* @realloc(i8* %57, i64 %61)
store i8* %62, i8** %13
%63 = load i8*, i8** %13
%64 = icmp ne i8* %63, null
br i1 %64, label %70, label %65
65: ; preds = %56
%66 = load i32, i32* %8
%67 = call i32 @close(i32 %66)
%68 = load i8*, i8** %9
%69 = call i32 @free(i8* %68)
store i8* null, i8** %3
br label %273
70: ; preds = %56
%71 = load i8*, i8** %13
store i8* %71, i8** %9
%72 = load i64, i64* @BUFSIZ
%73 = load i64, i64* %12
%74 = add nsw i64 %73, %72
store i64 %74, i64* %12
br label %75
75: ; preds = %70, %42
%76 = load i64, i64* %10
%77 = icmp sgt i64 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %75
%79 = load i64, i64* %10
%80 = load i64, i64* %11
%81 = add nsw i64 %80, %79
store i64 %81, i64* %11
br label %82
82: ; preds = %78, %75
br label %83
83: ; preds = %82
%84 = load i64, i64* %10
%85 = icmp sgt i64 %84, 0
br i1 %85, label %42, label %86
86: ; preds = %83
%87 = load i64, i64* %11
%88 = icmp sgt i64 %87, 0
br i1 %88, label %89, label %198
89: ; preds = %86
%90 = load i8*, i8** %9
%91 = load i64, i64* %11
%92 = getelementptr inbounds i8, i8* %90, i64 %91
store i8 0, i8* %92
%93 = load i32, i32* %5
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %164
95: ; preds = %89
%96 = load i8*, i8** %9
%97 = getelementptr inbounds i8, i8* %96, i64 0
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 47
br i1 %100, label %137, label %101
101: ; preds = %95
%102 = load i64, i64* %11
%103 = icmp sgt i64 %102, 1
br i1 %103, label %104, label %116
104: ; preds = %101
%105 = load i8*, i8** %9
%106 = getelementptr inbounds i8, i8* %105, i64 0
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp eq i32 %108, 46
br i1 %109, label %110, label %116
110: ; preds = %104
%111 = load i8*, i8** %9
%112 = getelementptr inbounds i8, i8* %111, i64 1
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 47
br i1 %115, label %137, label %116
116: ; preds = %110, %104, %101
%117 = load i64, i64* %11
%118 = icmp sgt i64 %117, 2
br i1 %118, label %119, label %164
119: ; preds = %116
%120 = load i8*, i8** %9
%121 = getelementptr inbounds i8, i8* %120, i64 0
%122 = load i8, i8* %121
%123 = sext i8 %122 to i32
%124 = icmp eq i32 %123, 46
br i1 %124, label %125, label %164
125: ; preds = %119
%126 = load i8*, i8** %9
%127 = getelementptr inbounds i8, i8* %126, i64 1
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = icmp eq i32 %129, 46
br i1 %130, label %131, label %164
131: ; preds = %125
%132 = load i8*, i8** %9
%133 = getelementptr inbounds i8, i8* %132, i64 2
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 47
br i1 %136, label %137, label %164
137: ; preds = %131, %110, %95
%138 = load i8*, i8** %9
%139 = call i8* @strrchr(i8* %138, i8 signext 47)
store i8* %139, i8** %14
%140 = load i8*, i8** %14
%141 = icmp ne i8* %140, null
br i1 %141, label %142, label %163
142: ; preds = %137
%143 = load i8*, i8** %14
%144 = getelementptr inbounds i8, i8* %143, i64 1
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %163
148: ; preds = %142
%149 = load i8*, i8** %14
%150 = getelementptr inbounds i8, i8* %149, i64 1
%151 = call i8* @strdup(i8* %150)
store i8* %151, i8** %15
%152 = load i8*, i8** %15
%153 = icmp ne i8* %152, null
br i1 %153, label %154, label %162
154: ; preds = %148
%155 = load i8*, i8** %9
%156 = call i32 @free(i8* %155)
%157 = load i8*, i8** %15
store i8* %157, i8** %9
%158 = load i8*, i8** %15
%159 = call i32 @strlen(i8* %158)
%160 = add nsw i32 %159, 1
%161 = sext i32 %160 to i64
store i64 %161, i64* %11
br label %162
162: ; preds = %154, %148
br label %163
163: ; preds = %162, %142, %137
br label %164
164: ; preds = %163, %131, %125, %119, %116, %89
%165 = load i32, i32* %5
%166 = icmp ne i32 %165, 0
br i1 %166, label %196, label %167
167: ; preds = %164
store i64 0, i64* %16
br label %168
168: ; preds = %192, %167
%169 = load i64, i64* %16
%170 = load i64, i64* %11
%171 = icmp slt i64 %169, %170
br i1 %171, label %172, label %195
172: ; preds = %168
%173 = load i8*, i8** %9
%174 = load i64, i64* %16
%175 = getelementptr inbounds i8, i8* %173, i64 %174
%176 = load i8, i8* %175
%177 = sext i8 %176 to i32
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %185
179: ; preds = %172
%180 = load i8*, i8** %9
%181 = load i64, i64* %16
%182 = getelementptr inbounds i8, i8* %180, i64 %181
%183 = load i8, i8* %182
%184 = sext i8 %183 to i32
br label %186
185: ; preds = %172
br label %186
186: ; preds = %185, %179
%187 = phi i32 [ %184, %179 ], [ 32, %185 ]
%188 = trunc i32 %187 to i8
%189 = load i8*, i8** %9
%190 = load i64, i64* %16
%191 = getelementptr inbounds i8, i8* %189, i64 %190
store i8 %188, i8* %191
br label %192
192: ; preds = %186
%193 = load i64, i64* %16
%194 = add nsw i64 %193, 1
store i64 %194, i64* %16
br label %168
195: ; preds = %168
br label %196
196: ; preds = %195, %164
%197 = load i8*, i8** %9
store i8* %197, i8** %6
br label %201
198: ; preds = %86
%199 = load i8*, i8** %9
%200 = call i32 @free(i8* %199)
br label %201
201: ; preds = %198, %196
%202 = load i32, i32* %8
%203 = call i32 @close(i32 %202)
br label %204
204: ; preds = %201, %2
%205 = load i8*, i8** %6
%206 = icmp ne i8* %205, null
br i1 %206, label %207, label %209
207: ; preds = %204
%208 = load i8*, i8** %6
store i8* %208, i8** %3
br label %273
209: ; preds = %204
%210 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%211 = load i32, i32* %4
%212 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %210, i64 30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %211)
%213 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%214 = load i32, i32* @O_RDONLY
%215 = call i32 @open(i8* %213, i32 %214)
store i32 %215, i32* %8
%216 = load i32, i32* %8
%217 = icmp ne i32 %216, -1
br i1 %217, label %218, label %271
218: ; preds = %209
%219 = load i64, i64* @BUFSIZ
%220 = add nsw i64 %219, 1
%221 = call i8* @llvm.stacksave()
store i8* %221, i8** %17
%222 = alloca i8, i64 %220
store i64 %220, i64* %18
%223 = load i32, i32* %8
%224 = load i64, i64* @BUFSIZ
%225 = call i64 @read(i32 %223, i8* %222, i64 %224)
store i64 %225, i64* %19
%226 = load i32, i32* %8
%227 = call i32 @close(i32 %226)
%228 = load i64, i64* %19
%229 = icmp sgt i64 %228, 0
br i1 %229, label %230, label %269
230: ; preds = %218
%231 = load i64, i64* %19
%232 = getelementptr inbounds i8, i8* %222, i64 %231
store i8 0, i8* %232
%233 = call i8* @strchr(i8* %222, i8 signext 10)
store i8* %233, i8** %20
%234 = call i8* @strchr(i8* %222, i8 signext 9)
store i8* %234, i8** %21
%235 = load i8*, i8** %20
%236 = icmp ne i8* %235, null
br i1 %236, label %237, label %268
237: ; preds = %230
%238 = load i8*, i8** %21
%239 = icmp ne i8* %238, null
br i1 %239, label %240, label %268
240: ; preds = %237
%241 = load i8*, i8** %20
%242 = load i8*, i8** %21
%243 = icmp ugt i8* %241, %242
br i1 %243, label %244, label %268
244: ; preds = %240
%245 = load i8*, i8** %20
%246 = getelementptr inbounds i8, i8* %245, i64 0
store i8 0, i8* %246
%247 = load i8*, i8** %21
%248 = getelementptr inbounds i8, i8* %247, i64 1
%249 = call i32 @strlen(i8* %248)
%250 = add nsw i32 %249, 3
%251 = sext i32 %250 to i64
store i64 %251, i64* %22
%252 = load i64, i64* %22
%253 = call i8* @malloc(i64 %252)
store i8* %253, i8** %6
%254 = load i8*, i8** %6
%255 = icmp ne i8* %254, null
br i1 %255, label %256, label %267
256: ; preds = %244
%257 = load i8*, i8** %6
%258 = load i64, i64* %22
%259 = load i32, i32* %5
%260 = icmp ne i32 %259, 0
%261 = xor i1 %260, true
%262 = zext i1 %261 to i64
%263 = select i1 %261, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%264 = load i8*, i8** %21
%265 = getelementptr inbounds i8, i8* %264, i64 1
%266 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %257, i64 %258, i8* %263, i8* %265)
br label %267
267: ; preds = %256, %244
br label %268
268: ; preds = %267, %240, %237, %230
br label %269
269: ; preds = %268, %218
%270 = load i8*, i8** %17
br label %271
271: ; preds = %269, %209
%272 = load i8*, i8** %6
store i8* %272, i8** %3
br label %273
273: ; preds = %271, %207, %65, %38
%274 = load i8*, i8** %3
ret i8* %274
}

LLVM IR (-O2):
@.str = [17 x i8] c"/proc/%d/cmdline\00"
@O_RDONLY = global i32 0
@BUFSIZ = global i64 0
@.str.1 = [16 x i8] c"/proc/%d/status\00"
@.str.2 = [5 x i8] c"[%s]\00"
@.str.3 = [3 x i8] c"%s\00"
define i8* @read_cmdline(i32 %0, i32 %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %4, i64 30, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %4, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %180, label %9
9: ; preds = %2
%10 = load i64, i64* @BUFSIZ
%11 = add nsw i64 %10, 1
%12 = tail call i8* @malloc(i64 %11)
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 @close(i32 %7)
br label %216
16: ; preds = %9, %36
%17 = phi i64 [ %37, %36 ], [ %10, %9 ]
%18 = phi i64 [ %40, %36 ], [ 0, %9 ]
%19 = phi i8* [ %38, %36 ], [ %12, %9 ]
%20 = getelementptr inbounds i8, i8* %19, i64 %18
%21 = sub nsw i64 %17, %18
%22 = tail call i64 @read(i32 %7, i8* %20, i64 %21)
%23 = icmp eq i64 %22, %21
br i1 %23, label %24, label %36
24: ; preds = %16
%25 = load i64, i64* @BUFSIZ
%26 = add i64 %17, 1
%27 = add i64 %26, %25
%28 = tail call i8* @realloc(i8* %19, i64 %27)
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %33
30: ; preds = %24
%31 = tail call i32 @close(i32 %7)
%32 = tail call i32 @free(i8* %19)
br label %216
33: ; preds = %24
%34 = load i64, i64* @BUFSIZ
%35 = add nsw i64 %34, %17
br label %36
36: ; preds = %33, %16
%37 = phi i64 [ %35, %33 ], [ %17, %16 ]
%38 = phi i8* [ %28, %33 ], [ %19, %16 ]
%39 = icmp sgt i64 %22, 0
%40 = add nsw i64 %22, %18
br i1 %39, label %16, label %41
41: ; preds = %36
%42 = icmp sgt i64 %18, 0
br i1 %42, label %43, label %175
43: ; preds = %41
%44 = getelementptr inbounds i8, i8* %38, i64 %18
store i8 0, i8* %44
%45 = icmp eq i32 %1, 0
br i1 %45, label %46, label %128
46: ; preds = %43
%47 = icmp ult i64 %18, 8
br i1 %47, label %126, label %48
48: ; preds = %46
%49 = icmp ult i64 %18, 32
br i1 %49, label %111, label %50
50: ; preds = %48
%51 = and i64 %18, -32
%52 = add i64 %51, -32
%53 = lshr exact i64 %52, 5
%54 = add nuw nsw i64 %53, 1
%55 = and i64 %54, 1
%56 = icmp eq i64 %52, 0
br i1 %56, label %90, label %57
57: ; preds = %50
%58 = and i64 %54, 1152921504606846974
br label %59
59: ; preds = %59, %57
%60 = phi i64 [ 0, %57 ], [ %87, %59 ]
%61 = phi i64 [ 0, %57 ], [ %88, %59 ]
%62 = getelementptr inbounds i8, i8* %38, i64 %60
%63 = bitcast i8* %62 to <16 x i8>*
%64 = load <16 x i8>, <16 x i8>* %63
%65 = getelementptr inbounds i8, i8* %62, i64 16
%66 = bitcast i8* %65 to <16 x i8>*
%67 = load <16 x i8>, <16 x i8>* %66
%68 = icmp eq <16 x i8> %64, zeroinitializer
%69 = icmp eq <16 x i8> %67, zeroinitializer
%70 = select <16 x i1> %68, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %64
%71 = select <16 x i1> %69, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %67
%72 = bitcast i8* %62 to <16 x i8>*
store <16 x i8> %70, <16 x i8>* %72
%73 = bitcast i8* %65 to <16 x i8>*
store <16 x i8> %71, <16 x i8>* %73
%74 = or i64 %60, 32
%75 = getelementptr inbounds i8, i8* %38, i64 %74
%76 = bitcast i8* %75 to <16 x i8>*
%77 = load <16 x i8>, <16 x i8>* %76
%78 = getelementptr inbounds i8, i8* %75, i64 16
%79 = bitcast i8* %78 to <16 x i8>*
%80 = load <16 x i8>, <16 x i8>* %79
%81 = icmp eq <16 x i8> %77, zeroinitializer
%82 = icmp eq <16 x i8> %80, zeroinitializer
%83 = select <16 x i1> %81, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %77
%84 = select <16 x i1> %82, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %80
%85 = bitcast i8* %75 to <16 x i8>*
store <16 x i8> %83, <16 x i8>* %85
%86 = bitcast i8* %78 to <16 x i8>*
store <16 x i8> %84, <16 x i8>* %86
%87 = add nuw i64 %60, 64
%88 = add i64 %61, 2
%89 = icmp eq i64 %88, %58
br i1 %89, label %90, label %59
90: ; preds = %59, %50
%91 = phi i64 [ 0, %50 ], [ %87, %59 ]
%92 = icmp eq i64 %55, 0
br i1 %92, label %106, label %93
93: ; preds = %90
%94 = getelementptr inbounds i8, i8* %38, i64 %91
%95 = bitcast i8* %94 to <16 x i8>*
%96 = load <16 x i8>, <16 x i8>* %95
%97 = getelementptr inbounds i8, i8* %94, i64 16
%98 = bitcast i8* %97 to <16 x i8>*
%99 = load <16 x i8>, <16 x i8>* %98
%100 = icmp eq <16 x i8> %96, zeroinitializer
%101 = icmp eq <16 x i8> %99, zeroinitializer
%102 = select <16 x i1> %100, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %96
%103 = select <16 x i1> %101, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %99
%104 = bitcast i8* %94 to <16 x i8>*
store <16 x i8> %102, <16 x i8>* %104
%105 = bitcast i8* %97 to <16 x i8>*
store <16 x i8> %103, <16 x i8>* %105
br label %106
106: ; preds = %90, %93
%107 = icmp eq i64 %18, %51
br i1 %107, label %178, label %108
108: ; preds = %106
%109 = and i64 %18, 24
%110 = icmp eq i64 %109, 0
br i1 %110, label %126, label %111
111: ; preds = %48, %108
%112 = phi i64 [ %51, %108 ], [ 0, %48 ]
%113 = and i64 %18, -8
br label %114
114: ; preds = %114, %111
%115 = phi i64 [ %112, %111 ], [ %122, %114 ]
%116 = getelementptr inbounds i8, i8* %38, i64 %115
%117 = bitcast i8* %116 to <8 x i8>*
%118 = load <8 x i8>, <8 x i8>* %117
%119 = icmp eq <8 x i8> %118, zeroinitializer
%120 = select <8 x i1> %119, <8 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <8 x i8> %118
%121 = bitcast i8* %116 to <8 x i8>*
store <8 x i8> %120, <8 x i8>* %121
%122 = add nuw i64 %115, 8
%123 = icmp eq i64 %122, %113
br i1 %123, label %124, label %114
124: ; preds = %114
%125 = icmp eq i64 %18, %113
br i1 %125, label %178, label %126
126: ; preds = %46, %108, %124
%127 = phi i64 [ 0, %46 ], [ %51, %108 ], [ %113, %124 ]
br label %167
128: ; preds = %43
%129 = load i8, i8* %38
%130 = icmp eq i8 %129, 47
br i1 %130, label %151, label %131
131: ; preds = %128
%132 = icmp ugt i64 %18, 1
%133 = icmp eq i8 %129, 46
%134 = select i1 %132, i1 %133, i1 false
br i1 %134, label %135, label %139
135: ; preds = %131
%136 = getelementptr inbounds i8, i8* %38, i64 1
%137 = load i8, i8* %136
%138 = icmp eq i8 %137, 47
br i1 %138, label %151, label %139
139: ; preds = %135, %131
%140 = icmp ult i64 %18, 3
%141 = xor i1 %133, true
%142 = select i1 %140, i1 true, i1 %141
br i1 %142, label %164, label %143
143: ; preds = %139
%144 = getelementptr inbounds i8, i8* %38, i64 1
%145 = load i8, i8* %144
%146 = icmp eq i8 %145, 46
br i1 %146, label %147, label %164
147: ; preds = %143
%148 = getelementptr inbounds i8, i8* %38, i64 2
%149 = load i8, i8* %148
%150 = icmp eq i8 %149, 47
br i1 %150, label %151, label %164
151: ; preds = %147, %135, %128
%152 = tail call i8* @strrchr(i8* %38, i8 signext 47)
%153 = icmp eq i8* %152, null
br i1 %153, label %164, label %154
154: ; preds = %151
%155 = getelementptr inbounds i8, i8* %152, i64 1
%156 = load i8, i8* %155
%157 = icmp eq i8 %156, 0
br i1 %157, label %164, label %158
158: ; preds = %154
%159 = tail call i8* @strdup(i8* %155)
%160 = icmp eq i8* %159, null
br i1 %160, label %164, label %161
161: ; preds = %158
%162 = tail call i32 @free(i8* %38)
%163 = tail call i32 @strlen(i8* %159)
br label %164
164: ; preds = %139, %143, %147, %158, %161, %154, %151
%165 = phi i8* [ %38, %158 ], [ %159, %161 ], [ %38, %151 ], [ %38, %154 ], [ %38, %139 ], [ %38, %143 ], [ %38, %147 ]
%166 = tail call i32 @close(i32 %7)
br label %216
167: ; preds = %126, %167
%168 = phi i64 [ %173, %167 ], [ %127, %126 ]
%169 = getelementptr inbounds i8, i8* %38, i64 %168
%170 = load i8, i8* %169
%171 = icmp eq i8 %170, 0
%172 = select i1 %171, i8 32, i8 %170
store i8 %172, i8* %169
%173 = add nuw nsw i64 %168, 1
%174 = icmp eq i64 %173, %18
br i1 %174, label %178, label %167
175: ; preds = %41
%176 = tail call i32 @free(i8* %38)
%177 = tail call i32 @close(i32 %7)
br label %180
178: ; preds = %167, %124, %106
%179 = tail call i32 @close(i32 %7)
br label %216
180: ; preds = %2, %175
%181 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %4, i64 30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%182 = load i32, i32* @O_RDONLY
%183 = call i32 @open(i8* %4, i32 %182)
%184 = icmp eq i32 %183, -1
br i1 %184, label %216, label %185
185: ; preds = %180
%186 = load i64, i64* @BUFSIZ
%187 = add nsw i64 %186, 1
%188 = tail call i8* @llvm.stacksave()
%189 = alloca i8, i64 %187
%190 = load i64, i64* @BUFSIZ
%191 = call i64 @read(i32 %183, i8* %189, i64 %190)
%192 = tail call i32 @close(i32 %183)
%193 = icmp sgt i64 %191, 0
br i1 %193, label %194, label %214
194: ; preds = %185
%195 = getelementptr inbounds i8, i8* %189, i64 %191
store i8 0, i8* %195
%196 = call i8* @strchr(i8* %189, i8 signext 10)
%197 = call i8* @strchr(i8* %189, i8 signext 9)
%198 = icmp ne i8* %196, null
%199 = icmp ne i8* %197, null
%200 = select i1 %198, i1 %199, i1 false
%201 = icmp ugt i8* %196, %197
%202 = select i1 %200, i1 %201, i1 false
br i1 %202, label %203, label %214
203: ; preds = %194
store i8 0, i8* %196
%204 = getelementptr inbounds i8, i8* %197, i64 1
%205 = call i32 @strlen(i8* %204)
%206 = add nsw i32 %205, 3
%207 = sext i32 %206 to i64
%208 = call i8* @malloc(i64 %207)
%209 = icmp eq i8* %208, null
br i1 %209, label %214, label %210
210: ; preds = %203
%211 = icmp eq i32 %1, 0
%212 = select i1 %211, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%213 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %208, i64 %207, i8* %212, i8* %204)
br label %214
214: ; preds = %194, %210, %203, %185
%215 = phi i8* [ null, %185 ], [ null, %194 ], [ %208, %210 ], [ null, %203 ]
br label %216
216: ; preds = %178, %30, %14, %164, %180, %214
%217 = phi i8* [ %38, %178 ], [ %215, %214 ], [ null, %180 ], [ %165, %164 ], [ null, %14 ], [ null, %30 ]
ret i8* %217
}