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;
  }
  case 0x40061000: {
    lInt = 71;
    break;
  }
  case 0x40062000: {
    lInt = 72;
    break;
  }
  case 0x40063000: {
    lInt = 127;
    break;
  }
  case 0x40064000: {
    lInt = 128;
    break;
  }
  case 0x40065000: {
    lInt = 132;
    break;
  }
  case 0x40066000: {
    lInt = 140;
    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     1304 <GPIOGetIntNumber+0x204>
jmp    1121 <GPIOGetIntNumber+0x21>
mov    -0x20(%rbp),%rax
sub    $0x40005000,%rax
je     1311 <GPIOGetIntNumber+0x211>
jmp    1136 <GPIOGetIntNumber+0x36>
mov    -0x20(%rbp),%rax
sub    $0x40006000,%rax
je     131e <GPIOGetIntNumber+0x21e>
jmp    114b <GPIOGetIntNumber+0x4b>
mov    -0x20(%rbp),%rax
sub    $0x40007000,%rax
je     132b <GPIOGetIntNumber+0x22b>
jmp    1160 <GPIOGetIntNumber+0x60>
mov    -0x20(%rbp),%rax
sub    $0x40024000,%rax
je     1338 <GPIOGetIntNumber+0x238>
jmp    1175 <GPIOGetIntNumber+0x75>
mov    -0x20(%rbp),%rax
sub    $0x40025000,%rax
je     1345 <GPIOGetIntNumber+0x245>
jmp    118a <GPIOGetIntNumber+0x8a>
mov    -0x20(%rbp),%rax
sub    $0x40026000,%rax
je     1352 <GPIOGetIntNumber+0x252>
jmp    119f <GPIOGetIntNumber+0x9f>
mov    -0x20(%rbp),%rax
sub    $0x40027000,%rax
je     135f <GPIOGetIntNumber+0x25f>
jmp    11b4 <GPIOGetIntNumber+0xb4>
mov    -0x20(%rbp),%rax
sub    $0x4003d000,%rax
je     136c <GPIOGetIntNumber+0x26c>
jmp    11c9 <GPIOGetIntNumber+0xc9>
mov    -0x20(%rbp),%rax
sub    $0x40058000,%rax
je     1304 <GPIOGetIntNumber+0x204>
jmp    11de <GPIOGetIntNumber+0xde>
mov    -0x20(%rbp),%rax
sub    $0x40059000,%rax
je     1311 <GPIOGetIntNumber+0x211>
jmp    11f3 <GPIOGetIntNumber+0xf3>
mov    -0x20(%rbp),%rax
sub    $0x4005a000,%rax
je     131e <GPIOGetIntNumber+0x21e>
jmp    1208 <GPIOGetIntNumber+0x108>
mov    -0x20(%rbp),%rax
sub    $0x4005b000,%rax
je     132b <GPIOGetIntNumber+0x22b>
jmp    121d <GPIOGetIntNumber+0x11d>
mov    -0x20(%rbp),%rax
sub    $0x4005c000,%rax
je     1338 <GPIOGetIntNumber+0x238>
jmp    1232 <GPIOGetIntNumber+0x132>
mov    -0x20(%rbp),%rax
sub    $0x4005d000,%rax
je     1345 <GPIOGetIntNumber+0x245>
jmp    1247 <GPIOGetIntNumber+0x147>
mov    -0x20(%rbp),%rax
sub    $0x4005e000,%rax
je     1352 <GPIOGetIntNumber+0x252>
jmp    125c <GPIOGetIntNumber+0x15c>
mov    -0x20(%rbp),%rax
sub    $0x4005f000,%rax
je     135f <GPIOGetIntNumber+0x25f>
jmp    1271 <GPIOGetIntNumber+0x171>
mov    -0x20(%rbp),%rax
sub    $0x40060000,%rax
je     136c <GPIOGetIntNumber+0x26c>
jmp    1286 <GPIOGetIntNumber+0x186>
mov    -0x20(%rbp),%rax
sub    $0x40061000,%rax
je     1379 <GPIOGetIntNumber+0x279>
jmp    129b <GPIOGetIntNumber+0x19b>
mov    -0x20(%rbp),%rax
sub    $0x40062000,%rax
je     1386 <GPIOGetIntNumber+0x286>
jmp    12b0 <GPIOGetIntNumber+0x1b0>
mov    -0x20(%rbp),%rax
sub    $0x40063000,%rax
je     1393 <GPIOGetIntNumber+0x293>
jmp    12c5 <GPIOGetIntNumber+0x1c5>
mov    -0x20(%rbp),%rax
sub    $0x40064000,%rax
je     13a0 <GPIOGetIntNumber+0x2a0>
jmp    12da <GPIOGetIntNumber+0x1da>
mov    -0x20(%rbp),%rax
sub    $0x40065000,%rax
je     13ad <GPIOGetIntNumber+0x2ad>
jmp    12ef <GPIOGetIntNumber+0x1ef>
mov    -0x20(%rbp),%rax
sub    $0x40066000,%rax
je     13ba <GPIOGetIntNumber+0x2ba>
jmp    13c7 <GPIOGetIntNumber+0x2c7>
movq   $0x10,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x11,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x12,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x13,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x14,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x2e,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x2f,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x30,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x46,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x47,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x48,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x7f,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x80,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x84,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0x8c,-0x18(%rbp)
jmp    13d4 <GPIOGetIntNumber+0x2d4>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    13dc <GPIOGetIntNumber+0x2dc>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOGetIntNumber>:
mov    $0xffffffffffffffff,%rax
cmp    $0x4005afff,%rdi
jg     1157 <GPIOGetIntNumber+0x57>
mov    $0x10,%ecx
cmp    $0x40025fff,%rdi
jg     1199 <GPIOGetIntNumber+0x99>
cmp    $0x40006fff,%rdi
jg     1210 <GPIOGetIntNumber+0x110>
cmp    $0x40004000,%rdi
je     12eb <GPIOGetIntNumber+0x1eb>
cmp    $0x40005000,%rdi
je     12ca <GPIOGetIntNumber+0x1ca>
cmp    $0x40006000,%rdi
je     1285 <GPIOGetIntNumber+0x185>
jmp    12ee <GPIOGetIntNumber+0x1ee>
cmp    $0x40060fff,%rdi
jg     11d2 <GPIOGetIntNumber+0xd2>
cmp    $0x4005dfff,%rdi
jg     1241 <GPIOGetIntNumber+0x141>
cmp    $0x4005b000,%rdi
je     12ae <GPIOGetIntNumber+0x1ae>
cmp    $0x4005c000,%rdi
je     12b5 <GPIOGetIntNumber+0x1b5>
cmp    $0x4005d000,%rdi
je     1237 <GPIOGetIntNumber+0x137>
jmp    12ee <GPIOGetIntNumber+0x1ee>
cmp    $0x40057fff,%rdi
jg     126a <GPIOGetIntNumber+0x16a>
cmp    $0x40026000,%rdi
je     12bc <GPIOGetIntNumber+0x1bc>
cmp    $0x40027000,%rdi
je     12c3 <GPIOGetIntNumber+0x1c3>
cmp    $0x4003d000,%rdi
je     1260 <GPIOGetIntNumber+0x160>
jmp    12ee <GPIOGetIntNumber+0x1ee>
cmp    $0x40063fff,%rdi
jg     128c <GPIOGetIntNumber+0x18c>
cmp    $0x40061000,%rdi
je     12d1 <GPIOGetIntNumber+0x1d1>
cmp    $0x40062000,%rdi
je     12d8 <GPIOGetIntNumber+0x1d8>
cmp    $0x40063000,%rdi
jne    12ee <GPIOGetIntNumber+0x1ee>
mov    $0x7f,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
cmp    $0x40007000,%rdi
je     12ae <GPIOGetIntNumber+0x1ae>
cmp    $0x40024000,%rdi
je     12b5 <GPIOGetIntNumber+0x1b5>
cmp    $0x40025000,%rdi
jne    12ee <GPIOGetIntNumber+0x1ee>
mov    $0x2e,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
cmp    $0x4005e000,%rdi
je     12bc <GPIOGetIntNumber+0x1bc>
cmp    $0x4005f000,%rdi
je     12c3 <GPIOGetIntNumber+0x1c3>
cmp    $0x40060000,%rdi
jne    12ee <GPIOGetIntNumber+0x1ee>
mov    $0x46,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
cmp    $0x40058000,%rdi
je     12eb <GPIOGetIntNumber+0x1eb>
cmp    $0x40059000,%rdi
je     12ca <GPIOGetIntNumber+0x1ca>
cmp    $0x4005a000,%rdi
jne    12ee <GPIOGetIntNumber+0x1ee>
mov    $0x12,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
cmp    $0x40064000,%rdi
je     12df <GPIOGetIntNumber+0x1df>
cmp    $0x40065000,%rdi
je     12e6 <GPIOGetIntNumber+0x1e6>
cmp    $0x40066000,%rdi
jne    12ee <GPIOGetIntNumber+0x1ee>
mov    $0x8c,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x13,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x14,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x2f,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x30,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x11,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x47,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x48,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x80,%ecx
jmp    12eb <GPIOGetIntNumber+0x1eb>
mov    $0x84,%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 %21 [
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
i64 1074139136, label %15
i64 1074143232, label %16
i64 1074147328, label %17
i64 1074151424, label %18
i64 1074155520, label %19
i64 1074159616, label %20
]
6: ; preds = %1, %1
store i64 16, i64* %4
br label %22
7: ; preds = %1, %1
store i64 17, i64* %4
br label %22
8: ; preds = %1, %1
store i64 18, i64* %4
br label %22
9: ; preds = %1, %1
store i64 19, i64* %4
br label %22
10: ; preds = %1, %1
store i64 20, i64* %4
br label %22
11: ; preds = %1, %1
store i64 46, i64* %4
br label %22
12: ; preds = %1, %1
store i64 47, i64* %4
br label %22
13: ; preds = %1, %1
store i64 48, i64* %4
br label %22
14: ; preds = %1, %1
store i64 70, i64* %4
br label %22
15: ; preds = %1
store i64 71, i64* %4
br label %22
16: ; preds = %1
store i64 72, i64* %4
br label %22
17: ; preds = %1
store i64 127, i64* %4
br label %22
18: ; preds = %1
store i64 128, i64* %4
br label %22
19: ; preds = %1
store i64 132, i64* %4
br label %22
20: ; preds = %1
store i64 140, i64* %4
br label %22
21: ; preds = %1
store i64 -1, i64* %2
br label %24
22: ; preds = %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%23 = load i64, i64* %4
store i64 %23, i64* %2
br label %24
24: ; preds = %22, %21
%25 = load i64, i64* %2
ret i64 %25
}

LLVM IR (-O2):
define i64 @GPIOGetIntNumber(i64 %0) {
switch i64 %0, label %18 [
i64 1073758208, label %16
i64 1074102272, label %16
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
i64 1074139136, label %10
i64 1074143232, label %11
i64 1074147328, label %12
i64 1074151424, label %13
i64 1074155520, label %14
i64 1074159616, label %15
]
2: ; preds = %1, %1
br label %16
3: ; preds = %1, %1
br label %16
4: ; preds = %1, %1
br label %16
5: ; preds = %1, %1
br label %16
6: ; preds = %1, %1
br label %16
7: ; preds = %1, %1
br label %16
8: ; preds = %1, %1
br label %16
9: ; preds = %1, %1
br label %16
10: ; preds = %1
br label %16
11: ; preds = %1
br label %16
12: ; preds = %1
br label %16
13: ; preds = %1
br label %16
14: ; preds = %1
br label %16
15: ; preds = %1
br label %16
16: ; preds = %1, %1, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%17 = phi i64 [ 140, %15 ], [ 132, %14 ], [ 128, %13 ], [ 127, %12 ], [ 72, %11 ], [ 71, %10 ], [ 70, %9 ], [ 48, %8 ], [ 47, %7 ], [ 46, %6 ], [ 20, %5 ], [ 19, %4 ], [ 18, %3 ], [ 17, %2 ], [ 16, %1 ], [ 16, %1 ]
br label %18
18: ; preds = %1, %16
%19 = phi i64 [ %17, %16 ], [ -1, %1 ]
ret i64 %19
}