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

/* Variables and functions */
void *AF_NETLINK;
int /*<<< orphan*/ NLMSG_DATA(struct nlmsghdr *);
void *NLMSG_SPACE(int);
int /*<<< orphan*/ SOCK_RAW;
scalar_t__ bind(unsigned int, struct sockaddr *, int);
int /*<<< orphan*/ close(unsigned int);
int errno;
void *getpid();
scalar_t__ malloc(void *);
int /*<<< orphan*/ memset(struct sockaddr_nl *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sendmsg(unsigned int, struct sockaddr_nl *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
unsigned int socket(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
void tttt() {
  unsigned int sock = socket(AF_NETLINK, SOCK_RAW, 25);
  if (sock == -1) {
    printf("create the socket frailed!\n");
    return;
  }
  struct sockaddr_nl src, dst;
  memset(&src, 0, sizeof(struct sockaddr_nl));
  src.nl_family = AF_NETLINK;
  src.nl_pid = getpid();
  src.nl_groups = 0;
  if (bind(sock, (struct sockaddr *)&src, sizeof(struct sockaddr_nl)) < 0) {
    printf("bind failed!\n");
    close(sock);
    return;
  }
  memset(&dst, 0, sizeof(struct sockaddr_nl));
  dst.nl_family = AF_NETLINK;
  dst.nl_pid = 0;
  dst.nl_groups = 0;
  struct nlmsghdr *nlh = (struct nlmsghdr *)malloc(NLMSG_SPACE(1024));
  if (nlh == NULL) {
    printf("malloc failed!\n");
    close(sock);
    return;
  }
  nlh->nlmsg_len = NLMSG_SPACE(1024);
  nlh->nlmsg_pid = getpid();
  nlh->nlmsg_flags = 0;
  strcpy(NLMSG_DATA(nlh), "hello! the kernel module!\n");
  struct iovec iov;
  memset(&iov, 0, sizeof(struct iovec));
  iov.iov_base = (void *)nlh;
  iov.iov_len = NLMSG_SPACE(1024);
  struct msghdr msgh;
  memset(&msgh, 0, sizeof(struct msghdr));
  msgh.msg_name = (void *)&dst;
  msgh.msg_namelen = sizeof(struct sockaddr_nl);
  msgh.msg_iov = &iov;
  msgh.msg_iovlen = 1;
  printf("send msg to kernel!\n");
  while (1) {
    printf("start....\n");
    if (sendmsg(sock, &msgh, 0) < 0) {
      printf("send failed, errno:%d !\n", errno);
    }
    sleep(5);
  }
  close(sock);
  return;
}


x86 assembly (clang, -O0):
<tttt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    0x2e0e(%rip),%rax
mov    (%rax),%rdi
mov    0x2e0c(%rip),%rax
mov    (%rax),%esi
mov    $0x19,%edx
call   10e0 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1208 <tttt+0x48>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1409 <tttt+0x249>
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
mov    0x2dc1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x48(%rbp),%rsi
mov    $0x40,%edx
call   10c0 <bind@plt>
cmp    $0x0,%rax
jge    126f <tttt+0xaf>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
call   1080 <close@plt>
jmp    1409 <tttt+0x249>
lea    -0x88(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
mov    0x2d57(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
mov    $0x400,%edi
call   1090 <NLMSG_SPACE@plt>
mov    %rax,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x90(%rbp)
jne    12e2 <tttt+0x122>
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
call   1080 <close@plt>
jmp    1409 <tttt+0x249>
mov    $0x400,%edi
call   1090 <NLMSG_SPACE@plt>
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x90(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x90(%rbp),%rdi
call   10a0 <NLMSG_DATA@plt>
mov    %eax,%edi
lea    0xd08(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
mov    -0x90(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    $0x400,%edi
call   1090 <NLMSG_SPACE@plt>
mov    %rax,-0xb8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
lea    -0x88(%rbp),%rax
mov    %rax,-0x100(%rbp)
movl   $0x40,-0x110(%rbp)
lea    -0xd0(%rbp),%rax
mov    %rax,-0x108(%rbp)
movl   $0x1,-0x10c(%rbp)
lea    0xca2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xca9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
xor    %edx,%edx
call   1040 <sendmsg@plt>
cmp    $0x0,%rax
jge    13fa <tttt+0x23a>
mov    0x2be6(%rip),%rax
mov    (%rax),%esi
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x5,%edi
call   10d0 <sleep@plt>
jmp    13ba <tttt+0x1fa>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tttt>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    0x2dfa(%rip),%rbp
mov    0x0(%rbp),%rdi
mov    0x2df7(%rip),%rax
mov    (%rax),%esi
mov    $0x19,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1394 <tttt+0x1c4>
mov    %eax,%r15d
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
mov    0x0(%rbp),%rax
mov    %rax,0x78(%rsp)
xor    %eax,%eax
call   1060 <getpid@plt>
mov    %rax,0x70(%rsp)
movq   $0x0,0x68(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   10d0 <bind@plt>
test   %rax,%rax
js     13af <tttt+0x1df>
lea    0xc0(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
mov    0x0(%rbp),%rax
mov    %rax,0xf8(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0xe8(%rsp)
mov    $0x400,%edi
call   10a0 <NLMSG_SPACE@plt>
mov    %rax,%rdi
call   10c0 <malloc@plt>
test   %rax,%rax
je     13b8 <tttt+0x1e8>
mov    %rax,%rbx
mov    $0x400,%edi
call   10a0 <NLMSG_SPACE@plt>
mov    %rax,0x10(%rbx)
xor    %eax,%eax
call   1060 <getpid@plt>
mov    %rax,0x8(%rbx)
movq   $0x0,(%rbx)
mov    %rbx,%rdi
call   10b0 <NLMSG_DATA@plt>
lea    0xd31(%rip),%rsi
mov    %eax,%edi
call   1030 <strcpy@plt>
lea    0x80(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
mov    %rbx,0xa0(%rsp)
mov    $0x400,%edi
call   10a0 <NLMSG_SPACE@plt>
mov    %rax,0x98(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
mov    %r14,0x10(%rsp)
movabs $0x100000040,%rax
mov    %rax,(%rsp)
mov    %rbp,0x8(%rsp)
lea    0xcfc(%rip),%rdi
call   1050 <puts@plt>
lea    0xd04(%rip),%rbp
mov    0x2c85(%rip),%r12
lea    0xcc9(%rip),%r14
jmp    136a <tttt+0x19a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    %rbp,%rdi
call   1050 <puts@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <sendmsg@plt>
test   %rax,%rax
jns    1360 <tttt+0x190>
mov    (%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1360 <tttt+0x190>
lea    0xcd3(%rip),%rdi
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <puts@plt>
lea    0xcab(%rip),%rdi
jmp    13bf <tttt+0x1ef>
lea    0xc93(%rip),%rdi
call   1050 <puts@plt>
mov    %r15d,%edi
call   1090 <close@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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