// File: hariguchi[P]rtacl/unitTest.cpp
// Function: v4sockTest()
static void
v4sockTest()
{
    rtacl::db<rtacl::ipv4a>    acl;
    rtacl::entry<rtacl::ipv4a> rtaclEnt;
    rtacl::sockItem<sockaddr_in> sKey;
    std::unique_ptr<rtacl::sockEnt<sockaddr_in> > pEnt[10];

    rtacl::tuple<rtacl::ipv4a>& min = rtaclEnt.first.min_corner();
    rtacl::tuple<rtacl::ipv4a>& max = rtaclEnt.first.max_corner();

    sockaddr_in siSrc;
    sockaddr_in siDst;
    memset(&siSrc, 0, sizeof(siSrc));
    memset(&siDst, 0, sizeof(siDst));
    siSrc.sin_family = AF_INET;
    siDst.sin_family = AF_INET;

    /*
     * Add ACL entries
     */
    size_t i;
    for (i = 0; i < elementsof(pEnt); ++i) {
        pEnt[i].reset(new rtacl::sockEnt<sockaddr_in>);
        assert(pEnt[i]);

        rtacl::sockItem<sockaddr_in>& smin = pEnt[i]->getMin();
        rtacl::sockItem<sockaddr_in>& smax = pEnt[i]->getMax();
        ipv4a sa = 0x0a0a0a00 + (i * 20);

        /*
         * minimum (lower bound)
         */
        siSrc.sin_addr.s_addr = htonl(sa);
        siSrc.sin_port        = htons(0);
        siDst.sin_addr.s_addr = htonl(0);
        siDst.sin_port        = htons(80);
        smin.set(siSrc, siDst, 6, 0);

        /*
         * maximum (upper bound)
         */
        siSrc.sin_addr.s_addr = htonl(sa + 10);
        siSrc.sin_port        = htons(65535);
        siDst.sin_addr.s_addr = htonl(0xffffffff);
        siDst.sin_port        = htons(80);
        smax.set(siSrc, siDst, 6, 0xff);

        acl.makeMin(smin.getSrc(), smin.getDst(),
                    smin.getProto(), smin.getDSCP(), min);
        acl.makeMax(smax.getSrc(), smax.getDst(),
                    smax.getProto(), smax.getDSCP(), max);
        rtaclEnt.second = reinterpret_cast<uintptr_t>(pEnt[i].get());
        acl.insert(rtaclEnt);
    }
    std::cout << (bfmt("size: %ld, i: %ld\n") % acl.size() % i).str();
    assert(i == acl.size());

    /*
     * Show all ACL entries
     */
    rtacl::result<rtacl::ipv4a> r = acl.dump();
    for (auto it : r) {
        showRTaclEnt<rtacl::ipv4a, sockaddr_in>(it.first, it.second);
    }

    /*
     * ACL match test (match)
     */
    for (i = 0; i < elementsof(pEnt); ++i) {
        ipv4a sa = 0x0a0a0a00 + (i * 20) + 2;

        siSrc.sin_addr.s_addr = htonl(sa);
        siDst.sin_addr.s_addr = htonl(0x12345678);
        siSrc.sin_port = htons(0x1234);
        siDst.sin_port = htons(80);
        sKey.set(siSrc, siDst, 6, 0);
        rtacl::tuple<rtacl::ipv4a> rtaclKey;
        acl.makeKey(sKey.getSrc(), sKey.getDst(),
                    sKey.getProto(), sKey.getDSCP(), rtaclKey);
        rtacl::result<rtacl::ipv4a> result = acl.find(rtaclKey);
        if (result.size() != 1) {
            std::cout << "Error: no match. Key:\n";
            showSockItem(sKey);
        }
        int j = 0;
        for (auto r : result) {
            assert(reinterpret_cast<uintptr_t>(pEnt[i].get()) == r.second);
            std::cout << (bfmt("pEnt: %p, result: 0x%lx\n")
                          % pEnt[i].get()
                          % r.second).str();
            ++j;
        }
    }

    /*
     * ACL match test (unmatch)
     */
    for (i = 0; i < elementsof(pEnt); ++i) {
        ipv4a sa = 0x0a0a0a00 + (i * 20) - 1 ;

        siSrc.sin_addr.s_addr = htonl(sa);
        siDst.sin_addr.s_addr = htonl(0x12345678);
        siSrc.sin_port = htons(0x1234);
        siDst.sin_port = htons(80);
        sKey.set(siSrc, siDst, 6, 0);
        rtacl::tuple<rtacl::ipv4a> rtaclKey;
        acl.makeKey(sKey.getSrc(), sKey.getDst(),
                    sKey.getProto(), sKey.getDSCP(), rtaclKey);
        rtacl::result<rtacl::ipv4a> result = acl.find(rtaclKey);
        if (result.size() == 0) {
            std::cout << "no match (correct): key: ";
            showSockItem(sKey);
        } else {
            std::cout << "Error: matched: key: ";
            showSockItem(sKey);
            for (auto it : result) {
                showRTaclEnt<rtacl::ipv4a,
                             sockaddr_in>(it.first, it.second);
            }
        }
    }

    /*
     * Remove ACL entries
     */
    for (i = 0; i < elementsof(pEnt); ++i) {
        rtacl::sockItem<sockaddr_in>& smin = pEnt[i]->getMin();
        rtacl::sockItem<sockaddr_in>& smax = pEnt[i]->getMax();
        acl.makeMin(smin.getSrc(), smin.getDst(),
                    smin.getProto(), smin.getDSCP(), min);
        acl.makeMax(smax.getSrc(), smax.getDst(),
                    smax.getProto(), smax.getDSCP(), max);
        rtaclEnt.second = reinterpret_cast<uintptr_t>(pEnt[i].get());
        bool rc = acl.remove(rtaclEnt);
        if (rc) {
            std::cout << (bfmt("size: %2ld: ") % acl.size()).str();
            ipv4a a = ntohl(smin.getSrc().sin_addr.s_addr) + 1;
            siSrc.sin_addr.s_addr = htonl(a);
            siDst.sin_addr.s_addr = smin.getDst().sin_addr.s_addr;
            siSrc.sin_port = htons(smin.getSrc().sin_port);
            siDst.sin_port = htons(smin.getDst().sin_port);
            sKey.set(siSrc, siDst, smin.getProto(), smin.getDSCP());
            rtacl::tuple<rtacl::ipv4a> rtaclKey;
            acl.makeKey(sKey.getSrc(), sKey.getDst(),
                        sKey.getProto(), sKey.getDSCP(), rtaclKey);
            rtacl::result<rtacl::ipv4a> result = acl.find(rtaclKey);
            if (result.size() == 0) {
                std::cout << "no match (correct): key: ";
                showSockItem(sKey);
            } else {
                std::cout << "Error: matched: key: ";
                showSockItem(sKey);
                for (auto it : result) {
                    showRTaclEnt<rtacl::ipv4a,
                                 sockaddr_in>(it.first, it.second);
                }
            }
        } else {
            std::cout << "Error: failed to remove acl entry: ";
            showRTaclEnt<rtacl::ipv4a,
                         sockaddr_in>(rtaclEnt.first, rtaclEnt.second);

        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x990, %rsp            # imm = 0x990
leaq -0x20(%rbp), %rdi
callq 0xa1a0
leaq -0x88(%rbp), %rdi
callq 0xa210
jmp 0x7282
leaq -0xd0(%rbp), %rdi
callq 0x2d000
jmp 0x7290
leaq -0x120(%rbp), %rax
movq %rax, %rcx
addq $0x50, %rcx
movq %rcx, -0x7c0(%rbp)
movq %rax, -0x7b8(%rbp)
movq -0x7b8(%rbp), %rdi
movq %rdi, -0x7c8(%rbp)
callq 0x2d0d0
movq -0x7c8(%rbp), %rax
movq -0x7c0(%rbp), %rcx
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x7b8(%rbp)
jne 0x72ac
leaq -0x88(%rbp), %rdi
callq 0xa250
movq %rax, -0x128(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xa260
movq %rax, -0x130(%rbp)
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x51b0
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x51b0
movw $0x2, -0x140(%rbp)
movw $0x2, -0x150(%rbp)
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x7d8(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2d100
movq %rax, -0x7d0(%rbp)
jmp 0x7369
movq -0x7d8(%rbp), %rax
movq -0x7d0(%rbp), %rcx
cmpq %rcx, %rax
jae 0x770a
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rax
movq %rax, -0x7e8(%rbp)
movl $0x70, %edi
callq 0x5360
movq %rax, -0x7e0(%rbp)
jmp 0x73a9
movq -0x7e0(%rbp), %rdi
callq 0x2d140
jmp 0x73b7
movq -0x7e0(%rbp), %rsi
movq -0x7e8(%rbp), %rdi
callq 0x2d110
movq -0x158(%rbp), %rax
leaq -0x120(%rbp), %rdi
shlq $0x3, %rax
addq %rax, %rdi
callq 0x2d170
testb $0x1, %al
jne 0x73ea
jmp 0x73ec
jmp 0x7461
leaq 0x5fa8f(%rip), %rdi     # 0x66e82
leaq 0x48666(%rip), %rsi     # 0x4fa60
movl $0x46, %edx
leaq 0x5fa84(%rip), %rcx     # 0x66e8a
callq 0x5220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x86bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x866f
movq -0x7e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
movl $0x70, %esi
callq 0x5370
jmp 0x866f
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d1a0
movq %rax, %rdi
callq 0x2d1c0
movq %rax, -0x7f0(%rbp)
jmp 0x7486
movq -0x7f0(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d1a0
movq %rax, %rdi
callq 0x2d1d0
movq %rax, -0x7f8(%rbp)
jmp 0x74b9
movq -0x7f8(%rbp), %rax
movq %rax, -0x168(%rbp)
movl -0x158(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,4), %ecx
movl %ecx, %eax
leal 0xa0a0a00(,%rax,4), %eax
movl %eax, -0x16c(%rbp)
movl -0x16c(%rbp), %edi
callq 0x5280
movl %eax, -0x13c(%rbp)
xorl %edi, %edi
movl %edi, -0x7fc(%rbp)
callq 0x5040
movl -0x7fc(%rbp), %edi
movw %ax, -0x13e(%rbp)
callq 0x5280
movl %eax, -0x14c(%rbp)
movl $0x50, %edi
callq 0x5040
movl -0x7fc(%rbp), %r8d
movw %ax, -0x14e(%rbp)
movq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x150(%rbp), %rdx
movl $0x6, %ecx
callq 0x2d1f0
jmp 0x7550
movl -0x16c(%rbp), %edi
addl $0xa, %edi
callq 0x5280
movl %eax, -0x13c(%rbp)
movl $0xffff, %edi           # imm = 0xFFFF
callq 0x5040
movw %ax, -0x13e(%rbp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x5280
movl %eax, -0x14c(%rbp)
movl $0x50, %edi
callq 0x5040
movw %ax, -0x14e(%rbp)
movq -0x168(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x150(%rbp), %rdx
movl $0x6, %ecx
movl $0xff, %r8d
callq 0x2d1f0
jmp 0x75bd
movq -0x160(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x808(%rbp)
jmp 0x75d2
movq -0x160(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x810(%rbp)
jmp 0x75e7
movq -0x160(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x811(%rbp)
jmp 0x75fb
movq -0x160(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x812(%rbp)
jmp 0x760f
movq -0x810(%rbp), %rdx
movq -0x808(%rbp), %rsi
movb -0x812(%rbp), %al
movb -0x811(%rbp), %cl
movq -0x128(%rbp), %r9
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
callq 0x2d240
jmp 0x7642
movq -0x168(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x820(%rbp)
jmp 0x7657
movq -0x168(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x828(%rbp)
jmp 0x766c
movq -0x168(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x829(%rbp)
jmp 0x7680
movq -0x168(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x82a(%rbp)
jmp 0x7694
movq -0x828(%rbp), %rdx
movq -0x820(%rbp), %rsi
movb -0x82a(%rbp), %al
movb -0x829(%rbp), %cl
movq -0x130(%rbp), %r9
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
callq 0x2d310
jmp 0x76c7
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d370
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa360
jmp 0x76f1
jmp 0x76f3
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x7346
leaq 0x4832c(%rip), %rsi     # 0x4fa3d
leaq -0x270(%rbp), %rdi
callq 0xa390
jmp 0x771f
leaq -0x20(%rbp), %rdi
callq 0xa540
movq %rax, -0x838(%rbp)
jmp 0x7731
movq -0x838(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x270(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0xa510
movq %rax, -0x840(%rbp)
jmp 0x775b
movq -0x840(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0xa560
movq %rax, -0x848(%rbp)
jmp 0x7777
movq -0x848(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0xa590
jmp 0x778c
movq 0xa9825(%rip), %rdi     # 0xb0fb8
leaq -0x190(%rbp), %rsi
callq 0x52f0
jmp 0x77a1
leaq -0x190(%rbp), %rdi
callq 0x51e0
leaq -0x270(%rbp), %rdi
callq 0xa7e0
movq -0x158(%rbp), %rax
movq %rax, -0x858(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa540
movq %rax, -0x850(%rbp)
jmp 0x77d9
movq -0x858(%rbp), %rax
movq -0x850(%rbp), %rcx
cmpq %rcx, %rax
jne 0x77ee
jmp 0x7850
leaq 0x4825b(%rip), %rdi     # 0x4fa50
leaq 0x48264(%rip), %rsi     # 0x4fa60
movl $0x66, %edx
leaq 0x5f682(%rip), %rcx     # 0x66e8a
callq 0x5220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x783f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x51e0
leaq -0x270(%rbp), %rdi
callq 0xa7e0
jmp 0x866f
leaq -0x290(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa840
jmp 0x7862
leaq -0x290(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rdi
callq 0xa940
movq %rax, -0x2a0(%rbp)
movq -0x298(%rbp), %rdi
callq 0xa970
movq %rax, -0x2a8(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0xa9a0
testb $0x1, %al
jne 0x78b2
jmp 0x7949
leaq -0x2a0(%rbp), %rdi
callq 0xa9e0
movq 0x60(%rax), %rcx
movq %rcx, -0x2b0(%rbp)
movups 0x50(%rax), %xmm0
movaps %xmm0, -0x2c0(%rbp)
movups 0x40(%rax), %xmm0
movaps %xmm0, -0x2d0(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movaps %xmm3, -0x2e0(%rbp)
movaps %xmm2, -0x2f0(%rbp)
movaps %xmm1, -0x300(%rbp)
movaps %xmm0, -0x310(%rbp)
movq -0x2b0(%rbp), %rsi
leaq -0x310(%rbp), %rdi
callq 0x9c70
jmp 0x791f
jmp 0x7921
leaq -0x2a0(%rbp), %rdi
callq 0xae30
jmp 0x7896
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x8663
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x868(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2d100
movq %rax, -0x860(%rbp)
jmp 0x7977
movq -0x868(%rbp), %rax
movq -0x860(%rbp), %rcx
cmpq %rcx, %rax
jae 0x7cf7
movl -0x158(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,4), %ecx
movl %ecx, %eax
leal 0xa0a0a02(,%rax,4), %eax
movl %eax, -0x314(%rbp)
movl -0x314(%rbp), %edi
callq 0x5280
movl %eax, -0x13c(%rbp)
movl $0x12345678, %edi       # imm = 0x12345678
callq 0x5280
movl %eax, -0x14c(%rbp)
movl $0x1234, %edi           # imm = 0x1234
callq 0x5040
movw %ax, -0x13e(%rbp)
movl $0x50, %edi
callq 0x5040
movw %ax, -0x14e(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x150(%rbp), %rdx
movl $0x6, %ecx
xorl %r8d, %r8d
callq 0x2d1f0
jmp 0x7a0f
leaq -0xd0(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x870(%rbp)
jmp 0x7a24
leaq -0xd0(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x878(%rbp)
jmp 0x7a39
leaq -0xd0(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x879(%rbp)
jmp 0x7a4d
leaq -0xd0(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x87a(%rbp)
jmp 0x7a61
movq -0x878(%rbp), %rdx
movq -0x870(%rbp), %rsi
movb -0x87a(%rbp), %al
movb -0x879(%rbp), %cl
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
leaq -0x348(%rbp), %r9
callq 0x2d3a0
jmp 0x7a94
leaq -0x360(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x348(%rbp), %rdx
callq 0xaec0
jmp 0x7aad
leaq -0x360(%rbp), %rdi
callq 0xb050
cmpq $0x1, %rax
je 0x7afb
movq 0xa94f2(%rip), %rdi     # 0xb0fb8
leaq 0x5f3cf(%rip), %rsi     # 0x66e9c
callq 0x5350
jmp 0x7ad4
leaq -0xd0(%rbp), %rdi
callq 0x9de0
jmp 0x7ae2
jmp 0x7afb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x7ce6
movl $0x0, -0x364(%rbp)
leaq -0x360(%rbp), %rax
movq %rax, -0x370(%rbp)
movq -0x370(%rbp), %rdi
callq 0xa940
movq %rax, -0x378(%rbp)
movq -0x370(%rbp), %rdi
callq 0xa970
movq %rax, -0x380(%rbp)
leaq -0x378(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0xa9a0
testb $0x1, %al
jne 0x7b55
jmp 0x7cc3
leaq -0x378(%rbp), %rdi
callq 0xa9e0
movq %rax, %rsi
leaq -0x3e8(%rbp), %rdi
movl $0x68, %edx
callq 0x52c0
movq -0x158(%rbp), %rax
leaq -0x120(%rbp), %rdi
shlq $0x3, %rax
addq %rax, %rdi
callq 0x2d370
cmpq -0x388(%rbp), %rax
jne 0x7b9a
jmp 0x7bb9
leaq 0x5f312(%rip), %rdi     # 0x66eb3
leaq 0x47eb8(%rip), %rsi     # 0x4fa60
movl $0x85, %edx
leaq 0x5f2d6(%rip), %rcx     # 0x66e8a
callq 0x5220
leaq 0x5f32a(%rip), %rsi     # 0x66eea
leaq -0x4e8(%rbp), %rdi
callq 0xa390
jmp 0x7bce
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d370
movq %rax, -0x4f0(%rbp)
leaq -0x4e8(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
callq 0x2d400
movq %rax, -0x888(%rbp)
jmp 0x7c05
movq -0x888(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0xa560
movq %rax, -0x890(%rbp)
jmp 0x7c21
movq -0x890(%rbp), %rsi
leaq -0x408(%rbp), %rdi
callq 0xa590
jmp 0x7c36
movq 0xa937b(%rip), %rdi     # 0xb0fb8
leaq -0x408(%rbp), %rsi
callq 0x52f0
jmp 0x7c4b
leaq -0x408(%rbp), %rdi
callq 0x51e0
leaq -0x4e8(%rbp), %rdi
callq 0xa7e0
movl -0x364(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x364(%rbp)
leaq -0x378(%rbp), %rdi
callq 0xae30
jmp 0x7b39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x7cb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x408(%rbp), %rdi
callq 0x51e0
leaq -0x4e8(%rbp), %rdi
callq 0xa7e0
jmp 0x7ce6
leaq -0x360(%rbp), %rdi
callq 0xb290
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x7954
leaq -0x360(%rbp), %rdi
callq 0xb290
jmp 0x8663
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x8a0(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2d100
movq %rax, -0x898(%rbp)
jmp 0x7d25
movq -0x8a0(%rbp), %rax
movq -0x898(%rbp), %rcx
cmpq %rcx, %rax
jae 0x7fd0
movl -0x158(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,4), %ecx
movl %ecx, %eax
leal 0xa0a09ff(,%rax,4), %eax
movl %eax, -0x4f4(%rbp)
movl -0x4f4(%rbp), %edi
callq 0x5280
movl %eax, -0x13c(%rbp)
movl $0x12345678, %edi       # imm = 0x12345678
callq 0x5280
movl %eax, -0x14c(%rbp)
movl $0x1234, %edi           # imm = 0x1234
callq 0x5040
movw %ax, -0x13e(%rbp)
movl $0x50, %edi
callq 0x5040
movw %ax, -0x14e(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x150(%rbp), %rdx
movl $0x6, %ecx
xorl %r8d, %r8d
callq 0x2d1f0
jmp 0x7dbd
leaq -0xd0(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x8a8(%rbp)
jmp 0x7dd2
leaq -0xd0(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x8b0(%rbp)
jmp 0x7de7
leaq -0xd0(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x8b1(%rbp)
jmp 0x7dfb
leaq -0xd0(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x8b2(%rbp)
jmp 0x7e0f
movq -0x8b0(%rbp), %rdx
movq -0x8a8(%rbp), %rsi
movb -0x8b2(%rbp), %al
movb -0x8b1(%rbp), %cl
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
leaq -0x528(%rbp), %r9
callq 0x2d3a0
jmp 0x7e42
leaq -0x540(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x528(%rbp), %rdx
callq 0xaec0
jmp 0x7e5b
leaq -0x540(%rbp), %rdi
callq 0xb050
cmpq $0x0, %rax
jne 0x7eb8
movq 0xa9144(%rip), %rdi     # 0xb0fb8
leaq 0x47c78(%rip), %rsi     # 0x4faf3
callq 0x5350
jmp 0x7e82
leaq -0xd0(%rbp), %rdi
callq 0x9de0
jmp 0x7e90
jmp 0x7fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x540(%rbp), %rdi
callq 0xb290
jmp 0x8663
movq 0xa90f9(%rip), %rdi     # 0xb0fb8
leaq 0x47c47(%rip), %rsi     # 0x4fb0d
callq 0x5350
jmp 0x7ecd
leaq -0xd0(%rbp), %rdi
callq 0x9de0
jmp 0x7edb
leaq -0x540(%rbp), %rax
movq %rax, -0x548(%rbp)
movq -0x548(%rbp), %rdi
callq 0xa940
movq %rax, -0x550(%rbp)
movq -0x548(%rbp), %rdi
callq 0xa970
movq %rax, -0x558(%rbp)
leaq -0x550(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0xa9a0
testb $0x1, %al
jne 0x7f2b
jmp 0x7fab
leaq -0x550(%rbp), %rdi
callq 0xa9e0
movq 0x60(%rax), %rcx
movq %rcx, -0x560(%rbp)
movups 0x50(%rax), %xmm0
movaps %xmm0, -0x570(%rbp)
movups 0x40(%rax), %xmm0
movaps %xmm0, -0x580(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movaps %xmm3, -0x590(%rbp)
movaps %xmm2, -0x5a0(%rbp)
movaps %xmm1, -0x5b0(%rbp)
movaps %xmm0, -0x5c0(%rbp)
movq -0x560(%rbp), %rsi
leaq -0x5c0(%rbp), %rdi
callq 0x9c70
jmp 0x7f98
jmp 0x7f9a
leaq -0x550(%rbp), %rdi
callq 0xae30
jmp 0x7f0f
jmp 0x7fad
leaq -0x540(%rbp), %rdi
callq 0xb290
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x7d02
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x8c8(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2d100
movq %rax, -0x8c0(%rbp)
jmp 0x7ffe
movq -0x8c8(%rbp), %rax
movq -0x8c0(%rbp), %rcx
cmpq %rcx, %rax
jae 0x85fb
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d1a0
movq %rax, %rdi
callq 0x2d1c0
movq %rax, -0x8d0(%rbp)
jmp 0x803a
movq -0x8d0(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d1a0
movq %rax, %rdi
callq 0x2d1d0
movq %rax, -0x8d8(%rbp)
jmp 0x806d
movq -0x8d8(%rbp), %rax
movq %rax, -0x5d0(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x8e0(%rbp)
jmp 0x8090
movq -0x5c8(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x8e8(%rbp)
jmp 0x80a5
movq -0x5c8(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x8e9(%rbp)
jmp 0x80b9
movq -0x5c8(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x8ea(%rbp)
jmp 0x80cd
movq -0x8e8(%rbp), %rdx
movq -0x8e0(%rbp), %rsi
movb -0x8ea(%rbp), %al
movb -0x8e9(%rbp), %cl
movq -0x128(%rbp), %r9
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
callq 0x2d240
jmp 0x8100
movq -0x5d0(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x8f8(%rbp)
jmp 0x8115
movq -0x5d0(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x900(%rbp)
jmp 0x812a
movq -0x5d0(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x901(%rbp)
jmp 0x813e
movq -0x5d0(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x902(%rbp)
jmp 0x8152
movq -0x900(%rbp), %rdx
movq -0x8f8(%rbp), %rsi
movb -0x902(%rbp), %al
movb -0x901(%rbp), %cl
movq -0x130(%rbp), %r9
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
callq 0x2d310
jmp 0x8185
movq -0x158(%rbp), %rax
leaq -0x120(%rbp,%rax,8), %rdi
callq 0x2d370
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb2f0
movb %al, -0x903(%rbp)
jmp 0x81b5
movb -0x903(%rbp), %al
andb $0x1, %al
movb %al, -0x5d1(%rbp)
testb $0x1, -0x5d1(%rbp)
je 0x85b9
leaq 0x47954(%rip), %rsi     # 0x4fb2b
leaq -0x6d8(%rbp), %rdi
callq 0xa390
jmp 0x81e5
leaq -0x20(%rbp), %rdi
callq 0xa540
movq %rax, -0x910(%rbp)
jmp 0x81f7
movq -0x910(%rbp), %rax
movq %rax, -0x6e0(%rbp)
leaq -0x6d8(%rbp), %rdi
leaq -0x6e0(%rbp), %rsi
callq 0xa510
movq %rax, -0x918(%rbp)
jmp 0x8221
movq -0x918(%rbp), %rsi
leaq -0x5f8(%rbp), %rdi
callq 0xa590
jmp 0x8236
movq 0xa8d7b(%rip), %rdi     # 0xb0fb8
leaq -0x5f8(%rbp), %rsi
callq 0x52f0
jmp 0x824b
leaq -0x5f8(%rbp), %rdi
callq 0x51e0
leaq -0x6d8(%rbp), %rdi
callq 0xa7e0
movq -0x5c8(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x920(%rbp)
jmp 0x8278
movq -0x920(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x5470
incl %eax
movl %eax, -0x6e4(%rbp)
movl -0x6e4(%rbp), %edi
callq 0x5280
movl %eax, -0x13c(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x928(%rbp)
jmp 0x82b5
movq -0x928(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14c(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x930(%rbp)
jmp 0x82da
movq -0x930(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x5040
movw %ax, -0x13e(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x938(%rbp)
jmp 0x8306
movq -0x938(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x5040
movw %ax, -0x14e(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x939(%rbp)
jmp 0x8331
movq -0x5c8(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x93a(%rbp)
jmp 0x8345
movb -0x93a(%rbp), %al
movb -0x939(%rbp), %cl
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0xd0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x2d1f0
jmp 0x8374
leaq -0xd0(%rbp), %rdi
callq 0x2d2a0
movq %rax, -0x948(%rbp)
jmp 0x8389
leaq -0xd0(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0x950(%rbp)
jmp 0x839e
leaq -0xd0(%rbp), %rdi
callq 0x2d2d0
movb %al, -0x951(%rbp)
jmp 0x83b2
leaq -0xd0(%rbp), %rdi
callq 0x2d2f0
movb %al, -0x952(%rbp)
jmp 0x83c6
movq -0x950(%rbp), %rdx
movq -0x948(%rbp), %rsi
movb -0x952(%rbp), %al
movb -0x951(%rbp), %cl
movzbl %cl, %ecx
movzbl %al, %r8d
leaq -0x20(%rbp), %rdi
leaq -0x718(%rbp), %r9
callq 0x2d3a0
jmp 0x83f9
leaq -0x730(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x718(%rbp), %rdx
callq 0xaec0
jmp 0x8412
leaq -0x730(%rbp), %rdi
callq 0xb050
cmpq $0x0, %rax
jne 0x84b6
movq 0xa8b89(%rip), %rdi     # 0xb0fb8
leaq 0x476bd(%rip), %rsi     # 0x4faf3
callq 0x5350
jmp 0x843d
leaq -0xd0(%rbp), %rdi
callq 0x9de0
jmp 0x844b
jmp 0x85ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x8482
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x5f8(%rbp), %rdi
callq 0x51e0
leaq -0x6d8(%rbp), %rdi
callq 0xa7e0
jmp 0x8663
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x730(%rbp), %rdi
callq 0xb290
jmp 0x8663
movq 0xa8afb(%rip), %rdi     # 0xb0fb8
leaq 0x47649(%rip), %rsi     # 0x4fb0d
callq 0x5350
jmp 0x84cb
leaq -0xd0(%rbp), %rdi
callq 0x9de0
jmp 0x84d9
leaq -0x730(%rbp), %rax
movq %rax, -0x738(%rbp)
movq -0x738(%rbp), %rdi
callq 0xa940
movq %rax, -0x740(%rbp)
movq -0x738(%rbp), %rdi
callq 0xa970
movq %rax, -0x748(%rbp)
leaq -0x740(%rbp), %rdi
leaq -0x748(%rbp), %rsi
callq 0xa9a0
testb $0x1, %al
jne 0x8529
jmp 0x85a9
leaq -0x740(%rbp), %rdi
callq 0xa9e0
movq 0x60(%rax), %rcx
movq %rcx, -0x750(%rbp)
movups 0x50(%rax), %xmm0
movaps %xmm0, -0x760(%rbp)
movups 0x40(%rax), %xmm0
movaps %xmm0, -0x770(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movaps %xmm3, -0x780(%rbp)
movaps %xmm2, -0x790(%rbp)
movaps %xmm1, -0x7a0(%rbp)
movaps %xmm0, -0x7b0(%rbp)
movq -0x750(%rbp), %rsi
leaq -0x7b0(%rbp), %rdi
callq 0x9c70
jmp 0x8596
jmp 0x8598
leaq -0x740(%rbp), %rdi
callq 0xae30
jmp 0x850d
jmp 0x85ab
leaq -0x730(%rbp), %rdi
callq 0xb290
jmp 0x85e2
movq 0xa89f8(%rip), %rdi     # 0xb0fb8
leaq 0x5e93c(%rip), %rsi     # 0x66f03
callq 0x5350
jmp 0x85ce
movq -0x28(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x9c70
jmp 0x85e0
jmp 0x85e2
jmp 0x85e4
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x7fdb
leaq -0x290(%rbp), %rdi
callq 0xb290
leaq -0x120(%rbp), %rax
movq %rax, -0x968(%rbp)
addq $0x50, %rax
movq %rax, -0x960(%rbp)
movq -0x960(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x970(%rbp)
callq 0x2d430
movq -0x968(%rbp), %rcx
movq -0x970(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x960(%rbp)
jne 0x8620
leaq -0x20(%rbp), %rdi
callq 0xb320
addq $0x990, %rsp            # imm = 0x990
popq %rbp
retq
leaq -0x290(%rbp), %rdi
callq 0xb290
leaq -0x120(%rbp), %rax
movq %rax, -0x980(%rbp)
addq $0x50, %rax
movq %rax, -0x978(%rbp)
movq -0x978(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x988(%rbp)
callq 0x2d430
movq -0x980(%rbp), %rcx
movq -0x988(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x978(%rbp)
jne 0x8688
jmp 0x86bb
leaq -0x20(%rbp), %rdi
callq 0xb320
movq -0x90(%rbp), %rdi
callq 0x5640