#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_DELLINK;
scalar_t__ RTM_GETLINK;
scalar_t__ RTM_NEWLINK;
bool IsIfInfoMsg(const struct nlmsghdr *nh) {
  return nh->nlmsg_type == RTM_NEWLINK || nh->nlmsg_type == RTM_DELLINK ||
         nh->nlmsg_type == RTM_GETLINK;
}


x86 assembly (clang, -O0):
<IsIfInfoMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%al
mov    0x2eb8(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1157 <IsIfInfoMsg+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%al
mov    0x2eac(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1157 <IsIfInfoMsg+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9a(%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):
<IsIfInfoMsg>:
mov    (%rdi),%rax
mov    0x2ec6(%rip),%rcx
cmp    (%rcx),%rax
sete   %cl
mov    0x2ec9(%rip),%rdx
cmp    (%rdx),%rax
sete   %dl
or     %cl,%dl
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i64 }
@RTM_NEWLINK = global i64 0
@RTM_DELLINK = global i64 0
@RTM_GETLINK = global i64 0
define i32 @IsIfInfoMsg(%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_NEWLINK
%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_DELLINK
%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_GETLINK
%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_NEWLINK = global i64 0
@RTM_DELLINK = global i64 0
@RTM_GETLINK = global i64 0
define i32 @IsIfInfoMsg(%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_NEWLINK
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @RTM_DELLINK
%7 = icmp eq i64 %3, %6
%8 = select i1 %5, i1 true, i1 %7
%9 = load i64, i64* @RTM_GETLINK
%10 = icmp eq i64 %3, %9
%11 = select i1 %8, i1 true, i1 %10
%12 = zext i1 %11 to i32
ret i32 %12
}