unsigned long PWMGenIntGet(unsigned long ulBase, unsigned long ulGen) {
  switch (ulBase + ulGen) {
  case 0x40028000 + 0x00000040: {
    return (26);
  }
  case 0x40028000 + 0x00000080: {
    return (27);
  }
  case 0x40028000 + 0x000000C0: {
    return (28);
  }
  case 0x40028000 + 0x00000100: {
    return (61);
  }
  case 0x40029000 + 0x00000040: {
    return (150);
  }
  case 0x40029000 + 0x00000080: {
    return (151);
  }
  case 0x40029000 + 0x000000C0: {
    return (152);
  }
  case 0x40029000 + 0x00000100: {
    return (153);
  }
  default: {
    return (0);
  }
  }
}


x86 assembly (clang, -O0):
<PWMGenIntGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
sub    $0x40028040,%rax
je     11bf <PWMGenIntGet+0xbf>
jmp    112c <PWMGenIntGet+0x2c>
mov    -0x20(%rbp),%rax
sub    $0x40028080,%rax
je     11cc <PWMGenIntGet+0xcc>
jmp    1141 <PWMGenIntGet+0x41>
mov    -0x20(%rbp),%rax
sub    $0x400280c0,%rax
je     11d9 <PWMGenIntGet+0xd9>
jmp    1156 <PWMGenIntGet+0x56>
mov    -0x20(%rbp),%rax
sub    $0x40028100,%rax
je     11e6 <PWMGenIntGet+0xe6>
jmp    116b <PWMGenIntGet+0x6b>
mov    -0x20(%rbp),%rax
sub    $0x40029040,%rax
je     11f3 <PWMGenIntGet+0xf3>
jmp    1180 <PWMGenIntGet+0x80>
mov    -0x20(%rbp),%rax
sub    $0x40029080,%rax
je     1200 <PWMGenIntGet+0x100>
jmp    1195 <PWMGenIntGet+0x95>
mov    -0x20(%rbp),%rax
sub    $0x400290c0,%rax
je     120d <PWMGenIntGet+0x10d>
jmp    11aa <PWMGenIntGet+0xaa>
mov    -0x20(%rbp),%rax
sub    $0x40029100,%rax
je     121a <PWMGenIntGet+0x11a>
jmp    1227 <PWMGenIntGet+0x127>
movq   $0x1a,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x1b,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x1c,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x3d,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x96,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x97,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x98,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x99,-0x8(%rbp)
jmp    122f <PWMGenIntGet+0x12f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntGet>:
add    %rsi,%rdi
cmp    $0x4002903f,%rdi
jg     1132 <PWMGenIntGet+0x32>
cmp    $0x400280bf,%rdi
jg     1153 <PWMGenIntGet+0x53>
mov    $0x1a,%eax
cmp    $0x40028040,%rdi
je     1197 <PWMGenIntGet+0x97>
cmp    $0x40028080,%rdi
jne    1195 <PWMGenIntGet+0x95>
mov    $0x1b,%eax
ret
cmp    $0x400290bf,%rdi
jg     116b <PWMGenIntGet+0x6b>
cmp    $0x40029040,%rdi
je     1183 <PWMGenIntGet+0x83>
cmp    $0x40029080,%rdi
jne    1195 <PWMGenIntGet+0x95>
mov    $0x97,%eax
ret
cmp    $0x400280c0,%rdi
je     1189 <PWMGenIntGet+0x89>
cmp    $0x40028100,%rdi
jne    1195 <PWMGenIntGet+0x95>
mov    $0x3d,%eax
ret
cmp    $0x400290c0,%rdi
je     118f <PWMGenIntGet+0x8f>
cmp    $0x40029100,%rdi
jne    1195 <PWMGenIntGet+0x95>
mov    $0x99,%eax
ret
mov    $0x96,%eax
ret
mov    $0x1c,%eax
ret
mov    $0x98,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @PWMGenIntGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = add i64 %6, %7
switch i64 %8, label %17 [
i64 1073905728, label %9
i64 1073905792, label %10
i64 1073905856, label %11
i64 1073905920, label %12
i64 1073909824, label %13
i64 1073909888, label %14
i64 1073909952, label %15
i64 1073910016, label %16
]
9: ; preds = %2
store i64 26, i64* %3
br label %18
10: ; preds = %2
store i64 27, i64* %3
br label %18
11: ; preds = %2
store i64 28, i64* %3
br label %18
12: ; preds = %2
store i64 61, i64* %3
br label %18
13: ; preds = %2
store i64 150, i64* %3
br label %18
14: ; preds = %2
store i64 151, i64* %3
br label %18
15: ; preds = %2
store i64 152, i64* %3
br label %18
16: ; preds = %2
store i64 153, i64* %3
br label %18
17: ; preds = %2
store i64 0, i64* %3
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @PWMGenIntGet(i64 %0, i64 %1) {
%3 = add i64 %1, %0
switch i64 %3, label %11 [
i64 1073905728, label %12
i64 1073905792, label %4
i64 1073905856, label %5
i64 1073905920, label %6
i64 1073909824, label %7
i64 1073909888, label %8
i64 1073909952, label %9
i64 1073910016, label %10
]
4: ; preds = %2
br label %12
5: ; preds = %2
br label %12
6: ; preds = %2
br label %12
7: ; preds = %2
br label %12
8: ; preds = %2
br label %12
9: ; preds = %2
br label %12
10: ; preds = %2
br label %12
11: ; preds = %2
br label %12
12: ; preds = %2, %11, %10, %9, %8, %7, %6, %5, %4
%13 = phi i64 [ 0, %11 ], [ 153, %10 ], [ 152, %9 ], [ 151, %8 ], [ 150, %7 ], [ 61, %6 ], [ 28, %5 ], [ 27, %4 ], [ 26, %2 ]
ret i64 %13
}