#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 EIO;
int EMFILE;
int ENFILE;
int ENOENT;
int ENOMEM;
int ERANGE;
int getpwnam_error_translate(int err) {
  if ((err == EIO) || (err == EMFILE) || (err == ENFILE) || (err == ENOMEM) ||
      (err == ERANGE)) {
    return err;
  }
  return ENOENT;
}


x86 assembly (clang, -O0):
<getpwnam_error_translate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
je     1161 <getpwnam_error_translate+0x61>
mov    -0x8(%rbp),%eax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
je     1161 <getpwnam_error_translate+0x61>
mov    -0x8(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     1161 <getpwnam_error_translate+0x61>
mov    -0x8(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
je     1161 <getpwnam_error_translate+0x61>
mov    -0x8(%rbp),%eax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
jne    116c <getpwnam_error_translate+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <getpwnam_error_translate+0x78>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwnam_error_translate>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r8d
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%r9
mov    %edi,%eax
cmp    %edi,(%r9)
je     113c <getpwnam_error_translate+0x3c>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
cmp    %edi,%ecx
cmove  %edi,%eax
cmp    %edi,%esi
cmove  %edi,%eax
cmp    %edi,%edx
cmove  %edi,%eax
cmp    %edi,%r8d
cmove  %edi,%eax
ret

LLVM IR (-O0):
@EIO = global i32 0
@EMFILE = global i32 0
@ENFILE = global i32 0
@ENOMEM = global i32 0
@ERANGE = global i32 0
@ENOENT = global i32 0
define i32 @getpwnam_error_translate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @EIO
%6 = icmp eq i32 %4, %5
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* @EMFILE
%10 = icmp eq i32 %8, %9
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* @ENFILE
%14 = icmp eq i32 %12, %13
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* @ENOMEM
%18 = icmp eq i32 %16, %17
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i32, i32* %3
%21 = load i32, i32* @ERANGE
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19, %15, %11, %7, %1
%24 = load i32, i32* %3
store i32 %24, i32* %2
br label %27
25: ; preds = %19
%26 = load i32, i32* @ENOENT
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %23
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@EIO = global i32 0
@EMFILE = global i32 0
@ENFILE = global i32 0
@ENOMEM = global i32 0
@ERANGE = global i32 0
@ENOENT = global i32 0
define i32 @getpwnam_error_translate(i32 %0) {
%2 = load i32, i32* @EIO
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @EMFILE
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @ENFILE
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = load i32, i32* @ENOMEM
%11 = icmp eq i32 %10, %0
%12 = select i1 %9, i1 true, i1 %11
%13 = load i32, i32* @ERANGE
%14 = icmp eq i32 %13, %0
%15 = select i1 %12, i1 true, i1 %14
%16 = load i32, i32* @ENOENT
%17 = select i1 %15, i32 %0, i32 %16
ret i32 %17
}