#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 */

/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
scalar_t__ errno;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ strerror(scalar_t__);
void log_lookup_group(const char *group) {
  if (errno)
    report(LOG_ERR, "Error while lookup group \"%s\": %s", group,
           strerror(errno));
  else
    report(LOG_ERR, "Unable to find group \"%s\"", group);
}


x86 assembly (clang, -O0):
<log_lookup_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
cmpq   $0x0,(%rax)
je     117c <log_lookup_group+0x5c>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%rdi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <report@plt>
jmp    1197 <log_lookup_group+0x77>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_lookup_group>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%ebp
test   %rdi,%rdi
je     115e <log_lookup_group+0x3e>
call   1040 <strerror@plt>
lea    0xeb6(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <report@plt>
lea    0xebd(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <report@plt>

LLVM IR (-O0):
@errno = global i64 0
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Error while lookup group \22%s\22: %s\00"
@.str.1 = [26 x i8] c"Unable to find group \22%s\22\00"
define void @log_lookup_group(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @LOG_ERR
%7 = load i8*, i8** %2
%8 = load i64, i64* @errno
%9 = call i32 @strerror(i64 %8)
%10 = call i32 (i32, i8*, i8*, ...) @report(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9)
br label %15
11: ; preds = %1
%12 = load i32, i32* @LOG_ERR
%13 = load i8*, i8** %2
%14 = call i32 (i32, i8*, i8*, ...) @report(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %11, %5
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Error while lookup group \22%s\22: %s\00"
@.str.1 = [26 x i8] c"Unable to find group \22%s\22\00"
define void @log_lookup_group(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @LOG_ERR
br i1 %3, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @strerror(i64 %2)
%7 = tail call i32 (i32, i8*, i8*, ...) @report(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
br label %10
8: ; preds = %1
%9 = tail call i32 (i32, i8*, i8*, ...) @report(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %5
ret void
}