#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 */
struct nlmsghdr {
  scalar_t__ nlmsg_type;
};

/* Variables and functions */
scalar_t__ RTM_DELROUTE;
scalar_t__ RTM_GETROUTE;
scalar_t__ RTM_NEWROUTE;
bool IsRtMsg(const struct nlmsghdr *nh) {
  return nh->nlmsg_type == RTM_NEWROUTE || nh->nlmsg_type == RTM_DELROUTE ||
         nh->nlmsg_type == RTM_GETROUTE;
}


x86 assembly (clang, -O0):
<IsRtMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%al
mov    0x2eb0(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1157 <IsRtMsg+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%al
mov    0x2ec4(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1157 <IsRtMsg+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsRtMsg>:
mov    (%rdi),%rax
mov    0x2ebe(%rip),%rcx
cmp    (%rcx),%rax
sete   %cl
mov    0x2ee1(%rip),%rdx
cmp    (%rdx),%rax
sete   %dl
or     %cl,%dl
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i64 }
@RTM_NEWROUTE = global i64 0
@RTM_DELROUTE = global i64 0
@RTM_GETROUTE = global i64 0
define i32 @IsRtMsg(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%3 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%4 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @RTM_NEWROUTE
%7 = icmp eq i64 %5, %6
br i1 %7, label %20, label %8
8: ; preds = %1
%9 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%10 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = load i64, i64* @RTM_DELROUTE
%13 = icmp eq i64 %11, %12
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%16 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = load i64, i64* @RTM_GETROUTE
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %14, %8, %1
%21 = phi i1 [ true, %8 ], [ true, %1 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i64 }
@RTM_NEWROUTE = global i64 0
@RTM_DELROUTE = global i64 0
@RTM_GETROUTE = global i64 0
define i32 @IsRtMsg(%struct.nlmsghdr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @RTM_NEWROUTE
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @RTM_DELROUTE
%7 = icmp eq i64 %3, %6
%8 = select i1 %5, i1 true, i1 %7
%9 = load i64, i64* @RTM_GETROUTE
%10 = icmp eq i64 %3, %9
%11 = select i1 %8, i1 true, i1 %10
%12 = zext i1 %11 to i32
ret i32 %12
}