#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 */
typedef enum zotypes { ____Placeholder_zotypes } zotypes;

/* Variables and functions */
#define NIS_BOGUS_OBJ 135
#define NIS_DIRECTORY_OBJ 134
#define NIS_ENTRY_OBJ 133
#define NIS_GROUP_OBJ 132
#define NIS_LINK_OBJ 131
#define NIS_NO_OBJ 130
#define NIS_PRIVATE_OBJ 129
#define NIS_TABLE_OBJ 128
int /*<<< orphan*/ _(char *);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void nis_print_objtype(enum zotypes type) {
  switch (type) {
  case NIS_BOGUS_OBJ:
    fputs(_("BOGUS OBJECT\n"), stdout);
    break;
  case NIS_NO_OBJ:
    fputs(_("NO OBJECT\n"), stdout);
    break;
  case NIS_DIRECTORY_OBJ:
    fputs(_("DIRECTORY\n"), stdout);
    break;
  case NIS_GROUP_OBJ:
    fputs(_("GROUP\n"), stdout);
    break;
  case NIS_TABLE_OBJ:
    fputs(_("TABLE\n"), stdout);
    break;
  case NIS_ENTRY_OBJ:
    fputs(_("ENTRY\n"), stdout);
    break;
  case NIS_LINK_OBJ:
    fputs(_("LINK\n"), stdout);
    break;
  case NIS_PRIVATE_OBJ:
    fputs(_("PRIVATE\n"), stdout);
    break;
  default:
    fputs(_("(Unknown object)\n"), stdout);
    break;
  }
}


x86 assembly (clang, -O0):
<nis_print_objtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     125c <nis_print_objtype+0x13c>
mov    -0x10(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec5(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xeb2(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2e56(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe9c(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2e35(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe86(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2e14(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe6c(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2df3(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe52(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe38(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2db1(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe1d(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1278 <nis_print_objtype+0x158>
lea    0xe05(%rip),%rdi
call   1040 <_@plt>
mov    %eax,%edi
mov    0x2d6f(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nis_print_objtype>:
push   %rax
add    $0xffffff80,%edi
cmp    $0x7,%edi
ja     113c <nis_print_objtype+0x1c>
movslq %edi,%rax
lea    0xf29(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1143 <nis_print_objtype+0x23>
lea    0xf05(%rip),%rdi
call   1040 <_@plt>
mov    0x2e91(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"BOGUS OBJECT\0A\00"
@stdout = global i32 0
@.str.1 = [11 x i8] c"NO OBJECT\0A\00"
@.str.2 = [11 x i8] c"DIRECTORY\0A\00"
@.str.3 = [7 x i8] c"GROUP\0A\00"
@.str.4 = [7 x i8] c"TABLE\0A\00"
@.str.5 = [7 x i8] c"ENTRY\0A\00"
@.str.6 = [6 x i8] c"LINK\0A\00"
@.str.7 = [9 x i8] c"PRIVATE\0A\00"
@.str.8 = [18 x i8] c"(Unknown object)\0A\00"
define void @nis_print_objtype(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %36 [
i32 135, label %4
i32 130, label %8
i32 134, label %12
i32 132, label %16
i32 128, label %20
i32 133, label %24
i32 131, label %28
i32 129, label %32
]
4: ; preds = %1
%5 = call i32 @_(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i32 %5, i32 %6)
br label %40
8: ; preds = %1
%9 = call i32 @_(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @stdout
%11 = call i32 @fputs(i32 %9, i32 %10)
br label %40
12: ; preds = %1
%13 = call i32 @_(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = call i32 @fputs(i32 %13, i32 %14)
br label %40
16: ; preds = %1
%17 = call i32 @_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = call i32 @fputs(i32 %17, i32 %18)
br label %40
20: ; preds = %1
%21 = call i32 @_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%22 = load i32, i32* @stdout
%23 = call i32 @fputs(i32 %21, i32 %22)
br label %40
24: ; preds = %1
%25 = call i32 @_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%26 = load i32, i32* @stdout
%27 = call i32 @fputs(i32 %25, i32 %26)
br label %40
28: ; preds = %1
%29 = call i32 @_(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%30 = load i32, i32* @stdout
%31 = call i32 @fputs(i32 %29, i32 %30)
br label %40
32: ; preds = %1
%33 = call i32 @_(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%34 = load i32, i32* @stdout
%35 = call i32 @fputs(i32 %33, i32 %34)
br label %40
36: ; preds = %1
%37 = call i32 @_(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%38 = load i32, i32* @stdout
%39 = call i32 @fputs(i32 %37, i32 %38)
br label %40
40: ; preds = %36, %32, %28, %24, %20, %16, %12, %8, %4
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"BOGUS OBJECT\0A\00"
@stdout = global i32 0
@.str.1 = [11 x i8] c"NO OBJECT\0A\00"
@.str.2 = [11 x i8] c"DIRECTORY\0A\00"
@.str.3 = [7 x i8] c"GROUP\0A\00"
@.str.4 = [7 x i8] c"TABLE\0A\00"
@.str.5 = [7 x i8] c"ENTRY\0A\00"
@.str.6 = [6 x i8] c"LINK\0A\00"
@.str.7 = [9 x i8] c"PRIVATE\0A\00"
@.str.8 = [18 x i8] c"(Unknown object)\0A\00"
@reltable.nis_print_objtype = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.nis_print_objtype to i64)) to i32)]
define void @nis_print_objtype(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.nis_print_objtype to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), %1 ]
%10 = tail call i32 @_(i8* %9)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fputs(i32 %10, i32 %11)
ret void
}