#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 sockaddr_nl {
  int nl_groups;
  int nlmsg_len;
  int msg_namelen;
  int msg_iovlen;
  struct iovec *msg_iov;
  void *msg_name;
  scalar_t__ nlmsg_flags;
  void *nlmsg_pid;
  void *nl_pid;
  void *nl_family;
};
struct sockaddr {
  int dummy;
};
struct nlmsghdr {
  int nl_groups;
  int nlmsg_len;
  int msg_namelen;
  int msg_iovlen;
  struct iovec *msg_iov;
  void *msg_name;
  scalar_t__ nlmsg_flags;
  void *nlmsg_pid;
  void *nl_pid;
  void *nl_family;
};
struct msghdr {
  int nl_groups;
  int nlmsg_len;
  int msg_namelen;
  int msg_iovlen;
  struct iovec *msg_iov;
  void *msg_name;
  scalar_t__ nlmsg_flags;
  void *nlmsg_pid;
  void *nl_pid;
  void *nl_family;
};
struct iovec {
  int iov_len;
  void *iov_base;
};
typedef int /*<<< orphan*/ src_addr;
typedef int /*<<< orphan*/ msg;
typedef int /*<<< orphan*/ dest_addr;

/* Variables and functions */
void *AF_NETLINK;
scalar_t__ NLMSG_DATA(struct sockaddr_nl *);
int NLMSG_SPACE(int);
int /*<<< orphan*/ SOCK_RAW;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
void *getpid();
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(struct sockaddr_nl *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ recvmsg(int, struct sockaddr_nl *, int /*<<< orphan*/);
int /*<<< orphan*/ sendmsg(int, struct sockaddr_nl *, int /*<<< orphan*/);
int socket(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(scalar_t__, char *);
int main(int argc, char **argv) {
  int sk;
  struct sockaddr_nl src_addr, dest_addr;
  struct nlmsghdr *nlh = NULL;
  struct iovec iov;
  struct msghdr msg;
  sk = socket(AF_NETLINK, SOCK_RAW, 21);
  if (sk < 0) {
    perror("socket failed");
    return -1;
  }
  memset(&msg, 0, sizeof(msg));
  memset(&src_addr, 0, sizeof(src_addr));
  memset(&dest_addr, 0, sizeof(dest_addr));
  src_addr.nl_family = AF_NETLINK;
  src_addr.nl_pid = getpid();
  src_addr.nl_groups = 1;
  if (bind(sk, (struct sockaddr *)&src_addr, sizeof(src_addr)) < 0) {
    perror("bind failed");
    close(sk);
    return -2;
  }
  dest_addr.nl_family = AF_NETLINK;
  dest_addr.nl_pid = 0;
  dest_addr.nl_groups = 0;
  nlh = (struct nlmsghdr *)malloc(NLMSG_SPACE(1024));
  nlh->nlmsg_len = NLMSG_SPACE(1024);
  nlh->nlmsg_pid = getpid();
  nlh->nlmsg_flags = 0;
  strcpy(NLMSG_DATA(nlh), "hello you.");
  iov.iov_base = (void *)nlh;
  iov.iov_len = nlh->nlmsg_len;
  msg.msg_name = (void *)&dest_addr;
  msg.msg_namelen = sizeof(dest_addr);
  msg.msg_iov = &iov;
  msg.msg_iovlen = 1;
  printf("sending msg ...\n");
  sendmsg(sk, &msg, 0);
  memset(nlh, 0, NLMSG_SPACE(1024));
  printf("waiting msg ...\n");
  recvmsg(sk, &msg, 0);
  printf("--> %s\n", (char *)NLMSG_DATA(nlh));
  close(sk);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0xa0(%rbp)
mov    0x2de5(%rip),%rax
mov    (%rax),%rdi
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
mov    $0x15,%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1236 <main+0x66>
lea    0xddb(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1434 <main+0x264>
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
lea    -0x98(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
mov    0x2d6d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x58(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x40,%edx
call   10d0 <bind@plt>
cmp    $0x0,%rax
jge    12c7 <main+0xf7>
lea    0xd60(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1434 <main+0x264>
mov    0x2d12(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
movl   $0x0,-0x98(%rbp)
mov    $0x400,%edi
call   1090 <NLMSG_SPACE@plt>
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    $0x400,%edi
call   1090 <NLMSG_SPACE@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0xa0(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0xa0(%rbp),%rdi
call   10a0 <NLMSG_DATA@plt>
mov    %rax,%rdi
lea    0xccb(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa0(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xb0(%rbp)
lea    -0x98(%rbp),%rax
mov    %rax,-0xd8(%rbp)
movl   $0x40,-0xe8(%rbp)
lea    -0xb0(%rbp),%rax
mov    %rax,-0xe0(%rbp)
movl   $0x1,-0xe4(%rbp)
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0xf0(%rbp),%rsi
xor    %edx,%edx
call   1040 <sendmsg@plt>
mov    -0xa0(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    $0x400,%edi
call   1090 <NLMSG_SPACE@plt>
mov    -0xf8(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xc46(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0xf0(%rbp),%rsi
xor    %edx,%edx
call   10c0 <recvmsg@plt>
mov    -0xa0(%rbp),%rdi
call   10a0 <NLMSG_DATA@plt>
mov    %rax,%rsi
lea    0xc29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd0,%rsp
mov    0x2dea(%rip),%r12
mov    (%r12),%rdi
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
mov    $0x15,%edx
call   1100 <socket@plt>
test   %eax,%eax
js     13a4 <main+0x1c4>
mov    %eax,%ebx
lea    0x10(%rsp),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
lea    0x50(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
mov    (%r12),%rax
mov    %rax,0xc8(%rsp)
xor    %eax,%eax
call   1060 <getpid@plt>
mov    %rax,0xc0(%rsp)
movl   $0x1,0x90(%rsp)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x40,%edx
call   10e0 <bind@plt>
test   %rax,%rax
js     13b8 <main+0x1d8>
mov    (%r12),%rax
mov    %rax,0x88(%rsp)
movq   $0x0,0x80(%rsp)
movl   $0x0,0x50(%rsp)
mov    $0x400,%edi
call   10a0 <NLMSG_SPACE@plt>
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,%rbp
mov    $0x400,%edi
call   10a0 <NLMSG_SPACE@plt>
mov    %eax,0x4(%rbp)
xor    %eax,%eax
call   1060 <getpid@plt>
mov    %rax,0x28(%rbp)
movq   $0x0,0x20(%rbp)
mov    %rbp,%rdi
call   10b0 <NLMSG_DATA@plt>
lea    0xd23(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbp,0x8(%rsp)
mov    0x4(%rbp),%eax
mov    %eax,(%rsp)
mov    %r15,0x28(%rsp)
movabs $0x100000040,%rax
mov    %rax,0x18(%rsp)
mov    %rsp,%rax
mov    %rax,0x20(%rsp)
lea    0xd00(%rip),%rdi
call   1050 <puts@plt>
lea    0x10(%rsp),%r15
mov    %ebx,%edi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <sendmsg@plt>
mov    $0x400,%edi
call   10a0 <NLMSG_SPACE@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
lea    0xcdd(%rip),%rdi
call   1050 <puts@plt>
mov    %ebx,%edi
mov    %r15,%rsi
xor    %edx,%edx
call   10d0 <recvmsg@plt>
mov    %rbp,%rdi
call   10b0 <NLMSG_DATA@plt>
lea    0xca5(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1090 <close@plt>
mov    %r14d,%eax
add    $0xd0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc55(%rip),%rdi
call   10f0 <perror@plt>
mov    $0xffffffff,%r14d
jmp    1391 <main+0x1b1>
lea    0xc4f(%rip),%rdi
call   10f0 <perror@plt>
mov    %ebx,%edi
call   1090 <close@plt>
mov    $0xfffffffe,%r14d
jmp    1391 <main+0x1b1>

LLVM IR (-O0):
%struct.sockaddr_nl = type { i32, i32, i32, i32, %struct.iovec*, i8*, i64, i8*, i8*, i8* }
%struct.iovec = type { i32, i8* }
%struct.nlmsghdr = type { i32, i32, i32, i32, %struct.iovec*, i8*, i64, i8*, i8*, i8* }
%struct.msghdr = type { i32, i32, i32, i32, %struct.iovec*, i8*, i64, i8*, i8*, i8* }
%struct.sockaddr = type { i32 }
@AF_NETLINK = global i8* null
@SOCK_RAW = global i32 0
@.str = [14 x i8] c"socket failed\00"
@.str.1 = [12 x i8] c"bind failed\00"
@.str.2 = [11 x i8] c"hello you.\00"
@.str.3 = [17 x i8] c"sending msg ...\0A\00"
@.str.4 = [17 x i8] c"waiting msg ...\0A\00"
@.str.5 = [8 x i8] c"--> %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_nl
%8 = alloca %struct.sockaddr_nl
%9 = alloca %struct.nlmsghdr*
%10 = alloca %struct.iovec
%11 = alloca %struct.msghdr
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.nlmsghdr* null, %struct.nlmsghdr** %9
%12 = load i8*, i8** @AF_NETLINK
%13 = load i32, i32* @SOCK_RAW
%14 = call i32 @socket(i8* %12, i32 %13, i32 21)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %88
19: ; preds = %2
%20 = bitcast %struct.msghdr* %11 to %struct.sockaddr_nl*
%21 = call i32 @memset(%struct.sockaddr_nl* %20, i32 0, i32 64)
%22 = call i32 @memset(%struct.sockaddr_nl* %7, i32 0, i32 64)
%23 = call i32 @memset(%struct.sockaddr_nl* %8, i32 0, i32 64)
%24 = load i8*, i8** @AF_NETLINK
%25 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %7, i32 0, i32 9
store i8* %24, i8** %25
%26 = call i8* (...) @getpid()
%27 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %7, i32 0, i32 8
store i8* %26, i8** %27
%28 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %7, i32 0, i32 0
store i32 1, i32* %28
%29 = load i32, i32* %6
%30 = bitcast %struct.sockaddr_nl* %7 to %struct.sockaddr*
%31 = call i64 @bind(i32 %29, %struct.sockaddr* %30, i32 64)
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %19
%34 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%35 = load i32, i32* %6
%36 = call i32 @close(i32 %35)
store i32 -2, i32* %3
br label %88
37: ; preds = %19
%38 = load i8*, i8** @AF_NETLINK
%39 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %8, i32 0, i32 9
store i8* %38, i8** %39
%40 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %8, i32 0, i32 8
store i8* null, i8** %40
%41 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %8, i32 0, i32 0
store i32 0, i32* %41
%42 = call i32 @NLMSG_SPACE(i32 1024)
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to %struct.nlmsghdr*
store %struct.nlmsghdr* %44, %struct.nlmsghdr** %9
%45 = call i32 @NLMSG_SPACE(i32 1024)
%46 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%47 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %46, i32 0, i32 1
store i32 %45, i32* %47
%48 = call i8* (...) @getpid()
%49 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%50 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %49, i32 0, i32 7
store i8* %48, i8** %50
%51 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%52 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %51, i32 0, i32 6
store i64 0, i64* %52
%53 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%54 = bitcast %struct.nlmsghdr* %53 to %struct.sockaddr_nl*
%55 = call i64 @NLMSG_DATA(%struct.sockaddr_nl* %54)
%56 = call i32 @strcpy(i64 %55, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%57 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%58 = bitcast %struct.nlmsghdr* %57 to i8*
%59 = getelementptr inbounds %struct.iovec, %struct.iovec* %10, i32 0, i32 1
store i8* %58, i8** %59
%60 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%61 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %60, i32 0, i32 1
%62 = load i32, i32* %61
%63 = getelementptr inbounds %struct.iovec, %struct.iovec* %10, i32 0, i32 0
store i32 %62, i32* %63
%64 = bitcast %struct.sockaddr_nl* %8 to i8*
%65 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %11, i32 0, i32 5
store i8* %64, i8** %65
%66 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %11, i32 0, i32 2
store i32 64, i32* %66
%67 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %11, i32 0, i32 4
store %struct.iovec* %10, %struct.iovec** %67
%68 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %11, i32 0, i32 3
store i32 1, i32* %68
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%70 = load i32, i32* %6
%71 = bitcast %struct.msghdr* %11 to %struct.sockaddr_nl*
%72 = call i32 @sendmsg(i32 %70, %struct.sockaddr_nl* %71, i32 0)
%73 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%74 = bitcast %struct.nlmsghdr* %73 to %struct.sockaddr_nl*
%75 = call i32 @NLMSG_SPACE(i32 1024)
%76 = call i32 @memset(%struct.sockaddr_nl* %74, i32 0, i32 %75)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%78 = load i32, i32* %6
%79 = bitcast %struct.msghdr* %11 to %struct.sockaddr_nl*
%80 = call i32 @recvmsg(i32 %78, %struct.sockaddr_nl* %79, i32 0)
%81 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%82 = bitcast %struct.nlmsghdr* %81 to %struct.sockaddr_nl*
%83 = call i64 @NLMSG_DATA(%struct.sockaddr_nl* %82)
%84 = inttoptr i64 %83 to i8*
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %84)
%86 = load i32, i32* %6
%87 = call i32 @close(i32 %86)
store i32 0, i32* %3
br label %88
88: ; preds = %37, %33, %17
%89 = load i32, i32* %3
ret i32 %89
}

LLVM IR (-O2):
%struct.sockaddr_nl = type { i32, i32, i32, i32, %struct.iovec*, i8*, i64, i8*, i8*, i8* }
%struct.iovec = type { i32, i8* }
%struct.msghdr = type { i32, i32, i32, i32, %struct.iovec*, i8*, i64, i8*, i8*, i8* }
%struct.nlmsghdr = type { i32, i32, i32, i32, %struct.iovec*, i8*, i64, i8*, i8*, i8* }
%struct.sockaddr = type { i32 }
@AF_NETLINK = global i8* null
@SOCK_RAW = global i32 0
@.str = [14 x i8] c"socket failed\00"
@.str.1 = [12 x i8] c"bind failed\00"
@.str.2 = [11 x i8] c"hello you.\00"
@.str.5 = [8 x i8] c"--> %s\0A\00"
@str = [16 x i8] c"sending msg ...\00"
@str.6 = [16 x i8] c"waiting msg ...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_nl
%4 = alloca %struct.sockaddr_nl
%5 = alloca %struct.iovec
%6 = alloca %struct.msghdr
%7 = bitcast %struct.sockaddr_nl* %3 to i8*
%8 = bitcast %struct.sockaddr_nl* %4 to i8*
%9 = bitcast %struct.iovec* %5 to i8*
%10 = bitcast %struct.msghdr* %6 to i8*
%11 = load i8*, i8** @AF_NETLINK
%12 = load i32, i32* @SOCK_RAW
%13 = tail call i32 @socket(i8* %11, i32 %12, i32 21)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %68
17: ; preds = %2
%18 = bitcast %struct.msghdr* %6 to %struct.sockaddr_nl*
%19 = call i32 @memset(%struct.sockaddr_nl* %18, i32 0, i32 64)
%20 = call i32 @memset(%struct.sockaddr_nl* %3, i32 0, i32 64)
%21 = call i32 @memset(%struct.sockaddr_nl* %4, i32 0, i32 64)
%22 = load i8*, i8** @AF_NETLINK
%23 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %3, i64 0, i32 9
store i8* %22, i8** %23
%24 = call i8* (...) @getpid()
%25 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %3, i64 0, i32 8
store i8* %24, i8** %25
%26 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %3, i64 0, i32 0
store i32 1, i32* %26
%27 = bitcast %struct.sockaddr_nl* %3 to %struct.sockaddr*
%28 = call i64 @bind(i32 %13, %struct.sockaddr* %27, i32 64)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %17
%31 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @close(i32 %13)
br label %68
33: ; preds = %17
%34 = load i8*, i8** @AF_NETLINK
%35 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %4, i64 0, i32 9
store i8* %34, i8** %35
%36 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %4, i64 0, i32 8
store i8* null, i8** %36
%37 = getelementptr inbounds %struct.sockaddr_nl, %struct.sockaddr_nl* %4, i64 0, i32 0
store i32 0, i32* %37
%38 = call i32 @NLMSG_SPACE(i32 1024)
%39 = call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to %struct.nlmsghdr*
%41 = call i32 @NLMSG_SPACE(i32 1024)
%42 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %40, i64 0, i32 1
store i32 %41, i32* %42
%43 = call i8* (...) @getpid()
%44 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %40, i64 0, i32 7
store i8* %43, i8** %44
%45 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %40, i64 0, i32 6
store i64 0, i64* %45
%46 = inttoptr i64 %39 to %struct.sockaddr_nl*
%47 = call i64 @NLMSG_DATA(%struct.sockaddr_nl* %46)
%48 = call i32 @strcpy(i64 %47, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%49 = inttoptr i64 %39 to i8*
%50 = getelementptr inbounds %struct.iovec, %struct.iovec* %5, i64 0, i32 1
store i8* %49, i8** %50
%51 = load i32, i32* %42
%52 = getelementptr inbounds %struct.iovec, %struct.iovec* %5, i64 0, i32 0
store i32 %51, i32* %52
%53 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %6, i64 0, i32 5
%54 = bitcast i8** %53 to %struct.sockaddr_nl**
store %struct.sockaddr_nl* %4, %struct.sockaddr_nl** %54
%55 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %6, i64 0, i32 2
store i32 64, i32* %55
%56 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %6, i64 0, i32 4
store %struct.iovec* %5, %struct.iovec** %56
%57 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %6, i64 0, i32 3
store i32 1, i32* %57
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%59 = call i32 @sendmsg(i32 %13, %struct.sockaddr_nl* %18, i32 0)
%60 = call i32 @NLMSG_SPACE(i32 1024)
%61 = call i32 @memset(%struct.sockaddr_nl* %46, i32 0, i32 %60)
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
%63 = call i32 @recvmsg(i32 %13, %struct.sockaddr_nl* %18, i32 0)
%64 = call i64 @NLMSG_DATA(%struct.sockaddr_nl* %46)
%65 = inttoptr i64 %64 to i8*
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %65)
%67 = call i32 @close(i32 %13)
br label %68
68: ; preds = %33, %30, %15
%69 = phi i32 [ -1, %15 ], [ -2, %30 ], [ 0, %33 ]
ret i32 %69
}