#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 */
typedef struct TYPE_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef size_t u_int;
typedef int /*<<< orphan*/ nis_result;
typedef int /*<<< orphan*/ nis_name;
typedef scalar_t__ nis_error;
typedef int /*<<< orphan*/ domainbuf;
typedef char *const_nis_name;
typedef int /*<<< orphan*/ buf;
struct TYPE_6__ {
  size_t gr_members_len;
  int /*<<< orphan*/ *gr_members_val;
};
struct TYPE_7__ {
  TYPE_1__ gr_members;
};
struct TYPE_8__ {
  char *zo_name;
  int /*<<< orphan*/ zo_domain;
  TYPE_2__ GR_data;
};

/* Variables and functions */
int EXPAND_NAME;
int FOLLOW_LINKS;
scalar_t__ NIS_FAIL;
scalar_t__ NIS_GROUP_OBJ;
scalar_t__ NIS_INVALIDOBJ;
size_t NIS_MAXNAMELEN;
scalar_t__ NIS_NOMEMORY;
int NIS_RES_NUMOBJ(int /*<<< orphan*/ *);
TYPE_3__ *NIS_RES_OBJECT(int /*<<< orphan*/ *);
scalar_t__ NIS_RES_STATUS(int /*<<< orphan*/ *);
scalar_t__ NIS_SUCCESS;
scalar_t__ __type_of(TYPE_3__ *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
char *nis_domain_of_r(char *, char *, int);
int /*<<< orphan*/ nis_freeresult(int /*<<< orphan*/ *);
int /*<<< orphan*/ nis_leaf_of_r(char *, char *, int);
int /*<<< orphan*/ *nis_lookup(char *, int);
int /*<<< orphan*/ *nis_modify(char *, TYPE_3__ *);
char *rawmemchr(int /*<<< orphan*/, char);
char *stpcpy(char *, char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, size_t);
nis_error nis_removemember(const_nis_name member, const_nis_name group) {
  if (group != NULL && group[0] != '\0') {
    size_t grouplen = strlen(group);
    char buf[grouplen + 14 + NIS_MAXNAMELEN];
    char domainbuf[grouplen + 2];
    nis_result *res, *res2;
    nis_error status;
    char *cp, *cp2;
    cp = rawmemchr(nis_leaf_of_r(group, buf, sizeof(buf) - 1), '\0');
    cp = stpcpy(cp, ".groups_dir");
    cp2 = nis_domain_of_r(group, domainbuf, sizeof(domainbuf) - 1);
    if (cp2 != NULL && cp2[0] != '\0') {
      cp = stpcpy(cp, ".");
      stpcpy(cp, cp2);
    }
    res = nis_lookup(buf, FOLLOW_LINKS | EXPAND_NAME);
    if (res == NULL)
      return NIS_NOMEMORY;
    if (NIS_RES_STATUS(res) != NIS_SUCCESS) {
      status = NIS_RES_STATUS(res);
      nis_freeresult(res);
      return status;
    }
    if (NIS_RES_NUMOBJ(res) != 1 ||
        __type_of(NIS_RES_OBJECT(res)) != NIS_GROUP_OBJ) {
      nis_freeresult(res);
      return NIS_INVALIDOBJ;
    }
    nis_name *gr_members_val =
        NIS_RES_OBJECT(res)->GR_data.gr_members.gr_members_val;
    u_int gr_members_len =
        NIS_RES_OBJECT(res)->GR_data.gr_members.gr_members_len;
    u_int j = 0;
    for (u_int i = 0; i < gr_members_len; ++i)
      if (strcmp(gr_members_val[i], member) != 0)
        gr_members_val[j++] = gr_members_val[i];
      else
        free(gr_members_val[i]);
    NIS_RES_OBJECT(res)->GR_data.gr_members.gr_members_len = j;
    cp = stpcpy(buf, NIS_RES_OBJECT(res)->zo_name);
    *cp++ = '.';
    strncpy(cp, NIS_RES_OBJECT(res)->zo_domain, NIS_MAXNAMELEN);
    res2 = nis_modify(buf, NIS_RES_OBJECT(res));
    status = NIS_RES_STATUS(res2);
    nis_freeresult(res);
    nis_freeresult(res2);
    return status;
  } else
    return NIS_FAIL;
}


x86 assembly (clang, -O0):
<nis_removemember>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     158f <nis_removemember+0x39f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     158f <nis_removemember+0x39f>
mov    -0x18(%rbp),%rdi
call   1080 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    0x2daa(%rip),%rax
mov    (%rax),%rdx
lea    0xe(%rcx,%rdx,1),%rax
mov    %rsp,%rsi
mov    %rsi,-0x28(%rbp)
lea    0x1d(%rcx,%rdx,1),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0xa0(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    %rdi,%rcx
add    $0x2,%rcx
mov    %rcx,-0x90(%rbp)
add    $0x11,%rdi
and    $0xfffffffffffffff0,%rdi
mov    %rsp,%rdx
sub    %rdi,%rdx
mov    %rdx,-0x98(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
sub    $0x1,%rax
mov    %eax,%edx
call   1090 <nis_leaf_of_r@plt>
mov    %eax,%edi
xor    %esi,%esi
call   10b0 <rawmemchr@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1070 <stpcpy@plt>
mov    -0x98(%rbp),%rsi
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
mov    %rcx,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
sub    $0x1,%rax
mov    %eax,%edx
call   1060 <nis_domain_of_r@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
je     1320 <nis_removemember+0x130>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1320 <nis_removemember+0x130>
mov    -0x58(%rbp),%rdi
lea    0xd02(%rip),%rsi
call   1070 <stpcpy@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
call   1070 <stpcpy@plt>
mov    -0xa0(%rbp),%rdi
mov    0x2ca2(%rip),%rax
mov    (%rax),%esi
mov    0x2ca1(%rip),%rax
or     (%rax),%esi
call   1100 <nis_lookup@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1367 <nis_removemember+0x177>
mov    0x2c54(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    1583 <nis_removemember+0x393>
mov    -0x40(%rbp),%rdi
call   10f0 <NIS_RES_STATUS@plt>
mov    0x2c71(%rip),%rcx
cmp    (%rcx),%rax
je     13aa <nis_removemember+0x1ba>
mov    -0x40(%rbp),%rdi
call   10f0 <NIS_RES_STATUS@plt>
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
call   1110 <nis_freeresult@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    1583 <nis_removemember+0x393>
mov    -0x40(%rbp),%rdi
call   10d0 <NIS_RES_NUMOBJ@plt>
cmp    $0x1,%eax
jne    13dd <nis_removemember+0x1ed>
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    %rax,%rdi
call   1030 <__type_of@plt>
mov    0x2be4(%rip),%rcx
cmp    (%rcx),%rax
je     1400 <nis_removemember+0x210>
mov    -0x40(%rbp),%rdi
call   1110 <nis_freeresult@plt>
mov    0x2bc3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    1583 <nis_removemember+0x393>
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    0x18(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    0x10(%rax),%rax
mov    %rax,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x78(%rbp),%rax
jae    14bf <nis_removemember+0x2cf>
mov    -0x70(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
je     1490 <nis_removemember+0x2a0>
mov    -0x70(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x70(%rbp),%rax
mov    -0x80(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x80(%rbp)
mov    %edx,(%rax,%rcx,4)
jmp    14a3 <nis_removemember+0x2b3>
mov    -0x70(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <free@plt>
jmp    14a8 <nis_removemember+0x2b8>
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1435 <nis_removemember+0x245>
mov    -0x80(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    -0xb0(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    -0xa0(%rbp),%rdi
mov    (%rax),%rsi
call   1070 <stpcpy@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x58(%rbp)
movb   $0x2e,(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    -0xa8(%rbp),%rdi
mov    0x8(%rax),%esi
mov    0x2aaf(%rip),%rax
mov    (%rax),%rdx
call   1050 <strncpy@plt>
mov    -0x40(%rbp),%rdi
call   10e0 <NIS_RES_OBJECT@plt>
mov    -0xa0(%rbp),%rdi
mov    %rax,%rsi
call   10a0 <nis_modify@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
call   10f0 <NIS_RES_STATUS@plt>
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
call   1110 <nis_freeresult@plt>
mov    -0x48(%rbp),%rdi
call   1110 <nis_freeresult@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
jmp    159d <nis_removemember+0x3ad>
mov    0x2a2a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nis_removemember>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x40(%rbp)
test   %rsi,%rsi
je     136a <nis_removemember+0x16a>
mov    %rsi,%rbx
cmpb   $0x0,(%rsi)
je     136a <nis_removemember+0x16a>
mov    %rbx,%rdi
call   1090 <strlen@plt>
mov    %rax,%r15
mov    %rsp,-0x30(%rbp)
mov    0x2da0(%rip),%rax
mov    (%rax),%rax
lea    (%r15,%rax,1),%rdx
add    %r15,%rax
add    $0x1d,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    %rsp,%r14
lea    0x11(%r15),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
add    $0xd,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <nis_leaf_of_r@plt>
mov    %eax,%edi
xor    %esi,%esi
call   10c0 <rawmemchr@plt>
mov    %rax,%r13
movabs $0x5f7370756f72672e,%rax
70 73 5f
mov    %rax,0x0(%r13)
movl   $0x726964,0x8(%r13)
add    $0x1,%r15d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1070 <nis_domain_of_r@plt>
test   %rax,%rax
je     12ce <nis_removemember+0xce>
cmpb   $0x0,(%rax)
je     12ce <nis_removemember+0xce>
mov    %r13,%rdi
add    $0xc,%rdi
movw   $0x2e,0xb(%r13)
mov    %rax,%rsi
call   1060 <strcpy@plt>
mov    0x2cfb(%rip),%rax
mov    0x2cfc(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %r12,%rdi
call   1110 <nis_lookup@plt>
test   %rax,%rax
je     13ae <nis_removemember+0x1ae>
mov    %rax,%r14
mov    %rax,%rdi
call   1100 <NIS_RES_STATUS@plt>
mov    0x2ce5(%rip),%rcx
cmp    (%rcx),%rax
jne    13b7 <nis_removemember+0x1b7>
mov    %r14,%rdi
call   10e0 <NIS_RES_NUMOBJ@plt>
cmp    $0x1,%eax
jne    13cc <nis_removemember+0x1cc>
mov    %r14,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    %rax,%rdi
call   1030 <__type_of@plt>
mov    0x2c84(%rip),%rcx
cmp    (%rcx),%rax
jne    13cc <nis_removemember+0x1cc>
mov    %r14,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    0x18(%rax),%rbx
mov    %r14,-0x38(%rbp)
mov    %r14,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    0x10(%rax),%r13
test   %r13,%r13
je     13f4 <nis_removemember+0x1f4>
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    138e <nis_removemember+0x18e>
mov    0x2c4f(%rip),%rax
mov    (%rax),%rbx
jmp    13e2 <nis_removemember+0x1e2>
cs nopw 0x0(%rax,%rax,1)
call   1040 <free@plt>
add    $0x1,%r15
cmp    %r15,%r13
je     13f7 <nis_removemember+0x1f7>
mov    (%rbx,%r15,4),%edi
mov    -0x40(%rbp),%rsi
call   10d0 <strcmp@plt>
mov    (%rbx,%r15,4),%edi
test   %rax,%rax
je     1380 <nis_removemember+0x180>
mov    %edi,(%rbx,%r14,4)
add    $0x1,%r14
jmp    1385 <nis_removemember+0x185>
mov    0x2bf3(%rip),%rax
jmp    13db <nis_removemember+0x1db>
mov    %r14,%rdi
call   1100 <NIS_RES_STATUS@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1120 <nis_freeresult@plt>
jmp    13de <nis_removemember+0x1de>
mov    %r14,%rdi
call   1120 <nis_freeresult@plt>
mov    0x2bd5(%rip),%rax
mov    (%rax),%rbx
mov    -0x30(%rbp),%rsp
mov    %rbx,%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r14d,%r14d
mov    -0x38(%rbp),%r15
mov    %r15,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    %r14,0x10(%rax)
mov    %r15,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    (%rax),%rsi
mov    %r12,%rdi
call   1080 <stpcpy@plt>
movb   $0x2e,(%rax)
lea    0x1(%rax),%rbx
mov    %r15,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    0x8(%rax),%esi
mov    0x2bad(%rip),%rax
mov    (%rax),%rdx
mov    %rbx,%rdi
call   1050 <strncpy@plt>
mov    %r15,%rdi
call   10f0 <NIS_RES_OBJECT@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   10b0 <nis_modify@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1100 <NIS_RES_STATUS@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1120 <nis_freeresult@plt>
jmp    13c2 <nis_removemember+0x1c2>

LLVM IR (-O0):
%struct.TYPE_8__ = type { i8*, i32, %struct.TYPE_7__ }
%struct.TYPE_7__ = type { %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i64, i32* }
@NIS_MAXNAMELEN = global i64 0
@.str = [12 x i8] c".groups_dir\00"
@.str.1 = [2 x i8] c".\00"
@FOLLOW_LINKS = global i32 0
@EXPAND_NAME = global i32 0
@NIS_NOMEMORY = global i64 0
@NIS_SUCCESS = global i64 0
@NIS_GROUP_OBJ = global i64 0
@NIS_INVALIDOBJ = global i64 0
@NIS_FAIL = global i64 0
define i64 @nis_removemember(i8* %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%20 = load i8*, i8** %5
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %176
22: ; preds = %2
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %176
28: ; preds = %22
%29 = load i8*, i8** %5
%30 = call i64 @strlen(i8* %29)
store i64 %30, i64* %6
%31 = load i64, i64* %6
%32 = add i64 %31, 14
%33 = load i64, i64* @NIS_MAXNAMELEN
%34 = add i64 %32, %33
%35 = call i8* @llvm.stacksave()
store i8* %35, i8** %7
%36 = alloca i8, i64 %34
store i64 %34, i64* %8
%37 = load i64, i64* %6
%38 = add i64 %37, 2
%39 = alloca i8, i64 %38
store i64 %38, i64* %9
%40 = load i8*, i8** %5
%41 = sub i64 %34, 1
%42 = trunc i64 %41 to i32
%43 = call i32 @nis_leaf_of_r(i8* %40, i8* %36, i32 %42)
%44 = call i8* @rawmemchr(i32 %43, i8 signext 0)
store i8* %44, i8** %13
%45 = load i8*, i8** %13
%46 = call i8* @stpcpy(i8* %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %46, i8** %13
%47 = load i8*, i8** %5
%48 = sub i64 %38, 1
%49 = trunc i64 %48 to i32
%50 = call i8* @nis_domain_of_r(i8* %47, i8* %39, i32 %49)
store i8* %50, i8** %14
%51 = load i8*, i8** %14
%52 = icmp ne i8* %51, null
br i1 %52, label %53, label %65
53: ; preds = %28
%54 = load i8*, i8** %14
%55 = getelementptr inbounds i8, i8* %54, i64 0
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %65
59: ; preds = %53
%60 = load i8*, i8** %13
%61 = call i8* @stpcpy(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %61, i8** %13
%62 = load i8*, i8** %13
%63 = load i8*, i8** %14
%64 = call i8* @stpcpy(i8* %62, i8* %63)
br label %65
65: ; preds = %59, %53, %28
%66 = load i32, i32* @FOLLOW_LINKS
%67 = load i32, i32* @EXPAND_NAME
%68 = or i32 %66, %67
%69 = call i32* @nis_lookup(i8* %36, i32 %68)
store i32* %69, i32** %10
%70 = load i32*, i32** %10
%71 = icmp eq i32* %70, null
br i1 %71, label %72, label %74
72: ; preds = %65
%73 = load i64, i64* @NIS_NOMEMORY
store i64 %73, i64* %3
store i32 1, i32* %15
br label %174
74: ; preds = %65
%75 = load i32*, i32** %10
%76 = call i64 @NIS_RES_STATUS(i32* %75)
%77 = load i64, i64* @NIS_SUCCESS
%78 = icmp ne i64 %76, %77
br i1 %78, label %79, label %85
79: ; preds = %74
%80 = load i32*, i32** %10
%81 = call i64 @NIS_RES_STATUS(i32* %80)
store i64 %81, i64* %12
%82 = load i32*, i32** %10
%83 = call i32 @nis_freeresult(i32* %82)
%84 = load i64, i64* %12
store i64 %84, i64* %3
store i32 1, i32* %15
br label %174
85: ; preds = %74
%86 = load i32*, i32** %10
%87 = call i32 @NIS_RES_NUMOBJ(i32* %86)
%88 = icmp ne i32 %87, 1
br i1 %88, label %95, label %89
89: ; preds = %85
%90 = load i32*, i32** %10
%91 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %90)
%92 = call i64 @__type_of(%struct.TYPE_8__* %91)
%93 = load i64, i64* @NIS_GROUP_OBJ
%94 = icmp ne i64 %92, %93
br i1 %94, label %95, label %99
95: ; preds = %89, %85
%96 = load i32*, i32** %10
%97 = call i32 @nis_freeresult(i32* %96)
%98 = load i64, i64* @NIS_INVALIDOBJ
store i64 %98, i64* %3
store i32 1, i32* %15
br label %174
99: ; preds = %89
%100 = load i32*, i32** %10
%101 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %100)
%102 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %101, i32 0, i32 2
%103 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %102, i32 0, i32 0
%104 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %103, i32 0, i32 1
%105 = load i32*, i32** %104
store i32* %105, i32** %16
%106 = load i32*, i32** %10
%107 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %106)
%108 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %107, i32 0, i32 2
%109 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %108, i32 0, i32 0
%110 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %109, i32 0, i32 0
%111 = load i64, i64* %110
store i64 %111, i64* %17
store i64 0, i64* %18
store i64 0, i64* %19
br label %112
112: ; preds = %140, %99
%113 = load i64, i64* %19
%114 = load i64, i64* %17
%115 = icmp ult i64 %113, %114
br i1 %115, label %116, label %143
116: ; preds = %112
%117 = load i32*, i32** %16
%118 = load i64, i64* %19
%119 = getelementptr inbounds i32, i32* %117, i64 %118
%120 = load i32, i32* %119
%121 = load i8*, i8** %4
%122 = call i64 @strcmp(i32 %120, i8* %121)
%123 = icmp ne i64 %122, 0
br i1 %123, label %124, label %133
124: ; preds = %116
%125 = load i32*, i32** %16
%126 = load i64, i64* %19
%127 = getelementptr inbounds i32, i32* %125, i64 %126
%128 = load i32, i32* %127
%129 = load i32*, i32** %16
%130 = load i64, i64* %18
%131 = add i64 %130, 1
store i64 %131, i64* %18
%132 = getelementptr inbounds i32, i32* %129, i64 %130
store i32 %128, i32* %132
br label %139
133: ; preds = %116
%134 = load i32*, i32** %16
%135 = load i64, i64* %19
%136 = getelementptr inbounds i32, i32* %134, i64 %135
%137 = load i32, i32* %136
%138 = call i32 @free(i32 %137)
br label %139
139: ; preds = %133, %124
br label %140
140: ; preds = %139
%141 = load i64, i64* %19
%142 = add i64 %141, 1
store i64 %142, i64* %19
br label %112
143: ; preds = %112
%144 = load i64, i64* %18
%145 = load i32*, i32** %10
%146 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %145)
%147 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %146, i32 0, i32 2
%148 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %147, i32 0, i32 0
%149 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %148, i32 0, i32 0
store i64 %144, i64* %149
%150 = load i32*, i32** %10
%151 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %150)
%152 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %151, i32 0, i32 0
%153 = load i8*, i8** %152
%154 = call i8* @stpcpy(i8* %36, i8* %153)
store i8* %154, i8** %13
%155 = load i8*, i8** %13
%156 = getelementptr inbounds i8, i8* %155, i32 1
store i8* %156, i8** %13
store i8 46, i8* %155
%157 = load i8*, i8** %13
%158 = load i32*, i32** %10
%159 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %158)
%160 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %159, i32 0, i32 1
%161 = load i32, i32* %160
%162 = load i64, i64* @NIS_MAXNAMELEN
%163 = call i32 @strncpy(i8* %157, i32 %161, i64 %162)
%164 = load i32*, i32** %10
%165 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %164)
%166 = call i32* @nis_modify(i8* %36, %struct.TYPE_8__* %165)
store i32* %166, i32** %11
%167 = load i32*, i32** %11
%168 = call i64 @NIS_RES_STATUS(i32* %167)
store i64 %168, i64* %12
%169 = load i32*, i32** %10
%170 = call i32 @nis_freeresult(i32* %169)
%171 = load i32*, i32** %11
%172 = call i32 @nis_freeresult(i32* %171)
%173 = load i64, i64* %12
store i64 %173, i64* %3
store i32 1, i32* %15
br label %174
174: ; preds = %143, %95, %79, %72
%175 = load i8*, i8** %7
br label %178
176: ; preds = %22, %2
%177 = load i64, i64* @NIS_FAIL
store i64 %177, i64* %3
br label %178
178: ; preds = %176, %174
%179 = load i64, i64* %3
ret i64 %179
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { i8*, i32, %struct.TYPE_7__ }
%struct.TYPE_7__ = type { %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i64, i32* }
@NIS_MAXNAMELEN = global i64 0
@.str = [12 x i8] c".groups_dir\00"
@FOLLOW_LINKS = global i32 0
@EXPAND_NAME = global i32 0
@NIS_NOMEMORY = global i64 0
@NIS_SUCCESS = global i64 0
@NIS_GROUP_OBJ = global i64 0
@NIS_INVALIDOBJ = global i64 0
@NIS_FAIL = global i64 0
define i64 @nis_removemember(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %104, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %104, label %7
7: ; preds = %4
%8 = tail call i64 @strlen(i8* %1)
%9 = add i64 %8, 14
%10 = load i64, i64* @NIS_MAXNAMELEN
%11 = add i64 %9, %10
%12 = tail call i8* @llvm.stacksave()
%13 = alloca i8, i64 %11
%14 = add i64 %8, 2
%15 = alloca i8, i64 %14
%16 = trunc i64 %11 to i32
%17 = add i32 %16, -1
%18 = call i32 @nis_leaf_of_r(i8* %1, i8* %13, i32 %17)
%19 = call i8* @rawmemchr(i32 %18, i8 signext 0)
%20 = getelementptr i8, i8* %19, i64 11
%21 = trunc i64 %8 to i32
%22 = add i32 %21, 1
%23 = call i8* @nis_domain_of_r(i8* %1, i8* %15, i32 %22)
%24 = icmp eq i8* %23, null
br i1 %24, label %32, label %25
25: ; preds = %7
%26 = load i8, i8* %23
%27 = icmp eq i8 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %25
%29 = getelementptr i8, i8* %19, i64 12
%30 = bitcast i8* %20 to i16*
store i16 46, i16* %30
%31 = call i8* @strcpy(i8* dereferenceable(1) %29, i8* %23)
br label %32
32: ; preds = %28, %25, %7
%33 = load i32, i32* @FOLLOW_LINKS
%34 = load i32, i32* @EXPAND_NAME
%35 = or i32 %34, %33
%36 = call i32* @nis_lookup(i8* %13, i32 %35)
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %40
38: ; preds = %32
%39 = load i64, i64* @NIS_NOMEMORY
br label %102
40: ; preds = %32
%41 = call i64 @NIS_RES_STATUS(i32* %36)
%42 = load i64, i64* @NIS_SUCCESS
%43 = icmp eq i64 %41, %42
br i1 %43, label %47, label %44
44: ; preds = %40
%45 = call i64 @NIS_RES_STATUS(i32* %36)
%46 = call i32 @nis_freeresult(i32* %36)
br label %102
47: ; preds = %40
%48 = call i32 @NIS_RES_NUMOBJ(i32* %36)
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%52 = call i64 @__type_of(%struct.TYPE_8__* %51)
%53 = load i64, i64* @NIS_GROUP_OBJ
%54 = icmp eq i64 %52, %53
br i1 %54, label %58, label %55
55: ; preds = %50, %47
%56 = call i32 @nis_freeresult(i32* %36)
%57 = load i64, i64* @NIS_INVALIDOBJ
br label %102
58: ; preds = %50
%59 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%60 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %59, i64 0, i32 2, i32 0, i32 1
%61 = load i32*, i32** %60
%62 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%63 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %62, i64 0, i32 2, i32 0, i32 0
%64 = load i64, i64* %63
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %85
66: ; preds = %98, %58
%67 = phi i64 [ 0, %58 ], [ %99, %98 ]
%68 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%69 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %68, i64 0, i32 2, i32 0, i32 0
store i64 %67, i64* %69
%70 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%71 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %70, i64 0, i32 0
%72 = load i8*, i8** %71
%73 = call i8* @stpcpy(i8* %13, i8* %72)
%74 = getelementptr inbounds i8, i8* %73, i64 1
store i8 46, i8* %73
%75 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%76 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %75, i64 0, i32 1
%77 = load i32, i32* %76
%78 = load i64, i64* @NIS_MAXNAMELEN
%79 = call i32 @strncpy(i8* %74, i32 %77, i64 %78)
%80 = call %struct.TYPE_8__* @NIS_RES_OBJECT(i32* %36)
%81 = call i32* @nis_modify(i8* %13, %struct.TYPE_8__* %80)
%82 = call i64 @NIS_RES_STATUS(i32* %81)
%83 = call i32 @nis_freeresult(i32* %36)
%84 = call i32 @nis_freeresult(i32* %81)
br label %102
85: ; preds = %58, %98
%86 = phi i64 [ %100, %98 ], [ 0, %58 ]
%87 = phi i64 [ %99, %98 ], [ 0, %58 ]
%88 = getelementptr inbounds i32, i32* %61, i64 %86
%89 = load i32, i32* %88
%90 = call i64 @strcmp(i32 %89, i8* %0)
%91 = icmp eq i64 %90, 0
%92 = load i32, i32* %88
br i1 %91, label %96, label %93
93: ; preds = %85
%94 = add i64 %87, 1
%95 = getelementptr inbounds i32, i32* %61, i64 %87
store i32 %92, i32* %95
br label %98
96: ; preds = %85
%97 = call i32 @free(i32 %92)
br label %98
98: ; preds = %93, %96
%99 = phi i64 [ %94, %93 ], [ %87, %96 ]
%100 = add nuw i64 %86, 1
%101 = icmp eq i64 %100, %64
br i1 %101, label %66, label %85
102: ; preds = %66, %55, %44, %38
%103 = phi i64 [ %39, %38 ], [ %45, %44 ], [ %57, %55 ], [ %82, %66 ]
br label %106
104: ; preds = %4, %2
%105 = load i64, i64* @NIS_FAIL
br label %106
106: ; preds = %104, %102
%107 = phi i64 [ %103, %102 ], [ %105, %104 ]
ret i64 %107
}