#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct msghdr {
  int /*<<< orphan*/ msg_flags;
  TYPE_1__ *msg_iov;
};
struct TYPE_2__ {
  int /*<<< orphan*/ iov_base;
};

/* Variables and functions */
int /*<<< orphan*/ test_check_buf_notification(int /*<<< orphan*/, int,
                                               int /*<<< orphan*/, int,
                                               int /*<<< orphan*/,
                                               int /*<<< orphan*/);
void test_check_msg_notification(struct msghdr *msg, int datalen,
                                 int expected_datalen,
                                 uint16_t expected_sn_type,
                                 uint32_t expected_additional) {
  test_check_buf_notification(msg->msg_iov[0].iov_base, datalen, msg->msg_flags,
                              expected_datalen, expected_sn_type,
                              expected_additional);
}


x86 assembly (clang, -O0):
<test_check_msg_notification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <test_check_buf_notification@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_check_msg_notification>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    0x8(%rdi),%rax
mov    (%rax),%eax
mov    (%rdi),%edx
mov    %eax,%edi
jmp    1030 <test_check_buf_notification@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32, %struct.TYPE_2__* }
%struct.TYPE_2__ = type { i32 }
define void @test_check_msg_notification(%struct.msghdr* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.msghdr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.msghdr* %0, %struct.msghdr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.msghdr*, %struct.msghdr** %6
%12 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %11, i32 0, i32 1
%13 = load %struct.TYPE_2__*, %struct.TYPE_2__** %12
%14 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %13, i64 0
%15 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load i32, i32* %7
%18 = load %struct.msghdr*, %struct.msghdr** %6
%19 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = call i32 @test_check_buf_notification(i32 %16, i32 %17, i32 %20, i32 %21, i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
%struct.msghdr = type { i32, %struct.TYPE_2__* }
%struct.TYPE_2__ = type { i32 }
define void @test_check_msg_notification(%struct.msghdr* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %0, i64 0, i32 1
%7 = load %struct.TYPE_2__*, %struct.TYPE_2__** %6
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i64 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %0, i64 0, i32 0
%11 = load i32, i32* %10
%12 = tail call i32 @test_check_buf_notification(i32 %9, i32 %1, i32 %11, i32 %2, i32 %3, i32 %4)
ret void
}