// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: optimize_expression
static opt_t optimize_expression(s7_scheme *sc, s7_pointer expr, int32_t hop, s7_pointer e, bool export_ok)
                {
                    s7_pointer car_expr;
#if OPTIMIZE_PRINT
                    fprintf(stderr, "optimize_expression %s %d %s\n", DISPLAY(expr), hop, DISPLAY(e));
#endif
                    set_checked(expr);
                    car_expr = car(expr);

                    if (is_symbol(car_expr))
                    {
                        s7_pointer slot;
                        if (is_syntactic_symbol(car_expr))
                        {
                            if (!is_pair(cdr(expr)))
                                return(OPT_OOPS);
                            return(optimize_syntax(sc, expr, T_Syn(slot_value(global_slot(car_expr))), hop, e, export_ok));
                        }

                        slot = find_uncomplicated_symbol(sc, car_expr, e); /* local vars (recursive calls too??) are considered "complicated" */
#if OPTIMIZE_PRINT
                        if (!is_slot(slot)) fprintf(stderr, "  %s is not simple\n", DISPLAY(expr));
#endif
                        if (is_slot(slot))
                        {
                            s7_pointer func;
                            func = slot_value(slot);
                            if (is_syntax(func))                           /* 12-8-16 was is_syntactic, but that is only appropriate above -- here we have the value */
                            {
                                if (!is_pair(cdr(expr)))
                                    return(OPT_OOPS);
                                return(optimize_syntax(sc, expr, func, hop, e, export_ok));  /* e can be extended via set-cdr! here */
                            }
                            if (is_any_macro(func)) return(OPT_F);

                            /* we miss implicit indexing here because at this time, the data are not set */
                            if ((is_t_procedure(func)) ||
                                    /* (is_c_function(func)) || */
                                    (is_safe_procedure(func)))                 /* built-in applicable objects like vectors */
                            {
                                int32_t pairs = 0, symbols = 0, args = 0, bad_pairs = 0, quotes = 0, orig_hop;
                                s7_pointer p;
                                orig_hop = hop;

                                if ((hop != 0) &&
                                        ((is_any_closure(func)) ||             /* see use-redef in s7test -- I'm not sure about this */
                                         ((!is_global(car_expr)) &&
                                          ((!is_slot(global_slot(car_expr))) ||
                                           (slot_value(global_slot(car_expr)) != func)))) &&
                                        (!is_immutable(car_expr)) && /* list|apply-values -- can't depend on opt1 here because it might not be global, or might be redefined locally */
                                        (!is_immutable(slot)))       /* (define-constant...) */
                                {
                                    /* (let () (define (f2 a) (+ a 1)) (define (f1 a) (f2 a)) (define (f2 a) (- a)) (f1 12))
                                     * (let () (define (f2 a) (+ a 1)) (define (f1 a) (f2 a)) (define (f2 a) (- a 1)) (f1 12))
                                     * and similar define* cases
                                     */
                                    hop = 0;
                                    /* this is very tricky!  See s7test for some cases.  Basically, we need to protect a recursive call
                                     *   of the current function being optimized from being confused with some previous definition
                                     *   of the same name.  But method lists have global names so the global bit is off even though the
                                     *   thing is actually a safe global.  But no closure can be considered safe in the hop sense --
                                     *   even a global function might be redefined at any time, and previous uses of it in other functions
                                     *   need to reflect its new value.
                                     *   So, closures are always checked, but built-in functions are used as if never redefined until that redefinition.
                                     * Syntax handling is already impure in s7, so the special handling of built-in functions doesn't
                                     *   offend me much.  Consider each a sort of reader macro until someone redefines it -- previous
                                     *   uses may not be affected because they might have been optimized away -- the result depends on the
                                     *   current optimizer.
                                     * Another case (from K Matheussen):
                                     *   (define (call-func func arg1 arg2) (define (call) (func arg1 arg2)) (call)) (call-func + 1 2.5) (call-func - 5 2)
                                     *   when we get here originally "func" is +, hop=1, but just checking for !is_global(car_expr) is
                                     *   not good enough -- if we load mockery.scm, nothing is global!
                                     * Yet another case (define (test-abs) (define (abs x) (+ x 1)) (format *stderr* "abs ~A~%" (abs -1)))
                                     *   when optimize_syntax sees the (define abs ...), it inserts abs into e so that the caller's e is extended (set-cdr!)
                                     *   so that find_uncomplicated_symbol above will be unhappy when we reach (abs -1) as the format arg.
                                     *   This can be confused if lambda is redefined at some point, but...
                                     */
                                }

                                for (p = cdr(expr); is_pair(p); p = cdr(p), args++) /* check the args (the calling expression) */
                                {
                                    s7_pointer car_p;
                                    car_p = car(p);
                                    if (is_normal_symbol(car_p)) /* for opt func */
                                        symbols++;
                                    else
                                    {
                                        if (is_pair(car_p))
                                        {
                                            pairs++;
                                            if (!is_checked(car_p))
                                            {
                                                opt_t res;
                                                res = optimize_expression(sc, car_p, orig_hop, e, false);
                                                if (res == OPT_F)
                                                {
                                                    bad_pairs++;
                                                    if (is_proper_quote(sc, car_p))
                                                        quotes++;
                                                }
                                                else
                                                {
                                                    if (res == OPT_OOPS)
                                                        return(OPT_OOPS);
                                                }
                                            }
                                            else
                                            {
                                                if ((!is_optimized(car_p)) ||
                                                        (is_unsafe(car_p)))
                                                {
                                                    bad_pairs++;
                                                    if (is_proper_quote(sc, car_p))
                                                        quotes++;
                                                }}}}}
                                if (is_null(p))                    /* if not null, dotted list of args? */
                                {
                                    switch (args)
                                    {
                                        case 0:  return(optimize_thunk(sc, expr, func, hop, e));
                                        case 1:  return(optimize_func_one_arg(sc, expr, func, hop, pairs, symbols, quotes, bad_pairs, e));
                                        case 2:  return(optimize_func_two_args(sc, expr, func, hop, pairs, symbols, quotes, bad_pairs, e));
                                        case 3:  return(optimize_func_three_args(sc, expr, func, hop, pairs, symbols, quotes, bad_pairs, e));
                                        default: return(optimize_func_many_args(sc, expr, func, hop, args, pairs, symbols, quotes, bad_pairs, e));
                                    }
                                }
                                return(OPT_F);
                            }
                        }
                        else
                        {
                            if ((sc->undefined_identifier_warnings) &&
                                    (slot == sc->undefined) &&           /* car_expr is not in e or global */
                                    (symbol_tag(car_expr) == 0))         /*    and we haven't looked it up earlier */
                            {
                                s7_pointer p;
                                p = sc->input_port;
                                if ((is_input_port(p)) &&
                                        (port_file(p) != stdin) &&
                                        (!port_is_closed(p)) &&
                                        (port_filename(p)))
                                    s7_warn(sc, 1024, "%s might be undefined (%s %u)\n", DISPLAY(car_expr), port_filename(p), port_line_number(p));
                                else s7_warn(sc, 1024, "; %s might be undefined\n", DISPLAY(car_expr));
                                symbol_set_tag(car_expr, 1);             /* one warning is enough */
                            }
                        }
#if OPTIMIZE_PRINT
                        fprintf(stderr, "  at line %d for %s\n", __LINE__, DISPLAY(car_expr));
#endif
                        /* car_expr is a symbol but it's not a built-in procedure or a "safe" case = vector etc */
                        {
                            /* else maybe it's something like a let variable binding: (sqrtfreq (sqrt frequency)) */
                            s7_pointer p;
                            int32_t len = 0, pairs = 0, symbols = 0;

                            for (p = cdr(expr); is_pair(p); p = cdr(p), len++)
                            {
                                s7_pointer car_p;
                                car_p = car(p);
                                if (is_pair(car_p))
                                {
                                    pairs++;
                                    if ((!is_checked(car_p)) &&
                                            (optimize_expression(sc, car_p, hop, e, false) == OPT_OOPS))
                                        return(OPT_OOPS);
                                }
                                else
                                {
                                    if (is_symbol(car_p))
                                        symbols++;
                                }
                            }

                            if ((is_null(p)) &&              /* (+ 1 . 2) */
                                    (!is_optimized(expr)))
                            {
                                /* len=0 case is almost entirely arglists */
                                set_opt1_con(expr, sc->unused);

                                if (pairs == 0)
                                {
                                    if (len == 0)
                                    {
                                        /* hoping to catch object application here, as in readers in Snd */
                                        set_unsafe_optimize_op(expr, OP_UNKNOWN);
                                        return(OPT_F);
                                    }

                                    if (len == 1)
                                    {
                                        if (car_expr != sc->quote_symbol) /* !! quote can be redefined locally, unsetting the T_SYNTACTIC flag -- can this happen elsewhere? */
                                            set_unsafe_optimize_op(expr, OP_UNKNOWN_G);
                                        return(OPT_F);
                                    }

                                    if (len == 2)
                                    {
                                        set_unsafely_optimized(expr);
                                        set_optimize_op(expr, OP_UNKNOWN_GG);
                                        return(OPT_F);
                                    }

                                    if ((len >= 3) &&
                                            (len == symbols))
                                    {
                                        set_unsafe_optimize_op(expr, OP_UNKNOWN_ALL_S);
                                        set_opt3_arglen(expr, make_permanent_integer(len));
                                        return(OPT_F);
                                    }
                                }
                                else /* pairs != 0 */
                                {
                                    s7_pointer arg1;
                                    arg1 = cadr(expr);
                                    if (pairs == 1)
                                    {
                                        if (len == 1)
                                        {

                                            if ((car(expr) == sc->quote_symbol) &&
                                                    (direct_memq(sc->quote_symbol, e)))
                                                return(OPT_OOPS);

                                            if (is_fxable(sc, arg1))
                                            {
                                                set_opt3_arglen(expr, small_int(1));
                                                annotate_arg(sc, cdr(expr), e);
                                                set_unsafe_optimize_op(expr, OP_UNKNOWN_A);
                                                return(OPT_F);
                                            }
                                        }
                                        else
                                        {
                                            if (len == 2)
                                            {
                                                if ((is_fxable(sc, arg1)) &&
                                                        (is_fxable(sc, caddr(expr))))
                                                {
                                                    set_opt3_arglen(expr, small_int(2));
                                                    set_unsafe_optimize_op(expr, OP_UNKNOWN_AA);
                                                    return(OPT_F);
                                                }}}}

                                    if ((len == 2) &&
                                            (is_fxable(sc, arg1)) &&
                                            (is_fxable(sc, caddr(expr))))
                                    {
                                        set_opt3_arglen(expr, small_int(2));
                                        set_unsafe_optimize_op(expr, OP_UNKNOWN_AA);
                                        return(OPT_F);
                                    }

                                    if ((fx_count(sc, expr) == len) &&
                                            (len < GC_TRIGGER_SIZE))
                                    {
                                        if ((len == 1) &&
                                                (car(expr) == sc->quote_symbol) &&
                                                (direct_memq(sc->quote_symbol, e)))
                                            return(OPT_OOPS);

                                        set_unsafe_optimize_op(expr, (len == 1) ? OP_UNKNOWN_A : OP_UNKNOWN_FX);
                                        set_opt3_arglen(expr, make_permanent_integer(len));
                                        if (len == 1)
                                            annotate_arg(sc, cdr(expr), e);
                                        return(OPT_F);
                                    }}}}
                    }
                    else
                    {
                        /* car(expr) is not a symbol, but there might be interesting stuff here */
                        /* (define (hi a) (case 1 ((1) (if (> a 2) a 2)))) */
                        s7_pointer p;

                        for (p = expr; is_pair(p); p = cdr(p))
                        {
                            if ((is_pair(car(p))) &&
                                    (!is_checked(car(p))) &&
                                    (optimize_expression(sc, car(p), hop, e, false) == OPT_OOPS))
                                return(OPT_OOPS);
                        }

                        if ((is_proper_list_1(sc, cdr(expr))) &&
                                (is_pair(car_expr)) &&
                                (car(car_expr) == sc->if_symbol) &&
                                (is_pair(cdr(car_expr))) &&
                                (is_pair(cddr(car_expr))) &&
                                (is_symbol(caddr(car_expr))) &&
                                (is_pair(cdddr(car_expr))) &&
                                (is_symbol(cadddr(car_expr))) &&
                                (is_fxable(sc, cadr(car_expr))) &&
                                (is_fxable(sc, cadr(expr))))
                        {
                            s7_pointer ptrue;
                            ptrue = find_uncomplicated_symbol(sc, caddr(car_expr), e);
                            if (is_slot(ptrue))
                            {
                                ptrue = slot_value(ptrue);
                                if ((is_c_function(ptrue)) &&
                                        (is_safe_procedure(ptrue)))
                                {
                                    s7_pointer pfalse;
                                    pfalse = find_uncomplicated_symbol(sc, cadddr(car_expr), e);
                                    if (is_slot(pfalse))
                                    {
                                        pfalse = slot_value(pfalse);
                                        if ((is_c_function(pfalse)) &&
                                                (is_safe_procedure(pfalse)))
                                        {
                                            set_opt1_con(expr, ptrue);
                                            set_opt2_con(expr, pfalse);
                                            set_safe_optimize_op(expr, OP_opIF_A_SSq_A);
                                            annotate_arg(sc, cdr(car_expr), e);
                                            annotate_arg(sc, cdr(expr), e);
                                            return(OPT_T);
                                        }}}}}
                    }
                    return(OPT_F);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movl %edx, %r13d
movq %rsi, %r15
orb $0x40, 0x2(%rsi)
movq 0x8(%rsi), %r12
cmpb $0xa, (%r12)
movq %rdi, (%rsp)
jne 0xe2493
movl %r8d, %ebp
cmpw $0x20a, (%r12)          # imm = 0x20A
jne 0xe2640
movq 0x10(%r15), %rax
cmpb $0x1, (%rax)
jne 0xe2c80
movq 0x10(%r12), %rax
movq 0x10(%rax), %rdx
movzbl %bpl, %r9d
movq %r15, %rsi
movl %r13d, %ecx
movq %r14, %r8
callq 0xe2df1
movl %eax, %ebp
jmp 0xe2c85
movq %r12, 0x18(%rsp)
cmpb $0x1, (%r15)
jne 0xe24db
movq %r15, %rbx
xorl %r12d, %r12d
movq 0x8(%rbx), %rsi
cmpb $0x1, (%rsi)
jne 0xe24d2
testb $0x40, 0x2(%rsi)
jne 0xe24d2
movq (%rsp), %rdi
movl %r13d, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xe242a
movq (%rsp), %rdi
cmpl $0x2, %eax
je 0xe26d0
movq 0x10(%rbx), %rbx
cmpb $0x1, (%rbx)
je 0xe24a4
movq 0x10(%r15), %rbx
movl $0x1, %ebp
movb $0x1, %r12b
cmpb $0x1, (%rbx)
jne 0xe26d5
movq 0x10(%rbx), %rax
cmpq 0x110(%rdi), %rax
jne 0xe26d5
movq 0x18(%rsp), %rcx
cmpb $0x1, (%rcx)
jne 0xe26d5
movq 0x8(%rcx), %rax
cmpq 0x17e8(%rdi), %rax
jne 0xe26d5
movq 0x10(%rcx), %rax
cmpb $0x1, (%rax)
jne 0xe26d5
movq 0x10(%rax), %rcx
cmpb $0x1, (%rcx)
jne 0xe26d5
movq %r14, %r13
movq 0x8(%rcx), %r14
cmpb $0xa, (%r14)
jne 0xe26d5
movq 0x10(%rcx), %rcx
cmpb $0x1, (%rcx)
jne 0xe26d5
movq 0x8(%rcx), %rcx
cmpb $0xa, (%rcx)
jne 0xe26d5
movq 0x8(%rax), %rsi
callq 0xd5a05
testb %al, %al
je 0xe26d5
movq 0x8(%rbx), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xd5a05
testb %al, %al
je 0xe26d5
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xe3fba
cmpb $0x20, (%rax)
jne 0xe26d5
movq 0x10(%rax), %rbx
cmpb $0x30, (%rbx)
jb 0xe26d5
testb $0x20, 0x2(%rbx)
je 0xe26d5
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq (%rsp), %rdi
movq %r13, %rdx
callq 0xe3fba
cmpb $0x20, (%rax)
jne 0xe26d5
movq 0x10(%rax), %rax
cmpb $0x30, (%rax)
jb 0xe26d5
testb $0x20, 0x2(%rax)
je 0xe26d5
movq %rbx, 0x18(%r15)
movq %rax, 0x20(%r15)
orb $0x8, 0x1(%r15)
movw $0x167, 0x4(%r15)       # imm = 0x167
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rdx
callq 0xd5a53
movq 0x10(%r15), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0xd5a53
xorl %r12d, %r12d
jmp 0xe26d5
movq %rdi, %rbx
movq %r12, %rsi
movq %r14, %rdx
callq 0xe3fba
cmpb $0x20, (%rax)
jne 0xe268c
movq 0x10(%rax), %rdx
movzbl (%rdx), %r8d
cmpq $0x9, %r8
jne 0xe26b4
movq 0x10(%r15), %rax
cmpb $0x1, (%rax)
movq (%rsp), %rdi
jne 0xe26ed
movzbl %bpl, %r9d
movq (%rsp), %rdi
movq %r15, %rsi
movl %r13d, %ecx
movq %r14, %r8
callq 0xe2df1
movq (%rsp), %rdi
movl %eax, %ebp
jmp 0xe26f2
cmpb $0x1, 0x218c(%rbx)
movq %rbx, %rdi
movq %r14, 0x20(%rsp)
jne 0xe26b2
cmpq 0x128(%rdi), %rax
jne 0xe26b2
cmpl $0x0, 0x2c(%r12)
je 0xe2901
jmp 0xe2701
leaq 0x71cb5(%rip), %rsi     # 0x154370
xorl %ecx, %ecx
cmpb $0x0, (%r8,%rsi)
movq (%rsp), %rdi
je 0xe2871
xorl %ebp, %ebp
jmp 0xe26f4
movl $0x2, %ebp
testb %r12b, %r12b
je 0xe26dc
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %ebp
xorl %ecx, %ecx
testb %cl, %cl
je 0xe2c85
movq %r14, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x10(%rsp)
movq 0x10(%r15), %rbx
xorl %r14d, %r14d
cmpb $0x1, (%rbx)
jne 0xe2778
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x8(%rbx), %rsi
movzbl (%rsi), %eax
movb $0x1, %cl
cmpl $0xa, %eax
je 0xe275f
cmpl $0x1, %eax
jne 0xe2762
incl %r15d
testb $0x40, 0x2(%rsi)
jne 0xe2762
movq (%rsp), %rdi
movl %r13d, %edx
movq 0x20(%rsp), %rcx
xorl %r8d, %r8d
callq 0xe242a
movq (%rsp), %rdi
cmpl $0x2, %eax
setne %cl
cmovel %eax, %ebp
jmp 0xe2762
incl %r12d
testb %cl, %cl
je 0xe2c85
incl %r14d
movq 0x10(%rbx), %rbx
cmpb $0x1, (%rbx)
je 0xe2720
jmp 0xe277e
xorl %r15d, %r15d
xorl %r12d, %r12d
movb $0x1, %r13b
cmpq 0x110(%rdi), %rbx
jne 0xe2c88
movq 0x10(%rsp), %rcx
cmpw $0x801, (%rcx)          # imm = 0x801
je 0xe2c88
movq 0x140(%rdi), %rax
movq %rax, 0x18(%rcx)
testl %r15d, %r15d
je 0xe28cd
movq 0x10(%rcx), %r12
movq 0x8(%r12), %rbx
cmpl $0x1, %r15d
jne 0xe2bb9
cmpl $0x2, %r14d
je 0xe2b8b
cmpl $0x1, %r14d
jne 0xe2c1b
movq 0x17b0(%rdi), %rax
movq 0x10(%rsp), %rcx
cmpq %rax, 0x8(%rcx)
jne 0xe281d
movq 0x20(%rsp), %rdx
cmpb $0x1, (%rdx)
sete %cl
jne 0xe2815
cmpq %rax, 0x8(%rdx)
je 0xe2815
movq 0x20(%rsp), %rdx
movq 0x10(%rdx), %rdx
cmpb $0x1, (%rdx)
sete %cl
jne 0xe2815
cmpq %rax, 0x8(%rdx)
jne 0xe2803
testb %cl, %cl
jne 0xe2c80
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0xd5a05
movq (%rsp), %rdi
testb %al, %al
je 0xe2bb9
movq 0x6c11c(%rip), %rax     # 0x14e958
movq %rax, 0x28(%r12)
movq 0x10(%rsp), %rbx
movq 0x10(%rbx), %rax
andq $-0x40001, (%rax)       # imm = 0xFFFBFFFF
movq 0x10(%rbx), %rsi
movq 0x20(%rsp), %rdx
callq 0xd5a53
orq $0x800800, (%rbx)       # imm = 0x800800
movw $0x184, 0x4(%rbx)       # imm = 0x184
jmp 0xe2d4f
leaq 0x71ab8(%rip), %rcx     # 0x154330
cmpb $0x0, (%r8,%rcx)
jne 0xe288c
testb $0x20, 0x2(%rdx)
jne 0xe288c
movb $0x1, %cl
jmp 0xe26f4
xorl %r10d, %r10d
movl $0x0, %esi
testl %r13d, %r13d
je 0xe29c1
leaq 0x7833c(%rip), %rcx     # 0x15abe0
cmpb $0x0, (%r8,%rcx)
je 0xe299c
movl $0x1, %esi
testb $0x1, 0x3(%r12)
jne 0xe29c1
movl (%rax), %esi
shrl $0x18, %esi
andl $0x1, %esi
jmp 0xe29c1
cmpl $0x2, %r14d
je 0xe2cfb
cmpl $0x1, %r14d
movq 0x10(%rsp), %rbx
je 0xe2cde
testl %r14d, %r14d
jne 0xe2d0f
orq $0x800800, (%rbx)       # imm = 0x800800
movw $0x17f, 0x4(%rbx)       # imm = 0x17F
jmp 0xe2d4f
movq 0x170(%rdi), %rbx
cmpb $0x23, (%rbx)
jne 0xe2963
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rcx
movq 0x6b6bc(%rip), %rdx     # 0x14dfd8
cmpq (%rdx), %rcx
je 0xe2963
cmpb $0x0, 0x2(%rax)
jne 0xe2963
cmpq $0x0, 0x10(%rax)
je 0xe2963
movq %rdi, %r14
movq %r12, %rsi
xorl %edx, %edx
callq 0x39f84
movq 0x10(%rax), %rcx
movq 0x8(%rbx), %rax
movq 0x10(%rax), %r8
movl 0x20(%rax), %r9d
leaq 0x3e547(%rip), %rdx     # 0x120e99
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
xorl %eax, %eax
callq 0xfc3d
jmp 0xe298a
movq %rdi, %rbx
movq %r12, %rsi
xorl %edx, %edx
callq 0x39f84
movq 0x10(%rax), %rcx
leaq 0x3e53d(%rip), %rdx     # 0x120eb8
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfc3d
movl $0x1, 0x2c(%r12)
movq (%rsp), %rdi
jmp 0xe2701
movl $0x1, %esi
testb $0x1, 0x2(%r12)
jne 0xe29c1
movq 0x10(%r12), %rcx
cmpb $0x20, (%rcx)
jne 0xe28af
cmpq %rdx, 0x10(%rcx)
jne 0xe28af
movl %esi, 0xc(%rsp)
movq %r12, 0x18(%rsp)
movq 0x10(%r15), %r12
cmpb $0x1, (%r12)
jne 0xe2b1a
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %ebp, %ebp
xorl %r11d, %r11d
xorl %r10d, %r10d
movq %rdx, 0x28(%rsp)
movq %r14, %rbx
movq 0x8(%r12), %r14
movzbl (%r14), %eax
movb $0x1, %sil
cmpl $0x1, %eax
je 0xe2a19
cmpl $0xa, %eax
jne 0xe2a8a
testb $-0x80, 0x6(%r14)
jne 0xe2a15
incl %r9d
jmp 0xe2a8a
cmpb $0x1, %al
jne 0xe2a8a
incl %r8d
testb $0x40, 0x2(%r14)
jne 0xe2a7b
movl %r8d, 0x10(%rsp)
movq %r9, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %r14, %rsi
movl %r13d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0xe242a
cmpl $0x2, %eax
je 0xe2aaf
testl %eax, %eax
movq 0x40(%rsp), %r10
movq 0x38(%rsp), %r11
movq 0x30(%rsp), %r9
movb $0x1, %sil
jne 0xe2ace
xorl %eax, %eax
cmpb $0x1, (%r14)
movq (%rsp), %rdi
movq 0x28(%rsp), %rdx
movl 0x10(%rsp), %r8d
je 0xe2a97
jmp 0xe2aa4
cmpw $0x801, (%r14)          # imm = 0x801
jne 0xe2a8f
testb $-0x80, 0x2(%r14)
jne 0xe2a8f
movq %rbx, %r14
jmp 0xe2adf
xorl %eax, %eax
cmpb $0x1, (%r14)
jne 0xe2aa4
movq 0x8(%r14), %rcx
cmpq 0x17b0(%rdi), %rcx
je 0xe2afc
movq %rbx, %r14
incl %r10d
addl %eax, %r11d
jmp 0xe2adf
xorl %esi, %esi
movq %rbx, %r14
movq (%rsp), %rdi
movq 0x28(%rsp), %rdx
movq 0x40(%rsp), %r10
movq 0x38(%rsp), %r11
movq 0x30(%rsp), %r9
jmp 0xe2ada
movq %rbx, %r14
movq (%rsp), %rdi
movq 0x28(%rsp), %rdx
movl 0x10(%rsp), %r8d
testb %sil, %sil
je 0xe2b75
incl %ebp
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
je 0xe29ec
jmp 0xe2b25
movq 0x10(%r14), %rcx
cmpb $0x1, (%rcx)
movq %rbx, %r14
jne 0xe2aa7
movq 0x10(%rcx), %rcx
xorl %eax, %eax
cmpq 0x110(%rdi), %rcx
sete %al
jmp 0xe2aa7
xorl %r11d, %r11d
xorl %ebp, %ebp
xorl %r9d, %r9d
xorl %r8d, %r8d
xorl %ecx, %ecx
cmpq 0x110(%rdi), %r12
je 0xe2b39
movl 0xc(%rsp), %r13d
xorl %ebp, %ebp
jmp 0xe2b81
cmpl $0x3, %ebp
movq 0x18(%rsp), %r12
ja 0xe2dbc
movl %ebp, %eax
leaq 0x2ee78(%rip), %rcx     # 0x1119c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsp), %rdi
movq %r15, %rsi
movl 0xc(%rsp), %r13d
movl %r13d, %ecx
movq %r14, %r8
callq 0xe40c5
jmp 0xe2684
movl $0x2, %ebp
xorl %ecx, %ecx
movl 0xc(%rsp), %r13d
movq 0x18(%rsp), %r12
jmp 0xe26f4
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0xd5a05
movq (%rsp), %rdi
testb %al, %al
je 0xe2bb9
movq 0x10(%r12), %rax
movq 0x8(%rax), %rsi
movq (%rsp), %rdi
callq 0xd5a05
movq (%rsp), %rdi
testb %al, %al
jne 0xe2bed
cmpl $0x2, %r14d
jne 0xe2c1b
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0xd5a05
movq (%rsp), %rdi
testb %al, %al
je 0xe2c1b
movq 0x10(%r12), %rax
movq 0x8(%rax), %rsi
movq (%rsp), %rdi
callq 0xd5a05
movq (%rsp), %rdi
testb %al, %al
je 0xe2c1b
movq 0x6bd6c(%rip), %rax     # 0x14e960
movq %rax, 0x28(%r12)
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rax
andq $-0x40001, (%rax)       # imm = 0xFFFBFFFF
orq $0x800800, (%rcx)       # imm = 0x800800
movw $0x185, 0x4(%rcx)       # imm = 0x185
jmp 0xe2d4f
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0xe8f6a
cmpl $0x3f, %r14d
ja 0xe2c88
cmpl %r14d, %eax
jne 0xe2c88
movw $0x181, %ax             # imm = 0x181
cmpl $0x1, %r14d
jne 0xe2c96
movq (%rsp), %rax
movq 0x17b0(%rax), %rcx
movw $0x184, %ax             # imm = 0x184
cmpq %rcx, 0x8(%rbx)
jne 0xe2c96
movq 0x20(%rsp), %rsi
cmpb $0x1, (%rsi)
sete %dl
jne 0xe2c7c
cmpq %rcx, 0x8(%rsi)
je 0xe2c7c
movq 0x20(%rsp), %rsi
movq 0x10(%rsi), %rsi
cmpb $0x1, (%rsi)
sete %dl
jne 0xe2c7c
cmpq %rcx, 0x8(%rsi)
jne 0xe2c6a
testb %dl, %dl
je 0xe2c96
movl $0x2, %ebp
xorl %r13d, %r13d
testb %r13b, %r13b
jne 0xe26da
jmp 0xe26dc
orq $0x800800, (%rbx)       # imm = 0x800800
movw %ax, 0x4(%rbx)
movl %r14d, %edi
callq 0xe8ee3
movq 0x10(%rbx), %rcx
movq %rax, 0x28(%rcx)
movq 0x10(%rbx), %rax
andq $-0x40001, (%rax)       # imm = 0xFFFBFFFF
xorl %r13d, %r13d
movl $0x0, %ebp
cmpl $0x1, %r14d
jne 0xe2c88
movq 0x10(%rbx), %rsi
movq (%rsp), %rdi
movq 0x20(%rsp), %rdx
callq 0xd5a53
jmp 0xe2d4f
movq 0x18(%rsp), %rax
cmpq 0x17b0(%rdi), %rax
je 0xe2d4f
orq $0x800800, (%rbx)       # imm = 0x800800
movw $0x182, 0x4(%rbx)       # imm = 0x182
jmp 0xe2d4f
movq 0x10(%rsp), %rax
orq $0x800800, (%rax)       # imm = 0x800800
movw $0x183, 0x4(%rax)       # imm = 0x183
jmp 0xe2d4f
cmpl $0x3, %r14d
setae %al
cmpl %r12d, %r14d
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xe2c88
orq $0x800800, (%rbx)       # imm = 0x800800
movw $0x180, 0x4(%rbx)       # imm = 0x180
movl %r14d, %edi
callq 0xe8ee3
movq 0x10(%rbx), %rcx
movq %rax, 0x28(%rcx)
movq 0x10(%rbx), %rax
andq $-0x40001, (%rax)       # imm = 0xFFFBFFFF
xorl %r13d, %r13d
xorl %ebp, %ebp
jmp 0xe2c88
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movl 0x14(%rsp), %r13d
movl %r13d, %ecx
pushq %r14
pushq %r10
pushq %r11
callq 0xe51e0
jmp 0xe2de3
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movl 0x14(%rsp), %r13d
movl %r13d, %ecx
pushq %r14
pushq %r10
pushq %r11
callq 0xe7547
jmp 0xe2de3
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movl 0x14(%rsp), %r13d
movl %r13d, %ecx
pushq %r14
pushq %r10
pushq %r11
callq 0xe4368
jmp 0xe2de3
movq (%rsp), %rdi
movq %r15, %rsi
movl 0xc(%rsp), %r13d
movl %r13d, %ecx
movl %r8d, %ebx
movl %ebp, %r8d
movq %r9, %rax
movl %ebx, %r9d
pushq %r14
pushq %r10
pushq %r11
pushq %rax
callq 0xe8661
movq 0x20(%rsp), %rdi
addq $0x20, %rsp
jmp 0xe2688