#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 group {
  char *gr_name;
  char *gr_passwd;
  int gr_gid;
  char **gr_mem;
};

/* Variables and functions */
int /*<<< orphan*/ endgrent();
scalar_t__ errno;
int getegid();
int geteuid();
int getgid();
struct group *getgrent();
struct group *getgrgid(int);
struct group *getgrnam(char *);
int getuid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ setgrent();
int main(int argc, char *argv[]) {
  int myid;
  int myeid;
  int gid;
  int egid;
  struct group *pwp;
  int i;
  myid = getuid();
  myeid = geteuid();
  gid = getgid();
  egid = getegid();
  printf("My ID is %d\n", myid);
  printf("My effective ID is %d\n", myeid);
  printf("Group ID is %d", gid);
  printf("Effective Group ID is %d\n", egid);
  errno = 0;
  while ((pwp = getgrent()) != NULL) {
    printf("Here is the inforamtion of the first record in password\n"
           " database\n");
    printf("User name: '%s'\n", pwp->gr_name);
    printf("User password: '%s'\n", pwp->gr_passwd);
    printf("User ID: %d\n", pwp->gr_gid);
    printf("Members in group %s\n", pwp->gr_name);
    for (i = 0; pwp->gr_mem[i] != NULL; i++) {
      printf("\t'%s'\n", pwp->gr_mem[i]);
    }
    putchar('\n');
  }
  if (errno != 0) {
    perror("getgrent() failed");
    return 1;
  } else {
    printf("EOF reached\n");
  }
  setgrent();
  myid = getgid();
  pwp = getgrgid(myid);
  if (pwp != NULL) {
    printf("User name is '%s'\n", pwp->gr_name);
    printf("other infor has been omitted\n");
  } else {
    if (errno != 0) {
      perror("No password entry found!");
      return 0;
    }
  }
  pwp = getgrnam("root");
  if (pwp != NULL) {
    printf("group name is '%s'\n", pwp->gr_name);
    printf("other infor omitted \n");
  }
  endgrent();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <getuid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10a0 <geteuid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   10c0 <getgid@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   10d0 <getegid@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d97(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1050 <getgrent@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1321 <main+0x161>
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0x2c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1312 <main+0x152>
mov    -0x28(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12cf <main+0x10f>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1250 <main+0x90>
mov    0x2cb8(%rip),%rax
cmpq   $0x0,(%rax)
je     134a <main+0x18a>
lea    0xda6(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1422 <main+0x262>
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1080 <setgrent@plt>
mov    $0x0,%al
call   10c0 <getgid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1090 <getgrgid@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     13a8 <main+0x1e8>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13d6 <main+0x216>
mov    0x2c31(%rip),%rax
cmpq   $0x0,(%rax)
je     13d1 <main+0x211>
lea    0xd6f(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1422 <main+0x262>
jmp    13d6 <main+0x216>
lea    0xd6b(%rip),%rdi
call   10b0 <getgrnam@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1414 <main+0x254>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <endgrent@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10b0 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10d0 <getgid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   10e0 <getegid@plt>
mov    %eax,%r15d
lea    0xdf8(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdf5(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdfc(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2d96(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
call   1050 <getgrent@plt>
test   %rax,%rax
je     1320 <main+0x150>
mov    %rax,%rbx
lea    0xdf3(%rip),%r12
lea    0xe01(%rip),%r13
lea    0xe07(%rip),%rbp
lea    0xe15(%rip),%r14
jmp    12a9 <main+0xd9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1050 <getgrent@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1320 <main+0x150>
lea    0xe81(%rip),%rdi
call   1060 <puts@plt>
mov    (%rbx),%rsi
lea    0xd8e(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x8(%rbx),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%rbx),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rbx),%rax
mov    (%rax),%rsi
test   %rsi,%rsi
je     1290 <main+0xc0>
mov    $0x8,%r15d
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rbx),%rax
mov    (%rax,%r15,1),%rsi
add    $0x8,%r15
test   %rsi,%rsi
jne    1300 <main+0x130>
jmp    1290 <main+0xc0>
mov    0x2cb9(%rip),%rbx
cmpq   $0x0,(%rbx)
jne    13c4 <main+0x1f4>
lea    0xdbb(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1090 <setgrent@plt>
xor    %eax,%eax
call   10d0 <getgid@plt>
mov    %eax,%edi
call   10a0 <getgrgid@plt>
test   %rax,%rax
je     1376 <main+0x1a6>
mov    (%rax),%rsi
lea    0xd4d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xda5(%rip),%rdi
call   1060 <puts@plt>
jmp    137c <main+0x1ac>
cmpq   $0x0,(%rbx)
jne    13d7 <main+0x207>
lea    0xd57(%rip),%rdi
call   10c0 <getgrnam@plt>
test   %rax,%rax
je     13aa <main+0x1da>
mov    (%rax),%rsi
lea    0xd48(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd5a(%rip),%rdi
call   1060 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <endgrent@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcd1(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%ebx
jmp    13b3 <main+0x1e3>
lea    0xce3(%rip),%rdi
call   10f0 <perror@plt>
xor    %ebx,%ebx
jmp    13b3 <main+0x1e3>

LLVM IR (-O0):
%struct.group = type { i8*, i8*, i32, i8** }
@.str = [13 x i8] c"My ID is %d\0A\00"
@.str.1 = [23 x i8] c"My effective ID is %d\0A\00"
@.str.2 = [15 x i8] c"Group ID is %d\00"
@.str.3 = [26 x i8] c"Effective Group ID is %d\0A\00"
@errno = global i64 0
@.str.4 = [67 x i8] c"Here is the inforamtion of the first record in password\0A database\0A\00"
@.str.5 = [17 x i8] c"User name: '%s'\0A\00"
@.str.6 = [21 x i8] c"User password: '%s'\0A\00"
@.str.7 = [13 x i8] c"User ID: %d\0A\00"
@.str.8 = [21 x i8] c"Members in group %s\0A\00"
@.str.9 = [7 x i8] c"\09'%s'\0A\00"
@.str.10 = [18 x i8] c"getgrent() failed\00"
@.str.11 = [13 x i8] c"EOF reached\0A\00"
@.str.12 = [19 x i8] c"User name is '%s'\0A\00"
@.str.13 = [30 x i8] c"other infor has been omitted\0A\00"
@.str.14 = [25 x i8] c"No password entry found!\00"
@.str.15 = [5 x i8] c"root\00"
@.str.16 = [20 x i8] c"group name is '%s'\0A\00"
@.str.17 = [22 x i8] c"other infor omitted \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 %struct.group*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (...) @getuid()
store i32 %12, i32* %6
%13 = call i32 (...) @geteuid()
store i32 %13, i32* %7
%14 = call i32 (...) @getgid()
store i32 %14, i32* %8
%15 = call i32 (...) @getegid()
store i32 %15, i32* %9
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %9
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %22)
store i64 0, i64* @errno
br label %24
24: ; preds = %66, %2
%25 = call %struct.group* (...) @getgrent()
store %struct.group* %25, %struct.group** %10
%26 = icmp ne %struct.group* %25, null
br i1 %26, label %27, label %68
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0))
%29 = load %struct.group*, %struct.group** %10
%30 = getelementptr inbounds %struct.group, %struct.group* %29, i32 0, i32 0
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %31)
%33 = load %struct.group*, %struct.group** %10
%34 = getelementptr inbounds %struct.group, %struct.group* %33, i32 0, i32 1
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %35)
%37 = load %struct.group*, %struct.group** %10
%38 = getelementptr inbounds %struct.group, %struct.group* %37, i32 0, i32 2
%39 = load i32, i32* %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %39)
%41 = load %struct.group*, %struct.group** %10
%42 = getelementptr inbounds %struct.group, %struct.group* %41, i32 0, i32 0
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %43)
store i32 0, i32* %11
br label %45
45: ; preds = %63, %27
%46 = load %struct.group*, %struct.group** %10
%47 = getelementptr inbounds %struct.group, %struct.group* %46, i32 0, i32 3
%48 = load i8**, i8*** %47
%49 = load i32, i32* %11
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %48, i64 %50
%52 = load i8*, i8** %51
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %66
54: ; preds = %45
%55 = load %struct.group*, %struct.group** %10
%56 = getelementptr inbounds %struct.group, %struct.group* %55, i32 0, i32 3
%57 = load i8**, i8*** %56
%58 = load i32, i32* %11
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %57, i64 %59
%61 = load i8*, i8** %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %54
%64 = load i32, i32* %11
%65 = add nsw i32 %64, 1
store i32 %65, i32* %11
br label %45
66: ; preds = %45
%67 = call i32 @putchar(i8 signext 10)
br label %24
68: ; preds = %24
%69 = load i64, i64* @errno
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %3
br label %106
73: ; preds = %68
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
br label %75
75: ; preds = %73
%76 = call i32 (...) @setgrent()
%77 = call i32 (...) @getgid()
store i32 %77, i32* %6
%78 = load i32, i32* %6
%79 = call %struct.group* @getgrgid(i32 %78)
store %struct.group* %79, %struct.group** %10
%80 = load %struct.group*, %struct.group** %10
%81 = icmp ne %struct.group* %80, null
br i1 %81, label %82, label %88
82: ; preds = %75
%83 = load %struct.group*, %struct.group** %10
%84 = getelementptr inbounds %struct.group, %struct.group* %83, i32 0, i32 0
%85 = load i8*, i8** %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %85)
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0))
br label %94
88: ; preds = %75
%89 = load i64, i64* @errno
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %93
91: ; preds = %88
%92 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %3
br label %106
93: ; preds = %88
br label %94
94: ; preds = %93, %82
%95 = call %struct.group* @getgrnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
store %struct.group* %95, %struct.group** %10
%96 = load %struct.group*, %struct.group** %10
%97 = icmp ne %struct.group* %96, null
br i1 %97, label %98, label %104
98: ; preds = %94
%99 = load %struct.group*, %struct.group** %10
%100 = getelementptr inbounds %struct.group, %struct.group* %99, i32 0, i32 0
%101 = load i8*, i8** %100
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i8* %101)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0))
br label %104
104: ; preds = %98, %94
%105 = call i32 (...) @endgrent()
store i32 0, i32* %3
br label %106
106: ; preds = %104, %91, %71
%107 = load i32, i32* %3
ret i32 %107
}

LLVM IR (-O2):
%struct.group = type { i8*, i8*, i32, i8** }
@.str = [13 x i8] c"My ID is %d\0A\00"
@.str.1 = [23 x i8] c"My effective ID is %d\0A\00"
@.str.2 = [15 x i8] c"Group ID is %d\00"
@.str.3 = [26 x i8] c"Effective Group ID is %d\0A\00"
@errno = global i64 0
@.str.5 = [17 x i8] c"User name: '%s'\0A\00"
@.str.6 = [21 x i8] c"User password: '%s'\0A\00"
@.str.7 = [13 x i8] c"User ID: %d\0A\00"
@.str.8 = [21 x i8] c"Members in group %s\0A\00"
@.str.9 = [7 x i8] c"\09'%s'\0A\00"
@.str.10 = [18 x i8] c"getgrent() failed\00"
@.str.12 = [19 x i8] c"User name is '%s'\0A\00"
@.str.14 = [25 x i8] c"No password entry found!\00"
@.str.15 = [5 x i8] c"root\00"
@.str.16 = [20 x i8] c"group name is '%s'\0A\00"
@str = [12 x i8] c"EOF reached\00"
@str.18 = [21 x i8] c"other infor omitted \00"
@str.19 = [29 x i8] c"other infor has been omitted\00"
@str.20 = [66 x i8] c"Here is the inforamtion of the first record in password\0A database\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 (...) @getgid()
%6 = tail call i32 (...) @getegid()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %6)
store i64 0, i64* @errno
%11 = tail call %struct.group* (...) @getgrent()
%12 = icmp eq %struct.group* %11, null
br i1 %12, label %44, label %13
13: ; preds = %2, %40
%14 = phi %struct.group* [ %42, %40 ], [ %11, %2 ]
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.20, i64 0, i64 0))
%16 = getelementptr inbounds %struct.group, %struct.group* %14, i64 0, i32 0
%17 = load i8*, i8** %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds %struct.group, %struct.group* %14, i64 0, i32 1
%20 = load i8*, i8** %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds %struct.group, %struct.group* %14, i64 0, i32 2
%23 = load i32, i32* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %23)
%25 = load i8*, i8** %16
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds %struct.group, %struct.group* %14, i64 0, i32 3
%28 = load i8**, i8*** %27
%29 = load i8*, i8** %28
%30 = icmp eq i8* %29, null
br i1 %30, label %40, label %31
31: ; preds = %13, %31
%32 = phi i64 [ %35, %31 ], [ 0, %13 ]
%33 = phi i8* [ %38, %31 ], [ %29, %13 ]
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %33)
%35 = add nuw i64 %32, 1
%36 = load i8**, i8*** %27
%37 = getelementptr inbounds i8*, i8** %36, i64 %35
%38 = load i8*, i8** %37
%39 = icmp eq i8* %38, null
br i1 %39, label %40, label %31
40: ; preds = %31, %13
%41 = tail call i32 @putchar(i8 signext 10)
%42 = tail call %struct.group* (...) @getgrent()
%43 = icmp eq %struct.group* %42, null
br i1 %43, label %44, label %13
44: ; preds = %40, %2
%45 = load i64, i64* @errno
%46 = icmp eq i64 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %44
%48 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %75
49: ; preds = %44
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%51 = tail call i32 (...) @setgrent()
%52 = tail call i32 (...) @getgid()
%53 = tail call %struct.group* @getgrgid(i32 %52)
%54 = icmp eq %struct.group* %53, null
br i1 %54, label %60, label %55
55: ; preds = %49
%56 = getelementptr inbounds %struct.group, %struct.group* %53, i64 0, i32 0
%57 = load i8*, i8** %56
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %57)
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.19, i64 0, i64 0))
br label %65
60: ; preds = %49
%61 = load i64, i64* @errno
%62 = icmp eq i64 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
br label %75
65: ; preds = %60, %55
%66 = tail call %struct.group* @getgrnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%67 = icmp eq %struct.group* %66, null
br i1 %67, label %73, label %68
68: ; preds = %65
%69 = getelementptr inbounds %struct.group, %struct.group* %66, i64 0, i32 0
%70 = load i8*, i8** %69
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i8* %70)
%72 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.18, i64 0, i64 0))
br label %73
73: ; preds = %68, %65
%74 = tail call i32 (...) @endgrent()
br label %75
75: ; preds = %73, %63, %47
%76 = phi i32 [ 1, %47 ], [ 0, %73 ], [ 0, %63 ]
ret i32 %76
}