#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 */
scalar_t__ ENOSYS;
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int getegid();
int geteuid();
int getgid();
int getuid();
int main(void) {
  do {
    int id;
    errno = 0;
    id = getgid();
    assert(id == -1);
    assert(errno == ENOSYS);
  } while (0);
  do {
    int id;
    errno = 0;
    id = getegid();
    assert(id == -1);
    assert(errno == ENOSYS);
  } while (0);
  do {
    int id;
    errno = 0;
    id = getuid();
    assert(id == -1);
    assert(errno == ENOSYS);
  } while (0);
  do {
    int id;
    errno = 0;
    id = geteuid();
    assert(id == -1);
    assert(errno == ENOSYS);
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e72(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%rax
mov    0x2e4f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
jmp    11ae <main+0x5e>
mov    0x2e23(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%rax
mov    0x2e00(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
jmp    11fd <main+0xad>
mov    0x2dd4(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%rax
mov    0x2db1(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
jmp    124c <main+0xfc>
mov    0x2d85(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%rax
mov    0x2d62(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e7d(%rip),%rbx
movq   $0x0,(%rbx)
xor    %eax,%eax
call   1060 <getgid@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%rbx),%rax
mov    0x2e67(%rip),%r14
xor    %edi,%edi
cmp    (%r14),%rax
sete   %dil
call   1050 <assert@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
call   1070 <getegid@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%rbx),%rax
xor    %edi,%edi
cmp    (%r14),%rax
sete   %dil
call   1050 <assert@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
call   1030 <getuid@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%rbx),%rax
xor    %edi,%edi
cmp    (%r14),%rax
sete   %dil
call   1050 <assert@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
call   1040 <geteuid@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%rbx),%rax
xor    %edi,%edi
cmp    (%r14),%rax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
@ENOSYS = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %0
store i64 0, i64* @errno
%7 = call i32 (...) @getgid()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* @errno
%13 = load i64, i64* @ENOSYS
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
br label %17
17: ; preds = %6
br label %18
18: ; preds = %17
store i64 0, i64* @errno
%19 = call i32 (...) @getegid()
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, -1
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i64, i64* @errno
%25 = load i64, i64* @ENOSYS
%26 = icmp eq i64 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
br label %29
29: ; preds = %18
br label %30
30: ; preds = %29
store i64 0, i64* @errno
%31 = call i32 (...) @getuid()
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, -1
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = load i64, i64* @errno
%37 = load i64, i64* @ENOSYS
%38 = icmp eq i64 %36, %37
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
br label %41
41: ; preds = %30
br label %42
42: ; preds = %41
store i64 0, i64* @errno
%43 = call i32 (...) @geteuid()
store i32 %43, i32* %5
%44 = load i32, i32* %5
%45 = icmp eq i32 %44, -1
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load i64, i64* @errno
%49 = load i64, i64* @ENOSYS
%50 = icmp eq i64 %48, %49
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
br label %53
53: ; preds = %42
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@ENOSYS = global i64 0
define i32 @main() {
store i64 0, i64* @errno
%1 = tail call i32 (...) @getgid()
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOSYS
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
store i64 0, i64* @errno
%10 = tail call i32 (...) @getegid()
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = load i64, i64* @errno
%15 = load i64, i64* @ENOSYS
%16 = icmp eq i64 %14, %15
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
store i64 0, i64* @errno
%19 = tail call i32 (...) @getuid()
%20 = icmp eq i32 %19, -1
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = load i64, i64* @errno
%24 = load i64, i64* @ENOSYS
%25 = icmp eq i64 %23, %24
%26 = zext i1 %25 to i32
%27 = tail call i32 @assert(i32 %26)
store i64 0, i64* @errno
%28 = tail call i32 (...) @geteuid()
%29 = icmp eq i32 %28, -1
%30 = zext i1 %29 to i32
%31 = tail call i32 @assert(i32 %30)
%32 = load i64, i64* @errno
%33 = load i64, i64* @ENOSYS
%34 = icmp eq i64 %32, %33
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
ret i32 0
}