#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 */
struct passwd {
  char *pw_name;
};
struct group {
  char *gr_name;
};
typedef int /*<<< orphan*/ groups;
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getegid();
int geteuid();
int getgid();
struct group *getgrgid(int);
int getgroups(int, int *);
struct passwd *getpwuid(int);
int getuid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void print(void) {
  int uid = getuid();
  int gid = getgid();
  int euid = geteuid();
  int egid = getegid();
  struct passwd *p = 0;
  struct group *g = 0;
  gid_t groups[1024];
  int n, size;
  p = getpwuid(uid);
  g = getgrgid(gid);
  fprintf(stderr, "real user/group: %ld/%ld (%s/%s)\n", (long)uid, (long)gid,
          (p && p->pw_name ? p->pw_name : "???"),
          (g && g->gr_name ? g->gr_name : "???"));
  p = getpwuid(euid);
  g = getgrgid(egid);
  fprintf(stderr, "eff. user/group: %ld/%ld (%s/%s)\n", (long)euid, (long)egid,
          (p && p->pw_name ? p->pw_name : "???"),
          (g && g->gr_name ? g->gr_name : "???"));
  size = sizeof(groups) / sizeof(gid_t);
  n = getgroups(size - 1, groups);
  if (n < 0)
    perror("getgroups failed");
  else {
    int i;
    fprintf(stderr, "eff. group list: [");
    for (i = 0; i < n; i++) {
      g = getgrgid(groups[i]);
      fprintf(stderr, "%s%s=%ld", (i == 0 ? "" : ", "),
              (g->gr_name ? g->gr_name : "???"), (long)groups[i]);
    }
    fprintf(stderr, "]\n");
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10b0,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1080 <getgid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   10a0 <getegid@plt>
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <getgrgid@plt>
mov    %rax,-0x20(%rbp)
mov    0x2dee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1044(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x1040(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x1038(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     123c <print+0xac>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     123c <print+0xac>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x1050(%rbp)
jmp    124f <print+0xbf>
lea    0xddf(%rip),%rax
mov    %rax,-0x1050(%rbp)
jmp    124f <print+0xbf>
mov    -0x1050(%rbp),%rax
mov    %rax,-0x1058(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1289 <print+0xf9>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1289 <print+0xf9>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x1060(%rbp)
jmp    129c <print+0x10c>
lea    0xd92(%rip),%rax
mov    %rax,-0x1060(%rbp)
jmp    129c <print+0x10c>
mov    -0x1058(%rbp),%r8
mov    -0x1038(%rbp),%rcx
mov    -0x1040(%rbp),%rdx
mov    -0x1044(%rbp),%edi
mov    -0x1060(%rbp),%r9
lea    0xd3b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <getgrgid@plt>
mov    %rax,-0x20(%rbp)
mov    0x2cf5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1074(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x1070(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x1068(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1335 <print+0x1a5>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1335 <print+0x1a5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x1080(%rbp)
jmp    1348 <print+0x1b8>
lea    0xce6(%rip),%rax
mov    %rax,-0x1080(%rbp)
jmp    1348 <print+0x1b8>
mov    -0x1080(%rbp),%rax
mov    %rax,-0x1088(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1382 <print+0x1f2>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1382 <print+0x1f2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x1090(%rbp)
jmp    1395 <print+0x205>
lea    0xc99(%rip),%rax
mov    %rax,-0x1090(%rbp)
jmp    1395 <print+0x205>
mov    -0x1088(%rbp),%r8
mov    -0x1068(%rbp),%rcx
mov    -0x1070(%rbp),%rdx
mov    -0x1074(%rbp),%edi
mov    -0x1090(%rbp),%r9
lea    0xc68(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x400,-0x1028(%rbp)
mov    -0x1028(%rbp),%edi
sub    $0x1,%edi
lea    -0x1020(%rbp),%rsi
call   1090 <getgroups@plt>
mov    %eax,-0x1024(%rbp)
cmpl   $0x0,-0x1024(%rbp)
jge    1408 <print+0x278>
lea    0xc4a(%rip),%rdi
call   10b0 <perror@plt>
jmp    1513 <print+0x383>
mov    0x2bd1(%rip),%rax
mov    (%rax),%edi
lea    0xc41(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x102c(%rbp)
mov    -0x102c(%rbp),%eax
cmp    -0x1024(%rbp),%eax
jge    14fc <print+0x36c>
movslq -0x102c(%rbp),%rax
mov    -0x1020(%rbp,%rax,4),%edi
call   1050 <getgrgid@plt>
mov    %rax,-0x20(%rbp)
mov    0x2b87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x109c(%rbp)
mov    -0x102c(%rbp),%edx
lea    0xc07(%rip),%rax
lea    0xbd2(%rip),%rcx
cmp    $0x0,%edx
cmove  %rcx,%rax
mov    %rax,-0x1098(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     14a4 <print+0x314>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10a8(%rbp)
jmp    14b7 <print+0x327>
lea    0xb77(%rip),%rax
mov    %rax,-0x10a8(%rbp)
jmp    14b7 <print+0x327>
mov    -0x1098(%rbp),%rdx
mov    -0x109c(%rbp),%edi
mov    -0x10a8(%rbp),%rcx
movslq -0x102c(%rbp),%rax
movslq -0x1020(%rbp,%rax,4),%r8
ff
lea    0xb8b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x102c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x102c(%rbp)
jmp    1429 <print+0x299>
mov    0x2add(%rip),%rax
mov    (%rax),%edi
lea    0xb6c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
add    $0x10b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1008,%rsp
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1080 <getgid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   10a0 <getegid@plt>
mov    %eax,%r15d
mov    %r12d,%edi
call   1030 <getpwuid@plt>
mov    %rax,%rbp
mov    %r13d,%edi
call   1050 <getgrgid@plt>
lea    0xe3f(%rip),%rbx
mov    %rbx,%r8
test   %rbp,%rbp
je     11fd <print+0x6d>
mov    0x0(%rbp),%rcx
test   %rcx,%rcx
lea    0xe29(%rip),%r8
cmovne %rcx,%r8
mov    0x2ddc(%rip),%rcx
mov    (%rcx),%edi
movslq %r12d,%rdx
movslq %r13d,%rcx
mov    %rbx,%r9
test   %rax,%rax
je     1225 <print+0x95>
mov    (%rax),%rax
test   %rax,%rax
lea    0xe01(%rip),%r9
cmovne %rax,%r9
lea    0xdd4(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14d,%edi
call   1030 <getpwuid@plt>
mov    %rax,%rbp
mov    %r15d,%edi
call   1050 <getgrgid@plt>
mov    %rbx,%r8
test   %rbp,%rbp
je     1260 <print+0xd0>
mov    0x0(%rbp),%rcx
test   %rcx,%rcx
lea    0xdc6(%rip),%r8
cmovne %rcx,%r8
mov    0x2d79(%rip),%rcx
mov    (%rcx),%edi
movslq %r14d,%rdx
movslq %r15d,%rcx
test   %rax,%rax
je     1285 <print+0xf5>
mov    (%rax),%rax
test   %rax,%rax
lea    0xda1(%rip),%rbx
cmovne %rax,%rbx
lea    0xd9a(%rip),%rsi
mov    %rbx,%r9
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rsp,%rsi
mov    $0x3ff,%edi
call   1090 <getgroups@plt>
test   %eax,%eax
js     135c <print+0x1cc>
mov    %eax,%ebx
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
lea    0xd9c(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %ebx,%ebx
je     1333 <print+0x1a3>
mov    %ebx,%ebp
lea    0xd76(%rip),%r15
lea    0xd9d(%rip),%r12
lea    0xd43(%rip),%r13
lea    0xd86(%rip),%rbx
xor    %r14d,%r14d
jmp    1310 <print+0x180>
nopl   0x0(%rax,%rax,1)
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
movslq (%rsp,%r14,4),%r8
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
je     1333 <print+0x1a3>
mov    (%rsp,%r14,4),%edi
call   1050 <getgrgid@plt>
test   %r14,%r14
mov    %r12,%rdx
cmove  %r15,%rdx
mov    (%rax),%rax
mov    %r13,%rcx
test   %rax,%rax
je     12f0 <print+0x160>
mov    %rax,%rcx
jmp    12f0 <print+0x160>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
lea    0xd35(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xce5(%rip),%rdi
call   10b0 <perror@plt>
jmp    134a <print+0x1ba>

LLVM IR (-O0):
%struct.passwd = type { i8* }
%struct.group = type { i8* }
@stderr = global i32 0
@.str = [34 x i8] c"real user/group: %ld/%ld (%s/%s)\0A\00"
@.str.1 = [4 x i8] c"???\00"
@.str.2 = [34 x i8] c"eff. user/group: %ld/%ld (%s/%s)\0A\00"
@.str.3 = [17 x i8] c"getgroups failed\00"
@.str.4 = [19 x i8] c"eff. group list: [\00"
@.str.5 = [9 x i8] c"%s%s=%ld\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [3 x i8] c", \00"
@.str.8 = [3 x i8] c"]\0A\00"
define void @print() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.passwd*
%6 = alloca %struct.group*
%7 = alloca [1024 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = call i32 (...) @getuid()
store i32 %11, i32* %1
%12 = call i32 (...) @getgid()
store i32 %12, i32* %2
%13 = call i32 (...) @geteuid()
store i32 %13, i32* %3
%14 = call i32 (...) @getegid()
store i32 %14, i32* %4
store %struct.passwd* null, %struct.passwd** %5
store %struct.group* null, %struct.group** %6
%15 = load i32, i32* %1
%16 = call %struct.passwd* @getpwuid(i32 %15)
store %struct.passwd* %16, %struct.passwd** %5
%17 = load i32, i32* %2
%18 = call %struct.group* @getgrgid(i32 %17)
store %struct.group* %18, %struct.group** %6
%19 = load i32, i32* @stderr
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = load %struct.passwd*, %struct.passwd** %5
%25 = icmp ne %struct.passwd* %24, null
br i1 %25, label %26, label %35
26: ; preds = %0
%27 = load %struct.passwd*, %struct.passwd** %5
%28 = getelementptr inbounds %struct.passwd, %struct.passwd* %27, i32 0, i32 0
%29 = load i8*, i8** %28
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %35
31: ; preds = %26
%32 = load %struct.passwd*, %struct.passwd** %5
%33 = getelementptr inbounds %struct.passwd, %struct.passwd* %32, i32 0, i32 0
%34 = load i8*, i8** %33
br label %36
35: ; preds = %26, %0
br label %36
36: ; preds = %35, %31
%37 = phi i8* [ %34, %31 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %35 ]
%38 = load %struct.group*, %struct.group** %6
%39 = icmp ne %struct.group* %38, null
br i1 %39, label %40, label %49
40: ; preds = %36
%41 = load %struct.group*, %struct.group** %6
%42 = getelementptr inbounds %struct.group, %struct.group* %41, i32 0, i32 0
%43 = load i8*, i8** %42
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = load %struct.group*, %struct.group** %6
%47 = getelementptr inbounds %struct.group, %struct.group* %46, i32 0, i32 0
%48 = load i8*, i8** %47
br label %50
49: ; preds = %40, %36
br label %50
50: ; preds = %49, %45
%51 = phi i8* [ %48, %45 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %49 ]
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %21, i64 %23, i8* %37, i8* %51)
%53 = load i32, i32* %3
%54 = call %struct.passwd* @getpwuid(i32 %53)
store %struct.passwd* %54, %struct.passwd** %5
%55 = load i32, i32* %4
%56 = call %struct.group* @getgrgid(i32 %55)
store %struct.group* %56, %struct.group** %6
%57 = load i32, i32* @stderr
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = load %struct.passwd*, %struct.passwd** %5
%63 = icmp ne %struct.passwd* %62, null
br i1 %63, label %64, label %73
64: ; preds = %50
%65 = load %struct.passwd*, %struct.passwd** %5
%66 = getelementptr inbounds %struct.passwd, %struct.passwd* %65, i32 0, i32 0
%67 = load i8*, i8** %66
%68 = icmp ne i8* %67, null
br i1 %68, label %69, label %73
69: ; preds = %64
%70 = load %struct.passwd*, %struct.passwd** %5
%71 = getelementptr inbounds %struct.passwd, %struct.passwd* %70, i32 0, i32 0
%72 = load i8*, i8** %71
br label %74
73: ; preds = %64, %50
br label %74
74: ; preds = %73, %69
%75 = phi i8* [ %72, %69 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %73 ]
%76 = load %struct.group*, %struct.group** %6
%77 = icmp ne %struct.group* %76, null
br i1 %77, label %78, label %87
78: ; preds = %74
%79 = load %struct.group*, %struct.group** %6
%80 = getelementptr inbounds %struct.group, %struct.group* %79, i32 0, i32 0
%81 = load i8*, i8** %80
%82 = icmp ne i8* %81, null
br i1 %82, label %83, label %87
83: ; preds = %78
%84 = load %struct.group*, %struct.group** %6
%85 = getelementptr inbounds %struct.group, %struct.group* %84, i32 0, i32 0
%86 = load i8*, i8** %85
br label %88
87: ; preds = %78, %74
br label %88
88: ; preds = %87, %83
%89 = phi i8* [ %86, %83 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %87 ]
%90 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %59, i64 %61, i8* %75, i8* %89)
store i32 1024, i32* %9
%91 = load i32, i32* %9
%92 = sub nsw i32 %91, 1
%93 = getelementptr inbounds [1024 x i32], [1024 x i32]* %7, i64 0, i64 0
%94 = call i32 @getgroups(i32 %92, i32* %93)
store i32 %94, i32* %8
%95 = load i32, i32* %8
%96 = icmp slt i32 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %88
%98 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %140
99: ; preds = %88
%100 = load i32, i32* @stderr
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %10
br label %102
102: ; preds = %134, %99
%103 = load i32, i32* %10
%104 = load i32, i32* %8
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %137
106: ; preds = %102
%107 = load i32, i32* %10
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [1024 x i32], [1024 x i32]* %7, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = call %struct.group* @getgrgid(i32 %110)
store %struct.group* %111, %struct.group** %6
%112 = load i32, i32* @stderr
%113 = load i32, i32* %10
%114 = icmp eq i32 %113, 0
%115 = zext i1 %114 to i64
%116 = select i1 %114, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)
%117 = load %struct.group*, %struct.group** %6
%118 = getelementptr inbounds %struct.group, %struct.group* %117, i32 0, i32 0
%119 = load i8*, i8** %118
%120 = icmp ne i8* %119, null
br i1 %120, label %121, label %125
121: ; preds = %106
%122 = load %struct.group*, %struct.group** %6
%123 = getelementptr inbounds %struct.group, %struct.group* %122, i32 0, i32 0
%124 = load i8*, i8** %123
br label %126
125: ; preds = %106
br label %126
126: ; preds = %125, %121
%127 = phi i8* [ %124, %121 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %125 ]
%128 = load i32, i32* %10
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [1024 x i32], [1024 x i32]* %7, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = sext i32 %131 to i64
%133 = call i32 (i32, i8*, ...) @fprintf(i32 %112, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %116, i8* %127, i64 %132)
br label %134
134: ; preds = %126
%135 = load i32, i32* %10
%136 = add nsw i32 %135, 1
store i32 %136, i32* %10
br label %102
137: ; preds = %102
%138 = load i32, i32* @stderr
%139 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %140
140: ; preds = %137, %97
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
%struct.group = type { i8* }
@stderr = global i32 0
@.str = [34 x i8] c"real user/group: %ld/%ld (%s/%s)\0A\00"
@.str.1 = [4 x i8] c"???\00"
@.str.2 = [34 x i8] c"eff. user/group: %ld/%ld (%s/%s)\0A\00"
@.str.3 = [17 x i8] c"getgroups failed\00"
@.str.4 = [19 x i8] c"eff. group list: [\00"
@.str.5 = [9 x i8] c"%s%s=%ld\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [3 x i8] c", \00"
@.str.8 = [3 x i8] c"]\0A\00"
define void @print() {
%1 = alloca [1024 x i32]
%2 = tail call i32 (...) @getuid()
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 (...) @getegid()
%6 = bitcast [1024 x i32]* %1 to i8*
%7 = tail call %struct.passwd* @getpwuid(i32 %2)
%8 = tail call %struct.group* @getgrgid(i32 %3)
%9 = load i32, i32* @stderr
%10 = sext i32 %2 to i64
%11 = sext i32 %3 to i64
%12 = icmp eq %struct.passwd* %7, null
br i1 %12, label %18, label %13
13: ; preds = %0
%14 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i64 0, i32 0
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
%17 = select i1 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15
br label %18
18: ; preds = %13, %0
%19 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %17, %13 ]
%20 = icmp eq %struct.group* %8, null
br i1 %20, label %26, label %21
21: ; preds = %18
%22 = getelementptr inbounds %struct.group, %struct.group* %8, i64 0, i32 0
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
%25 = select i1 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %23
br label %26
26: ; preds = %21, %18
%27 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %18 ], [ %25, %21 ]
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11, i8* %19, i8* %27)
%29 = tail call %struct.passwd* @getpwuid(i32 %4)
%30 = tail call %struct.group* @getgrgid(i32 %5)
%31 = load i32, i32* @stderr
%32 = sext i32 %4 to i64
%33 = sext i32 %5 to i64
%34 = icmp eq %struct.passwd* %29, null
br i1 %34, label %40, label %35
35: ; preds = %26
%36 = getelementptr inbounds %struct.passwd, %struct.passwd* %29, i64 0, i32 0
%37 = load i8*, i8** %36
%38 = icmp eq i8* %37, null
%39 = select i1 %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %37
br label %40
40: ; preds = %35, %26
%41 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %26 ], [ %39, %35 ]
%42 = icmp eq %struct.group* %30, null
br i1 %42, label %48, label %43
43: ; preds = %40
%44 = getelementptr inbounds %struct.group, %struct.group* %30, i64 0, i32 0
%45 = load i8*, i8** %44
%46 = icmp eq i8* %45, null
%47 = select i1 %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %45
br label %48
48: ; preds = %43, %40
%49 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %40 ], [ %47, %43 ]
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %32, i64 %33, i8* %41, i8* %49)
%51 = getelementptr inbounds [1024 x i32], [1024 x i32]* %1, i64 0, i64 0
%52 = call i32 @getgroups(i32 1023, i32* %51)
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %48
%55 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %82
56: ; preds = %48
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%59 = icmp eq i32 %52, 0
br i1 %59, label %79, label %60
60: ; preds = %56
%61 = zext i32 %52 to i64
br label %62
62: ; preds = %60, %62
%63 = phi i64 [ 0, %60 ], [ %77, %62 ]
%64 = getelementptr inbounds [1024 x i32], [1024 x i32]* %1, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = call %struct.group* @getgrgid(i32 %65)
%67 = load i32, i32* @stderr
%68 = icmp eq i64 %63, 0
%69 = select i1 %68, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)
%70 = getelementptr inbounds %struct.group, %struct.group* %66, i64 0, i32 0
%71 = load i8*, i8** %70
%72 = icmp eq i8* %71, null
%73 = select i1 %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %71
%74 = load i32, i32* %64
%75 = sext i32 %74 to i64
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %69, i8* %73, i64 %75)
%77 = add nuw nsw i64 %63, 1
%78 = icmp eq i64 %77, %61
br i1 %78, label %79, label %62
79: ; preds = %62, %56
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %82
82: ; preds = %79, %54
ret void
}