#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*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct nfulnl_msg_config_mode {
  int /*<<< orphan*/ copy_range;
  int /*<<< orphan*/ copy_mode;
};
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ NFULA_CFG_MODE;
int /*<<< orphan*/ __nflog_sendcmd(int, int /*<<< orphan*/,
                                   struct nfulnl_msg_config_mode *, int,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct nfulnl_msg_config_mode *, int /*<<< orphan*/,
                          int);
void nflog_sendcmd_mode(int fd, uint16_t family, uint16_t group_id,
                        uint8_t mode, uint32_t value) {
  struct nfulnl_msg_config_mode msg;
  memset(&msg, 0, sizeof(msg));
  msg.copy_mode = mode;
  msg.copy_range = htonl(value);
  __nflog_sendcmd(fd, NFULA_CFG_MODE, &msg, sizeof(msg), family, group_id);
}


x86 assembly (clang, -O0):
<nflog_sendcmd_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    -0x20(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <__nflog_sendcmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nflog_sendcmd_mode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r12d
mov    %rsp,%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %ebp,0x4(%rsp)
mov    %ebx,%edi
call   1040 <htonl@plt>
mov    %eax,(%rsp)
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    %r12d,%edi
mov    %r13,%rdx
mov    $0x8,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <__nflog_sendcmd@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.nfulnl_msg_config_mode = type { i32, i32 }
@NFULA_CFG_MODE = global i32 0
define void @nflog_sendcmd_mode(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 %struct.nfulnl_msg_config_mode
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
%12 = call i32 @memset(%struct.nfulnl_msg_config_mode* %11, i32 0, i32 8)
%13 = load i32, i32* %9
%14 = getelementptr inbounds %struct.nfulnl_msg_config_mode, %struct.nfulnl_msg_config_mode* %11, i32 0, i32 1
store i32 %13, i32* %14
%15 = load i32, i32* %10
%16 = call i32 @htonl(i32 %15)
%17 = getelementptr inbounds %struct.nfulnl_msg_config_mode, %struct.nfulnl_msg_config_mode* %11, i32 0, i32 0
store i32 %16, i32* %17
%18 = load i32, i32* %6
%19 = load i32, i32* @NFULA_CFG_MODE
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = call i32 @__nflog_sendcmd(i32 %18, i32 %19, %struct.nfulnl_msg_config_mode* %11, i32 8, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.nfulnl_msg_config_mode = type { i32, i32 }
@NFULA_CFG_MODE = global i32 0
define void @nflog_sendcmd_mode(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.nfulnl_msg_config_mode
%7 = bitcast %struct.nfulnl_msg_config_mode* %6 to i8*
%8 = call i32 @memset(%struct.nfulnl_msg_config_mode* %6, i32 0, i32 8)
%9 = getelementptr inbounds %struct.nfulnl_msg_config_mode, %struct.nfulnl_msg_config_mode* %6, i64 0, i32 1
store i32 %3, i32* %9
%10 = call i32 @htonl(i32 %4)
%11 = getelementptr inbounds %struct.nfulnl_msg_config_mode, %struct.nfulnl_msg_config_mode* %6, i64 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* @NFULA_CFG_MODE
%13 = call i32 @__nflog_sendcmd(i32 %0, i32 %12, %struct.nfulnl_msg_config_mode* %6, i32 8, i32 %1, i32 %2)
ret void
}