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

/* Variables and functions */
int /*<<< orphan*/ CTRL_ATTR_FAMILY_NAME;
int /*<<< orphan*/ CTRL_CMD_GETFAMILY;
int /*<<< orphan*/ GENL_ID_CTRL;
int /*<<< orphan*/ NFC_GENL_NAME;
int send_cmd_mt_nla(int, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/, int, int /*<<< orphan*/ *, void **,
                    int *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int strlen(int /*<<< orphan*/);
int send_get_nfc_family(int sd, __u32 pid) {
  __u16 nla_get_family_type = CTRL_ATTR_FAMILY_NAME;
  void *nla_get_family_data;
  int nla_get_family_len;
  char family_name[100];
  nla_get_family_len = strlen(NFC_GENL_NAME) + 1;
  strcpy(family_name, NFC_GENL_NAME);
  nla_get_family_data = family_name;
  return send_cmd_mt_nla(sd, GENL_ID_CTRL, pid, CTRL_CMD_GETFAMILY, 1,
                         &nla_get_family_type, &nla_get_family_data,
                         &nla_get_family_len);
}


x86 assembly (clang, -O0):
<send_get_nfc_family>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x80(%rbp),%rdi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e47(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%r8d
lea    -0xc(%rbp),%r9
lea    -0x18(%rbp),%r10
lea    -0x1c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <send_cmd_mt_nla@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_get_nfc_family>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2e8c(%rip),%rbx
mov    (%rbx),%edi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,(%rsp)
mov    (%rbx),%esi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,0x8(%rsp)
mov    0x2e54(%rip),%rax
mov    (%rax),%esi
mov    0x2e53(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rax
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%r9
mov    %ebp,%edi
mov    %r14d,%edx
mov    $0x1,%r8d
push   %rax
push   %rbx
call   1050 <send_cmd_mt_nla@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CTRL_ATTR_FAMILY_NAME = global i32 0
@NFC_GENL_NAME = global i32 0
@GENL_ID_CTRL = global i32 0
@CTRL_CMD_GETFAMILY = global i32 0
define i32 @send_get_nfc_family(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [100 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* @CTRL_ATTR_FAMILY_NAME
store i32 %9, i32* %5
%10 = load i32, i32* @NFC_GENL_NAME
%11 = call i32 @strlen(i32 %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %7
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%14 = load i32, i32* @NFC_GENL_NAME
%15 = call i32 @strcpy(i8* %13, i32 %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
store i8* %16, i8** %6
%17 = load i32, i32* %3
%18 = load i32, i32* @GENL_ID_CTRL
%19 = load i32, i32* %4
%20 = load i32, i32* @CTRL_CMD_GETFAMILY
%21 = call i32 @send_cmd_mt_nla(i32 %17, i32 %18, i32 %19, i32 %20, i32 1, i32* %5, i8** %6, i32* %7)
ret i32 %21
}

LLVM IR (-O2):
@CTRL_ATTR_FAMILY_NAME = global i32 0
@NFC_GENL_NAME = global i32 0
@GENL_ID_CTRL = global i32 0
@CTRL_CMD_GETFAMILY = global i32 0
define i32 @send_get_nfc_family(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = bitcast i32* %3 to i8*
%8 = load i32, i32* @CTRL_ATTR_FAMILY_NAME
store i32 %8, i32* %3
%9 = bitcast i8** %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @NFC_GENL_NAME
%13 = tail call i32 @strlen(i32 %12)
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
%15 = load i32, i32* @NFC_GENL_NAME
%16 = call i32 @strcpy(i8* %11, i32 %15)
store i8* %11, i8** %4
%17 = load i32, i32* @GENL_ID_CTRL
%18 = load i32, i32* @CTRL_CMD_GETFAMILY
%19 = call i32 @send_cmd_mt_nla(i32 %0, i32 %17, i32 %1, i32 %18, i32 1, i32* %3, i8** %4, i32* %5)
ret i32 %19
}