#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 uint16_t;

/* Variables and functions */
#define RTM_DELADDR 132
#define RTM_DELLINK 131
#define RTM_NEWADDR 130
#define RTM_NEWLINK 129
#define RTM_SETLINK 128
int handle_rtnl_addr(int, void const *);
int handle_rtnl_link(int, void const *);
bool handle_rtnl_msg(uint16_t type, const void *data) {
  switch (type) {
  case RTM_NEWLINK:
  case RTM_DELLINK:
  case RTM_SETLINK:
    return handle_rtnl_link(type, data);
  case RTM_NEWADDR:
  case RTM_DELADDR:
    return handle_rtnl_addr(type, data);
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<handle_rtnl_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
add    $0xffffff80,%eax
sub    $0x2,%eax
jb     117f <handle_rtnl_msg+0x5f>
jmp    1146 <handle_rtnl_msg+0x26>
mov    -0x14(%rbp),%eax
sub    $0x82,%eax
je     1193 <handle_rtnl_msg+0x73>
jmp    1159 <handle_rtnl_msg+0x39>
mov    -0x14(%rbp),%eax
sub    $0x83,%eax
je     117f <handle_rtnl_msg+0x5f>
jmp    116c <handle_rtnl_msg+0x4c>
mov    -0x14(%rbp),%eax
sub    $0x84,%eax
je     1193 <handle_rtnl_msg+0x73>
jmp    11a7 <handle_rtnl_msg+0x87>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <handle_rtnl_link@plt>
mov    %eax,-0x4(%rbp)
jmp    11ae <handle_rtnl_msg+0x8e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <handle_rtnl_addr@plt>
mov    %eax,-0x4(%rbp)
jmp    11ae <handle_rtnl_msg+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_rtnl_msg>:
lea    -0x80(%rdi),%eax
cmp    $0x4,%eax
ja     113c <handle_rtnl_msg+0x1c>
mov    $0xb,%ecx
bt     %eax,%ecx
jae    1137 <handle_rtnl_msg+0x17>
jmp    1030 <handle_rtnl_link@plt>
jmp    1040 <handle_rtnl_addr@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @handle_rtnl_msg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
switch i32 %6, label %15 [
i32 129, label %7
i32 131, label %7
i32 128, label %7
i32 130, label %11
i32 132, label %11
]
7: ; preds = %2, %2, %2
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @handle_rtnl_link(i32 %8, i8* %9)
store i32 %10, i32* %3
br label %16
11: ; preds = %2, %2
%12 = load i32, i32* %4
%13 = load i8*, i8** %5
%14 = call i32 @handle_rtnl_addr(i32 %12, i8* %13)
store i32 %14, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %11, %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @handle_rtnl_msg(i32 %0, i8* %1) {
switch i32 %0, label %7 [
i32 129, label %3
i32 131, label %3
i32 128, label %3
i32 130, label %5
i32 132, label %5
]
3: ; preds = %2, %2, %2
%4 = tail call i32 @handle_rtnl_link(i32 %0, i8* %1)
br label %7
5: ; preds = %2, %2
%6 = tail call i32 @handle_rtnl_addr(i32 %0, i8* %1)
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %6, %5 ], [ %4, %3 ], [ 0, %2 ]
ret i32 %8
}