#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 int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int WEXITSTATUS(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int execvp(char *const, char *const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *const, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ getgid();
scalar_t__ getpid();
scalar_t__ getsid(int /*<<< orphan*/);
scalar_t__ getuid();
scalar_t__ malloc(unsigned int);
scalar_t__ setegid(int /*<<< orphan*/);
scalar_t__ seteuid(scalar_t__);
scalar_t__ setgid(int /*<<< orphan*/);
scalar_t__ setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *const, char *);
char *strerror(int /*<<< orphan*/);
int strlen(char *const);
int /*<<< orphan*/ system(char *);
int main(int argc, char *const argv[]) {
  if (!getuid() || !getgid()) {
    uid_t user = geteuid();
    gid_t group = getegid();
    if (getuid() || !user || !group) {
      fprintf(stderr, "%s: will not run as root\n", argv[0]);
      return 1;
    }
    if (seteuid(0) != 0 || (!getgid() && setgid(group) != 0) ||
        (!getuid() && setuid(user) != 0)) {
      fprintf(stderr, "%s: cannot change from root: %s\n", argv[0],
              strerror(errno));
      return 1;
    }
  }
  setegid(getgid());
  seteuid(getuid());
  if (!getuid() || !getgid() || setegid(getgid()) != 0 ||
      seteuid(getuid()) != 0) {
    fprintf(stderr, "%s: cannot change from root\n", argv[0]);
    return 1;
  }
  if ((getsid(0) != getpid()) && (setpgid(0, 0) < 0)) {
    fprintf(stderr, "%s: could not create new process group: %s\n", argv[0],
            strerror(errno));
    return 1;
  }
  int result = 0;
  if (argc > 2 && strcmp(argv[1], "s") == 0) {
    unsigned int total_size = 0, I = 0;
    for (I = 2; I < argc; I++)
      total_size += strlen(argv[I]) + 1;
    if (total_size < 1) {
      fprintf(stderr, "%s: invalid system command\n", argv[0]);
      return 1;
    }
    char *command = (char *)malloc(total_size);
    if (!command) {
      fprintf(stderr, "%s: could not allocate temporary memory: %s\n", argv[0],
              strerror(errno));
      return 1;
    }
    int J = 0;
    for (I = 2, J = 0; (I < argc) && (J < total_size); I++) {
      int current_size = strlen(argv[I]), K = 0;
      for (K = 0; (K < current_size) && (J < total_size); K++)
        command[J++] = argv[I][K];
      if (I < argc - 1)
        command[J++] = ' ';
      else if (I == argc - 1)
        command[J++] = '\0';
    }
    int outcome = WEXITSTATUS(system(command));
    free(command);
    return outcome;
  } else if (argc > 2 && strcmp(argv[1], "e") == 0) {
    result = execvp(argv[2], argv + 2);
    fprintf(stderr, "%s: '%s' execution error: %s\n", argv[0], argv[2],
            strerror(errno));
    return result;
  } else {
    fprintf(stderr, "%s s \"command\" (...)\n", argv[0]);
    fprintf(stderr, "%s e [command] (arguments...)\n", argv[0]);
    return 1;
  }
  return 0;
}


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)
mov    $0x0,%al
call   1060 <getuid@plt>
cmp    $0x0,%rax
je     127a <main+0x3a>
mov    $0x0,%al
call   10c0 <getgid@plt>
cmp    $0x0,%eax
jne    1383 <main+0x143>
mov    $0x0,%al
call   1090 <geteuid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10e0 <getegid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getuid@plt>
cmp    $0x0,%rax
jne    12b3 <main+0x73>
cmpl   $0x0,-0x14(%rbp)
je     12b3 <main+0x73>
cmpl   $0x0,-0x18(%rbp)
jne    12dd <main+0x9d>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
xor    %eax,%eax
mov    %eax,%edi
call   1160 <seteuid@plt>
cmp    $0x0,%rax
jne    1335 <main+0xf5>
mov    $0x0,%al
call   10c0 <getgid@plt>
cmp    $0x0,%eax
jne    1312 <main+0xd2>
mov    -0x18(%rbp),%edi
call   1100 <setgid@plt>
cmp    $0x0,%rax
jne    1335 <main+0xf5>
mov    $0x0,%al
call   1060 <getuid@plt>
cmp    $0x0,%rax
jne    137e <main+0x13e>
mov    -0x14(%rbp),%edi
call   1130 <setuid@plt>
cmp    $0x0,%rax
je     137e <main+0x13e>
mov    0x2ca4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rdx
mov    %rax,%rcx
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   10c0 <getgid@plt>
mov    %eax,%edi
call   1150 <setegid@plt>
mov    $0x0,%al
call   1060 <getuid@plt>
mov    %rax,%rdi
call   1160 <seteuid@plt>
mov    $0x0,%al
call   1060 <getuid@plt>
cmp    $0x0,%rax
je     13f2 <main+0x1b2>
mov    $0x0,%al
call   10c0 <getgid@plt>
cmp    $0x0,%eax
je     13f2 <main+0x1b2>
mov    $0x0,%al
call   10c0 <getgid@plt>
mov    %eax,%edi
call   1150 <setegid@plt>
cmp    $0x0,%rax
jne    13f2 <main+0x1b2>
mov    $0x0,%al
call   1060 <getuid@plt>
mov    %rax,%rdi
call   1160 <seteuid@plt>
cmp    $0x0,%rax
je     141c <main+0x1dc>
mov    0x2be7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc32(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
xor    %edi,%edi
call   1080 <getsid@plt>
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
cmp    %rcx,%rax
je     149a <main+0x25a>
xor    %esi,%esi
mov    %esi,%edi
call   1120 <setpgid@plt>
cmp    $0x0,%rax
jge    149a <main+0x25a>
mov    0x2b88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    0x2b69(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    %rax,%rcx
lea    0xbd1(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    16fc <main+0x4bc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xbca(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    16fc <main+0x4bc>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1511 <main+0x2d1>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14de <main+0x29e>
cmpl   $0x1,-0x20(%rbp)
jae    1545 <main+0x305>
mov    0x2abe(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb54(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
mov    -0x20(%rbp),%edi
call   10d0 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    15a5 <main+0x365>
mov    0x2a7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    0x2a5e(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%rdx
mov    %rax,%rcx
lea    0xb10(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
movl   $0x0,-0x34(%rbp)
movl   $0x2,-0x24(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x24(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x75(%rbp)
jae    15d7 <main+0x397>
mov    -0x34(%rbp),%eax
cmp    -0x20(%rbp),%eax
setb   %al
mov    %al,-0x75(%rbp)
mov    -0x75(%rbp),%al
test   $0x1,%al
jne    15e7 <main+0x3a7>
jmp    16d5 <main+0x495>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x38(%rbp),%ecx
mov    %al,-0x76(%rbp)
jge    1625 <main+0x3e5>
mov    -0x34(%rbp),%eax
cmp    -0x20(%rbp),%eax
setb   %al
mov    %al,-0x76(%rbp)
mov    -0x76(%rbp),%al
test   $0x1,%al
jne    1635 <main+0x3f5>
jmp    166a <main+0x42a>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x34(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1608 <main+0x3c8>
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    1696 <main+0x456>
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    16c2 <main+0x482>
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    16bd <main+0x47d>
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    16c2 <main+0x482>
jmp    16c7 <main+0x487>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15ba <main+0x37a>
mov    -0x30(%rbp),%rdi
call   1070 <system@plt>
mov    %eax,%edi
call   10f0 <WEXITSTATUS@plt>
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
cmpl   $0x2,-0x8(%rbp)
jle    17a0 <main+0x560>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x9ba(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    17a0 <main+0x560>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1110 <execvp@plt>
mov    %eax,-0x1c(%rbp)
mov    0x289d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x80(%rbp)
mov    0x286c(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
mov    -0x8c(%rbp),%edi
mov    -0x88(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    %rax,%r8
lea    0x943(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    17e3 <main+0x5a3>
mov    0x2839(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0x938(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x281b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0x930(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%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    $0x18,%rsp
mov    %rsi,%r15
mov    %edi,%r14d
xor    %eax,%eax
call   1060 <getuid@plt>
test   %rax,%rax
je     12df <main+0x9f>
xor    %eax,%eax
call   10c0 <getgid@plt>
test   %eax,%eax
je     12df <main+0x9f>
xor    %eax,%eax
call   10c0 <getgid@plt>
mov    %eax,%edi
call   1150 <setegid@plt>
xor    %eax,%eax
call   1060 <getuid@plt>
mov    %rax,%rdi
call   1160 <seteuid@plt>
xor    %eax,%eax
call   1060 <getuid@plt>
test   %rax,%rax
je     12ca <main+0x8a>
xor    %eax,%eax
call   10c0 <getgid@plt>
test   %eax,%eax
je     12ca <main+0x8a>
xor    %eax,%eax
call   10c0 <getgid@plt>
mov    %eax,%edi
call   1150 <setegid@plt>
test   %rax,%rax
jne    12ca <main+0x8a>
xor    %eax,%eax
call   1060 <getuid@plt>
mov    %rax,%rdi
call   1160 <seteuid@plt>
test   %rax,%rax
je     13b3 <main+0x173>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xd5e(%rip),%rsi
jmp    1356 <main+0x116>
xor    %eax,%eax
call   1090 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10e0 <getegid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <getuid@plt>
test   %rax,%rax
jne    1343 <main+0x103>
test   %ebx,%ebx
je     1343 <main+0x103>
test   %ebp,%ebp
je     1343 <main+0x103>
xor    %edi,%edi
call   1160 <seteuid@plt>
test   %rax,%rax
je     1371 <main+0x131>
mov    0x2cc8(%rip),%rax
mov    (%rax),%ebx
mov    (%r15),%rbp
mov    0x2cb4(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
lea    0xce8(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    135d <main+0x11d>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xcaa(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   10c0 <getgid@plt>
test   %eax,%eax
je     13a1 <main+0x161>
xor    %eax,%eax
call   1060 <getuid@plt>
test   %rax,%rax
jne    126b <main+0x2b>
mov    %ebx,%edi
call   1130 <setuid@plt>
test   %rax,%rax
jne    1311 <main+0xd1>
jmp    126b <main+0x2b>
mov    %ebp,%edi
call   1100 <setgid@plt>
test   %rax,%rax
jne    1311 <main+0xd1>
jmp    137c <main+0x13c>
xor    %edi,%edi
call   1080 <getsid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
cmp    %rax,%rbx
je     13d7 <main+0x197>
xor    %edi,%edi
xor    %esi,%esi
call   1120 <setpgid@plt>
test   %rax,%rax
js     1436 <main+0x1f6>
cmp    $0x3,%r14d
jl     140b <main+0x1cb>
mov    0x8(%r15),%rdi
lea    0xc9c(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     145c <main+0x21c>
mov    0x8(%r15),%rdi
lea    0xcd2(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     154f <main+0x30f>
mov    0x2bce(%rip),%rbx
mov    (%rbx),%edi
mov    (%r15),%rdx
lea    0xcd1(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r15),%rdx
lea    0xcd4(%rip),%rsi
jmp    1356 <main+0x116>
mov    0x2ba3(%rip),%rax
mov    (%rax),%ebx
mov    (%r15),%rbp
mov    0x2b8f(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
lea    0xc01(%rip),%rsi
jmp    1332 <main+0xf2>
mov    %r14d,%ebx
xor    %r13d,%r13d
mov    $0x2,%ebp
mov    (%r15,%rbp,8),%rdi
call   1050 <strlen@plt>
add    %eax,%r13d
add    $0x1,%r13d
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1467 <main+0x227>
test   %r13d,%r13d
je     159e <main+0x35e>
mov    %r13d,%edi
call   10d0 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     15b6 <main+0x376>
add    $0xffffffff,%r14d
xor    %ebp,%ebp
mov    $0x2,%r12d
mov    %rbx,0x10(%rsp)
mov    (%r15,%r12,8),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    14fe <main+0x2be>
cmp    %r13d,%ebp
jae    14fe <main+0x2be>
mov    %eax,%eax
movslq %ebp,%rcx
add    0x8(%rsp),%rcx
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%r12,8),%rsi
movzbl -0x1(%rsi,%rdx,1),%ebx
mov    %bl,-0x1(%rcx,%rdx,1)
add    $0x1,%ebp
cmp    %rax,%rdx
jae    14fe <main+0x2be>
add    $0x1,%rdx
cmp    %ebp,%r13d
ja     14e0 <main+0x2a0>
mov    $0x20,%al
cmp    %r14,%r12
mov    0x10(%rsp),%rdx
jb     150e <main+0x2ce>
jne    151c <main+0x2dc>
xor    %eax,%eax
movslq %ebp,%rcx
add    $0x1,%ebp
mov    0x8(%rsp),%rsi
mov    %al,(%rsi,%rcx,1)
add    $0x1,%r12
cmp    %rdx,%r12
jae    152a <main+0x2ea>
cmp    %r13d,%ebp
jb     14b0 <main+0x270>
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <system@plt>
mov    %eax,%edi
call   10f0 <WEXITSTATUS@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
jmp    1362 <main+0x122>
lea    0x10(%r15),%rsi
mov    0x10(%r15),%rdi
call   1110 <execvp@plt>
mov    %eax,%r14d
mov    0x2a7a(%rip),%rax
mov    (%rax),%ebp
mov    (%r15),%rbx
mov    0x10(%r15),%r15
mov    0x2a62(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
lea    0xb4d(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    %r14d,%eax
jmp    1362 <main+0x122>
mov    0x2a3b(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xad5(%rip),%rsi
jmp    1356 <main+0x116>
mov    0x2a23(%rip),%rax
mov    (%rax),%ebx
mov    (%r15),%rbp
mov    0x2a0f(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
lea    0xacb(%rip),%rsi
jmp    1332 <main+0xf2>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"%s: will not run as root\0A\00"
@.str.1 = [33 x i8] c"%s: cannot change from root: %s\0A\00"
@errno = global i32 0
@.str.2 = [29 x i8] c"%s: cannot change from root\0A\00"
@.str.3 = [44 x i8] c"%s: could not create new process group: %s\0A\00"
@.str.4 = [2 x i8] c"s\00"
@.str.5 = [28 x i8] c"%s: invalid system command\0A\00"
@.str.6 = [45 x i8] c"%s: could not allocate temporary memory: %s\0A\00"
@.str.7 = [2 x i8] c"e\00"
@.str.8 = [30 x i8] c"%s: '%s' execution error: %s\0A\00"
@.str.9 = [22 x i8] c"%s s \22command\22 (...)\0A\00"
@.str.10 = [31 x i8] c"%s e [command] (arguments...)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 (...) @getuid()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 (...) @getgid()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %42
8: ; preds = %5, %2
%9 = tail call i32 (...) @geteuid()
%10 = tail call i32 (...) @getegid()
%11 = tail call i64 (...) @getuid()
%12 = icmp eq i64 %11, 0
%13 = icmp ne i32 %9, 0
%14 = select i1 %12, i1 %13, i1 false
%15 = icmp ne i32 %10, 0
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %21, label %17
17: ; preds = %8
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %1
%20 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %184
21: ; preds = %8
%22 = tail call i64 @seteuid(i64 0)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = tail call i32 (...) @getgid()
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = tail call i64 @setgid(i32 %10)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %36
30: ; preds = %27, %24
%31 = tail call i64 (...) @getuid()
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = tail call i64 @setuid(i32 %9)
%35 = icmp eq i64 %34, 0
br i1 %35, label %42, label %36
36: ; preds = %33, %27, %21
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %1
%39 = load i32, i32* @errno
%40 = tail call i8* @strerror(i32 %39)
%41 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %38, i8* %40)
br label %184
42: ; preds = %30, %33, %5
%43 = tail call i32 (...) @getgid()
%44 = tail call i64 @setegid(i32 %43)
%45 = tail call i64 (...) @getuid()
%46 = tail call i64 @seteuid(i64 %45)
%47 = tail call i64 (...) @getuid()
%48 = icmp eq i64 %47, 0
br i1 %48, label %60, label %49
49: ; preds = %42
%50 = tail call i32 (...) @getgid()
%51 = icmp eq i32 %50, 0
br i1 %51, label %60, label %52
52: ; preds = %49
%53 = tail call i32 (...) @getgid()
%54 = tail call i64 @setegid(i32 %53)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = tail call i64 (...) @getuid()
%58 = tail call i64 @seteuid(i64 %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %64, label %60
60: ; preds = %56, %52, %49, %42
%61 = load i32, i32* @stderr
%62 = load i8*, i8** %1
%63 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %62)
br label %184
64: ; preds = %56
%65 = tail call i64 @getsid(i32 0)
%66 = tail call i64 (...) @getpid()
%67 = icmp eq i64 %65, %66
br i1 %67, label %77, label %68
68: ; preds = %64
%69 = tail call i64 @setpgid(i32 0, i32 0)
%70 = icmp slt i64 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %1
%74 = load i32, i32* @errno
%75 = tail call i8* @strerror(i32 %74)
%76 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* %73, i8* %75)
br label %184
77: ; preds = %68, %64
%78 = icmp sgt i32 %0, 2
br i1 %78, label %79, label %177
79: ; preds = %77
%80 = getelementptr inbounds i8*, i8** %1, i64 1
%81 = load i8*, i8** %80
%82 = tail call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %163
84: ; preds = %79
%85 = zext i32 %0 to i64
br label %86
86: ; preds = %84, %86
%87 = phi i64 [ 2, %84 ], [ %94, %86 ]
%88 = phi i32 [ 0, %84 ], [ %93, %86 ]
%89 = getelementptr inbounds i8*, i8** %1, i64 %87
%90 = load i8*, i8** %89
%91 = tail call i32 @strlen(i8* %90)
%92 = add i32 %88, 1
%93 = add i32 %92, %91
%94 = add nuw nsw i64 %87, 1
%95 = icmp eq i64 %94, %85
br i1 %95, label %96, label %86
96: ; preds = %86
%97 = icmp eq i32 %93, 0
br i1 %97, label %98, label %102
98: ; preds = %96
%99 = load i32, i32* @stderr
%100 = load i8*, i8** %1
%101 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* %100)
br label %184
102: ; preds = %96
%103 = tail call i64 @malloc(i32 %93)
%104 = inttoptr i64 %103 to i8*
%105 = icmp eq i64 %103, 0
br i1 %105, label %110, label %106
106: ; preds = %102
%107 = add nsw i32 %0, -1
%108 = zext i32 %107 to i64
%109 = zext i32 %0 to i64
br label %116
110: ; preds = %102
%111 = load i32, i32* @stderr
%112 = load i8*, i8** %1
%113 = load i32, i32* @errno
%114 = tail call i8* @strerror(i32 %113)
%115 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i8* %112, i8* %114)
br label %184
116: ; preds = %106, %153
%117 = phi i64 [ 2, %106 ], [ %155, %153 ]
%118 = phi i32 [ 0, %106 ], [ %154, %153 ]
%119 = getelementptr inbounds i8*, i8** %1, i64 %117
%120 = load i8*, i8** %119
%121 = tail call i32 @strlen(i8* %120)
%122 = icmp sgt i32 %121, 0
%123 = icmp ult i32 %118, %93
%124 = select i1 %122, i1 %123, i1 false
br i1 %124, label %125, label %143
125: ; preds = %116
%126 = zext i32 %121 to i64
%127 = sext i32 %118 to i64
br label %128
128: ; preds = %125, %128
%129 = phi i64 [ %127, %125 ], [ %134, %128 ]
%130 = phi i64 [ 0, %125 ], [ %136, %128 ]
%131 = load i8*, i8** %119
%132 = getelementptr inbounds i8, i8* %131, i64 %130
%133 = load i8, i8* %132
%134 = add nsw i64 %129, 1
%135 = getelementptr inbounds i8, i8* %104, i64 %129
store i8 %133, i8* %135
%136 = add nuw nsw i64 %130, 1
%137 = icmp ult i64 %136, %126
%138 = trunc i64 %134 to i32
%139 = icmp ugt i32 %93, %138
%140 = select i1 %137, i1 %139, i1 false
br i1 %140, label %128, label %141
141: ; preds = %128
%142 = trunc i64 %134 to i32
br label %143
143: ; preds = %141, %116
%144 = phi i32 [ %118, %116 ], [ %142, %141 ]
%145 = icmp ult i64 %117, %108
br i1 %145, label %148, label %146
146: ; preds = %143
%147 = icmp eq i64 %117, %108
br i1 %147, label %148, label %153
148: ; preds = %146, %143
%149 = phi i8 [ 32, %143 ], [ 0, %146 ]
%150 = add nsw i32 %144, 1
%151 = sext i32 %144 to i64
%152 = getelementptr inbounds i8, i8* %104, i64 %151
store i8 %149, i8* %152
br label %153
153: ; preds = %148, %146
%154 = phi i32 [ %144, %146 ], [ %150, %148 ]
%155 = add nuw nsw i64 %117, 1
%156 = icmp ult i64 %155, %109
%157 = icmp ult i32 %154, %93
%158 = select i1 %156, i1 %157, i1 false
br i1 %158, label %116, label %159
159: ; preds = %153
%160 = tail call i32 @system(i8* %104)
%161 = tail call i32 @WEXITSTATUS(i32 %160)
%162 = tail call i32 @free(i8* %104)
br label %184
163: ; preds = %79
%164 = load i8*, i8** %80
%165 = tail call i64 @strcmp(i8* %164, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%166 = icmp eq i64 %165, 0
br i1 %166, label %167, label %177
167: ; preds = %163
%168 = getelementptr inbounds i8*, i8** %1, i64 2
%169 = load i8*, i8** %168
%170 = tail call i32 @execvp(i8* %169, i8** %168)
%171 = load i32, i32* @stderr
%172 = load i8*, i8** %1
%173 = load i8*, i8** %168
%174 = load i32, i32* @errno
%175 = tail call i8* @strerror(i32 %174)
%176 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %171, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* %172, i8* %173, i8* %175)
br label %184
177: ; preds = %77, %163
%178 = load i32, i32* @stderr
%179 = load i8*, i8** %1
%180 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %178, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i8* %179)
%181 = load i32, i32* @stderr
%182 = load i8*, i8** %1
%183 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %181, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %182)
br label %184
184: ; preds = %17, %36, %167, %177, %110, %159, %98, %71, %60
%185 = phi i32 [ 1, %60 ], [ 1, %71 ], [ %170, %167 ], [ 1, %177 ], [ 1, %98 ], [ %161, %159 ], [ 1, %110 ], [ 1, %36 ], [ 1, %17 ]
ret i32 %185
}