#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int ipv4_is_private(uint32_t addr) {
  uint8_t *b8 = (uint8_t *)&addr;
  switch (b8[0]) {
  case 0:
  case 10:
  case 14:
  case 24:
  case 39:
  case 127:
    return 1;
    break;
  case 128:
    if (b8[1] == 0)
      return 1;
    break;
  case 169:
    if (b8[1] == 254)
      return 1;
    break;
  case 172:
    if ((b8[1] >= 16) && (b8[1] <= 31))
      return 1;
    break;
  case 191:
    if (b8[1] == 255)
      return 1;
    break;
  case 192:
    switch (b8[1]) {
    case 0:
      if ((b8[2] == 0) || (b8[2] == 2))
        return 1;
      break;
    case 88:
      if (b8[2] == 99)
        return 1;
      break;
    case 168:
      return 1;
    default:
      break;
    }
    break;
  case 198:
    if ((b8[1] == 18) || (b8[1] == 19))
      return 1;
    break;
  case 223:
    if ((b8[1] == 255) && (b8[2] == 255))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ipv4_is_private>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     11ff <ipv4_is_private+0xff>
jmp    1125 <ipv4_is_private+0x25>
mov    -0x14(%rbp),%eax
sub    $0xa,%eax
je     11ff <ipv4_is_private+0xff>
jmp    1136 <ipv4_is_private+0x36>
mov    -0x14(%rbp),%eax
sub    $0xe,%eax
je     11ff <ipv4_is_private+0xff>
jmp    1147 <ipv4_is_private+0x47>
mov    -0x14(%rbp),%eax
sub    $0x18,%eax
je     11ff <ipv4_is_private+0xff>
jmp    1158 <ipv4_is_private+0x58>
mov    -0x14(%rbp),%eax
sub    $0x27,%eax
je     11ff <ipv4_is_private+0xff>
jmp    1169 <ipv4_is_private+0x69>
mov    -0x14(%rbp),%eax
sub    $0x7f,%eax
je     11ff <ipv4_is_private+0xff>
jmp    117a <ipv4_is_private+0x7a>
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
je     120b <ipv4_is_private+0x10b>
jmp    118d <ipv4_is_private+0x8d>
mov    -0x14(%rbp),%eax
sub    $0xa9,%eax
je     122a <ipv4_is_private+0x12a>
jmp    11a0 <ipv4_is_private+0xa0>
mov    -0x14(%rbp),%eax
sub    $0xac,%eax
je     124c <ipv4_is_private+0x14c>
jmp    11b3 <ipv4_is_private+0xb3>
mov    -0x14(%rbp),%eax
sub    $0xbf,%eax
je     1279 <ipv4_is_private+0x179>
jmp    11c6 <ipv4_is_private+0xc6>
mov    -0x14(%rbp),%eax
sub    $0xc0,%eax
je     129b <ipv4_is_private+0x19b>
jmp    11d9 <ipv4_is_private+0xd9>
mov    -0x14(%rbp),%eax
sub    $0xc6,%eax
je     1338 <ipv4_is_private+0x238>
jmp    11ec <ipv4_is_private+0xec>
mov    -0x14(%rbp),%eax
sub    $0xdf,%eax
je     1365 <ipv4_is_private+0x265>
jmp    1398 <ipv4_is_private+0x298>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jne    1225 <ipv4_is_private+0x125>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1398 <ipv4_is_private+0x298>
mov    -0x10(%rbp),%rax
cmpl   $0xfe,0x4(%rax)
jne    1247 <ipv4_is_private+0x147>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1398 <ipv4_is_private+0x298>
mov    -0x10(%rbp),%rax
cmpl   $0x10,0x4(%rax)
jl     1274 <ipv4_is_private+0x174>
mov    -0x10(%rbp),%rax
cmpl   $0x1f,0x4(%rax)
jg     1274 <ipv4_is_private+0x174>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1398 <ipv4_is_private+0x298>
mov    -0x10(%rbp),%rax
cmpl   $0xff,0x4(%rax)
jne    1296 <ipv4_is_private+0x196>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1398 <ipv4_is_private+0x298>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     12d6 <ipv4_is_private+0x1d6>
jmp    12b2 <ipv4_is_private+0x1b2>
mov    -0x18(%rbp),%eax
sub    $0x58,%eax
je     1303 <ipv4_is_private+0x203>
jmp    12c3 <ipv4_is_private+0x1c3>
mov    -0x18(%rbp),%eax
sub    $0xa8,%eax
je     1322 <ipv4_is_private+0x222>
jmp    132e <ipv4_is_private+0x22e>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     12f2 <ipv4_is_private+0x1f2>
mov    -0x10(%rbp),%rax
cmpl   $0x2,0x8(%rax)
jne    12fe <ipv4_is_private+0x1fe>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1333 <ipv4_is_private+0x233>
mov    -0x10(%rbp),%rax
cmpl   $0x63,0x8(%rax)
jne    131d <ipv4_is_private+0x21d>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1333 <ipv4_is_private+0x233>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1333 <ipv4_is_private+0x233>
jmp    1398 <ipv4_is_private+0x298>
mov    -0x10(%rbp),%rax
cmpl   $0x12,0x4(%rax)
je     1354 <ipv4_is_private+0x254>
mov    -0x10(%rbp),%rax
cmpl   $0x13,0x4(%rax)
jne    1360 <ipv4_is_private+0x260>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1398 <ipv4_is_private+0x298>
mov    -0x10(%rbp),%rax
cmpl   $0xff,0x4(%rax)
jne    1393 <ipv4_is_private+0x293>
mov    -0x10(%rbp),%rax
cmpl   $0xff,0x8(%rax)
jne    1393 <ipv4_is_private+0x293>
movl   $0x1,-0x4(%rbp)
jmp    139f <ipv4_is_private+0x29f>
jmp    1398 <ipv4_is_private+0x298>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_is_private>:
mov    $0x1,%eax
cmp    $0x27,%edi
ja     111d <ipv4_is_private+0x1d>
mov    %edi,%ecx
movabs $0x8001004401,%rdx
bt     %rcx,%rdx
jae    111d <ipv4_is_private+0x1d>
ret
cmp    $0x7f,%edi
je     111c <ipv4_is_private+0x1c>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ipv4_is_private(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %3, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
switch i32 %7, label %92 [
i32 0, label %8
i32 10, label %8
i32 14, label %8
i32 24, label %8
i32 39, label %8
i32 127, label %8
i32 128, label %9
i32 169, label %16
i32 172, label %23
i32 191, label %35
i32 192, label %42
i32 198, label %68
i32 223, label %80
]
8: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %93
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %93
15: ; preds = %9
br label %92
16: ; preds = %1
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 254
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 1, i32* %2
br label %93
22: ; preds = %16
br label %92
23: ; preds = %1
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load i32, i32* %25
%27 = icmp sge i32 %26, 16
br i1 %27, label %28, label %34
28: ; preds = %23
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 1
%31 = load i32, i32* %30
%32 = icmp sle i32 %31, 31
br i1 %32, label %33, label %34
33: ; preds = %28
store i32 1, i32* %2
br label %93
34: ; preds = %28, %23
br label %92
35: ; preds = %1
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 1
%38 = load i32, i32* %37
%39 = icmp eq i32 %38, 255
br i1 %39, label %40, label %41
40: ; preds = %35
store i32 1, i32* %2
br label %93
41: ; preds = %35
br label %92
42: ; preds = %1
%43 = load i32*, i32** %4
%44 = getelementptr inbounds i32, i32* %43, i64 1
%45 = load i32, i32* %44
switch i32 %45, label %66 [
i32 0, label %46
i32 88, label %58
i32 168, label %65
]
46: ; preds = %42
%47 = load i32*, i32** %4
%48 = getelementptr inbounds i32, i32* %47, i64 2
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %56, label %51
51: ; preds = %46
%52 = load i32*, i32** %4
%53 = getelementptr inbounds i32, i32* %52, i64 2
%54 = load i32, i32* %53
%55 = icmp eq i32 %54, 2
br i1 %55, label %56, label %57
56: ; preds = %51, %46
store i32 1, i32* %2
br label %93
57: ; preds = %51
br label %67
58: ; preds = %42
%59 = load i32*, i32** %4
%60 = getelementptr inbounds i32, i32* %59, i64 2
%61 = load i32, i32* %60
%62 = icmp eq i32 %61, 99
br i1 %62, label %63, label %64
63: ; preds = %58
store i32 1, i32* %2
br label %93
64: ; preds = %58
br label %67
65: ; preds = %42
store i32 1, i32* %2
br label %93
66: ; preds = %42
br label %67
67: ; preds = %66, %64, %57
br label %92
68: ; preds = %1
%69 = load i32*, i32** %4
%70 = getelementptr inbounds i32, i32* %69, i64 1
%71 = load i32, i32* %70
%72 = icmp eq i32 %71, 18
br i1 %72, label %78, label %73
73: ; preds = %68
%74 = load i32*, i32** %4
%75 = getelementptr inbounds i32, i32* %74, i64 1
%76 = load i32, i32* %75
%77 = icmp eq i32 %76, 19
br i1 %77, label %78, label %79
78: ; preds = %73, %68
store i32 1, i32* %2
br label %93
79: ; preds = %73
br label %92
80: ; preds = %1
%81 = load i32*, i32** %4
%82 = getelementptr inbounds i32, i32* %81, i64 1
%83 = load i32, i32* %82
%84 = icmp eq i32 %83, 255
br i1 %84, label %85, label %91
85: ; preds = %80
%86 = load i32*, i32** %4
%87 = getelementptr inbounds i32, i32* %86, i64 2
%88 = load i32, i32* %87
%89 = icmp eq i32 %88, 255
br i1 %89, label %90, label %91
90: ; preds = %85
store i32 1, i32* %2
br label %93
91: ; preds = %85, %80
br label %92
92: ; preds = %91, %1, %79, %67, %41, %34, %22, %15
store i32 0, i32* %2
br label %93
93: ; preds = %92, %90, %78, %65, %63, %56, %40, %33, %21, %14, %8
%94 = load i32, i32* %2
ret i32 %94
}

LLVM IR (-O2):
define i32 @ipv4_is_private(i32 %0) {
switch i32 %0, label %2 [
i32 0, label %3
i32 10, label %3
i32 14, label %3
i32 24, label %3
i32 39, label %3
i32 127, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}