#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 */
unsigned int __local_inb(unsigned long);
unsigned int _bus_inb(unsigned long);
extern unsigned int __inb(unsigned long addr) {
  if (((addr == 0x60 || addr == 0x64) || (addr == 0x170 || addr == 0x171) ||
       (addr >= 0x2f8 && addr <= 0x2ff) || (addr >= 0x3bc && addr <= 0x3be) ||
       (addr >= 0x3f8 && addr <= 0x3ff)))
    return __local_inb(addr);
  return _bus_inb(addr);
}


x86 assembly (clang, -O0):
<__inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x60,-0x10(%rbp)
je     11b2 <__inb+0x92>
cmpq   $0x64,-0x10(%rbp)
je     11b2 <__inb+0x92>
cmpq   $0x170,-0x10(%rbp)
je     11b2 <__inb+0x92>
cmpq   $0x171,-0x10(%rbp)
je     11b2 <__inb+0x92>
cmpq   $0x2f8,-0x10(%rbp)
jb     117a <__inb+0x5a>
cmpq   $0x2ff,-0x10(%rbp)
jbe    11b2 <__inb+0x92>
cmpq   $0x3bc,-0x10(%rbp)
jb     1196 <__inb+0x76>
cmpq   $0x3be,-0x10(%rbp)
jbe    11b2 <__inb+0x92>
cmpq   $0x3f8,-0x10(%rbp)
jb     11c3 <__inb+0xa3>
cmpq   $0x3ff,-0x10(%rbp)
ja     11c3 <__inb+0xa3>
mov    -0x10(%rbp),%rdi
call   1040 <__local_inb@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <__inb+0xaf>
mov    -0x10(%rbp),%rdi
call   1030 <_bus_inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inb>:
lea    -0x170(%rdi),%rax
cmp    $0x2,%rax
jb     115b <__inb+0x3b>
cmp    $0x60,%rdi
je     115b <__inb+0x3b>
cmp    $0x64,%rdi
je     115b <__inb+0x3b>
lea    -0x3bc(%rdi),%rax
cmp    $0x3,%rax
jb     115b <__inb+0x3b>
mov    %rdi,%rax
or     $0x100,%rax
and    $0xfffffffffffffff8,%rax
cmp    $0x3f8,%rax
jne    1160 <__inb+0x40>
jmp    1040 <__local_inb@plt>
jmp    1030 <_bus_inb@plt>

LLVM IR (-O0):
define i32 @__inb(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 96
br i1 %5, label %33, label %6
6: ; preds = %1
%7 = load i64, i64* %3
%8 = icmp eq i64 %7, 100
br i1 %8, label %33, label %9
9: ; preds = %6
%10 = load i64, i64* %3
%11 = icmp eq i64 %10, 368
br i1 %11, label %33, label %12
12: ; preds = %9
%13 = load i64, i64* %3
%14 = icmp eq i64 %13, 369
br i1 %14, label %33, label %15
15: ; preds = %12
%16 = load i64, i64* %3
%17 = icmp uge i64 %16, 760
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i64, i64* %3
%20 = icmp ule i64 %19, 767
br i1 %20, label %33, label %21
21: ; preds = %18, %15
%22 = load i64, i64* %3
%23 = icmp uge i64 %22, 956
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i64, i64* %3
%26 = icmp ule i64 %25, 958
br i1 %26, label %33, label %27
27: ; preds = %24, %21
%28 = load i64, i64* %3
%29 = icmp uge i64 %28, 1016
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i64, i64* %3
%32 = icmp ule i64 %31, 1023
br i1 %32, label %33, label %36
33: ; preds = %30, %24, %18, %12, %9, %6, %1
%34 = load i64, i64* %3
%35 = call i32 @__local_inb(i64 %34)
store i32 %35, i32* %2
br label %39
36: ; preds = %30, %27
%37 = load i64, i64* %3
%38 = call i32 @_bus_inb(i64 %37)
store i32 %38, i32* %2
br label %39
39: ; preds = %36, %33
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
define i32 @__inb(i64 %0) {
switch i64 %0, label %2 [
i64 369, label %7
i64 368, label %7
i64 100, label %7
i64 96, label %7
]
2: ; preds = %1
%3 = add i64 %0, -956
%4 = icmp ult i64 %3, 3
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = and i64 %0, -8
switch i64 %6, label %9 [
i64 1016, label %7
i64 760, label %7
]
7: ; preds = %5, %5, %2, %1, %1, %1, %1
%8 = tail call i32 @__local_inb(i64 %0)
br label %11
9: ; preds = %5
%10 = tail call i32 @_bus_inb(i64 %0)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}