#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__ uid_t;
struct passwd {
  scalar_t__ pw_uid;
};
struct group {
  scalar_t__ gr_gid;
};
typedef scalar_t__ gid_t;

/* Variables and functions */
char *_PATH_BSHELL;
int /*<<< orphan*/ _SC_NGROUPS_MAX;
int chdir(char *);
int chroot(char *);
int /*<<< orphan*/ err(int, char *, ...);
int /*<<< orphan*/ errx(int, char *, ...);
int /*<<< orphan*/ execlp(char const *, char const *, char *, char *);
int /*<<< orphan*/ execvp(char *, char **);
char *getenv(char *);
struct group *getgrnam(char *);
int getopt(int, char **, char *);
struct passwd *getpwnam(char *);
scalar_t__ isdigit(unsigned char);
scalar_t__ *malloc(int);
char *optarg;
scalar_t__ optind;
int setgid(scalar_t__);
int setgroups(int, scalar_t__ *);
int setuid(scalar_t__);
char *strsep(char **, char *);
scalar_t__ strtoul(char *, char **, int /*<<< orphan*/);
int sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  struct group *gp;
  struct passwd *pw;
  char *endp, *p, *user, *group, *grouplist;
  const char *shell;
  gid_t gid, *gidlist;
  uid_t uid;
  int ch, gids;
  long ngroups_max;
  gid = 0;
  uid = 0;
  user = group = grouplist = NULL;
  while ((ch = getopt(argc, argv, "G:g:u:")) != -1) {
    switch (ch) {
    case 'u':
      user = optarg;
      if (*user == '\0')
        usage();
      break;
    case 'g':
      group = optarg;
      if (*group == '\0')
        usage();
      break;
    case 'G':
      grouplist = optarg;
      if (*grouplist == '\0')
        usage();
      break;
    case '?':
    default:
      usage();
    }
  }
  argc -= optind;
  argv += optind;
  if (argc < 1)
    usage();
  if (group != NULL) {
    if (isdigit((unsigned char)*group)) {
      gid = (gid_t)strtoul(group, &endp, 0);
      if (*endp != '\0')
        goto getgroup;
    } else {
    getgroup:
      if ((gp = getgrnam(group)) != NULL)
        gid = gp->gr_gid;
      else
        errx(1, "no such group `%s'", group);
    }
  }
  ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
  if ((gidlist = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
    err(1, "malloc");
  for (gids = 0; (p = strsep(&grouplist, ",")) != NULL && gids < ngroups_max;) {
    if (*p == '\0')
      continue;
    if (isdigit((unsigned char)*p)) {
      gidlist[gids] = (gid_t)strtoul(p, &endp, 0);
      if (*endp != '\0')
        goto getglist;
    } else {
    getglist:
      if ((gp = getgrnam(p)) != NULL)
        gidlist[gids] = gp->gr_gid;
      else
        errx(1, "no such group `%s'", p);
    }
    gids++;
  }
  if (p != NULL && gids == ngroups_max)
    errx(1, "too many supplementary groups provided");
  if (user != NULL) {
    if (isdigit((unsigned char)*user)) {
      uid = (uid_t)strtoul(user, &endp, 0);
      if (*endp != '\0')
        goto getuser;
    } else {
    getuser:
      if ((pw = getpwnam(user)) != NULL)
        uid = pw->pw_uid;
      else
        errx(1, "no such user `%s'", user);
    }
  }
  if (chdir(argv[0]) == -1 || chroot(".") == -1)
    err(1, "%s", argv[0]);
  if (gids && setgroups(gids, gidlist) == -1)
    err(1, "setgroups");
  if (group && setgid(gid) == -1)
    err(1, "setgid");
  if (user && setuid(uid) == -1)
    err(1, "setuid");
  if (argv[1]) {
    execvp(argv[1], &argv[1]);
    err(1, "%s", argv[1]);
  }
  if (!(shell = getenv("SHELL")))
    shell = _PATH_BSHELL;
  execlp(shell, shell, "-i", (char *)NULL);
  err(1, "%s", shell);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xd81(%rip),%rdx
call   1110 <getopt@plt>
mov    %eax,-0x6c(%rbp)
cmp    $0xffffffff,%eax
je     1366 <main+0x136>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x3f,%eax
je     1355 <main+0x125>
jmp    12a4 <main+0x74>
mov    -0x7c(%rbp),%eax
sub    $0x47,%eax
je     132b <main+0xfb>
jmp    12b5 <main+0x85>
mov    -0x7c(%rbp),%eax
sub    $0x67,%eax
je     1301 <main+0xd1>
jmp    12c6 <main+0x96>
mov    -0x7c(%rbp),%eax
sub    $0x75,%eax
jne    135a <main+0x12a>
jmp    12d7 <main+0xa7>
mov    0x2d1a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12fc <main+0xcc>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1361 <main+0x131>
mov    0x2cf0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1326 <main+0xf6>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1361 <main+0x131>
mov    0x2cc6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1350 <main+0x120>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1361 <main+0x131>
jmp    135a <main+0x12a>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1271 <main+0x41>
mov    0x2c63(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2c4f(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    13a1 <main+0x171>
mov    $0x0,%al
call   10e0 <usage@plt>
cmpq   $0x0,-0x40(%rbp)
je     143c <main+0x20c>
mov    -0x40(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     13ef <main+0x1bf>
mov    -0x40(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13ea <main+0x1ba>
jmp    13f4 <main+0x1c4>
jmp    1437 <main+0x207>
jmp    13f4 <main+0x1c4>
mov    -0x40(%rbp),%rdi
call   10a0 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     141b <main+0x1eb>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    1432 <main+0x202>
mov    -0x40(%rbp),%rdx
mov    $0x1,%edi
lea    0xbdc(%rip),%rsi
mov    $0x0,%al
call   1070 <errx@plt>
jmp    1437 <main+0x207>
jmp    143c <main+0x20c>
mov    0x2b9d(%rip),%rax
mov    (%rax),%edi
call   1100 <sysconf@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    1483 <main+0x253>
mov    $0x1,%edi
lea    0xb9e(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
movl   $0x0,-0x70(%rbp)
lea    -0x48(%rbp),%rdi
lea    0xb8c(%rip),%rsi
call   10d0 <strsep@plt>
mov    %rax,%rcx
mov    %rcx,-0x30(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x7d(%rbp)
je     14be <main+0x28e>
movslq -0x70(%rbp),%rax
cmp    -0x78(%rbp),%rax
setl   %al
mov    %al,-0x7d(%rbp)
mov    -0x7d(%rbp),%al
test   $0x1,%al
jne    14ce <main+0x29e>
jmp    158f <main+0x35f>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    14e3 <main+0x2b3>
jmp    148a <main+0x25a>
mov    -0x30(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1531 <main+0x301>
mov    -0x30(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
movslq -0x70(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     152c <main+0x2fc>
jmp    1536 <main+0x306>
jmp    1581 <main+0x351>
jmp    1536 <main+0x306>
mov    -0x30(%rbp),%rdi
call   10a0 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1565 <main+0x335>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x60(%rbp),%rax
movslq -0x70(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    157c <main+0x34c>
mov    -0x30(%rbp),%rdx
mov    $0x1,%edi
lea    0xa92(%rip),%rsi
mov    $0x0,%al
call   1070 <errx@plt>
jmp    1581 <main+0x351>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    148a <main+0x25a>
cmpq   $0x0,-0x30(%rbp)
je     15bb <main+0x38b>
movslq -0x70(%rbp),%rax
cmp    -0x78(%rbp),%rax
jne    15bb <main+0x38b>
mov    $0x1,%edi
lea    0xa6f(%rip),%rsi
mov    $0x0,%al
call   1070 <errx@plt>
cmpq   $0x0,-0x38(%rbp)
je     1656 <main+0x426>
mov    -0x38(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1609 <main+0x3d9>
mov    -0x38(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    %rax,-0x68(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1604 <main+0x3d4>
jmp    160e <main+0x3de>
jmp    1651 <main+0x421>
jmp    160e <main+0x3de>
mov    -0x38(%rbp),%rdi
call   1090 <getpwnam@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1635 <main+0x405>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
jmp    164c <main+0x41c>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xa05(%rip),%rsi
mov    $0x0,%al
call   1070 <errx@plt>
jmp    1651 <main+0x421>
jmp    1656 <main+0x426>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <chdir@plt>
cmp    $0xffffffff,%eax
je     1680 <main+0x450>
lea    0x9ea(%rip),%rdi
call   1050 <chroot@plt>
cmp    $0xffffffff,%eax
jne    169a <main+0x46a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0x9cb(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
cmpl   $0x0,-0x70(%rbp)
je     16cc <main+0x49c>
mov    -0x70(%rbp),%edi
mov    -0x60(%rbp),%rsi
call   1080 <setgroups@plt>
cmp    $0xffffffff,%eax
jne    16cc <main+0x49c>
mov    $0x1,%edi
lea    0x99c(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
cmpq   $0x0,-0x40(%rbp)
je     16fc <main+0x4cc>
mov    -0x58(%rbp),%rdi
call   10f0 <setgid@plt>
cmp    $0xffffffff,%eax
jne    16fc <main+0x4cc>
mov    $0x1,%edi
lea    0x976(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
cmpq   $0x0,-0x38(%rbp)
je     172c <main+0x4fc>
mov    -0x68(%rbp),%rdi
call   1140 <setuid@plt>
cmp    $0xffffffff,%eax
jne    172c <main+0x4fc>
mov    $0x1,%edi
lea    0x94d(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     176b <main+0x53b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1130 <execvp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0x8fa(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
lea    0x907(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    1793 <main+0x563>
mov    0x284c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x50(%rbp),%rsi
lea    0x8dd(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1150 <execlp@plt>
mov    -0x50(%rbp),%rdx
mov    $0x1,%edi
lea    0x8a3(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%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,%r14
mov    %edi,%ebx
movq   $0x0,0x10(%rsp)
lea    0xdad(%rip),%rbp
mov    0x2d9e(%rip),%r15
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    1270 <main+0x40>
xor    %eax,%eax
call   10e0 <usage@plt>
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1110 <getopt@plt>
cmp    $0x47,%eax
jne    1291 <main+0x61>
mov    (%r15),%rax
mov    %rax,0x10(%rsp)
cmpb   $0x0,(%rax)
jne    1270 <main+0x40>
jmp    1262 <main+0x32>
cmp    $0xffffffff,%eax
je     12b8 <main+0x88>
cmp    $0x67,%eax
je     12ac <main+0x7c>
cmp    $0x75,%eax
jne    1262 <main+0x32>
mov    (%r15),%r12
cmpb   $0x0,(%r12)
jne    1270 <main+0x40>
jmp    1262 <main+0x32>
mov    (%r15),%r13
cmpb   $0x0,0x0(%r13)
jne    1270 <main+0x40>
jmp    1262 <main+0x32>
mov    0x2d11(%rip),%rax
mov    (%rax),%rbp
sub    %ebp,%ebx
test   %ebx,%ebx
jle    12f7 <main+0xc7>
test   %r13,%r13
je     1303 <main+0xd3>
movzbl 0x0(%r13),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     1307 <main+0xd7>
mov    %rsp,%rsi
mov    %r13,%rdi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    %rax,%rbx
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
jne    1309 <main+0xd9>
jmp    1331 <main+0x101>
xor    %eax,%eax
call   10e0 <usage@plt>
test   %r13,%r13
jne    12cd <main+0x9d>
xor    %ebx,%ebx
jmp    1331 <main+0x101>
xor    %ebx,%ebx
mov    %r13,%rdi
call   10a0 <getgrnam@plt>
test   %rax,%rax
je     131b <main+0xeb>
mov    (%rax),%rbx
jmp    1331 <main+0x101>
lea    0xce5(%rip),%rsi
mov    $0x1,%edi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <errx@plt>
mov    %rbx,0x18(%rsp)
mov    %r13,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
call   1100 <sysconf@plt>
mov    %eax,%ebx
lea    0x8(,%rbx,8),%edi
call   10c0 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    1379 <main+0x149>
lea    0xcad(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <err@plt>
lea    (%r14,%rbp,8),%rax
mov    %rax,0x20(%rsp)
movslq %ebx,%r15
add    $0x1,%ebx
lea    0xc92(%rip),%r14
lea    0x10(%rsp),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
call   10d0 <strsep@plt>
mov    %rax,%r12
test   %rax,%rax
je     142b <main+0x1fb>
cmp    %r15,%rbp
jg     142b <main+0x1fb>
movzbl (%r12),%eax
test   %al,%al
je     13a0 <main+0x170>
movzbl %al,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     13ed <main+0x1bd>
mov    %r12,%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%rbp,8)
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     1422 <main+0x1f2>
mov    %r12,%rdi
call   10a0 <getgrnam@plt>
test   %rax,%rax
je     140c <main+0x1dc>
mov    (%rax),%rax
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%rbp,8)
add    $0x1,%rbp
jmp    13a0 <main+0x170>
mov    $0x1,%edi
lea    0xbef(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <errx@plt>
add    $0x1,%rbp
jmp    13a0 <main+0x170>
test   %r12,%r12
je     1447 <main+0x217>
cmp    %ebp,%ebx
jne    1447 <main+0x217>
lea    0xbe8(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <errx@plt>
mov    0x30(%rsp),%r12
test   %r12,%r12
mov    0x28(%rsp),%r15
mov    0x20(%rsp),%rbx
je     1485 <main+0x255>
movzbl (%r12),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     148a <main+0x25a>
mov    %rsp,%rsi
mov    %r12,%rdi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    %rax,%r14
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
jne    148d <main+0x25d>
jmp    14b5 <main+0x285>
xor    %r14d,%r14d
jmp    14b5 <main+0x285>
xor    %r14d,%r14d
mov    %r12,%rdi
call   1090 <getpwnam@plt>
test   %rax,%rax
je     149f <main+0x26f>
mov    (%rax),%r14
jmp    14b5 <main+0x285>
lea    0xba4(%rip),%rsi
mov    $0x1,%edi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <errx@plt>
mov    (%rbx),%rdi
call   1060 <chdir@plt>
cmp    $0xffffffff,%eax
je     14d3 <main+0x2a3>
lea    0xb93(%rip),%rdi
call   1050 <chroot@plt>
cmp    $0xffffffff,%eax
jne    14e9 <main+0x2b9>
mov    (%rbx),%rdx
lea    0xb81(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <err@plt>
test   %ebp,%ebp
je     1511 <main+0x2e1>
mov    %ebp,%edi
mov    0x8(%rsp),%rsi
call   1080 <setgroups@plt>
cmp    $0xffffffff,%eax
jne    1511 <main+0x2e1>
lea    0xb5c(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <err@plt>
test   %r15,%r15
je     1538 <main+0x308>
mov    0x18(%rsp),%rdi
call   10f0 <setgid@plt>
cmp    $0xffffffff,%eax
jne    1538 <main+0x308>
lea    0xb3f(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <err@plt>
test   %r12,%r12
je     155d <main+0x32d>
mov    %r14,%rdi
call   1140 <setuid@plt>
cmp    $0xffffffff,%eax
jne    155d <main+0x32d>
lea    0xb21(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <err@plt>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     1588 <main+0x358>
add    $0x8,%rbx
mov    %rbx,%rsi
call   1130 <execvp@plt>
mov    (%rbx),%rdx
lea    0xae2(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <err@plt>
lea    0xaea(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    15a6 <main+0x376>
mov    0x2a35(%rip),%rax
mov    (%rax),%rbx
lea    0xad2(%rip),%rdx
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1150 <execlp@plt>
lea    0xa9d(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   10b0 <err@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.group = type { i64 }
%struct.passwd = type { i64 }
@.str = [7 x i8] c"G:g:u:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.1 = [19 x i8] c"no such group `%s'\00"
@_SC_NGROUPS_MAX = global i32 0
@.str.2 = [7 x i8] c"malloc\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [39 x i8] c"too many supplementary groups provided\00"
@.str.5 = [18 x i8] c"no such user `%s'\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [10 x i8] c"setgroups\00"
@.str.9 = [7 x i8] c"setgid\00"
@.str.10 = [7 x i8] c"setuid\00"
@.str.11 = [6 x i8] c"SHELL\00"
@_PATH_BSHELL = global i8* null
@.str.12 = [3 x i8] c"-i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.group*
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64*
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %14
store i64 0, i64* %16
store i8* null, i8** %12
store i8* null, i8** %11
store i8* null, i8** %10
br label %20
20: ; preds = %57, %2
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = call i32 @getopt(i32 %21, i8** %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %23, i32* %17
%24 = icmp ne i32 %23, -1
br i1 %24, label %25, label %58
25: ; preds = %20
%26 = load i32, i32* %17
switch i32 %26, label %55 [
i32 117, label %27
i32 103, label %36
i32 71, label %45
i32 63, label %54
]
27: ; preds = %25
%28 = load i8*, i8** @optarg
store i8* %28, i8** %10
%29 = load i8*, i8** %10
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 (...) @usage()
br label %35
35: ; preds = %33, %27
br label %57
36: ; preds = %25
%37 = load i8*, i8** @optarg
store i8* %37, i8** %11
%38 = load i8*, i8** %11
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 (...) @usage()
br label %44
44: ; preds = %42, %36
br label %57
45: ; preds = %25
%46 = load i8*, i8** @optarg
store i8* %46, i8** %12
%47 = load i8*, i8** %12
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 (...) @usage()
br label %53
53: ; preds = %51, %45
br label %57
54: ; preds = %25
br label %55
55: ; preds = %25, %54
%56 = call i32 (...) @usage()
br label %57
57: ; preds = %55, %53, %44, %35
br label %20
58: ; preds = %20
%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, 1
br i1 %68, label %69, label %71
69: ; preds = %58
%70 = call i32 (...) @usage()
br label %71
71: ; preds = %69, %58
%72 = load i8*, i8** %11
%73 = icmp ne i8* %72, null
br i1 %73, label %74, label %102
74: ; preds = %71
%75 = load i8*, i8** %11
%76 = load i8, i8* %75
%77 = call i64 @isdigit(i8 zeroext %76)
%78 = icmp ne i64 %77, 0
br i1 %78, label %79, label %88
79: ; preds = %74
%80 = load i8*, i8** %11
%81 = call i64 @strtoul(i8* %80, i8** %8, i32 0)
store i64 %81, i64* %14
%82 = load i8*, i8** %8
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %87
86: ; preds = %79
br label %89
87: ; preds = %79
br label %101
88: ; preds = %74
br label %89
89: ; preds = %88, %86
%90 = load i8*, i8** %11
%91 = call %struct.group* @getgrnam(i8* %90)
store %struct.group* %91, %struct.group** %6
%92 = icmp ne %struct.group* %91, null
br i1 %92, label %93, label %97
93: ; preds = %89
%94 = load %struct.group*, %struct.group** %6
%95 = getelementptr inbounds %struct.group, %struct.group* %94, i32 0, i32 0
%96 = load i64, i64* %95
store i64 %96, i64* %14
br label %100
97: ; preds = %89
%98 = load i8*, i8** %11
%99 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %98)
br label %100
100: ; preds = %97, %93
br label %101
101: ; preds = %100, %87
br label %102
102: ; preds = %101, %71
%103 = load i32, i32* @_SC_NGROUPS_MAX
%104 = call i32 @sysconf(i32 %103)
%105 = add nsw i32 %104, 1
%106 = sext i32 %105 to i64
store i64 %106, i64* %19
%107 = load i64, i64* %19
%108 = mul i64 8, %107
%109 = trunc i64 %108 to i32
%110 = call i64* @malloc(i32 %109)
store i64* %110, i64** %15
%111 = icmp eq i64* %110, null
br i1 %111, label %112, label %114
112: ; preds = %102
%113 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %114
114: ; preds = %112, %102
store i32 0, i32* %18
br label %115
115: ; preds = %166, %130, %114
%116 = call i8* @strsep(i8** %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %116, i8** %9
%117 = icmp ne i8* %116, null
br i1 %117, label %118, label %123
118: ; preds = %115
%119 = load i32, i32* %18
%120 = sext i32 %119 to i64
%121 = load i64, i64* %19
%122 = icmp slt i64 %120, %121
br label %123
123: ; preds = %118, %115
%124 = phi i1 [ false, %115 ], [ %122, %118 ]
br i1 %124, label %125, label %169
125: ; preds = %123
%126 = load i8*, i8** %9
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 0
br i1 %129, label %130, label %131
130: ; preds = %125
br label %115
131: ; preds = %125
%132 = load i8*, i8** %9
%133 = load i8, i8* %132
%134 = call i64 @isdigit(i8 zeroext %133)
%135 = icmp ne i64 %134, 0
br i1 %135, label %136, label %149
136: ; preds = %131
%137 = load i8*, i8** %9
%138 = call i64 @strtoul(i8* %137, i8** %8, i32 0)
%139 = load i64*, i64** %15
%140 = load i32, i32* %18
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i64, i64* %139, i64 %141
store i64 %138, i64* %142
%143 = load i8*, i8** %8
%144 = load i8, i8* %143
%145 = sext i8 %144 to i32
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %148
147: ; preds = %136
br label %150
148: ; preds = %136
br label %166
149: ; preds = %131
br label %150
150: ; preds = %149, %147
%151 = load i8*, i8** %9
%152 = call %struct.group* @getgrnam(i8* %151)
store %struct.group* %152, %struct.group** %6
%153 = icmp ne %struct.group* %152, null
br i1 %153, label %154, label %162
154: ; preds = %150
%155 = load %struct.group*, %struct.group** %6
%156 = getelementptr inbounds %struct.group, %struct.group* %155, i32 0, i32 0
%157 = load i64, i64* %156
%158 = load i64*, i64** %15
%159 = load i32, i32* %18
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i64, i64* %158, i64 %160
store i64 %157, i64* %161
br label %165
162: ; preds = %150
%163 = load i8*, i8** %9
%164 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %163)
br label %165
165: ; preds = %162, %154
br label %166
166: ; preds = %165, %148
%167 = load i32, i32* %18
%168 = add nsw i32 %167, 1
store i32 %168, i32* %18
br label %115
169: ; preds = %123
%170 = load i8*, i8** %9
%171 = icmp ne i8* %170, null
br i1 %171, label %172, label %179
172: ; preds = %169
%173 = load i32, i32* %18
%174 = sext i32 %173 to i64
%175 = load i64, i64* %19
%176 = icmp eq i64 %174, %175
br i1 %176, label %177, label %179
177: ; preds = %172
%178 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %179
179: ; preds = %177, %172, %169
%180 = load i8*, i8** %10
%181 = icmp ne i8* %180, null
br i1 %181, label %182, label %210
182: ; preds = %179
%183 = load i8*, i8** %10
%184 = load i8, i8* %183
%185 = call i64 @isdigit(i8 zeroext %184)
%186 = icmp ne i64 %185, 0
br i1 %186, label %187, label %196
187: ; preds = %182
%188 = load i8*, i8** %10
%189 = call i64 @strtoul(i8* %188, i8** %8, i32 0)
store i64 %189, i64* %16
%190 = load i8*, i8** %8
%191 = load i8, i8* %190
%192 = sext i8 %191 to i32
%193 = icmp ne i32 %192, 0
br i1 %193, label %194, label %195
194: ; preds = %187
br label %197
195: ; preds = %187
br label %209
196: ; preds = %182
br label %197
197: ; preds = %196, %194
%198 = load i8*, i8** %10
%199 = call %struct.passwd* @getpwnam(i8* %198)
store %struct.passwd* %199, %struct.passwd** %7
%200 = icmp ne %struct.passwd* %199, null
br i1 %200, label %201, label %205
201: ; preds = %197
%202 = load %struct.passwd*, %struct.passwd** %7
%203 = getelementptr inbounds %struct.passwd, %struct.passwd* %202, i32 0, i32 0
%204 = load i64, i64* %203
store i64 %204, i64* %16
br label %208
205: ; preds = %197
%206 = load i8*, i8** %10
%207 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %206)
br label %208
208: ; preds = %205, %201
br label %209
209: ; preds = %208, %195
br label %210
210: ; preds = %209, %179
%211 = load i8**, i8*** %5
%212 = getelementptr inbounds i8*, i8** %211, i64 0
%213 = load i8*, i8** %212
%214 = call i32 @chdir(i8* %213)
%215 = icmp eq i32 %214, -1
br i1 %215, label %219, label %216
216: ; preds = %210
%217 = call i32 @chroot(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%218 = icmp eq i32 %217, -1
br i1 %218, label %219, label %224
219: ; preds = %216, %210
%220 = load i8**, i8*** %5
%221 = getelementptr inbounds i8*, i8** %220, i64 0
%222 = load i8*, i8** %221
%223 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %222)
br label %224
224: ; preds = %219, %216
%225 = load i32, i32* %18
%226 = icmp ne i32 %225, 0
br i1 %226, label %227, label %234
227: ; preds = %224
%228 = load i32, i32* %18
%229 = load i64*, i64** %15
%230 = call i32 @setgroups(i32 %228, i64* %229)
%231 = icmp eq i32 %230, -1
br i1 %231, label %232, label %234
232: ; preds = %227
%233 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %234
234: ; preds = %232, %227, %224
%235 = load i8*, i8** %11
%236 = icmp ne i8* %235, null
br i1 %236, label %237, label %243
237: ; preds = %234
%238 = load i64, i64* %14
%239 = call i32 @setgid(i64 %238)
%240 = icmp eq i32 %239, -1
br i1 %240, label %241, label %243
241: ; preds = %237
%242 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %243
243: ; preds = %241, %237, %234
%244 = load i8*, i8** %10
%245 = icmp ne i8* %244, null
br i1 %245, label %246, label %252
246: ; preds = %243
%247 = load i64, i64* %16
%248 = call i32 @setuid(i64 %247)
%249 = icmp eq i32 %248, -1
br i1 %249, label %250, label %252
250: ; preds = %246
%251 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
br label %252
252: ; preds = %250, %246, %243
%253 = load i8**, i8*** %5
%254 = getelementptr inbounds i8*, i8** %253, i64 1
%255 = load i8*, i8** %254
%256 = icmp ne i8* %255, null
br i1 %256, label %257, label %268
257: ; preds = %252
%258 = load i8**, i8*** %5
%259 = getelementptr inbounds i8*, i8** %258, i64 1
%260 = load i8*, i8** %259
%261 = load i8**, i8*** %5
%262 = getelementptr inbounds i8*, i8** %261, i64 1
%263 = call i32 @execvp(i8* %260, i8** %262)
%264 = load i8**, i8*** %5
%265 = getelementptr inbounds i8*, i8** %264, i64 1
%266 = load i8*, i8** %265
%267 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %266)
br label %268
268: ; preds = %257, %252
%269 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
store i8* %269, i8** %13
%270 = icmp ne i8* %269, null
br i1 %270, label %273, label %271
271: ; preds = %268
%272 = load i8*, i8** @_PATH_BSHELL
store i8* %272, i8** %13
br label %273
273: ; preds = %271, %268
%274 = load i8*, i8** %13
%275 = load i8*, i8** %13
%276 = call i32 @execlp(i8* %274, i8* %275, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* null)
%277 = load i8*, i8** %13
%278 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %277)
%279 = load i32, i32* %3
ret i32 %279
}

LLVM IR (-O2):
%struct.group = type { i64 }
%struct.passwd = type { i64 }
@.str = [7 x i8] c"G:g:u:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.1 = [19 x i8] c"no such group `%s'\00"
@_SC_NGROUPS_MAX = global i32 0
@.str.2 = [7 x i8] c"malloc\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [39 x i8] c"too many supplementary groups provided\00"
@.str.5 = [18 x i8] c"no such user `%s'\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [10 x i8] c"setgroups\00"
@.str.9 = [7 x i8] c"setgid\00"
@.str.10 = [7 x i8] c"setuid\00"
@.str.11 = [6 x i8] c"SHELL\00"
@_PATH_BSHELL = global i8* null
@.str.12 = [3 x i8] c"-i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i8** %4 to i8*
store i8* null, i8** %4
br label %7
7: ; preds = %18, %2
%8 = phi i8* [ null, %2 ], [ %19, %18 ]
%9 = phi i8* [ null, %2 ], [ %20, %18 ]
br label %10
10: ; preds = %7, %21
%11 = phi i8* [ %9, %7 ], [ %22, %21 ]
br label %12
12: ; preds = %10, %25
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %13, label %29 [
i32 -1, label %33
i32 117, label %14
i32 103, label %21
i32 71, label %25
]
14: ; preds = %12
%15 = load i8*, i8** @optarg
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %29, label %18
18: ; preds = %14, %29
%19 = phi i8* [ %30, %29 ], [ %15, %14 ]
%20 = phi i8* [ %31, %29 ], [ %11, %14 ]
br label %7
21: ; preds = %12
%22 = load i8*, i8** @optarg
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %29, label %10
25: ; preds = %12
%26 = load i8*, i8** @optarg
store i8* %26, i8** %4
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 0
br i1 %28, label %29, label %12
29: ; preds = %12, %25, %21, %14
%30 = phi i8* [ %15, %14 ], [ %8, %21 ], [ %8, %25 ], [ %8, %12 ]
%31 = phi i8* [ %11, %14 ], [ %11, %12 ], [ %11, %25 ], [ %22, %21 ]
%32 = tail call i32 (...) @usage()
br label %18
33: ; preds = %12
%34 = load i64, i64* @optind
%35 = trunc i64 %34 to i32
%36 = sub i32 %0, %35
%37 = getelementptr inbounds i8*, i8** %1, i64 %34
%38 = icmp slt i32 %36, 1
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = tail call i32 (...) @usage()
br label %41
41: ; preds = %39, %33
%42 = icmp eq i8* %11, null
br i1 %42, label %61, label %43
43: ; preds = %41
%44 = load i8, i8* %11
%45 = tail call i64 @isdigit(i8 zeroext %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %52, label %47
47: ; preds = %43
%48 = call i64 @strtoul(i8* %11, i8** %3, i32 0)
%49 = load i8*, i8** %3
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 0
br i1 %51, label %61, label %52
52: ; preds = %43, %47
%53 = phi i64 [ %48, %47 ], [ 0, %43 ]
%54 = tail call %struct.group* @getgrnam(i8* %11)
%55 = icmp eq %struct.group* %54, null
br i1 %55, label %59, label %56
56: ; preds = %52
%57 = getelementptr inbounds %struct.group, %struct.group* %54, i64 0, i32 0
%58 = load i64, i64* %57
br label %61
59: ; preds = %52
%60 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %61
61: ; preds = %47, %59, %56, %41
%62 = phi i64 [ %58, %56 ], [ %53, %59 ], [ %48, %47 ], [ 0, %41 ]
%63 = load i32, i32* @_SC_NGROUPS_MAX
%64 = tail call i32 @sysconf(i32 %63)
%65 = add nsw i32 %64, 1
%66 = shl i32 %65, 3
%67 = tail call i64* @malloc(i32 %66)
%68 = icmp eq i64* %67, null
br i1 %68, label %69, label %71
69: ; preds = %61
%70 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %71
71: ; preds = %69, %61
%72 = sext i32 %64 to i64
br label %73
73: ; preds = %101, %71
%74 = phi i64 [ %102, %101 ], [ 0, %71 ]
%75 = icmp sle i64 %74, %72
br label %76
76: ; preds = %73, %80
%77 = call i8* @strsep(i8** %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%78 = icmp ne i8* %77, null
%79 = select i1 %78, i1 %75, i1 false
br i1 %79, label %80, label %103
80: ; preds = %76
%81 = load i8, i8* %77
%82 = icmp eq i8 %81, 0
br i1 %82, label %76, label %83
83: ; preds = %80
%84 = call i64 @isdigit(i8 zeroext %81)
%85 = icmp eq i64 %84, 0
br i1 %85, label %92, label %86
86: ; preds = %83
%87 = call i64 @strtoul(i8* %77, i8** %3, i32 0)
%88 = getelementptr inbounds i64, i64* %67, i64 %74
store i64 %87, i64* %88
%89 = load i8*, i8** %3
%90 = load i8, i8* %89
%91 = icmp eq i8 %90, 0
br i1 %91, label %101, label %92
92: ; preds = %83, %86
%93 = call %struct.group* @getgrnam(i8* %77)
%94 = icmp eq %struct.group* %93, null
br i1 %94, label %99, label %95
95: ; preds = %92
%96 = getelementptr inbounds %struct.group, %struct.group* %93, i64 0, i32 0
%97 = load i64, i64* %96
%98 = getelementptr inbounds i64, i64* %67, i64 %74
store i64 %97, i64* %98
br label %101
99: ; preds = %92
%100 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %77)
br label %101
101: ; preds = %95, %99, %86
%102 = add nuw nsw i64 %74, 1
br label %73
103: ; preds = %76
%104 = trunc i64 %74 to i32
%105 = icmp eq i32 %65, %104
%106 = select i1 %78, i1 %105, i1 false
br i1 %106, label %107, label %109
107: ; preds = %103
%108 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %109
109: ; preds = %107, %103
%110 = icmp eq i8* %8, null
br i1 %110, label %129, label %111
111: ; preds = %109
%112 = load i8, i8* %8
%113 = call i64 @isdigit(i8 zeroext %112)
%114 = icmp eq i64 %113, 0
br i1 %114, label %120, label %115
115: ; preds = %111
%116 = call i64 @strtoul(i8* %8, i8** %3, i32 0)
%117 = load i8*, i8** %3
%118 = load i8, i8* %117
%119 = icmp eq i8 %118, 0
br i1 %119, label %129, label %120
120: ; preds = %111, %115
%121 = phi i64 [ %116, %115 ], [ 0, %111 ]
%122 = call %struct.passwd* @getpwnam(i8* %8)
%123 = icmp eq %struct.passwd* %122, null
br i1 %123, label %127, label %124
124: ; preds = %120
%125 = getelementptr inbounds %struct.passwd, %struct.passwd* %122, i64 0, i32 0
%126 = load i64, i64* %125
br label %129
127: ; preds = %120
%128 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %8)
br label %129
129: ; preds = %115, %127, %124, %109
%130 = phi i64 [ %126, %124 ], [ %121, %127 ], [ %116, %115 ], [ 0, %109 ]
%131 = load i8*, i8** %37
%132 = call i32 @chdir(i8* %131)
%133 = icmp eq i32 %132, -1
br i1 %133, label %137, label %134
134: ; preds = %129
%135 = call i32 @chroot(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%136 = icmp eq i32 %135, -1
br i1 %136, label %137, label %140
137: ; preds = %134, %129
%138 = load i8*, i8** %37
%139 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %138)
br label %140
140: ; preds = %137, %134
%141 = icmp eq i32 %104, 0
br i1 %141, label %147, label %142
142: ; preds = %140
%143 = call i32 @setgroups(i32 %104, i64* %67)
%144 = icmp eq i32 %143, -1
br i1 %144, label %145, label %147
145: ; preds = %142
%146 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %147
147: ; preds = %145, %142, %140
br i1 %42, label %153, label %148
148: ; preds = %147
%149 = call i32 @setgid(i64 %62)
%150 = icmp eq i32 %149, -1
br i1 %150, label %151, label %153
151: ; preds = %148
%152 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %153
153: ; preds = %151, %148, %147
br i1 %110, label %159, label %154
154: ; preds = %153
%155 = call i32 @setuid(i64 %130)
%156 = icmp eq i32 %155, -1
br i1 %156, label %157, label %159
157: ; preds = %154
%158 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
br label %159
159: ; preds = %157, %154, %153
%160 = getelementptr inbounds i8*, i8** %37, i64 1
%161 = load i8*, i8** %160
%162 = icmp eq i8* %161, null
br i1 %162, label %167, label %163
163: ; preds = %159
%164 = call i32 @execvp(i8* %161, i8** %160)
%165 = load i8*, i8** %160
%166 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %165)
br label %167
167: ; preds = %163, %159
%168 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%169 = icmp eq i8* %168, null
%170 = load i8*, i8** @_PATH_BSHELL
%171 = select i1 %169, i8* %170, i8* %168
%172 = call i32 @execlp(i8* %171, i8* %171, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* null)
%173 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %171)
ret i32 0
}