#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 scalar_t__ in_addr_t;

/* Variables and functions */
scalar_t__ INADDR_ANY;
scalar_t__ INADDR_BROADCAST;
scalar_t__ make_ip_addr(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int is_ordinary_ip(in_addr_t ip) {
  static in_addr_t lo_ip = 0;
  if (lo_ip == 0)
    lo_ip = make_ip_addr(127, 0, 0, 1);
  return ip != lo_ip && ip != INADDR_ANY && ip != INADDR_BROADCAST;
}


x86 assembly (clang, -O0):
<is_ordinary_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f0c(%rip)
jne    1144 <is_ordinary_ip+0x34>
mov    $0x7f,%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1030 <make_ip_addr@plt>
mov    %rax,0x2eec(%rip)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    0x2edf(%rip),%rcx
mov    %al,-0x9(%rbp)
je     1187 <is_ordinary_ip+0x77>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    0x2e81(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1187 <is_ordinary_ip+0x77>
mov    -0x8(%rbp),%rax
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ordinary_ip>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f15(%rip),%rax
test   %rax,%rax
jne    113a <is_ordinary_ip+0x2a>
mov    $0x7f,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <make_ip_addr@plt>
mov    %rax,0x2ef6(%rip)
cmp    %rbx,%rax
setne  %al
mov    0x2ea1(%rip),%rcx
cmp    %rbx,(%rcx)
setne  %cl
and    %al,%cl
mov    0x2e8a(%rip),%rax
cmp    %rbx,(%rax)
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
@is_ordinary_ip.lo_ip = internal global i64 0
@INADDR_ANY = global i64 0
@INADDR_BROADCAST = global i64 0
define i32 @is_ordinary_ip(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* @is_ordinary_ip.lo_ip
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i64 @make_ip_addr(i32 127, i32 0, i32 0, i32 1)
store i64 %6, i64* @is_ordinary_ip.lo_ip
br label %7
7: ; preds = %5, %1
%8 = load i64, i64* %2
%9 = load i64, i64* @is_ordinary_ip.lo_ip
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i64, i64* %2
%13 = load i64, i64* @INADDR_ANY
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i64, i64* %2
%17 = load i64, i64* @INADDR_BROADCAST
%18 = icmp ne i64 %16, %17
br label %19
19: ; preds = %15, %11, %7
%20 = phi i1 [ false, %11 ], [ false, %7 ], [ %18, %15 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@is_ordinary_ip.lo_ip = internal unnamed_addr global i64 0
@INADDR_ANY = global i64 0
@INADDR_BROADCAST = global i64 0
define i32 @is_ordinary_ip(i64 %0) {
%2 = load i64, i64* @is_ordinary_ip.lo_ip
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @make_ip_addr(i32 127, i32 0, i32 0, i32 1)
store i64 %5, i64* @is_ordinary_ip.lo_ip
br label %6
6: ; preds = %4, %1
%7 = phi i64 [ %5, %4 ], [ %2, %1 ]
%8 = icmp ne i64 %7, %0
%9 = load i64, i64* @INADDR_ANY
%10 = icmp ne i64 %9, %0
%11 = select i1 %8, i1 %10, i1 false
%12 = load i64, i64* @INADDR_BROADCAST
%13 = icmp ne i64 %12, %0
%14 = select i1 %11, i1 %13, i1 false
%15 = zext i1 %14 to i32
ret i32 %15
}