#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_cmd {
  int /*<<< orphan*/ pf;
  int /*<<< orphan*/ command;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ NFQA_CFG_CMD;
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int nfq_cfg_msg(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                struct nfqnl_msg_config_cmd *, int, int /*<<< orphan*/);
bool nfq_cfg_cmd(int fd, uint32_t seq, uint16_t gid, uint8_t cmd, uint16_t pf) {
  struct nfqnl_msg_config_cmd nmcc;
  nmcc.command = cmd;
  nmcc.pf = htons(pf);
  return nfq_cfg_msg(fd, seq, AF_UNSPEC, gid, &nmcc, sizeof nmcc, NFQA_CFG_CMD);
}


x86 assembly (clang, -O0):
<nfq_cfg_cmd>:
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    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
mov    0x2e76(%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_cmd>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %ecx,0xc(%rsp)
mov    %r8d,%edi
call   1030 <htons@plt>
mov    %eax,0x8(%rsp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
lea    0x8(%rsp),%r8
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%ecx
mov    $0x8,%r9d
call   1040 <nfq_cfg_msg@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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