#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 {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int ENOENT;
int NSS_STATUS_NOTFOUND;
int fill_group(struct group *const, char *const, size_t const, int *const);
scalar_t__ strcmp(char const *const, char *);
enum nss_status _nss_puavoadmins_getgrnam_r(const char *const name,
                                            struct group *const gr,
                                            char *const buf,
                                            const size_t bufsize,
                                            int *const errnop) {
  if (strcmp(name, "puavoadmins")) {
    *errnop = ENOENT;
    return NSS_STATUS_NOTFOUND;
  }
  return fill_group(gr, buf, bufsize, errnop);
}


x86 assembly (clang, -O0):
<_nss_puavoadmins_getgrnam_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1176 <_nss_puavoadmins_getgrnam_r+0x56>
mov    0x2e73(%rip),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    118e <_nss_puavoadmins_getgrnam_r+0x6e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1030 <fill_group@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_puavoadmins_getgrnam_r>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1165 <_nss_puavoadmins_getgrnam_r+0x45>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fill_group@plt>

LLVM IR (-O0):
%struct.group = type { i32 }
@.str = [12 x i8] c"puavoadmins\00"
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_puavoadmins_getgrnam_r(i8* %0, %struct.group* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.group*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
store i8* %0, i8** %7
store %struct.group* %1, %struct.group** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
%12 = load i8*, i8** %7
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %5
%16 = load i32, i32* @ENOENT
%17 = load i32*, i32** %11
store i32 %16, i32* %17
%18 = load i32, i32* @NSS_STATUS_NOTFOUND
store i32 %18, i32* %6
br label %25
19: ; preds = %5
%20 = load %struct.group*, %struct.group** %8
%21 = load i8*, i8** %9
%22 = load i64, i64* %10
%23 = load i32*, i32** %11
%24 = call i32 @fill_group(%struct.group* %20, i8* %21, i64 %22, i32* %23)
store i32 %24, i32* %6
br label %25
25: ; preds = %19, %15
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
%struct.group = type { i32 }
@.str = [12 x i8] c"puavoadmins\00"
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_puavoadmins_getgrnam_r(i8* %0, %struct.group* %1, i8* %2, i64 %3, i32* %4) {
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* @ENOENT
store i32 %9, i32* %4
%10 = load i32, i32* @NSS_STATUS_NOTFOUND
br label %13
11: ; preds = %5
%12 = tail call i32 @fill_group(%struct.group* %1, i8* %2, i64 %3, i32* %4)
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}