#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*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct nfqnl_msg_verdict_hdr {
  void *verdict;
  void *id;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int NFNL_SUBSYS_QUEUE;
int /*<<< orphan*/ NFQA_VERDICT_HDR;
int NFQNL_MSG_VERDICT;
void *htonl(int /*<<< orphan*/);
int nf_cfg_msg(int, int /*<<< orphan*/, int, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/,
               struct nfqnl_msg_verdict_hdr *, int, int /*<<< orphan*/);
bool nfq_verdict(int fd, uint32_t seq, uint16_t gid, uint32_t id,
                 uint32_t verdict) {
  struct nfqnl_msg_verdict_hdr nmvh;
  nmvh.id = htonl(id);
  nmvh.verdict = htonl(verdict);
  return nf_cfg_msg(fd, seq, (NFNL_SUBSYS_QUEUE << 8) | NFQNL_MSG_VERDICT, 0,
                    AF_UNSPEC, gid, &nmvh, sizeof nmvh, NFQA_VERDICT_HDR);
}


x86 assembly (clang, -O0):
<nfq_verdict>:
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    -0x10(%rbp),%edi
call   1030 <htonl@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
shl    $0x8,%edx
mov    0x2e77(%rip),%rax
or     (%rax),%edx
mov    0x2e76(%rip),%rax
mov    (%rax),%r8d
mov    -0xc(%rbp),%r9d
mov    0x2e50(%rip),%rax
mov    (%rax),%eax
xor    %ecx,%ecx
lea    -0x28(%rbp),%r10
mov    %r10,(%rsp)
movl   $0x10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1040 <nf_cfg_msg@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfq_verdict>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
mov    %ecx,%edi
call   1030 <htonl@plt>
mov    %rax,0x10(%rsp)
mov    %ebp,%edi
call   1030 <htonl@plt>
mov    %rax,0x8(%rsp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
shl    $0x8,%edx
mov    0x2e80(%rip),%rax
or     (%rax),%edx
mov    0x2e7f(%rip),%rax
mov    (%rax),%r8d
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
lea    0x10(%rsp),%rbp
mov    %ebx,%edi
mov    %r15d,%esi
xor    %ecx,%ecx
mov    %r14d,%r9d
push   %rax
push   $0x10
push   %rbp
call   1040 <nf_cfg_msg@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.nfqnl_msg_verdict_hdr = type { i8*, i8* }
@NFNL_SUBSYS_QUEUE = global i32 0
@NFQNL_MSG_VERDICT = global i32 0
@AF_UNSPEC = global i32 0
@NFQA_VERDICT_HDR = global i32 0
define i32 @nfq_verdict(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_verdict_hdr
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 = call i8* @htonl(i32 %12)
%14 = getelementptr inbounds %struct.nfqnl_msg_verdict_hdr, %struct.nfqnl_msg_verdict_hdr* %11, i32 0, i32 1
store i8* %13, i8** %14
%15 = load i32, i32* %10
%16 = call i8* @htonl(i32 %15)
%17 = getelementptr inbounds %struct.nfqnl_msg_verdict_hdr, %struct.nfqnl_msg_verdict_hdr* %11, i32 0, i32 0
store i8* %16, i8** %17
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i32, i32* @NFNL_SUBSYS_QUEUE
%21 = shl i32 %20, 8
%22 = load i32, i32* @NFQNL_MSG_VERDICT
%23 = or i32 %21, %22
%24 = load i32, i32* @AF_UNSPEC
%25 = load i32, i32* %8
%26 = load i32, i32* @NFQA_VERDICT_HDR
%27 = call i32 @nf_cfg_msg(i32 %18, i32 %19, i32 %23, i32 0, i32 %24, i32 %25, %struct.nfqnl_msg_verdict_hdr* %11, i32 16, i32 %26)
ret i32 %27
}

LLVM IR (-O2):
%struct.nfqnl_msg_verdict_hdr = type { i8*, i8* }
@NFNL_SUBSYS_QUEUE = global i32 0
@NFQNL_MSG_VERDICT = global i32 0
@AF_UNSPEC = global i32 0
@NFQA_VERDICT_HDR = global i32 0
define i32 @nfq_verdict(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.nfqnl_msg_verdict_hdr
%7 = bitcast %struct.nfqnl_msg_verdict_hdr* %6 to i8*
%8 = tail call i8* @htonl(i32 %3)
%9 = getelementptr inbounds %struct.nfqnl_msg_verdict_hdr, %struct.nfqnl_msg_verdict_hdr* %6, i64 0, i32 1
store i8* %8, i8** %9
%10 = tail call i8* @htonl(i32 %4)
%11 = getelementptr inbounds %struct.nfqnl_msg_verdict_hdr, %struct.nfqnl_msg_verdict_hdr* %6, i64 0, i32 0
store i8* %10, i8** %11
%12 = load i32, i32* @NFNL_SUBSYS_QUEUE
%13 = shl i32 %12, 8
%14 = load i32, i32* @NFQNL_MSG_VERDICT
%15 = or i32 %13, %14
%16 = load i32, i32* @AF_UNSPEC
%17 = load i32, i32* @NFQA_VERDICT_HDR
%18 = call i32 @nf_cfg_msg(i32 %0, i32 %1, i32 %15, i32 0, i32 %16, i32 %2, %struct.nfqnl_msg_verdict_hdr* %6, i32 16, i32 %17)
ret i32 %18
}