#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*/ UNM_CAM_RAM(int);
unsigned long CRB_SW_INT_MASK(unsigned long N) {
  switch (N) {
  case 0:
    return (UNM_CAM_RAM(0x200) + (0x1d8));
  case 1:
    return (UNM_CAM_RAM(0x200) + (0x1e0));
  case 2:
    return (UNM_CAM_RAM(0x200) + (0x1e4));
  case 3:
    return (UNM_CAM_RAM(0x200) + (0x1e8));
  case 4:
    return (UNM_CAM_RAM(0x200) + (0x450));
  case 5:
    return (UNM_CAM_RAM(0x200) + (0x454));
  case 6:
    return (UNM_CAM_RAM(0x200) + (0x458));
  case 7:
    return (UNM_CAM_RAM(0x200) + (0x45c));
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<CRB_SW_INT_MASK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x7,%rax
ja     1212 <CRB_SW_INT_MASK+0x102>
mov    -0x18(%rbp),%rax
lea    0xec7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x1d8,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x1e0,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x1e4,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x1e8,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x450,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x454,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x458,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
add    $0x45c,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    121a <CRB_SW_INT_MASK+0x10a>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRB_SW_INT_MASK>:
mov    $0xffffffffffffffff,%rax
cmp    $0x7,%rdi
ja     1139 <CRB_SW_INT_MASK+0x29>
push   %rbx
lea    0xedb(%rip),%rax
movslq (%rax,%rdi,4),%rbx
mov    $0x200,%edi
call   1030 <UNM_CAM_RAM@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @CRB_SW_INT_MASK(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %37 [
i64 0, label %5
i64 1, label %9
i64 2, label %13
i64 3, label %17
i64 4, label %21
i64 5, label %25
i64 6, label %29
i64 7, label %33
]
5: ; preds = %1
%6 = call i32 @UNM_CAM_RAM(i32 512)
%7 = add nsw i32 %6, 472
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
br label %38
9: ; preds = %1
%10 = call i32 @UNM_CAM_RAM(i32 512)
%11 = add nsw i32 %10, 480
%12 = sext i32 %11 to i64
store i64 %12, i64* %2
br label %38
13: ; preds = %1
%14 = call i32 @UNM_CAM_RAM(i32 512)
%15 = add nsw i32 %14, 484
%16 = sext i32 %15 to i64
store i64 %16, i64* %2
br label %38
17: ; preds = %1
%18 = call i32 @UNM_CAM_RAM(i32 512)
%19 = add nsw i32 %18, 488
%20 = sext i32 %19 to i64
store i64 %20, i64* %2
br label %38
21: ; preds = %1
%22 = call i32 @UNM_CAM_RAM(i32 512)
%23 = add nsw i32 %22, 1104
%24 = sext i32 %23 to i64
store i64 %24, i64* %2
br label %38
25: ; preds = %1
%26 = call i32 @UNM_CAM_RAM(i32 512)
%27 = add nsw i32 %26, 1108
%28 = sext i32 %27 to i64
store i64 %28, i64* %2
br label %38
29: ; preds = %1
%30 = call i32 @UNM_CAM_RAM(i32 512)
%31 = add nsw i32 %30, 1112
%32 = sext i32 %31 to i64
store i64 %32, i64* %2
br label %38
33: ; preds = %1
%34 = call i32 @UNM_CAM_RAM(i32 512)
%35 = add nsw i32 %34, 1116
%36 = sext i32 %35 to i64
store i64 %36, i64* %2
br label %38
37: ; preds = %1
store i64 -1, i64* %2
br label %38
38: ; preds = %37, %33, %29, %25, %21, %17, %13, %9, %5
%39 = load i64, i64* %2
ret i64 %39
}

LLVM IR (-O2):
@switch.table.CRB_SW_INT_MASK = [8 x i32] [i32 472, i32 480, i32 484, i32 488, i32 1104, i32 1108, i32 1112, i32 1116]
define i64 @CRB_SW_INT_MASK(i64 %0) {
%2 = icmp ult i64 %0, 8
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.CRB_SW_INT_MASK, i64 0, i64 %0
%5 = load i32, i32* %4
%6 = tail call i32 @UNM_CAM_RAM(i32 512)
%7 = add nsw i32 %6, %5
%8 = sext i32 %7 to i64
br label %9
9: ; preds = %1, %3
%10 = phi i64 [ -1, %1 ], [ %8, %3 ]
ret i64 %10
}