#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 /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ NFC_ATTR_DEVICE_INDEX;
int send_cmd_mt_nla(int, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/, int, int /*<<< orphan*/ *, void **,
                    int *);
int send_cmd_with_idx(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, __u8 genl_cmd,
                      int dev_id) {
  __u16 nla_type = NFC_ATTR_DEVICE_INDEX;
  void *nla_data = &dev_id;
  int nla_len = 4;
  return send_cmd_mt_nla(sd, nlmsg_type, nlmsg_pid, genl_cmd, 1, &nla_type,
                         &nla_data, &nla_len);
}


x86 assembly (clang, -O0):
<send_cmd_with_idx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%r8d
lea    -0x18(%rbp),%r9
lea    -0x20(%rbp),%r10
lea    -0x24(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <send_cmd_mt_nla@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_with_idx>:
sub    $0x18,%rsp
mov    %r8d,0xc(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
lea    0xc(%rsp),%rax
mov    %rax,0x10(%rsp)
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0x8(%rsp),%r9
mov    $0x1,%r8d
push   %rax
push   %r10
call   1030 <send_cmd_mt_nla@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@NFC_ATTR_DEVICE_INDEX = global i32 0
define i32 @send_cmd_with_idx(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load i32, i32* @NFC_ATTR_DEVICE_INDEX
store i32 %14, i32* %11
%15 = bitcast i32* %10 to i8*
store i8* %15, i8** %12
store i32 4, i32* %13
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = call i32 @send_cmd_mt_nla(i32 %16, i32 %17, i32 %18, i32 %19, i32 1, i32* %11, i8** %12, i32* %13)
ret i32 %20
}

LLVM IR (-O2):
@NFC_ATTR_DEVICE_INDEX = global i32 0
define i32 @send_cmd_with_idx(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 %4, i32* %6
%10 = bitcast i32* %7 to i8*
%11 = load i32, i32* @NFC_ATTR_DEVICE_INDEX
store i32 %11, i32* %7
%12 = bitcast i8** %8 to i8*
%13 = bitcast i8** %8 to i32**
store i32* %6, i32** %13
%14 = bitcast i32* %9 to i8*
store i32 4, i32* %9
%15 = call i32 @send_cmd_mt_nla(i32 %0, i32 %1, i32 %2, i32 %3, i32 1, i32* %7, i8** %8, i32* %9)
ret i32 %15
}