int GeoIP_is_private_ipnum_v4(unsigned long ipnum) {
  return ((ipnum >= 167772160U && ipnum <= 184549375U) ||
          (ipnum >= 2851995648U && ipnum <= 2852061183U) ||
          (ipnum >= 2886729728U && ipnum <= 2887778303U) ||
          (ipnum >= 3232235520U && ipnum <= 3232301055U) ||
          (ipnum >= 2130706432U && ipnum <= 2147483647U))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<GeoIP_is_private_ipnum_v4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xa000000,-0x8(%rbp)
0a
jb     1129 <GeoIP_is_private_ipnum_v4+0x29>
mov    $0x1,%al
cmpq   $0xaffffff,-0x8(%rbp)
0a
mov    %al,-0x9(%rbp)
jbe    11b9 <GeoIP_is_private_ipnum_v4+0xb9>
mov    $0xa9fe0000,%eax
cmp    %rax,-0x8(%rbp)
jb     114c <GeoIP_is_private_ipnum_v4+0x4c>
mov    $0x1,%al
mov    $0xa9feffff,%ecx
cmp    %rcx,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jbe    11b9 <GeoIP_is_private_ipnum_v4+0xb9>
mov    $0xac100000,%eax
cmp    %rax,-0x8(%rbp)
jb     116f <GeoIP_is_private_ipnum_v4+0x6f>
mov    $0x1,%al
mov    $0xac1fffff,%ecx
cmp    %rcx,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jbe    11b9 <GeoIP_is_private_ipnum_v4+0xb9>
mov    $0xc0a80000,%eax
cmp    %rax,-0x8(%rbp)
jb     1192 <GeoIP_is_private_ipnum_v4+0x92>
mov    $0x1,%al
mov    $0xc0a8ffff,%ecx
cmp    %rcx,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jbe    11b9 <GeoIP_is_private_ipnum_v4+0xb9>
xor    %eax,%eax
cmpq   $0x7f000000,-0x8(%rbp)
7f
mov    %al,-0xa(%rbp)
jb     11b3 <GeoIP_is_private_ipnum_v4+0xb3>
cmpq   $0x7fffffff,-0x8(%rbp)
7f
setbe  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeoIP_is_private_ipnum_v4>:
mov    %rdi,%r9
and    $0xffffffffff000000,%r9
cmp    $0xa000000,%r9
sete   %r8b
mov    %rdi,%rdx
and    $0xffffffffffff0000,%rdx
mov    $0xa9fe0000,%esi
cmp    %rsi,%rdx
sete   %cl
or     %r8b,%cl
and    $0xfffffffffff00000,%rdi
lea    0x2120000(%rsi),%rax
cmp    %rax,%rdi
sete   %al
or     %cl,%al
add    $0x16aa0000,%rsi
cmp    %rsi,%rdx
sete   %cl
cmp    $0x7f000000,%r9
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @GeoIP_is_private_ipnum_v4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 167772160
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ule i64 %6, 184549375
br i1 %7, label %34, label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
%10 = icmp uge i64 %9, 2851995648
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %2
%13 = icmp ule i64 %12, 2852061183
br i1 %13, label %34, label %14
14: ; preds = %11, %8
%15 = load i64, i64* %2
%16 = icmp uge i64 %15, 2886729728
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i64, i64* %2
%19 = icmp ule i64 %18, 2887778303
br i1 %19, label %34, label %20
20: ; preds = %17, %14
%21 = load i64, i64* %2
%22 = icmp uge i64 %21, 3232235520
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i64, i64* %2
%25 = icmp ule i64 %24, 3232301055
br i1 %25, label %34, label %26
26: ; preds = %23, %20
%27 = load i64, i64* %2
%28 = icmp uge i64 %27, 2130706432
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i64, i64* %2
%31 = icmp ule i64 %30, 2147483647
br label %32
32: ; preds = %29, %26
%33 = phi i1 [ false, %26 ], [ %31, %29 ]
br label %34
34: ; preds = %32, %23, %17, %11, %5
%35 = phi i1 [ true, %23 ], [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %33, %32 ]
%36 = zext i1 %35 to i64
%37 = select i1 %35, i32 1, i32 0
ret i32 %37
}

LLVM IR (-O2):
define i32 @GeoIP_is_private_ipnum_v4(i64 %0) {
%2 = and i64 %0, -16777216
%3 = icmp eq i64 %2, 167772160
%4 = and i64 %0, -65536
%5 = icmp eq i64 %4, 2851995648
%6 = or i1 %3, %5
%7 = and i64 %0, -1048576
%8 = icmp eq i64 %7, 2886729728
%9 = or i1 %8, %6
%10 = icmp eq i64 %4, 3232235520
%11 = or i1 %10, %9
%12 = icmp eq i64 %2, 2130706432
%13 = or i1 %12, %11
%14 = zext i1 %13 to i32
ret i32 %14
}