// File: /workspace/github_cpp_makefile_star2_O2/dechimal[P]TaggedUnion/test_sum.cpp
// Function: main
int main() {
    {
        // construct, assign, exception safety
        sum<int, double, hoge, hoge> a(_1, 10.0);
        assert(a.get(_1) == 10.0);
        auto b = a;
        assert(b.get(_1) == 10.0);
        a = { _0, 5 };
        assert(a.get(_0) == 5);
        a = { _2, hoge{42} };
        a.get(_2).b = true;
        try {
            b = a;
            assert(false);
        } catch (int) {
            assert(b.get(_1) == 10.0);
        }
        a.get(_2).b = false;
        a = { _3, hoge{24} };
        assert(a.get(_3).x == 24);
        try {
            b = { _2, hoge{36} };
            assert(b.get(_2).x == 36);
            b.get(_2).b = true;
            a = b;
            assert(false);
        } catch (int) {
            assert(a.get(_0) == 0);
        }
    }
    {
        // strong guarantee without fallback type
        sum<hoge, hoge> a(_0, hoge{42});
        sum<hoge, hoge> b(_1, hoge{24});
        b.get(_1).b = true;
        try {
            a = b;
            assert(false);
        } catch (int) {
            assert(a.get(_0).x == 42);
        }
    }
    {
        // equality
        sum<int, hoge> a(_0, 42);
        sum<int, hoge> b(_1, hoge{42});
        assert(a != b);
        a = { _1, hoge{42} };
        assert(a == b);
    }
    {
        // strong guarantee without nothrow constructible type
        sum<hoge, hoge> a(_0, hoge{42});
        sum<hoge, hoge> b(_1, hoge{42});
        b.get(_1).b = true;
        try {
            a = b;
            assert(false);
        } catch (int) {
            assert(a.get(_0) == b.get(_1));
        }
    }
    {
        // less
        sum<int, double> a(_0, 42);
        sum<int, double> b(_1, 10.0);
        assert(a < b);
    }
    {
        // move
        sum<int, std::vector<int>> a(_0, 10);
        sum<int, std::vector<int>> b(_1, {1, 2, 3});
        a = std::move(b);
        auto & v1 = a.get(_1);
        auto v2 = {1, 2, 3};
        assert(std::equal(v1.begin(), v1.end(), v2.begin(), v2.end()));
        auto & v3 = b.get(_1);
        assert(v3.empty());
    }
    {
        // recursive type using class member
        struct leaf {};
        struct node {
            node(int x, leaf l, leaf r) : x(x), l(_0, l), r(_0, r) {}
            node(int x, node l, leaf r) : x(x), l(_1, l), r(_0, r) {}
            node(int x, leaf l, node r) : x(x), l(_0, l), r(_1, r) {}
            node(int x, node l, node r) : x(x), l(_1, l), r(_1, r) {}
            int x;
            sum<leaf, rec_guard<node>> l; // rec_guard<T> prevent cyclic class definition.
            sum<leaf, rec_guard<node>> r;
        };
        node n(1,
               leaf{},
               node(2,
                    node(3,
                         leaf{},
                         leaf{}),
                    node(4,
                         node(5,
                              leaf{},
                              leaf{}),
                         leaf{})));
        auto g = ::fix(::tie(
            [] (auto, tag<0>, leaf) {
                return 0;
            }, [] (auto f, tag<1>, node const & n) -> int {
                return n.x + n.l.when(f) + n.r.when(f);
            }));
        assert(n.x + n.l.when(g) + n.r.when(g) == 15);
    }
    {
        // direct recursive type
        struct leaf {};
        using node = sum<leaf, std::tuple<int, _, _>>;
        auto make_leaf = [] () { return node(_0, leaf{}); };
        auto make_node = [] (int v, node l, node r) {
                return node(_1, std::make_tuple(v, std::move(l), std::move(r)));
            };
        auto n = make_node(1,
                           make_leaf(),
                           make_node(2,
                                     make_node(3,
                                               make_leaf(),
                                               make_leaf()),
                                     make_node(4,
                                               make_node(5,
                                                         make_leaf(),
                                                         make_leaf()),
                                               make_leaf())));
        auto g = ::fix(::tie(
            [] (auto, tag<0>, leaf) {
                return 0;
            }, [] (auto f, tag<1>, std::tuple<int, node, node> const & tup) -> int {
                return std::get<0>(tup) + std::get<1>(tup).when(f) + std::get<2>(tup).when(f);
            }));
        assert(n.when(g) == 15);
    }
    {
        // recursion with nest
        using u1 = sum<int, _>;
        using u2 = sum<_, u1, char>;
        static_assert(std::is_same<decltype(std::declval<u1&>().get(_1)), u1&>::value, "failed at recursion type 1");
        static_assert(std::is_same<decltype(std::declval<u2&>().get(_0)), u2&>::value, "failed at recursion type 2");
        u2 x = u2(_1, u1(_1, u1(_0, 42)));
        assert(x.get(_1).get(_1).get(_0) == 42);
    }
    {
        // fallback type in recursion type
        using u = sum<std::tuple<_>, char>;
        u x(_1, 'a');
        assert(x == x);
    }
    {
        // recursion with nested and outer placeholder
        using u = sum<sum<_, rec<1>, char>, int>;
        static_assert(std::is_same<decltype(std::declval<u&>().get(_0)), sum<_, u, char>&>::value, "failed at recursion with nested and outer placeholder 1");
        static_assert(std::is_same<decltype(std::declval<u&>().get(_0).get(_1)), u&>::value, "failed at recursion with nested and outer placeholder 2");
        u a(_1, 42);
        u b(_0, { _0, { _2, 'a' } });
        u c(_0, { _1, { _1, 42 } });
        u d(_0, { _2, 'a' });
        assert(a == c.get(_0).get(_1));
        assert(b.get(_0).get(_0) == d.get(_0));
        a = { _0, { _1, d } };
        assert(a.get(_0).get(_1).get(_0) == b.get(_0).get(_0));
    }
    {
        // implicit conversions
        struct unit {
            bool operator==(unit) const { return true; }
        };
        using ilist = sum<unit, std::tuple<int, _>>;
        using clist = sum<unit, std::tuple<char, _>>;

        ilist xs(_1, std::make_tuple(42, ilist(_0)));
        clist ys(_1, std::make_tuple(42, clist(_0)));
        assert(xs == ys);
    }
    {
        // recursion with non-type parameter using traits
        // (traits of std::array is already defined in this implementation)
        using ternary_tree = sum<int, std::array<_, 3>>;
        auto n = ternary_tree(_1, {{{_0, 1}, {_0, 2}, {_0, 3}}});
        n.when(::tie(
            [] (tag<0>, int) {
                assert(false);
            },
            [] (tag<1>, std::array<ternary_tree, 3> const & ar) {
                assert(ar[0].get(_0) == 1 && ar[1].get(_0) == 2 && ar[2].get(_0) == 3);
            }));
        // Following is also OK (same with above).
        n.when(
            [] (tag<0>, int) {
                assert(false);
            },
            [] (tag<1>, std::array<ternary_tree, 3> const & ar) {
                assert(ar[0].get(_0) == 1 && ar[1].get(_0) == 2 && ar[2].get(_0) == 3);
            });
    }
    {
        // recursion with non-type parameter (ad-hoc way)
        using type = type_fun<make_non_type_parameter_template<_, 2, int>>;
        using u = sum<rec_guard<type>, int>;
        // print<decltype(std::declval<u>().get(_0))>;
        u x(_1, 42);
        using expected = non_type_parameter_template<u, 2, int>;
        static_assert(std::is_same<decltype(std::declval<u>().get(_0)), expected &&>::value, "failed at recursion with non-type parameter (ad-hoc way)");
    }
    {
        // return type deduction of dispatch/when member function
        using u = sum<int, int, int, int>;
        struct hogera{};
        struct piyo{ piyo()=default; piyo(hogera){} };
        struct fuga{ fuga()=default; fuga(piyo){} };
        struct hoge{ hoge()=default; hoge(fuga){} };

        u x(_0, {});
        x.dispatch(::tie([] (tag<0>) {
            return hoge{};
        }, [] (tag<1>) {
            return fuga{};
        }, [] (tag<2>) {
            return piyo{};
        }, [] (tag<3>) {
            return hogera{};
        }));
    }
    {
        // extension
        using u = sum<int, int>;
        auto x = u(_0, 42);
        auto y = ::extend<tag<1>, char, tag<0>>(x);
        static_assert(std::is_same<decltype(y), sum<int, char, int>>::value, "failed at extension");
        assert(y.which() == 2 && y.get(_2) == 42);
        auto z = ::extend_right<short>(x);
        static_assert(std::is_same<decltype(z), sum<short, int, int>>::value, "failed at extension");
        assert(z.which() == 1 && z.get(_1) == 42);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
leaq 0x40(%rsp), %rdi
movl $0x1, (%rdi)
movabsq $0x4024000000000000, %r13 # imm = 0x4024000000000000
movq %r13, 0x8(%rdi)
callq 0x516e
movsd (%rax), %xmm0
ucomisd 0x4d91(%rip), %xmm0     # 0x8008
jne 0x334b
jp 0x334b
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4c18
movq %rsp, %rdi
callq 0x516e
movsd (%rax), %xmm0
ucomisd 0x4d64(%rip), %xmm0     # 0x8008
jne 0x3368
jp 0x3368
leaq 0x20(%rsp), %rsi
andl $0x0, (%rsi)
movl $0x5, 0x8(%rsi)
leaq 0x40(%rsp), %rdi
callq 0x527c
leaq 0x20(%rsp), %rdi
callq 0x4c26
leaq 0x40(%rsp), %rdi
callq 0x5792
cmpl $0x5, (%rax)
jne 0x3381
leaq 0x78(%rsp), %rsi
movb $0x0, (%rsi)
movl $0x2a, 0x4(%rsi)
leaq 0x20(%rsp), %rdi
callq 0x4c36
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x527c
leaq 0x20(%rsp), %rdi
callq 0x4c26
leaq 0x40(%rsp), %rdi
callq 0x57ea
movb $0x1, (%rax)
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4c46
leaq 0x4d32(%rip), %rdi      # 0x806b
leaq 0x4cf2(%rip), %rsi      # 0x8032
leaq 0x4cf8(%rip), %rcx      # 0x803f
pushq $0x4f
jmp 0x3362
leaq 0x4cce(%rip), %rdi      # 0x8020
leaq 0x4cd9(%rip), %rsi      # 0x8032
leaq 0x4cdf(%rip), %rcx      # 0x803f
pushq $0x46
popq %rdx
callq 0x3090
leaq 0x4cdb(%rip), %rdi      # 0x804a
leaq 0x4cbc(%rip), %rsi      # 0x8032
leaq 0x4cc2(%rip), %rcx      # 0x803f
pushq $0x48
jmp 0x3362
leaq 0x4cd4(%rip), %rdi      # 0x805c
leaq 0x4ca3(%rip), %rsi      # 0x8032
leaq 0x4ca9(%rip), %rcx      # 0x803f
pushq $0x4a
jmp 0x3362
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x44c5
movq %rbx, %rdi
callq 0x3050
movq %rsp, %rdi
callq 0x516e
movsd (%rax), %xmm0
ucomisd 0x4c42(%rip), %xmm0     # 0x8008
jne 0x349c
jp 0x349c
callq 0x3110
leaq 0x40(%rsp), %rdi
callq 0x57ea
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x78(%rsp), %rsi
movb %cl, (%rsi)
movl $0x18, 0x4(%rsi)
leaq 0x20(%rsp), %rdi
callq 0x4c54
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x527c
leaq 0x20(%rsp), %rdi
callq 0x4c26
leaq 0x40(%rsp), %rdi
callq 0x5d9c
cmpl $0x18, 0x4(%rax)
jne 0x34b8
leaq 0x78(%rsp), %rsi
movb $0x0, (%rsi)
movl $0x24, 0x4(%rsi)
leaq 0x20(%rsp), %rdi
callq 0x4c36
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x527c
leaq 0x20(%rsp), %rdi
callq 0x4c26
movq %rsp, %rdi
callq 0x57ea
cmpl $0x24, 0x4(%rax)
jne 0x34d4
movq %rsp, %rdi
callq 0x57ea
movb $0x1, (%rax)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4c46
leaq 0x4be4(%rip), %rdi      # 0x806b
leaq 0x4ba4(%rip), %rsi      # 0x8032
leaq 0x4baa(%rip), %rcx      # 0x803f
pushq $0x5b
jmp 0x3362
leaq 0x4ba7(%rip), %rdi      # 0x804a
leaq 0x4b88(%rip), %rsi      # 0x8032
leaq 0x4b8e(%rip), %rcx      # 0x803f
pushq $0x51
jmp 0x3362
leaq 0x4bb2(%rip), %rdi      # 0x8071
leaq 0x4b6c(%rip), %rsi      # 0x8032
leaq 0x4b72(%rip), %rcx      # 0x803f
pushq $0x55
jmp 0x3362
leaq 0x4ba8(%rip), %rdi      # 0x8083
leaq 0x4b50(%rip), %rsi      # 0x8032
leaq 0x4b56(%rip), %rcx      # 0x803f
pushq $0x58
jmp 0x3362
jmp 0x3504
movq %rdx, %r15
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4c26
jmp 0x350a
movq %rdx, %r15
movq %rax, %rbx
cmpl %r14d, %r15d
jne 0x44c5
movq %rbx, %rdi
callq 0x3050
leaq 0x40(%rsp), %rdi
callq 0x5792
cmpl $0x0, (%rax)
jne 0x35a8
callq 0x3110
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x4c26
leaq 0x40(%rsp), %rdi
callq 0x4c26
xorl %ebp, %ebp
movb %bpl, (%rbx)
movl $0x2a, 0x4(%rbx)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4c64
leaq 0x20(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x18, 0x4(%rsi)
movq %rsp, %rdi
callq 0x4c70
movq %rsp, %rdi
callq 0x5e56
movb $0x1, (%rax)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4c80
leaq 0x4ad8(%rip), %rdi      # 0x806b
leaq 0x4a98(%rip), %rsi      # 0x8032
leaq 0x4a9e(%rip), %rcx      # 0x803f
pushq $0x67
jmp 0x3362
leaq 0x4ae6(%rip), %rdi      # 0x8095
leaq 0x4a7c(%rip), %rsi      # 0x8032
leaq 0x4a82(%rip), %rcx      # 0x803f
pushq $0x5d
jmp 0x3362
movq %rax, %rbx
cmpl %r14d, %edx
jne 0x4486
movq %rbx, %rdi
callq 0x3050
leaq 0x40(%rsp), %rdi
callq 0x63f0
cmpl $0x2a, 0x4(%rax)
jne 0x36fd
callq 0x3110
movq %rsp, %rdi
callq 0x4c8e
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4c8e
movabsq $0x2a00000000, %r12     # imm = 0x2A00000000
movq %r12, (%rbx)
leaq 0x20(%rsp), %rsi
movb $0x0, (%rsi)
movl $0x2a, 0x4(%rsi)
movq %rsp, %rdi
callq 0x4c9e
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4cad
testb %al, %al
je 0x3719
leaq 0x78(%rsp), %rsi
movb $0x0, (%rsi)
movl $0x2a, 0x4(%rsi)
leaq 0x20(%rsp), %rdi
callq 0x4c9e
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x6474
leaq 0x20(%rsp), %rdi
callq 0x4cb8
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4cc8
testb %al, %al
je 0x3735
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x4cb8
leaq 0x40(%rsp), %rdi
callq 0x4cb8
xorl %ebp, %ebp
movb %bpl, (%rbx)
pushq $0x2a
popq %r15
movl %r15d, 0x4(%rbx)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4c64
leaq 0x20(%rsp), %rsi
movb %bpl, (%rsi)
movl %r15d, 0x4(%rsi)
movq %rsp, %rdi
callq 0x4c70
movq %rsp, %rdi
callq 0x5e56
movb $0x1, (%rax)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4c80
leaq 0x4983(%rip), %rdi      # 0x806b
leaq 0x4943(%rip), %rsi      # 0x8032
leaq 0x4949(%rip), %rcx      # 0x803f
pushq $0x7b
jmp 0x3362
leaq 0x49a0(%rip), %rdi      # 0x80a4
leaq 0x4927(%rip), %rsi      # 0x8032
leaq 0x492d(%rip), %rcx      # 0x803f
pushq $0x69
jmp 0x3362
leaq 0x4996(%rip), %rdi      # 0x80b6
leaq 0x490b(%rip), %rsi      # 0x8032
leaq 0x4911(%rip), %rcx      # 0x803f
pushq $0x70
jmp 0x3362
leaq 0x4981(%rip), %rdi      # 0x80bd
leaq 0x48ef(%rip), %rsi      # 0x8032
leaq 0x48f5(%rip), %rcx      # 0x803f
pushq $0x72
jmp 0x3362
movq %rax, %rbx
cmpl %r14d, %edx
jne 0x4486
movq %rbx, %rdi
callq 0x3050
leaq 0x40(%rsp), %rdi
callq 0x63f0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5e56
movl 0x4(%rbx), %ecx
cmpl 0x4(%rax), %ecx
jne 0x3fc0
callq 0x3110
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x4c8e
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x4c8e
andl $0x0, (%r14)
movl $0x2a, 0x8(%r14)
movl $0x1, (%rbx)
movq %r13, 0x8(%rbx)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4d00
testb %al, %al
je 0x3fdc
movq %rsp, %rdi
callq 0x4d3a
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4d3a
andl $0x0, (%rbx)
movl $0xa, 0x8(%rbx)
movabsq $0x200000001, %r14      # imm = 0x200000001
leaq 0x78(%rsp), %rsi
movq %r14, (%rsi)
movl $0x3, 0x8(%rsi)
leaq 0x20(%rsp), %rdi
pushq $0x3
popq %rdx
leaq 0x88(%rsp), %rcx
callq 0x4d4a
movq %rsp, %rbx
movl $0x1, (%rbx)
leaq 0x20(%rsp), %rdi
movapd (%rdi), %xmm0
movupd %xmm0, 0x8(%rbx)
movq 0x10(%rdi), %rax
movq %rax, 0x18(%rbx)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x6864
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x68ee
leaq 0x40(%rsp), %rdi
callq 0x6c9c
leaq 0x2c(%rsp), %rcx
movq %r14, -0xc(%rcx)
movl $0x3, -0x4(%rcx)
movq (%rax), %rdi
movq 0x8(%rax), %rsi
leaq 0x20(%rsp), %rdx
callq 0x4f9a
testb %al, %al
je 0x3ffb
movq %rsp, %rdi
callq 0x6c9c
movq (%rax), %rcx
cmpq 0x8(%rax), %rcx
jne 0x401a
movq %rsp, %rdi
callq 0x4d80
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x4d80
movl $0x3, 0x148(%rsp)
andl $0x0, 0x150(%rsp)
andl $0x0, 0x160(%rsp)
leaq 0x1c0(%rsp), %rsi
movl $0x5, (%rsi)
andl $0x0, 0x8(%rsi)
andl $0x0, 0x18(%rsi)
leaq 0x178(%rsp), %rdi
movl $0x4, -0x8(%rdi)
callq 0x466e
andl $0x0, 0x188(%rsp)
leaq 0x1a0(%rsp), %r15
movl $0x2, -0x8(%r15)
leaq 0x148(%rsp), %rsi
movq %r15, %rdi
callq 0x466e
leaq 0x1b0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x466e
leaq 0x48(%rsp), %r15
movl $0x1, -0x8(%r15)
andl $0x0, (%r15)
leaq 0x58(%rsp), %rbx
leaq 0x198(%rsp), %rsi
movq %rbx, %rdi
callq 0x466e
leaq 0x198(%rsp), %rdi
callq 0x44e6
leaq 0x170(%rsp), %rdi
callq 0x44e6
leaq 0x1c0(%rsp), %rdi
callq 0x44e6
leaq 0x148(%rsp), %rdi
callq 0x44e6
movl 0x40(%rsp), %r13d
movl 0x48(%rsp), %eax
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x77(%rsp), %rcx
movq %rcx, 0x8(%rdi)
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0xacfa(%rip), %r15      # 0xe6b0
callq *(%r15,%rax,8)
movl %eax, %ebp
movq %rsp, %rdi
movq %rbx, (%rdi)
leaq 0x76(%rsp), %rax
movq %rax, 0x8(%rdi)
movl 0x58(%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
callq *(%r15,%rax,8)
addl %r13d, %ebp
addl %eax, %ebp
cmpl $0xf, %ebp
jne 0x4039
leaq 0x40(%rsp), %rdi
callq 0x44e6
andl $0x0, 0xe8(%rsp)
leaq 0x138(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x128(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0xc8(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4500
leaq 0x118(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x108(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0xa8(%rsp), %rdi
pushq $0x5
popq %rsi
callq 0x4500
leaq 0xf8(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0xb8(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0xa8(%rsp), %rdx
callq 0x4500
leaq 0xd8(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0xc8(%rsp), %rdx
leaq 0xb8(%rsp), %rcx
callq 0x4500
movq %rsp, %r14
pushq $0x1
popq %rsi
leaq 0xe8(%rsp), %rdx
leaq 0xd8(%rsp), %rcx
movq %r14, %rdi
callq 0x4500
leaq 0xd8(%rsp), %rdi
callq 0x457a
leaq 0xb8(%rsp), %rdi
callq 0x457a
leaq 0xf8(%rsp), %rdi
callq 0x457a
leaq 0xa8(%rsp), %rdi
callq 0x457a
leaq 0x108(%rsp), %rdi
callq 0x457a
leaq 0x118(%rsp), %rdi
callq 0x457a
leaq 0xc8(%rsp), %rdi
callq 0x457a
leaq 0x128(%rsp), %rdi
callq 0x457a
leaq 0x138(%rsp), %rdi
callq 0x457a
leaq 0xe8(%rsp), %rdi
callq 0x457a
leaq 0x40(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x75(%rsp), %rax
movq %rax, 0x8(%rdi)
movl (%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0xab99(%rip), %rcx      # 0xe6e0
callq *(%rcx,%rax,8)
cmpl $0xf, %eax
jne 0x4058
movq %rsp, %rdi
callq 0x457a
leaq 0x20(%rsp), %rsi
andl $0x0, (%rsi)
movl $0x2a, 0x8(%rsi)
movq %rsp, %rdi
callq 0x4d90
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x4da0
movq %rsp, %rdi
callq 0x4db0
leaq 0x20(%rsp), %rdi
callq 0x4db0
leaq 0x40(%rsp), %rdi
callq 0x6e4e
movq %rax, %rdi
callq 0x4dc0
movq %rax, %rdi
callq 0x6f06
cmpl $0x2a, (%rax)
jne 0x4077
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4dcc
movl $0x1, (%rbx)
movb $0x61, 0x8(%rbx)
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
callq 0x4ddc
testb %al, %al
je 0x4096
leaq 0x40(%rsp), %rdi
callq 0x4e14
movl $0x1, 0x20(%rsp)
movl $0x2a, 0x28(%rsp)
movq %rsp, %rsi
movl $0x2, (%rsi)
movb $0x61, 0x8(%rsi)
leaq 0x40(%rsp), %rdi
callq 0x4e24
leaq 0x78(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4e30
leaq 0x40(%rsp), %rdi
callq 0x4e3c
movq %rsp, %rdi
callq 0x4e3c
leaq 0x88(%rsp), %rsi
movl $0x1, (%rsi)
movl $0x2a, 0x8(%rsi)
leaq 0x40(%rsp), %rdi
callq 0x4e4c
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4e30
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4e3c
leaq 0x88(%rsp), %rdi
callq 0x4e5c
movl $0x2, (%rbx)
movb $0x61, 0x8(%rbx)
leaq 0x88(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4e30
leaq 0x40(%rsp), %rdi
callq 0x4e3c
movq %rsp, %rdi
callq 0x4ea4
movq %rax, %rdi
callq 0x71ec
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x4e6c
testb %al, %al
je 0x40b5
leaq 0x78(%rsp), %rdi
callq 0x4ea4
movq %rax, %rdi
callq 0x4ee8
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4ea4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4eaf
testb %al, %al
je 0x40d4
leaq 0x40(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x4ef4
leaq 0x98(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4e30
leaq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x743c
leaq 0x98(%rsp), %rdi
callq 0x4e5c
leaq 0x40(%rsp), %rdi
callq 0x4e3c
leaq 0x20(%rsp), %rdi
callq 0x4ea4
movq %rax, %rdi
callq 0x71ec
movq %rax, %rdi
callq 0x4ea4
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x4ea4
movq %rax, %rdi
callq 0x4ee8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4eaf
testb %al, %al
je 0x40f3
leaq 0x88(%rsp), %rdi
callq 0x4e5c
movq %rsp, %rdi
callq 0x4e5c
leaq 0x78(%rsp), %rdi
callq 0x4e5c
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x4e5c
andl $0x0, (%rbx)
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x4988
leaq 0x40(%rsp), %rsi
movl $0x2a, 0x10(%rsi)
movq %rsp, %rdi
movl $0x1, (%rdi)
callq 0x49ce
leaq 0x40(%rsp), %rdi
callq 0x45a0
leaq 0x20(%rsp), %rdi
callq 0x45a0
leaq 0x78(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x4a18
movl $0x2a, 0x50(%rsp)
movl $0x1, 0x20(%rsp)
pushq $0x18
popq %rdi
callq 0x30c0
movq %rax, %r14
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x4a18
leaq 0x40(%rsp), %rdi
movb 0x10(%rdi), %al
movb %al, 0x10(%r14)
leaq 0x20(%rsp), %rbx
movq %r14, 0x8(%rbx)
callq 0x45c6
leaq 0x78(%rsp), %rdi
callq 0x45c6
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x45ec
testb %al, %al
je 0x4112
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x45c6
movq %rsp, %rdi
callq 0x45a0
leaq 0x40(%rsp), %rsi
andl $0x0, (%rsi)
movl $0x1, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
movl $0x2, 0x18(%rsi)
andl $0x0, 0x20(%rsi)
movl $0x3, 0x28(%rsi)
movq %rsp, %r14
movq %r14, %rdi
callq 0x4f04
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x4f14
movq %r14, (%r15)
leaq 0x74(%rsp), %rax
movq %rax, 0x8(%r15)
movl (%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0xa84f(%rip), %rcx      # 0xe720
leaq 0x40(%rsp), %rdi
callq *(%rcx,%rax,8)
leaq 0x40(%rsp), %rdi
movq %r14, (%rdi)
movq %rbx, 0x8(%rdi)
movl (%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0xa83c(%rip), %rcx      # 0xe730
callq *(%rcx,%rax,8)
movq %rsp, %rdi
callq 0x4f3a
leaq 0x40(%rsp), %rbx
movl $0x1, (%rbx)
movl $0x2a, 0x8(%rbx)
movq %rbx, %rdi
callq 0x4f4a
andq $0x0, (%rbx)
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4f5a
movq %r12, (%rbx)
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x508c
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl (%rsp), %eax
cmpl $0x2, %eax
jne 0x4131
movq %rsp, %rdi
callq 0x7d16
cmpl $0x2a, (%rax)
jne 0x4131
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x50e8
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl 0x20(%rsp), %eax
cmpl $0x1, %eax
jne 0x4150
leaq 0x20(%rsp), %rdi
callq 0x7d96
cmpl $0x2a, (%rax)
jne 0x4150
leaq 0x20(%rsp), %rdi
callq 0x4f6a
movq %rsp, %rdi
callq 0x4f7a
leaq 0x40(%rsp), %rdi
callq 0x4f8a
xorl %eax, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40fd(%rip), %rdi      # 0x80c4
leaq 0x4064(%rip), %rsi      # 0x8032
leaq 0x406a(%rip), %rcx      # 0x803f
pushq $0x7d
jmp 0x3362
leaq 0x40f8(%rip), %rdi      # 0x80db
leaq 0x4048(%rip), %rsi      # 0x8032
leaq 0x404e(%rip), %rcx      # 0x803f
movl $0x84, %edx
callq 0x3090
leaq 0x40df(%rip), %rdi      # 0x80e1
leaq 0x4029(%rip), %rsi      # 0x8032
leaq 0x402f(%rip), %rcx      # 0x803f
movl $0x8d, %edx
callq 0x3090
leaq 0x40f7(%rip), %rdi      # 0x8118
leaq 0x400a(%rip), %rsi      # 0x8032
leaq 0x4010(%rip), %rcx      # 0x803f
movl $0x8f, %edx
callq 0x3090
leaq 0x40e3(%rip), %rdi      # 0x8123
leaq 0x3feb(%rip), %rsi      # 0x8032
leaq 0x3ff1(%rip), %rcx      # 0x803f
movl $0xae, %edx
callq 0x3090
leaq 0x40ea(%rip), %rdi      # 0x8149
leaq 0x3fcc(%rip), %rsi      # 0x8032
leaq 0x3fd2(%rip), %rcx      # 0x803f
movl $0xc9, %edx
callq 0x3090
leaq 0x40db(%rip), %rdi      # 0x8159
leaq 0x3fad(%rip), %rsi      # 0x8032
leaq 0x3fb3(%rip), %rcx      # 0x803f
movl $0xd2, %edx
callq 0x3090
leaq 0x40dc(%rip), %rdi      # 0x8179
leaq 0x3f8e(%rip), %rsi      # 0x8032
leaq 0x3f94(%rip), %rcx      # 0x803f
movl $0xd8, %edx
callq 0x3090
leaq 0x40c4(%rip), %rdi      # 0x8180
leaq 0x3f6f(%rip), %rsi      # 0x8032
leaq 0x3f75(%rip), %rcx      # 0x803f
movl $0xe3, %edx
callq 0x3090
leaq 0x40bc(%rip), %rdi      # 0x8197
leaq 0x3f50(%rip), %rsi      # 0x8032
leaq 0x3f56(%rip), %rcx      # 0x803f
movl $0xe4, %edx
callq 0x3090
leaq 0x40bc(%rip), %rdi      # 0x81b6
leaq 0x3f31(%rip), %rsi      # 0x8032
leaq 0x3f37(%rip), %rcx      # 0x803f
movl $0xe6, %edx
callq 0x3090
leaq 0x40cc(%rip), %rdi      # 0x81e5
leaq 0x3f12(%rip), %rsi      # 0x8032
leaq 0x3f18(%rip), %rcx      # 0x803f
movl $0xf2, %edx
callq 0x3090
leaq 0x40b6(%rip), %rdi      # 0x81ee
leaq 0x3ef3(%rip), %rsi      # 0x8032
leaq 0x3ef9(%rip), %rcx      # 0x803f
movl $0x12b, %edx            # imm = 0x12B
callq 0x3090
leaq 0x40b9(%rip), %rdi      # 0x8210
leaq 0x3ed4(%rip), %rsi      # 0x8032
leaq 0x3eda(%rip), %rcx      # 0x803f
movl $0x12e, %edx            # imm = 0x12E
callq 0x3090
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4f6a
jmp 0x4183
jmp 0x4180
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4f7a
jmp 0x4190
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4f8a
jmp 0x44de
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4f3a
jmp 0x44de
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4f14
jmp 0x44de
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x41f2
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x30d0
jmp 0x41de
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x45c6
jmp 0x41ed
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x45c6
movq %rsp, %rdi
jmp 0x4213
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x45a0
jmp 0x420e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x45a0
jmp 0x44de
jmp 0x4240
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4e5c
jmp 0x4234
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4e3c
jmp 0x4243
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4e5c
jmp 0x425f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4e3c
movq %rsp, %rdi
jmp 0x427e
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4e3c
jmp 0x4276
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4e5c
leaq 0x78(%rsp), %rdi
callq 0x4e5c
jmp 0x42a9
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4e3c
jmp 0x42a1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4e3c
leaq 0x20(%rsp), %rdi
callq 0x4e5c
jmp 0x44de
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4e14
jmp 0x44de
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4dcc
jmp 0x44de
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4db0
jmp 0x42ec
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4db0
jmp 0x44de
movq %rax, %rbx
jmp 0x4397
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x457a
jmp 0x4318
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x457a
jmp 0x432a
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x457a
leaq 0xa8(%rsp), %rdi
callq 0x457a
jmp 0x4349
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x457a
leaq 0x118(%rsp), %rdi
callq 0x457a
leaq 0xc8(%rsp), %rdi
callq 0x457a
jmp 0x4375
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x457a
leaq 0x138(%rsp), %rdi
callq 0x457a
leaq 0xe8(%rsp), %r14
movq %r14, %rdi
callq 0x457a
jmp 0x44de
movq %rax, %rbx
jmp 0x43fa
movq %rax, %rbx
movq %r15, %rdi
callq 0x4624
leaq 0x198(%rsp), %rdi
callq 0x44e6
jmp 0x43d3
movq %rax, %rbx
movq %r15, %rdi
callq 0x4624
jmp 0x43d3
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x44e6
jmp 0x43e5
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x44e6
leaq 0x148(%rsp), %r14
movq %r14, %rdi
callq 0x44e6
jmp 0x44de
jmp 0x440d
jmp 0x440d
jmp 0x440d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4d80
jmp 0x441d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4d80
jmp 0x44de
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4d3a
leaq 0x40(%rsp), %rdi
callq 0x4d3a
jmp 0x44de
jmp 0x4479
jmp 0x4483
jmp 0x4490
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4cb8
jmp 0x4460
jmp 0x445d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4cb8
jmp 0x446d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4cb8
jmp 0x44de
movq %rax, %rbx
callq 0x3110
jmp 0x4486
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4c8e
jmp 0x4493
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4c8e
jmp 0x44de
jmp 0x44a5
jmp 0x44b3
jmp 0x44c2
movq %rax, %rbx
callq 0x3110
jmp 0x44c5
jmp 0x44b3
jmp 0x44c2
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4c26
jmp 0x44c5
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4c26
jmp 0x44d4
jmp 0x44d1
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4c26
movq %rbx, %rdi
callq 0x3130