long GPIOGetIntNumber(unsigned long ulPort) {
  long lInt;
  switch (ulPort) {
  case 0x40004000:
  case 0x40058000: {
    lInt = 16;
    break;
  }
  case 0x40005000:
  case 0x40059000: {
    lInt = 17;
    break;
  }
  case 0x40006000:
  case 0x4005A000: {
    lInt = 18;
    break;
  }
  case 0x40007000:
  case 0x4005B000: {
    lInt = 19;
    break;
  }
  case 0x40024000:
  case 0x4005C000: {
    lInt = 20;
    break;
  }
  case 0x40025000:
  case 0x4005D000: {
    lInt = 46;
    break;
  }
  case 0x40026000:
  case 0x4005E000: {
    lInt = 47;
    break;
  }
  case 0x40027000:
  case 0x4005F000: {
    lInt = 48;
    break;
  }
  case 0x4003D000:
  case 0x40060000: {
    lInt = 70;
    break;
  }
  default: {
    return (-1);
  }
  }
  return (lInt);
}


x86 assembly (clang, -O0):
<GPIOGetIntNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
sub    $0x40004000,%rax
je     1286 <GPIOGetIntNumber+0x186>
jmp    1121 <GPIOGetIntNumber+0x21>
mov    -0x20(%rbp),%rax
sub    $0x40005000,%rax
je     1293 <GPIOGetIntNumber+0x193>
jmp    1136 <GPIOGetIntNumber+0x36>
mov    -0x20(%rbp),%rax
sub    $0x40006000,%rax
je     12a0 <GPIOGetIntNumber+0x1a0>
jmp    114b <GPIOGetIntNumber+0x4b>
mov    -0x20(%rbp),%rax
sub    $0x40007000,%rax
je     12ad <GPIOGetIntNumber+0x1ad>
jmp    1160 <GPIOGetIntNumber+0x60>
mov    -0x20(%rbp),%rax
sub    $0x40024000,%rax
je     12ba <GPIOGetIntNumber+0x1ba>
jmp    1175 <GPIOGetIntNumber+0x75>
mov    -0x20(%rbp),%rax
sub    $0x40025000,%rax
je     12c7 <GPIOGetIntNumber+0x1c7>
jmp    118a <GPIOGetIntNumber+0x8a>
mov    -0x20(%rbp),%rax
sub    $0x40026000,%rax
je     12d4 <GPIOGetIntNumber+0x1d4>
jmp    119f <GPIOGetIntNumber+0x9f>
mov    -0x20(%rbp),%rax
sub    $0x40027000,%rax
je     12e1 <GPIOGetIntNumber+0x1e1>
jmp    11b4 <GPIOGetIntNumber+0xb4>
mov    -0x20(%rbp),%rax
sub    $0x4003d000,%rax
je     12ee <GPIOGetIntNumber+0x1ee>
jmp    11c9 <GPIOGetIntNumber+0xc9>
mov    -0x20(%rbp),%rax
sub    $0x40058000,%rax
je     1286 <GPIOGetIntNumber+0x186>
jmp    11de <GPIOGetIntNumber+0xde>
mov    -0x20(%rbp),%rax
sub    $0x40059000,%rax
je     1293 <GPIOGetIntNumber+0x193>
jmp    11f3 <GPIOGetIntNumber+0xf3>
mov    -0x20(%rbp),%rax
sub    $0x4005a000,%rax
je     12a0 <GPIOGetIntNumber+0x1a0>
jmp    1208 <GPIOGetIntNumber+0x108>
mov    -0x20(%rbp),%rax
sub    $0x4005b000,%rax
je     12ad <GPIOGetIntNumber+0x1ad>
jmp    121d <GPIOGetIntNumber+0x11d>
mov    -0x20(%rbp),%rax
sub    $0x4005c000,%rax
je     12ba <GPIOGetIntNumber+0x1ba>
jmp    1232 <GPIOGetIntNumber+0x132>
mov    -0x20(%rbp),%rax
sub    $0x4005d000,%rax
je     12c7 <GPIOGetIntNumber+0x1c7>
jmp    1247 <GPIOGetIntNumber+0x147>
mov    -0x20(%rbp),%rax
sub    $0x4005e000,%rax
je     12d4 <GPIOGetIntNumber+0x1d4>
jmp    125c <GPIOGetIntNumber+0x15c>
mov    -0x20(%rbp),%rax
sub    $0x4005f000,%rax
je     12e1 <GPIOGetIntNumber+0x1e1>
jmp    1271 <GPIOGetIntNumber+0x171>
mov    -0x20(%rbp),%rax
sub    $0x40060000,%rax
je     12ee <GPIOGetIntNumber+0x1ee>
jmp    12fb <GPIOGetIntNumber+0x1fb>
movq   $0x10,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x11,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x12,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x13,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x14,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x2e,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x2f,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x30,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0x46,-0x18(%rbp)
jmp    1308 <GPIOGetIntNumber+0x208>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1310 <GPIOGetIntNumber+0x210>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOGetIntNumber>:
mov    $0x10,%ecx
mov    $0xffffffffffffffff,%rax
cmp    $0x40057fff,%rdi
jg     1153 <GPIOGetIntNumber+0x53>
cmp    $0x40023fff,%rdi
jle    119a <GPIOGetIntNumber+0x9a>
cmp    $0x40025fff,%rdi
jle    11e4 <GPIOGetIntNumber+0xe4>
cmp    $0x40026000,%rdi
je     123e <GPIOGetIntNumber+0x13e>
cmp    $0x40027000,%rdi
je     1245 <GPIOGetIntNumber+0x145>
cmp    $0x4003d000,%rdi
je     1190 <GPIOGetIntNumber+0x90>
jmp    125b <GPIOGetIntNumber+0x15b>
cmp    $0x4005bfff,%rdi
jle    11be <GPIOGetIntNumber+0xbe>
cmp    $0x4005dfff,%rdi
jle    11f8 <GPIOGetIntNumber+0xf8>
cmp    $0x4005e000,%rdi
je     123e <GPIOGetIntNumber+0x13e>
cmp    $0x4005f000,%rdi
je     1245 <GPIOGetIntNumber+0x145>
cmp    $0x40060000,%rdi
jne    125b <GPIOGetIntNumber+0x15b>
mov    $0x46,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
cmp    $0x40005fff,%rdi
jg     1211 <GPIOGetIntNumber+0x111>
cmp    $0x40004000,%rdi
je     1258 <GPIOGetIntNumber+0x158>
cmp    $0x40005000,%rdi
je     11dd <GPIOGetIntNumber+0xdd>
jmp    125b <GPIOGetIntNumber+0x15b>
cmp    $0x40059fff,%rdi
jg     1225 <GPIOGetIntNumber+0x125>
cmp    $0x40058000,%rdi
je     1258 <GPIOGetIntNumber+0x158>
cmp    $0x40059000,%rdi
jne    125b <GPIOGetIntNumber+0x15b>
mov    $0x11,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
cmp    $0x40024000,%rdi
je     124c <GPIOGetIntNumber+0x14c>
cmp    $0x40025000,%rdi
je     120a <GPIOGetIntNumber+0x10a>
jmp    125b <GPIOGetIntNumber+0x15b>
cmp    $0x4005c000,%rdi
je     124c <GPIOGetIntNumber+0x14c>
cmp    $0x4005d000,%rdi
jne    125b <GPIOGetIntNumber+0x15b>
mov    $0x2e,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
cmp    $0x40006000,%rdi
je     1253 <GPIOGetIntNumber+0x153>
cmp    $0x40007000,%rdi
je     1237 <GPIOGetIntNumber+0x137>
jmp    125b <GPIOGetIntNumber+0x15b>
cmp    $0x4005a000,%rdi
je     1253 <GPIOGetIntNumber+0x153>
cmp    $0x4005b000,%rdi
jne    125b <GPIOGetIntNumber+0x15b>
mov    $0x13,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
mov    $0x2f,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
mov    $0x30,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
mov    $0x14,%ecx
jmp    1258 <GPIOGetIntNumber+0x158>
mov    $0x12,%ecx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @GPIOGetIntNumber(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
switch i64 %5, label %15 [
i64 1073758208, label %6
i64 1074102272, label %6
i64 1073762304, label %7
i64 1074106368, label %7
i64 1073766400, label %8
i64 1074110464, label %8
i64 1073770496, label %9
i64 1074114560, label %9
i64 1073889280, label %10
i64 1074118656, label %10
i64 1073893376, label %11
i64 1074122752, label %11
i64 1073897472, label %12
i64 1074126848, label %12
i64 1073901568, label %13
i64 1074130944, label %13
i64 1073991680, label %14
i64 1074135040, label %14
]
6: ; preds = %1, %1
store i64 16, i64* %4
br label %16
7: ; preds = %1, %1
store i64 17, i64* %4
br label %16
8: ; preds = %1, %1
store i64 18, i64* %4
br label %16
9: ; preds = %1, %1
store i64 19, i64* %4
br label %16
10: ; preds = %1, %1
store i64 20, i64* %4
br label %16
11: ; preds = %1, %1
store i64 46, i64* %4
br label %16
12: ; preds = %1, %1
store i64 47, i64* %4
br label %16
13: ; preds = %1, %1
store i64 48, i64* %4
br label %16
14: ; preds = %1, %1
store i64 70, i64* %4
br label %16
15: ; preds = %1
store i64 -1, i64* %2
br label %18
16: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%17 = load i64, i64* %4
store i64 %17, i64* %2
br label %18
18: ; preds = %16, %15
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @GPIOGetIntNumber(i64 %0) {
switch i64 %0, label %12 [
i64 1073758208, label %10
i64 1074102272, label %10
i64 1073762304, label %2
i64 1074106368, label %2
i64 1073766400, label %3
i64 1074110464, label %3
i64 1073770496, label %4
i64 1074114560, label %4
i64 1073889280, label %5
i64 1074118656, label %5
i64 1073893376, label %6
i64 1074122752, label %6
i64 1073897472, label %7
i64 1074126848, label %7
i64 1073901568, label %8
i64 1074130944, label %8
i64 1073991680, label %9
i64 1074135040, label %9
]
2: ; preds = %1, %1
br label %10
3: ; preds = %1, %1
br label %10
4: ; preds = %1, %1
br label %10
5: ; preds = %1, %1
br label %10
6: ; preds = %1, %1
br label %10
7: ; preds = %1, %1
br label %10
8: ; preds = %1, %1
br label %10
9: ; preds = %1, %1
br label %10
10: ; preds = %1, %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i64 [ 70, %9 ], [ 48, %8 ], [ 47, %7 ], [ 46, %6 ], [ 20, %5 ], [ 19, %4 ], [ 18, %3 ], [ 17, %2 ], [ 16, %1 ], [ 16, %1 ]
br label %12
12: ; preds = %1, %10
%13 = phi i64 [ %11, %10 ], [ -1, %1 ]
ret i64 %13
}