// File: hariguchi[P]rtacl/./rtacl.hpp
// Function: rtacl::db<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<256u, 256u, (boost::multiprecision::cpp_integer_type)1, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0>>::makeTuple(sockaddr_in6 const&, sockaddr_in6 const&, unsigned char, unsigned char, int, boost::geometry::model::point<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<256u, 256u, (boost::multiprecision::cpp_integer_type)1, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0>, 6ul, boost::geometry::cs::cartesian>&)
inline void
db<ADDR>::makeTuple (const sockaddr_in6& src,
                     const sockaddr_in6& dst,
                     const u8 proto,
                     const u8 dscp,
                     const s32 offset,
                     tuple<rtacl::ipv6a>& result)
{
    assert(af == AF_INET6);

    s256 val;

    val = sin6a2int<s256>(src) + offset;
    bg::set<0>(result, val);
    val = sin6a2int<s256>(dst) + offset;
    bg::set<1>(result, val);
    val = static_cast<s256>(ntohs(src.sin6_port)) + offset;
    bg::set<2>(result, val);
    val = static_cast<s256>(ntohs(dst.sin6_port)) + offset;
    bg::set<3>(result, val);
    val = static_cast<s256>(proto) + offset;
    bg::set<4>(result, val);
    val = static_cast<s256>(dscp) + offset;
    bg::set<5>(result, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movb %r8b, %al
movq 0x10(%rbp), %r8
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %cl, -0x19(%rbp)
movb %al, -0x1a(%rbp)
movl %r9d, -0x20(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
cmpl $0xa, %eax
jne 0x2f1b7
jmp 0x2f1d6
leaq 0x37e2f(%rip), %rdi     # 0x66fed
leaq 0x30dab(%rip), %rsi     # 0x5ff70
movl $0x286, %edx            # imm = 0x286
leaq 0x37e2b(%rip), %rcx     # 0x66ffc
callq 0x5220
leaq -0x50(%rbp), %rdi
callq 0x2f3d0
movq -0x10(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x2f470
leaq -0x80(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f3f0
leaq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2f510
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f540
movq -0x18(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x2f470
leaq -0xe0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f3f0
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x2f510
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f570
movq -0x10(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x5690
movw %ax, -0x172(%rbp)
leaq -0x170(%rbp), %rdi
leaq -0x172(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f5a0
leaq -0x140(%rbp), %rdi
leaq -0x170(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f3f0
leaq -0x50(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x2f510
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f5e0
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x5690
movw %ax, -0x1e2(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x1e2(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f5a0
leaq -0x1b0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f3f0
leaq -0x50(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x2f510
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f610
leaq -0x250(%rbp), %rdi
leaq -0x19(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f640
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f3f0
leaq -0x50(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x2f510
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f680
leaq -0x2b0(%rbp), %rdi
leaq -0x1a(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f640
leaq -0x280(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f3f0
leaq -0x50(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x2f510
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f6b0
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq