#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 nlattr {
  int dummy;
};
struct libbpf_nla_policy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ libbpf_nla_data(struct nlattr *);
int /*<<< orphan*/ libbpf_nla_len(struct nlattr *);
int libbpf_nla_parse(struct nlattr **, int, int /*<<< orphan*/,
                     int /*<<< orphan*/, struct libbpf_nla_policy *);
int libbpf_nla_parse_nested(struct nlattr *tb[], int maxtype,
                            struct nlattr *nla,
                            struct libbpf_nla_policy *policy) {
  return libbpf_nla_parse(tb, maxtype, libbpf_nla_data(nla),
                          libbpf_nla_len(nla), policy);
}


x86 assembly (clang, -O0):
<libbpf_nla_parse_nested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <libbpf_nla_data@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <libbpf_nla_len@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
call   1040 <libbpf_nla_parse@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libbpf_nla_parse_nested>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%r12
mov    %rdx,%rdi
call   1050 <libbpf_nla_data@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <libbpf_nla_len@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <libbpf_nla_parse@plt>

LLVM IR (-O0):
%struct.nlattr = type { i32 }
%struct.libbpf_nla_policy = type { i32 }
define i32 @libbpf_nla_parse_nested(%struct.nlattr** %0, i32 %1, %struct.nlattr* %2, %struct.libbpf_nla_policy* %3) {
%5 = alloca %struct.nlattr**
%6 = alloca i32
%7 = alloca %struct.nlattr*
%8 = alloca %struct.libbpf_nla_policy*
store %struct.nlattr** %0, %struct.nlattr*** %5
store i32 %1, i32* %6
store %struct.nlattr* %2, %struct.nlattr** %7
store %struct.libbpf_nla_policy* %3, %struct.libbpf_nla_policy** %8
%9 = load %struct.nlattr**, %struct.nlattr*** %5
%10 = load i32, i32* %6
%11 = load %struct.nlattr*, %struct.nlattr** %7
%12 = call i32 @libbpf_nla_data(%struct.nlattr* %11)
%13 = load %struct.nlattr*, %struct.nlattr** %7
%14 = call i32 @libbpf_nla_len(%struct.nlattr* %13)
%15 = load %struct.libbpf_nla_policy*, %struct.libbpf_nla_policy** %8
%16 = call i32 @libbpf_nla_parse(%struct.nlattr** %9, i32 %10, i32 %12, i32 %14, %struct.libbpf_nla_policy* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
%struct.libbpf_nla_policy = type { i32 }
define i32 @libbpf_nla_parse_nested(%struct.nlattr** %0, i32 %1, %struct.nlattr* %2, %struct.libbpf_nla_policy* %3) {
%5 = tail call i32 @libbpf_nla_data(%struct.nlattr* %2)
%6 = tail call i32 @libbpf_nla_len(%struct.nlattr* %2)
%7 = tail call i32 @libbpf_nla_parse(%struct.nlattr** %0, i32 %1, i32 %5, i32 %6, %struct.libbpf_nla_policy* %3)
ret i32 %7
}