// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/simple_type.cpp
// Function: simty::simple_typing[abi:cxx11](ast::expr_t const&, environment_t<simty::type_t> const&)
result_t simple_typing(ast::expr_t const& expr, type_env_t const& env) {
    using namespace ast;
    switch (expr.kind()) {
    case expr_kind_t::LetFun: {
        auto const& letfun = cast<letfun_expr_t>(expr);
        auto const& simty = type_t::from(letfun.type);
        auto const& fun_simty = cast<fun_type_t>(*simty);
        auto init_env = env.append(letfun.name, simty);
        for (size_t i=0; i<fun_simty.args.size(); ++i)
            init_env = init_env.append(letfun.type.args[i].name, fun_simty.args[i]);
        auto init_typing_result = simple_typing(*letfun.init, init_env);
        if (init_typing_result.is_error())
            return init_typing_result;
        auto body_env = env.append(letfun.name, simty);
        return simple_typing(*letfun.body, body_env);
        }
    case expr_kind_t::App: {
        auto const& f_typing_result = simple_typing(*cast<app_expr_t>(expr).f, env);
        if (f_typing_result.is_error())
            return f_typing_result;
        auto const& fun_ty = cast<fun_type_t>(*f_typing_result.ok());
        auto const& args = cast<app_expr_t>(expr).args;
        if (fun_ty.args.size() != args.size()) {
            return result_t::error(format(
                        "not match numbers of parameters and arguments (param {} vs arg {}) in \"{}\"",
                        fun_ty.args.size(), args.size(), to_debug_string(expr)));
        }
        for (size_t i=0; i<args.size(); ++i) {
            auto arg_ty_result = simple_typing(*args[i], env);
            if (arg_ty_result.is_error())
                return arg_ty_result;
            if (*arg_ty_result.ok() != *fun_ty.args[i]) {
                return result_t::error(format(
                        "not match {}th parameter and arguments ({} vs {}) in \"{}\"",
                        to_debug_string(*arg_ty_result.ok()), to_debug_string(*fun_ty.args[i]),
                        to_debug_string(expr)));
            }
        }
        return fun_ty.ret;
        }
    case expr_kind_t::Fun:
        // do not appear in syntax
        throw std::logic_error{"fun expr can not appear"};
    case expr_kind_t::Let: {
            auto init_result = simple_typing(*cast<let_expr_t>(expr).init, env);
            if (init_result.is_error())
                return init_result;
            auto new_env = env.append(cast<let_expr_t>(expr).name, init_result.ok());
            return simple_typing(*cast<let_expr_t>(expr).body, new_env);
        }
    case expr_kind_t::If: {
        auto const& cond_result = simple_typing(*cast<if_expr_t>(expr).cond_expr, env);
        auto const& tr_result = simple_typing(*cast<if_expr_t>(expr).true_expr, env);
        auto const& fl_result = simple_typing(*cast<if_expr_t>(expr).false_expr, env);
        auto sub_result = cond_result && tr_result && fl_result;
        if (sub_result.is_error())
            return sub_result;
        if (*cond_result.ok() != simty::bool_type_t{})
            return result_t::error(format("condition of if expr must be boolean in \"{}\"", to_debug_string(expr)));
        if (*tr_result.ok() != *fl_result.ok())
            return result_t::error(format("not match types of branches of if expr in \"{}\"", to_debug_string(expr)));
        return tr_result;
        }
    case expr_kind_t::Rand:
        return result_t::ok(make<simty::int_type_t>());
    case expr_kind_t::Typed: {
        auto const& inner = *cast<typed_expr_t>(expr).expr;
        auto const& expr_ty_result = simple_typing(inner, env);
        if (expr_ty_result.is_error())
            return expr_ty_result;
        auto const& ty = type_t::from(cast<typed_expr_t>(expr).type);
        if (*expr_ty_result.ok() == *ty)
            return expr_ty_result;
        else
            return result_t::error(format("{} has simple type {}, but expected {}",
                        to_debug_string(inner),
                        to_debug_string(*expr_ty_result.ok()), to_debug_string(*ty)));
        }
    case expr_kind_t::Add:
    case expr_kind_t::Sub:
    case expr_kind_t::Mul:
    case expr_kind_t::Div: {
        auto const& lhs_result = simple_typing(*cast<binop_expr_t>(expr).lhs, env);
        auto const& rhs_result = simple_typing(*cast<binop_expr_t>(expr).rhs, env);
        auto const& sub_result = lhs_result && rhs_result;
        if (sub_result.is_error())
            return sub_result;
        if (*lhs_result.ok() != simty::int_type_t{} || *rhs_result.ok() != simty::int_type_t{}) {
            return result_t::error(format(
                    "can not apply arithmetic binary operation to non-integer expression in {}",
                    to_debug_string(expr)));
        }
        return result_t::ok(make<simty::int_type_t>());
        }
    case expr_kind_t::Neg: {
        auto const& inner_result = simple_typing(*cast<neg_expr_t>(expr).inner, env);
        if (inner_result.is_error())
            return inner_result;
        if (*inner_result.ok() != simty::bool_type_t{}) {
            return result_t::error(format(
                    "can not apply negation operator to non-boolean expression in {}",
                    to_debug_string(expr)));
        }
        return result_t::ok(make<simty::bool_type_t>());
        }
    case expr_kind_t::Eq:
    case expr_kind_t::Neq:
    case expr_kind_t::Leq:
    case expr_kind_t::Geq: {
        auto const& lhs_result = simple_typing(*cast<binop_expr_t>(expr).lhs, env);
        auto const& rhs_result = simple_typing(*cast<binop_expr_t>(expr).rhs, env);
        auto sub_result = lhs_result && rhs_result;
        if (sub_result.is_error())
            return sub_result;
        if (*lhs_result.ok() != simty::int_type_t{} || *rhs_result.ok() != simty::int_type_t{}) {
            return result_t::error(format(
                    "can not apply comparison operation to non-boolean expression in {}",
                    to_debug_string(expr)));
        }
        return result_t::ok(make<simty::bool_type_t>());
        }
    case expr_kind_t::And:
    case expr_kind_t::Or: {
        auto const& lhs_result = simple_typing(*cast<binop_expr_t>(expr).lhs, env);
        auto const& rhs_result = simple_typing(*cast<binop_expr_t>(expr).rhs, env);
        auto const& sub_result = lhs_result && rhs_result;
        if (sub_result.is_error())
            return sub_result;
        if (*lhs_result.ok() != simty::bool_type_t{} || *rhs_result.ok() != simty::bool_type_t{}) {
            return result_t::error(format(
                        "can not apply logical binary operation to non-boolean expression in {}",
                        to_debug_string(expr)));
        }
        return result_t::ok(make<simty::bool_type_t>());
        }
    case expr_kind_t::Int:
        return result_t::ok(make<simty::int_type_t>());
    case expr_kind_t::Bool:
        return result_t::ok(make<simty::bool_type_t>());
    case expr_kind_t::Var:
        return result_t::ok(env.lookup(cast<var_expr_t>(expr).name));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
movl %eax, %eax
leaq 0x19a3a(%rip), %rcx     # 0x3a030
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x222b2
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
movq %r14, %rdi
callq 0x222b2
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
leaq 0xc0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2200f
cmpb $0x0, 0xe0(%rsp)
je 0x20932
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x3aee6(%rip), %rbx     # 0x5b550
leaq 0x98(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x21ab1
testb %al, %al
jne 0x206a0
leaq 0x10(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x70(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x21ab1
testb %al, %al
je 0x20f7d
leaq 0x19afd(%rip), %rsi     # 0x3a1a4
leaq 0x70(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0xeb2e
leaq 0xf8(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x2203e
leaq 0x98(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
jmp 0x208e5
movq %r14, %rdi
callq 0x222b2
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
movq %r14, %rdi
callq 0x222b2
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
leaq 0xc0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2200f
cmpb $0x0, 0xe0(%rsp)
je 0x2091d
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x3aded(%rip), %rbx     # 0x5b550
leaq 0x98(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x21ab1
testb %al, %al
jne 0x20799
leaq 0x10(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x70(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x21ab1
testb %al, %al
je 0x20f6e
leaq 0x19a8e(%rip), %rsi     # 0x3a22e
leaq 0x70(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0xeb2e
leaq 0xf8(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x2203e
leaq 0x98(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
jmp 0x208e5
movq %r14, %rdi
callq 0x222b2
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
movq %r14, %rdi
callq 0x222b2
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
leaq 0xc0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2200f
cmpb $0x0, 0xe0(%rsp)
je 0x20e80
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x3acb4(%rip), %rbx     # 0x5b510
leaq 0x98(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x21ab1
testb %al, %al
jne 0x20892
leaq 0x10(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x70(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x21ab1
testb %al, %al
je 0x2118f
leaq 0x199d8(%rip), %rsi     # 0x3a271
leaq 0x70(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0xeb2e
leaq 0xf8(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x2203e
leaq 0x98(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
leaq 0x98(%rsp), %rdi
callq 0x9130
leaq 0xf8(%rsp), %rdi
callq 0x9130
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x2128e
leaq 0x10(%rsp), %rdi
callq 0x224d6
jmp 0x20a0e
leaq 0xc0(%rsp), %rsi
movq %r15, %rdi
callq 0x223ac
jmp 0x2128e
leaq 0xc0(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
jmp 0x2128e
leaq 0x3912a(%rip), %rsi     # 0x59a78
leaq 0x392db(%rip), %rdx     # 0x59c30
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9330
testq %rax, %rax
je 0x213c3
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x205cb
cmpb $0x0, 0x20(%rbx)
je 0x20f47
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x3ab76(%rip), %rax     # 0x5b510
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
callq 0x21ab1
testb %al, %al
je 0x20fbf
leaq 0x19838(%rip), %rsi     # 0x3a1ee
leaq 0xc0(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0xeb2e
leaq 0x98(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x2203e
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
jmp 0x21090
leaq 0x10(%rsp), %rdi
callq 0x22627
leaq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rbx
andq $0x0, (%rdi)
movb $0x1, 0x20(%r15)
movaps -0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%rbx)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0xa248
movq %rbx, %rdi
jmp 0x20fb5
movq %r14, %rdi
callq 0x21fed
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
movq %r14, %rdi
callq 0x21fed
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
movq %r14, %rdi
callq 0x21fed
movq 0x28(%rax), %rsi
leaq 0xc0(%rsp), %rdi
movq %rbp, %rdx
callq 0x205cb
leaq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2200f
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x2200f
leaq 0x70(%rsp), %rdi
callq 0x13c86
cmpb $0x0, 0xb8(%rsp)
je 0x20f59
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
leaq 0x3aa26(%rip), %rax     # 0x5b510
leaq 0x70(%rsp), %rsi
movq %rax, (%rsi)
callq 0x21ab1
testb %al, %al
je 0x211d5
leaq 0x1961b(%rip), %rsi     # 0x3a121
leaq 0xf8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xeb2e
leaq 0x118(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x70(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x2203e
leaq 0x70(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
jmp 0x2124e
movq %r14, %rdi
callq 0x21705
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x205cb
cmpb $0x0, 0x20(%rbx)
je 0x20f11
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
callq 0x216e3
movq %rax, 0xf0(%rsp)
movq %r14, %rdi
callq 0x21705
movq %rax, %r13
movq 0xf0(%rsp), %rax
movq 0x10(%rax), %rdx
subq 0x8(%rax), %rdx
movq 0x18(%r13), %rax
movq 0x20(%r13), %rcx
movq %rcx, %rsi
subq %rax, %rsi
cmpq %rsi, %rdx
jne 0x21003
movq %rbp, 0x138(%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %rbp
xorl %r12d, %r12d
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r12
jae 0x212c4
movq (%rax,%rbx), %rsi
movq %rbp, %rdi
movq 0x138(%rsp), %rdx
callq 0x205cb
cmpb $0x0, 0x30(%rsp)
je 0x212da
movq %rbp, %rdi
callq 0x223e4
movq (%rax), %rdi
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%rbx), %rsi
callq 0x21ab1
testb %al, %al
jne 0x212e9
movq %rbp, %rdi
callq 0x13c86
incq %r12
movq 0x18(%r13), %rax
movq 0x20(%r13), %rcx
addq $0x10, %rbx
jmp 0x20bd8
movq %r14, %rdi
callq 0x21fcb
movq 0x28(%rax), %rsi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x205cb
cmpb $0x0, 0x20(%rbx)
je 0x20f23
movq %r14, %rdi
callq 0x21fcb
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x223e4
addq $0x8, %rbx
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x22336
movq %r14, %rdi
callq 0x21fcb
movq 0x38(%rax), %rsi
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x205cb
leaq 0x10(%rsp), %rdi
callq 0x22c8c
jmp 0x212a5
movq %rbp, 0x138(%rsp)
leaq 0x38da7(%rip), %rsi     # 0x59a78
leaq 0x38e80(%rip), %rdx     # 0x59b58
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9330
testq %rax, %rax
je 0x213c3
movq %rax, %r14
leaq 0x28(%rax), %rsi
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0xf0(%rsp)
callq 0x204d0
movq (%rbx), %rdi
callq 0x216e3
movq %rax, %rbp
movq %r15, 0x148(%rsp)
movq %r14, 0x150(%rsp)
leaq 0x8(%r14), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rcx
movq 0x138(%rsp), %rsi
movq %rdx, 0x140(%rsp)
callq 0x22336
xorl %r14d, %r14d
leaq 0x40(%rsp), %r12
leaq 0x10(%rsp), %rbx
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x8(%rbp), %rcx
movq 0x10(%rbp), %rax
subq %rcx, %rax
sarq $0x4, %rax
cmpq %rax, %r13
jae 0x20e95
movq 0xf0(%rsp), %rax
movq (%rax), %rdx
addq %r14, %rdx
addq %r15, %rcx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x22336
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22ade
movq %r12, %rdi
callq 0x22c8c
incq %r13
addq $0x10, %r15
addq $0x38, %r14
jmp 0x20d5e
movq %r14, %rdi
callq 0x221f5
movq 0x8(%rax), %r12
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x205cb
cmpb $0x0, 0x20(%rbx)
je 0x20f35
movq %r14, %rdi
callq 0x221f5
addq $0x18, %rax
leaq 0x118(%rsp), %rdi
movq %rax, %rsi
callq 0x2048c
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rdi
movq 0x118(%rsp), %rsi
callq 0x22217
testb %al, %al
je 0x210b9
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
jmp 0x2117d
leaq 0x38c46(%rip), %rsi     # 0x59a78
leaq 0x38e0f(%rip), %rdx     # 0x59c48
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9330
testq %rax, %rax
je 0x213c3
addq $0x8, %rax
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x2245a
movb $0x1, 0x20(%r15)
leaq 0x48(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
jmp 0x20fb5
leaq 0xc0(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
jmp 0x2128e
movq 0x150(%rsp), %rbx
movq 0x78(%rbx), %rsi
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x205cb
cmpb $0x0, 0x60(%rsp)
movq 0x148(%rsp), %r15
movq 0x138(%rsp), %rsi
je 0x20f8c
leaq 0xc0(%rsp), %rdi
leaq 0x98(%rsp), %rcx
movq 0x140(%rsp), %rdx
callq 0x22336
movq 0x88(%rbx), %rsi
leaq 0xc0(%rsp), %rdx
movq %r15, %rdi
callq 0x205cb
leaq 0xc0(%rsp), %rdi
callq 0x22c8c
jmp 0x20f99
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
jmp 0x212a5
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x223ac
jmp 0x212a5
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
jmp 0x212a5
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
jmp 0x212a5
leaq 0x98(%rsp), %rsi
movq %r15, %rdi
callq 0x223ac
jmp 0x21281
leaq 0x70(%rsp), %rdi
callq 0x22627
jmp 0x21199
leaq 0x70(%rsp), %rdi
callq 0x224d6
jmp 0x21199
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x223ac
leaq 0x40(%rsp), %rdi
callq 0x13c86
leaq 0x10(%rsp), %rdi
callq 0x22c8c
leaq 0xa0(%rsp), %rdi
callq 0xa248
jmp 0x212af
leaq 0xc0(%rsp), %rdi
callq 0x22627
leaq 0x18(%rsp), %rdi
leaq 0xc8(%rsp), %rbx
andq $0x0, (%rdi)
movb $0x1, 0x20(%r15)
movaps -0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%rbx)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0xa248
movq %rbx, %rdi
jmp 0x21185
leaq 0x1907a(%rip), %rsi     # 0x3a084
leaq 0xc0(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0xeb2e
movq 0xf0(%rsp), %rcx
movq 0x10(%rcx), %rax
subq 0x8(%rcx), %rax
sarq $0x4, %rax
movq %rax, 0x70(%rsp)
movq 0x20(%r13), %rax
subq 0x18(%r13), %rax
sarq $0x4, %rax
movq %rax, 0xf8(%rsp)
leaq 0x98(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
leaq 0x98(%rsp), %r8
callq 0x21727
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
leaq 0x10(%rsp), %rdi
callq 0x9130
leaq 0x98(%rsp), %rdi
callq 0x9130
leaq 0xc0(%rsp), %rdi
callq 0x9130
jmp 0x212a5
leaq 0x190bd(%rip), %rsi     # 0x3a17d
leaq 0xc0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xeb2e
leaq 0x98(%rsp), %rdi
movq %r12, %rsi
callq 0xdaae
leaq 0x40(%rsp), %rdi
callq 0x223e4
movq (%rax), %rsi
leaq 0x70(%rsp), %rdi
callq 0x21e44
movq 0x118(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x21e44
leaq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x98(%rsp), %rdx
leaq 0x70(%rsp), %rcx
leaq 0xf8(%rsp), %r8
callq 0x21abb
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
leaq 0x10(%rsp), %rdi
callq 0x9130
leaq 0xf8(%rsp), %rdi
callq 0x9130
leaq 0x70(%rsp), %rdi
callq 0x9130
leaq 0x98(%rsp), %rdi
callq 0x9130
leaq 0xc0(%rsp), %rdi
callq 0x9130
leaq 0x120(%rsp), %rdi
callq 0xa248
jmp 0x212a5
leaq 0x70(%rsp), %rdi
callq 0x22627
leaq 0xa0(%rsp), %rdi
leaq 0x78(%rsp), %rbx
andq $0x0, (%rdi)
movb $0x1, 0x20(%r15)
movaps -0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%rbx)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0xa248
movq %rbx, %rdi
callq 0xa248
jmp 0x2128e
leaq 0x10(%rsp), %rdi
callq 0x223e4
movq (%rax), %rbx
leaq 0xc0(%rsp), %rdi
callq 0x223e4
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x21ab1
testb %al, %al
je 0x21274
leaq 0x18f49(%rip), %rsi     # 0x3a14e
leaq 0xf8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xeb2e
leaq 0x118(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0x70(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x2203e
leaq 0x70(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
leaq 0x70(%rsp), %rdi
callq 0x9130
leaq 0x118(%rsp), %rdi
callq 0x9130
leaq 0xf8(%rsp), %rdi
callq 0x9130
jmp 0x21281
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x223d0
leaq 0x98(%rsp), %rdi
callq 0x13c86
leaq 0xc0(%rsp), %rdi
callq 0x13c86
leaq 0x10(%rsp), %rdi
callq 0x13c86
leaq 0x40(%rsp), %rdi
callq 0x13c86
movq %r15, %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf0(%rsp), %rsi
addq $0x20, %rsi
movq %r15, %rdi
callq 0x2244e
jmp 0x212a5
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x223ac
jmp 0x2129b
leaq 0x18ddf(%rip), %rsi     # 0x3a0cf
leaq 0x98(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0xeb2e
leaq 0x10(%rsp), %rdi
callq 0x223e4
movq (%rax), %rsi
leaq 0x70(%rsp), %rdi
callq 0x21e44
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%rbx), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x21e44
leaq 0x118(%rsp), %rdi
movq %r14, %rsi
callq 0xdaae
leaq 0xc0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
leaq 0x118(%rsp), %r8
callq 0x21abb
leaq 0xc0(%rsp), %rsi
movq %r15, %rdi
callq 0x2243c
leaq 0xc0(%rsp), %rdi
callq 0x9130
leaq 0x118(%rsp), %rdi
callq 0x9130
leaq 0xf8(%rsp), %rdi
callq 0x9130
leaq 0x70(%rsp), %rdi
callq 0x9130
leaq 0x98(%rsp), %rdi
callq 0x9130
jmp 0x2129b
callq 0x9510
pushq $0x10
popq %rdi
callq 0x9150
movq %rax, %r14
leaq 0x18d2f(%rip), %rsi     # 0x3a109
movq %rax, %rdi
callq 0x93c0
movq 0x3abe7(%rip), %rsi     # 0x5bfd0
movq 0x3aba8(%rip), %rdx     # 0x5bf98
movq %r14, %rdi
callq 0x94b0
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x9130
jmp 0x2140d
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x9130
jmp 0x2141f
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x9130
jmp 0x21431
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x21455
jmp 0x216a1
jmp 0x216a1
jmp 0x21467
jmp 0x21485
jmp 0x214a9
jmp 0x21667
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x9130
jmp 0x216a4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x21488
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9130
jmp 0x2149a
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x9130
jmp 0x214ac
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x9130
jmp 0x214c1
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x9130
jmp 0x2166a
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x2157a
jmp 0x21667
jmp 0x21689
jmp 0x214dc
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9130
jmp 0x214f8
movq %rax, %rbx
jmp 0x21587
jmp 0x214f5
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x9130
jmp 0x21511
jmp 0x21611
jmp 0x2150e
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x9130
jmp 0x216b5
jmp 0x216b2
jmp 0x216b2
jmp 0x216b2
movq %rax, %rbx
movq %r14, %rdi
callq 0x9210
jmp 0x216db
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x22c8c
jmp 0x21559
jmp 0x21556
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x13c86
jmp 0x216c4
jmp 0x21689
jmp 0x21667
jmp 0x21689
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x9130
leaq 0xc0(%rsp), %rdi
callq 0x9130
jmp 0x21614
jmp 0x21689
jmp 0x216b2
jmp 0x216b2
jmp 0x216b2
jmp 0x216b2
jmp 0x216b2
jmp 0x21628
jmp 0x2163c
jmp 0x21650
jmp 0x21689
jmp 0x216c1
jmp 0x21689
jmp 0x21689
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x21672
jmp 0x21689
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x22c8c
jmp 0x216b5
jmp 0x215fa
movq %rax, %rbx
jmp 0x216ce
jmp 0x216b2
jmp 0x216b2
jmp 0x216b2
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0xa248
jmp 0x216b5
jmp 0x21628
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x9130
jmp 0x2163f
jmp 0x2163c
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x9130
jmp 0x21653
jmp 0x21650
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x2168c
jmp 0x21689
jmp 0x21689
jmp 0x21689
jmp 0x216b2
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x13c86
jmp 0x2168c
jmp 0x21689
jmp 0x216a1
jmp 0x216a1
jmp 0x216b2
jmp 0x216b2
jmp 0x21689
jmp 0x21689
jmp 0x21689
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x13c86
jmp 0x216a4
jmp 0x216a1
jmp 0x216a1
jmp 0x216b2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x13c86
jmp 0x216b5
jmp 0x216b2
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x13c86
jmp 0x216db
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x22c8c
leaq 0xa0(%rsp), %rdi
callq 0xa248
movq %rbx, %rdi
callq 0x94d0