#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;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
scalar_t__ atol(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct group *getgrnam(char *);
struct passwd *getpwnam(char *);
scalar_t__ getuid();
int setgid(scalar_t__);
int setuid(scalar_t__);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
void SetPriv(char *userid, char *groupid) {
  struct passwd *pw_entry;
  struct group *gr_entry;
  uid_t myuid, newuid, newgid;
  int err;
  if (userid == 0 && groupid == 0)
    return;
  newuid = newgid = 0;
  myuid = getuid();
  if (myuid != 0) {
    syslog(LOG_ERR, "Only root wants to change uid/gid");
    fprintf(stderr, "ERROR: Only root wants to change uid/gid\n");
    exit(255);
  }
  if (userid) {
    pw_entry = getpwnam(userid);
    newuid = pw_entry ? pw_entry->pw_uid : atol(userid);
    if (newuid == 0) {
      fprintf(stderr, "Invalid user '%s'\n", userid);
      exit(255);
    }
  }
  if (groupid) {
    gr_entry = getgrnam(groupid);
    newgid = gr_entry ? gr_entry->gr_gid : atol(groupid);
    if (newgid == 0) {
      fprintf(stderr, "Invalid group '%s'\n", groupid);
      exit(255);
    }
    err = setgid(newgid);
    if (err) {
      syslog(LOG_ERR, "Can't set group id %ld for group '%s': %s", (long)newgid,
             groupid, strerror(errno));
      fprintf(stderr, "Can't set group id %ld for group '%s': %s\n",
              (long)newgid, groupid, strerror(errno));
      exit(255);
    }
  }
  if (newuid) {
    err = setuid(newuid);
    if (err) {
      syslog(LOG_ERR, "Can't set user id %ld for user '%s': %s", (long)newuid,
             userid, strerror(errno));
      fprintf(stderr, "Can't set user id %ld for user '%s': %s\n", (long)newuid,
              userid, strerror(errno));
      exit(255);
    }
  }
}


x86 assembly (clang, -O0):
<SetPriv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11ce <SetPriv+0x2e>
cmpq   $0x0,-0x10(%rbp)
jne    11ce <SetPriv+0x2e>
jmp    14b2 <SetPriv+0x312>
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     122c <SetPriv+0x8c>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1070 <syslog@plt>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
lea    0xe07(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
cmpq   $0x0,-0x8(%rbp)
je     12a9 <SetPriv+0x109>
mov    -0x8(%rbp),%rdi
call   1040 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     125f <SetPriv+0xbf>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    126c <SetPriv+0xcc>
mov    -0x8(%rbp),%rdi
call   1090 <atol@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12a4 <SetPriv+0x104>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
jmp    12a9 <SetPriv+0x109>
cmpq   $0x0,-0x10(%rbp)
je     13d2 <SetPriv+0x232>
mov    -0x10(%rbp),%rdi
call   1060 <getgrnam@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     12dc <SetPriv+0x13c>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    12e9 <SetPriv+0x149>
mov    -0x10(%rbp),%rdi
call   1090 <atol@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1321 <SetPriv+0x181>
mov    0x2cdd(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1080 <setgid@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     13cd <SetPriv+0x22d>
mov    0x2c8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    0x2c7e(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%rdx
mov    -0x70(%rbp),%rcx
mov    %eax,%r8d
lea    0xcfd(%rip),%rsi
mov    $0x0,%al
call   1070 <syslog@plt>
mov    0x2c5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    %eax,%r8d
lea    0xce1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
jmp    13d2 <SetPriv+0x232>
cmpq   $0x0,-0x30(%rbp)
je     14b2 <SetPriv+0x312>
mov    -0x30(%rbp),%rdi
call   10b0 <setuid@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     14ad <SetPriv+0x30d>
mov    0x2bce(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xac(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0xac(%rbp),%edi
mov    -0xa8(%rbp),%rdx
mov    -0xa0(%rbp),%rcx
mov    %eax,%r8d
lea    0xc84(%rip),%rsi
mov    $0x0,%al
call   1070 <syslog@plt>
mov    0x2b8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    0x2b61(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x94(%rbp),%edi
mov    -0x90(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    %eax,%r8d
lea    0xc54(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
jmp    14b2 <SetPriv+0x312>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPriv>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rax
or     %rsi,%rax
je     1229 <SetPriv+0x89>
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getuid@plt>
test   %rax,%rax
jne    128b <SetPriv+0xeb>
test   %r14,%r14
je     11e7 <SetPriv+0x47>
mov    %r14,%rdi
call   1040 <getpwnam@plt>
test   %rax,%rax
je     1232 <SetPriv+0x92>
mov    (%rax),%r15
test   %r15,%r15
je     1242 <SetPriv+0xa2>
test   %rbx,%rbx
jne    11ef <SetPriv+0x4f>
jmp    1214 <SetPriv+0x74>
xor    %r15d,%r15d
test   %rbx,%rbx
je     1214 <SetPriv+0x74>
mov    %rbx,%rdi
call   1060 <getgrnam@plt>
test   %rax,%rax
je     1257 <SetPriv+0xb7>
mov    (%rax),%r12
test   %r12,%r12
je     1267 <SetPriv+0xc7>
mov    %r12,%rdi
call   1080 <setgid@plt>
test   %eax,%eax
jne    12c3 <SetPriv+0x123>
test   %r15,%r15
je     1229 <SetPriv+0x89>
mov    %r15,%rdi
call   10b0 <setuid@plt>
test   %eax,%eax
jne    1316 <SetPriv+0x176>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
call   1090 <atol@plt>
mov    %rax,%r15
test   %r15,%r15
jne    11e0 <SetPriv+0x40>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
lea    0xdfa(%rip),%rsi
mov    %r14,%rdx
jmp    127a <SetPriv+0xda>
mov    %rbx,%rdi
call   1090 <atol@plt>
mov    %rax,%r12
test   %r12,%r12
jne    1204 <SetPriv+0x64>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
lea    0xde8(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
lea    0xd65(%rip),%rsi
xor    %eax,%eax
call   1070 <syslog@plt>
mov    0x2d37(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>
mov    0x2cfe(%rip),%rax
mov    (%rax),%ebp
mov    0x2d05(%rip),%r14
mov    (%r14),%edi
call   10c0 <strerror@plt>
lea    0xd91(%rip),%rsi
mov    %ebp,%edi
mov    %r12,%rdx
mov    %rbx,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1070 <syslog@plt>
mov    0x2ce5(%rip),%rax
mov    (%rax),%ebp
mov    (%r14),%edi
call   10c0 <strerror@plt>
lea    0xd91(%rip),%rsi
mov    %ebp,%edi
mov    %r12,%rdx
mov    %rbx,%rcx
jmp    1367 <SetPriv+0x1c7>
mov    0x2cab(%rip),%rax
mov    (%rax),%ebx
mov    0x2cb2(%rip),%rbp
mov    0x0(%rbp),%edi
call   10c0 <strerror@plt>
lea    0xd93(%rip),%rsi
mov    %ebx,%edi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1070 <syslog@plt>
mov    0x2c92(%rip),%rax
mov    (%rax),%ebx
mov    0x0(%rbp),%edi
call   10c0 <strerror@plt>
lea    0xd91(%rip),%rsi
mov    %ebx,%edi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i64 }
%struct.group = type { i64 }
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Only root wants to change uid/gid\00"
@stderr = global i32 0
@.str.1 = [42 x i8] c"ERROR: Only root wants to change uid/gid\0A\00"
@.str.2 = [19 x i8] c"Invalid user '%s'\0A\00"
@.str.3 = [20 x i8] c"Invalid group '%s'\0A\00"
@.str.4 = [42 x i8] c"Can't set group id %ld for group '%s': %s\00"
@errno = global i32 0
@.str.5 = [43 x i8] c"Can't set group id %ld for group '%s': %s\0A\00"
@.str.6 = [40 x i8] c"Can't set user id %ld for user '%s': %s\00"
@.str.7 = [41 x i8] c"Can't set user id %ld for user '%s': %s\0A\00"
define void @SetPriv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.passwd*
%6 = alloca %struct.group*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %13
br label %119
17: ; preds = %13, %2
store i64 0, i64* %9
store i64 0, i64* %8
%18 = call i64 (...) @getuid()
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32, i32* @LOG_ERR
%23 = call i32 (i32, i8*, ...) @syslog(i32 %22, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 @exit(i32 255)
unreachable
27: ; preds = %17
%28 = load i8*, i8** %3
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %52
30: ; preds = %27
%31 = load i8*, i8** %3
%32 = call %struct.passwd* @getpwnam(i8* %31)
store %struct.passwd* %32, %struct.passwd** %5
%33 = load %struct.passwd*, %struct.passwd** %5
%34 = icmp ne %struct.passwd* %33, null
br i1 %34, label %35, label %39
35: ; preds = %30
%36 = load %struct.passwd*, %struct.passwd** %5
%37 = getelementptr inbounds %struct.passwd, %struct.passwd* %36, i32 0, i32 0
%38 = load i64, i64* %37
br label %42
39: ; preds = %30
%40 = load i8*, i8** %3
%41 = call i64 @atol(i8* %40)
br label %42
42: ; preds = %39, %35
%43 = phi i64 [ %38, %35 ], [ %41, %39 ]
store i64 %43, i64* %8
%44 = load i64, i64* %8
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %42
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %3
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %48)
%50 = call i32 @exit(i32 255)
unreachable
51: ; preds = %42
br label %52
52: ; preds = %51, %27
%53 = load i8*, i8** %4
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %96
55: ; preds = %52
%56 = load i8*, i8** %4
%57 = call %struct.group* @getgrnam(i8* %56)
store %struct.group* %57, %struct.group** %6
%58 = load %struct.group*, %struct.group** %6
%59 = icmp ne %struct.group* %58, null
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = load %struct.group*, %struct.group** %6
%62 = getelementptr inbounds %struct.group, %struct.group* %61, i32 0, i32 0
%63 = load i64, i64* %62
br label %67
64: ; preds = %55
%65 = load i8*, i8** %4
%66 = call i64 @atol(i8* %65)
br label %67
67: ; preds = %64, %60
%68 = phi i64 [ %63, %60 ], [ %66, %64 ]
store i64 %68, i64* %9
%69 = load i64, i64* %9
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %76
71: ; preds = %67
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %4
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %73)
%75 = call i32 @exit(i32 255)
unreachable
76: ; preds = %67
%77 = load i64, i64* %9
%78 = call i32 @setgid(i64 %77)
store i32 %78, i32* %10
%79 = load i32, i32* %10
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %95
81: ; preds = %76
%82 = load i32, i32* @LOG_ERR
%83 = load i64, i64* %9
%84 = load i8*, i8** %4
%85 = load i32, i32* @errno
%86 = call i32 @strerror(i32 %85)
%87 = call i32 (i32, i8*, ...) @syslog(i32 %82, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i64 %83, i8* %84, i32 %86)
%88 = load i32, i32* @stderr
%89 = load i64, i64* %9
%90 = load i8*, i8** %4
%91 = load i32, i32* @errno
%92 = call i32 @strerror(i32 %91)
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i64 %89, i8* %90, i32 %92)
%94 = call i32 @exit(i32 255)
unreachable
95: ; preds = %76
br label %96
96: ; preds = %95, %52
%97 = load i64, i64* %8
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %119
99: ; preds = %96
%100 = load i64, i64* %8
%101 = call i32 @setuid(i64 %100)
store i32 %101, i32* %10
%102 = load i32, i32* %10
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %118
104: ; preds = %99
%105 = load i32, i32* @LOG_ERR
%106 = load i64, i64* %8
%107 = load i8*, i8** %3
%108 = load i32, i32* @errno
%109 = call i32 @strerror(i32 %108)
%110 = call i32 (i32, i8*, ...) @syslog(i32 %105, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i64 %106, i8* %107, i32 %109)
%111 = load i32, i32* @stderr
%112 = load i64, i64* %8
%113 = load i8*, i8** %3
%114 = load i32, i32* @errno
%115 = call i32 @strerror(i32 %114)
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i64 %112, i8* %113, i32 %115)
%117 = call i32 @exit(i32 255)
unreachable
118: ; preds = %99
br label %119
119: ; preds = %16, %118, %96
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i64 }
%struct.group = type { i64 }
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Only root wants to change uid/gid\00"
@stderr = global i32 0
@.str.1 = [42 x i8] c"ERROR: Only root wants to change uid/gid\0A\00"
@.str.2 = [19 x i8] c"Invalid user '%s'\0A\00"
@.str.3 = [20 x i8] c"Invalid group '%s'\0A\00"
@.str.4 = [42 x i8] c"Can't set group id %ld for group '%s': %s\00"
@errno = global i32 0
@.str.5 = [43 x i8] c"Can't set group id %ld for group '%s': %s\0A\00"
@.str.6 = [40 x i8] c"Can't set user id %ld for user '%s': %s\00"
@.str.7 = [41 x i8] c"Can't set user id %ld for user '%s': %s\0A\00"
define void @SetPriv(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %76, label %6
6: ; preds = %2
%7 = tail call i64 (...) @getuid()
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* @LOG_ERR
%11 = tail call i32 (i32, i8*, ...) @syslog(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @exit(i32 255)
unreachable
15: ; preds = %6
br i1 %3, label %31, label %16
16: ; preds = %15
%17 = tail call %struct.passwd* @getpwnam(i8* %0)
%18 = icmp eq %struct.passwd* %17, null
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = getelementptr inbounds %struct.passwd, %struct.passwd* %17, i64 0, i32 0
%21 = load i64, i64* %20
br label %24
22: ; preds = %16
%23 = tail call i64 @atol(i8* %0)
br label %24
24: ; preds = %22, %19
%25 = phi i64 [ %21, %19 ], [ %23, %22 ]
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%30 = tail call i32 @exit(i32 255)
unreachable
31: ; preds = %24, %15
%32 = phi i64 [ %25, %24 ], [ 0, %15 ]
br i1 %4, label %61, label %33
33: ; preds = %31
%34 = tail call %struct.group* @getgrnam(i8* %1)
%35 = icmp eq %struct.group* %34, null
br i1 %35, label %39, label %36
36: ; preds = %33
%37 = getelementptr inbounds %struct.group, %struct.group* %34, i64 0, i32 0
%38 = load i64, i64* %37
br label %41
39: ; preds = %33
%40 = tail call i64 @atol(i8* %1)
br label %41
41: ; preds = %39, %36
%42 = phi i64 [ %38, %36 ], [ %40, %39 ]
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%47 = tail call i32 @exit(i32 255)
unreachable
48: ; preds = %41
%49 = tail call i32 @setgid(i64 %42)
%50 = icmp eq i32 %49, 0
br i1 %50, label %61, label %51
51: ; preds = %48
%52 = load i32, i32* @LOG_ERR
%53 = load i32, i32* @errno
%54 = tail call i32 @strerror(i32 %53)
%55 = tail call i32 (i32, i8*, ...) @syslog(i32 %52, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i64 %42, i8* %1, i32 %54)
%56 = load i32, i32* @stderr
%57 = load i32, i32* @errno
%58 = tail call i32 @strerror(i32 %57)
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i64 %42, i8* %1, i32 %58)
%60 = tail call i32 @exit(i32 255)
unreachable
61: ; preds = %48, %31
%62 = icmp eq i64 %32, 0
br i1 %62, label %76, label %63
63: ; preds = %61
%64 = tail call i32 @setuid(i64 %32)
%65 = icmp eq i32 %64, 0
br i1 %65, label %76, label %66
66: ; preds = %63
%67 = load i32, i32* @LOG_ERR
%68 = load i32, i32* @errno
%69 = tail call i32 @strerror(i32 %68)
%70 = tail call i32 (i32, i8*, ...) @syslog(i32 %67, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i64 %32, i8* %0, i32 %69)
%71 = load i32, i32* @stderr
%72 = load i32, i32* @errno
%73 = tail call i32 @strerror(i32 %72)
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i64 %32, i8* %0, i32 %73)
%75 = tail call i32 @exit(i32 255)
unreachable
76: ; preds = %61, %63, %2
ret void
}