#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_DELADDR;
scalar_t__ RTM_GETADDR;
scalar_t__ RTM_NEWADDR;
bool IsIfAddrMsg(const struct nlmsghdr *nh) {
  return nh->nlmsg_type == RTM_NEWADDR || nh->nlmsg_type == RTM_DELADDR ||
         nh->nlmsg_type == RTM_GETADDR;
}


x86 assembly (clang, -O0):
<IsIfAddrMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%al
mov    0x2ed0(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1157 <IsIfAddrMsg+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%al
mov    0x2ea4(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1157 <IsIfAddrMsg+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e82(%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):
<IsIfAddrMsg>:
mov    (%rdi),%rax
mov    0x2ede(%rip),%rcx
cmp    (%rcx),%rax
sete   %cl
mov    0x2ec1(%rip),%rdx
cmp    (%rdx),%rax
sete   %dl
or     %cl,%dl
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i64 }
@RTM_NEWADDR = global i64 0
@RTM_DELADDR = global i64 0
@RTM_GETADDR = global i64 0
define i32 @IsIfAddrMsg(%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_NEWADDR
%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_DELADDR
%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_GETADDR
%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_NEWADDR = global i64 0
@RTM_DELADDR = global i64 0
@RTM_GETADDR = global i64 0
define i32 @IsIfAddrMsg(%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_NEWADDR
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @RTM_DELADDR
%7 = icmp eq i64 %3, %6
%8 = select i1 %5, i1 true, i1 %7
%9 = load i64, i64* @RTM_GETADDR
%10 = icmp eq i64 %3, %9
%11 = select i1 %8, i1 true, i1 %10
%12 = zext i1 %11 to i32
ret i32 %12
}