#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 nfqnl_msg_config_params {
  int /*<<< orphan*/ copy_mode;
  int /*<<< orphan*/ copy_range;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ NFQA_CFG_PARAMS;
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int nfq_cfg_msg(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                struct nfqnl_msg_config_params *, int, int /*<<< orphan*/);
bool nfq_cfg_mode(int fd, uint32_t seq, uint16_t gid, uint8_t mode,
                  uint32_t range) {
  struct nfqnl_msg_config_params nmcp;
  nmcp.copy_range = htonl(range);
  nmcp.copy_mode = mode;
  return nfq_cfg_msg(fd, seq, AF_UNSPEC, gid, &nmcp, sizeof nmcp,
                     NFQA_CFG_PARAMS);
}


x86 assembly (clang, -O0):
<nfq_cfg_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
lea    -0x20(%rbp),%r8
mov    $0x8,%r9d
mov    %eax,(%rsp)
call   1040 <nfq_cfg_msg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfq_cfg_mode>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebp
mov    %r8d,%edi
call   1030 <htonl@plt>
mov    %eax,0x14(%rsp)
mov    %ebx,0x10(%rsp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
lea    0x10(%rsp),%r8
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14d,%ecx
mov    $0x8,%r9d
call   1040 <nfq_cfg_msg@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.nfqnl_msg_config_params = type { i32, i32 }
@AF_UNSPEC = global i32 0
@NFQA_CFG_PARAMS = global i32 0
define i32 @nfq_cfg_mode(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.nfqnl_msg_config_params
%7 = bitcast %struct.nfqnl_msg_config_params* %6 to i8*
%8 = tail call i32 @htonl(i32 %4)
%9 = getelementptr inbounds %struct.nfqnl_msg_config_params, %struct.nfqnl_msg_config_params* %6, i64 0, i32 1
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.nfqnl_msg_config_params, %struct.nfqnl_msg_config_params* %6, i64 0, i32 0
store i32 %3, i32* %10
%11 = load i32, i32* @AF_UNSPEC
%12 = load i32, i32* @NFQA_CFG_PARAMS
%13 = call i32 @nfq_cfg_msg(i32 %0, i32 %1, i32 %11, i32 %2, %struct.nfqnl_msg_config_params* %6, i32 8, i32 %12)
ret i32 %13
}