// File: /workspace/github_c_makefile_star2_O0/pedro-onate[P]eva/eva.c
// Function: es_vm_run
static void* es_vm_run(es_ctx_t* ctx, es_vm_mode_t mode, ...)
{

#ifdef LABELS_AS_VALUES
  static es_inst_info_t inst_info[] = {
    { &&HALT,       "halt",       0 },
    { &&CONST,      "const",      1 },
    { &&POP,        "pop",        0 },
    { &&GLOBAL_REF, "global-ref", 1 },
    { &&GLOBAL_SET, "global-set", 1 },
    { &&CLOSED_REF, "closed-ref", 2 },
    { &&CLOSED_SET, "closed-set", 2 },
    { &&ARG_REF,    "arg-ref",    1 },
    { &&ARG_SET,    "arg-set",    1 },
    { &&JMP,        "jmp",        1 },
    { &&BF,         "bf",         1 },
    { &&CALL,       "call",       1 },
    { &&TAIL_CALL,  "tail-call",  1 },
    { &&RETURN,     "return",     0 },
    { &&CLOSURE,    "closure",    1 }
  };

  if (mode == ES_VM_FETCH_OPCODE) {
    va_list ap;
    va_start(ap, mode);
    es_opcode_t opcode = va_arg(ap, es_opcode_t);
    va_end(ap);
    return &inst_info[opcode];
  }
#endif

  va_list ap;
  va_start(ap, mode);
  es_val_t proc = va_arg(ap, es_val_t);
  va_end(ap);

  es_inst_t* inst  = es_bytecode_val(ctx->bytecode)->inst;
  ctx->ip          = inst + es_proc_addr(proc);
  ctx->args        = es_nil;
  es_val_t* consts = es_bytecode_val(ctx->bytecode)->consts;

  #ifdef LABELS_AS_VALUES
    #define SWITCH(value) goto *(value);
    #define CASE(label)   label
    #define BREAK         goto *(ctx->ip->opcode)
  #else
    #define SWITCH(value) switch(value)
    #define CASE(label)   case label
    #define BREAK         break
  #endif

  while(1) {
    SWITCH(ctx->ip->opcode) {
      CASE(HALT):
        //assert(ctx->sp - ctx->stack == 1);
        return (void*)pop(ctx);
      CASE(CONST): {
        int const_idx = ctx->ip->operand1;
        push(ctx, consts[const_idx]);
        ctx->ip++;
        BREAK;
      }
      CASE(POP):
        ctx->sp--;
        ctx->ip++;
        BREAK;
      CASE(BF): {
        int else_br = ctx->ip->operand1;
        es_val_t val = pop(ctx);
        ctx->ip += es_is_true(val) ? 1 : else_br;
        BREAK;
      }
      CASE(JMP):
        ctx->ip += ctx->ip->operand1;
        BREAK;
      CASE(GLOBAL_REF): {
        int global_idx      = ctx->ip->operand1;
        es_val_t global_val = env_ref(ctx, ctx->env, global_idx);
        push(ctx, global_val);
        ctx->ip++;
        BREAK;
      }
      CASE(GLOBAL_SET): {
        int global_idx = ctx->ip->operand1;
        es_val_t val   = pop(ctx);
        push(ctx, env_set(ctx, ctx->env, global_idx, val));
        ctx->ip++;
        BREAK;
      }
      CASE(CLOSED_REF): {
        int depth = ctx->ip->operand1;
        int idx   = ctx->ip->operand2;
        es_args_t* cenv = es_args_val(ctx->args);
        while(depth-- > 0) {
          cenv = cenv->parent;
        }
        push(ctx, cenv->args[idx]);
        ctx->ip++;
        BREAK;
      }
      CASE(CLOSED_SET): {
        int depth = ctx->ip->operand1;
        int idx   = ctx->ip->operand2;
        es_args_t* cenv = es_args_val(ctx->args);
        while(depth-- > 0) {
          cenv = cenv->parent;
        }
        cenv->args[idx] = pop(ctx);
        push(ctx, es_void);
        ctx->ip++;
        BREAK;
      }
      CASE(ARG_REF): {
        int arg_idx  = ctx->ip->operand1;
        es_val_t arg = es_args_val(ctx->args)->args[arg_idx];
        push(ctx, arg);
        ctx->ip++;
        BREAK;
      }
      CASE(ARG_SET): {
        int arg_idx  = ctx->ip->operand1;
        es_val_t val = pop(ctx);
        es_args_val(ctx->args)->args[arg_idx] = val;
        ctx->ip++;
        BREAK;
      }
      CASE(CLOSURE): {
        int const_idx = ctx->ip->operand1;
        es_val_t proc = consts[const_idx];
        es_val_t closure = es_make_closure(ctx, ctx->args, proc);
        push(ctx, closure);
        ctx->ip++;
        BREAK;
      }
      CASE(RETURN):
        restore(ctx);
        BREAK;
      CASE(CALL): {
        int argc = ctx->ip->operand1;
        ctx->ip++;
        es_val_t proc = pop(ctx);
        if (es_is_fn(proc)) {
          es_val_t* argv = ctx->sp - argc;
          es_val_t res   = es_fn_apply_argv(ctx, proc, argc, argv);
          pop_n(ctx, argc);
          push(ctx, res);
        } else if (es_is_closure(proc)) {
          es_closure_t* closure = es_closure_val(proc);
          es_proc_t* proc = es_obj_to(es_proc_t*, closure->proc);
          save(ctx);
          es_val_t* argv = ctx->sp - argc;
          ctx->args  = es_make_args(ctx, closure->env, proc->arity, proc->rest, argc, argv);
          pop_n(ctx, argc);
          ctx->ip = inst + proc->addr;
        } else if (es_is_cont(proc)) {
          // TODO
          assert(0);
        }
        BREAK;
      }
      CASE(TAIL_CALL): {
        int argc = ctx->ip->operand1;
        ctx->ip++;
        es_val_t proc = pop(ctx);
        if (es_is_fn(proc)) {
          es_val_t* argv = ctx->sp - argc;
          es_val_t res   = es_fn_apply_argv(ctx, proc, argc, argv);
          pop_n(ctx, argc);
          push(ctx, res);
          restore(ctx);
        } else if (es_is_closure(proc)) {
          es_closure_t* closure = es_closure_val(proc);
          es_proc_t* proc = es_obj_to(es_proc_t*, closure->proc);
          es_val_t* argv  = ctx->sp - argc;
          ctx->args   = es_make_args(ctx, closure->env, proc->arity, proc->rest, argc, argv);
          pop_n(ctx, argc);
          ctx->ip = inst + proc->addr;
        } else if (es_is_cont(proc)) {
          // TODO
          assert(0);
        }
        BREAK;
      }
    }
  }
  return (void*)es_void;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
testb %al, %al
je 0x4ce7
movaps %xmm0, -0x1e0(%rbp)
movaps %xmm1, -0x1d0(%rbp)
movaps %xmm2, -0x1c0(%rbp)
movaps %xmm3, -0x1b0(%rbp)
movaps %xmm4, -0x1a0(%rbp)
movaps %xmm5, -0x190(%rbp)
movaps %xmm6, -0x180(%rbp)
movaps %xmm7, -0x170(%rbp)
movq %r9, -0x1e8(%rbp)
movq %r8, -0x1f0(%rbp)
movq %rcx, -0x1f8(%rbp)
movq %rdx, -0x200(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x4dbc
leaq -0x30(%rbp), %rax
leaq -0x210(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x220(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x214(%rbp)
cmpl $0x28, %eax
ja 0x4d73
movq -0x220(%rbp), %rcx
movl -0x214(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x228(%rbp)
jmp 0x4d90
movq -0x220(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq -0x30(%rbp), %rax
movl -0x34(%rbp), %eax
movl %eax, %ecx
leaq 0xa334(%rip), %rax      # 0xf0e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x5ac4
leaq -0x50(%rbp), %rax
leaq -0x210(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x50(%rbp), %rax
movq %rax, -0x238(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x22c(%rbp)
cmpl $0x28, %eax
ja 0x4e1b
movq -0x238(%rbp), %rcx
movl -0x22c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x240(%rbp)
jmp 0x4e38
movq -0x238(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rax
movq -0x10(%rbp), %rax
movq 0x42060(%rax), %rdi
callq 0x7000
movq 0x8018(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x58(%rbp), %rdi
callq 0x9790
movq -0x248(%rbp), %rcx
cltq
shlq $0x4, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq $0x3, 0x42088(%rax)
movq -0x10(%rbp), %rax
movq 0x42060(%rax), %rdi
callq 0x7000
addq $0x10, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x5ac4
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x68(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rcx
addq $-0x8, %rcx
movq %rcx, 0x42070(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x1920
cmpl $0x0, %eax
je 0x4ff9
movl $0x1, %eax
movl %eax, -0x254(%rbp)
jmp 0x5002
movl -0x70(%rbp), %eax
movl %eax, -0x254(%rbp)
movl -0x254(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x42080(%rax), %rsi
movl -0x7c(%rbp), %edx
callq 0x3870
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x42080(%rax), %rsi
movl -0x8c(%rbp), %edx
movq -0x98(%rbp), %rcx
callq 0x97b0
movq %rax, %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0xa(%rax), %eax
movl %eax, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movq 0x42088(%rax), %rax
movq %rax, -0xa8(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x9c(%rbp)
cmpl $0x0, %eax
jle 0x5215
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0x51eb
movq -0xa8(%rbp), %rax
movslq -0xa0(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0xac(%rbp)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0xa(%rax), %eax
movl %eax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq 0x42088(%rax), %rax
movq %rax, -0xb8(%rbp)
movl -0xac(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xac(%rbp)
cmpl $0x0, %eax
jle 0x52da
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb8(%rbp)
jmp 0x52b0
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rdx
movq -0xb8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq $0x5b, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rax
movq 0x42088(%rax), %rax
movslq -0xbc(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0xcc(%rbp)
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x42088(%rax), %rax
movslq -0xcc(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0xdc(%rbp)
movq -0x68(%rbp), %rax
movslq -0xdc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x42088(%rax), %rsi
movq -0xe8(%rbp), %rdx
callq 0x3990
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movl 0x42078(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x42078(%rax)
movq -0x10(%rbp), %rax
addq $0x4a090, %rax          # imm = 0x4A090
movq -0x10(%rbp), %rcx
movslq 0x42078(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42088(%rax)
movq -0x10(%rbp), %rax
addq $0x4a090, %rax          # imm = 0x4A090
movq -0x10(%rbp), %rcx
movslq 0x42078(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0xf4(%rbp)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rdi
callq 0x2b60
cmpl $0x0, %eax
je 0x5685
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rax
movslq -0xf4(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rdi
movq -0x100(%rbp), %rsi
movl -0xf4(%rbp), %edx
movq -0x108(%rbp), %rcx
callq 0x9840
movq %rax, -0x110(%rbp)
movl -0xf4(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rcx
movslq %edx, %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movq %rcx, 0x42070(%rax)
movq -0x110(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
jmp 0x580e
movq -0x100(%rbp), %rdi
callq 0x3a40
cmpl $0x0, %eax
je 0x57da
movq -0x100(%rbp), %rdi
callq 0x3a90
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x10(%rbp), %rax
movq 0x42088(%rax), %rcx
movq -0x10(%rbp), %rax
addq $0x4a090, %rax          # imm = 0x4A090
movq -0x10(%rbp), %rdx
movslq 0x42078(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
movq -0x10(%rbp), %rax
addq $0x4a090, %rax          # imm = 0x4A090
movq -0x10(%rbp), %rdx
movslq 0x42078(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x42078(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x42078(%rax)
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rax
movslq -0xf4(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x10(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x120(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x120(%rbp), %rax
movl 0x14(%rax), %ecx
movl -0xf4(%rbp), %r8d
movq -0x128(%rbp), %r9
callq 0x9880
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42088(%rax)
movl -0xf4(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rcx
movslq %edx, %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movq %rcx, 0x42070(%rax)
movq -0x60(%rbp), %rcx
movq -0x120(%rbp), %rax
movslq 0x18(%rax), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42068(%rax)
jmp 0x580c
movq -0x100(%rbp), %rdi
callq 0x2c50
cmpl $0x0, %eax
je 0x580a
leaq 0x4aaf(%rip), %rdi      # 0xa2a1
leaq 0x4a05(%rip), %rsi      # 0xa1fe
movl $0x9c0, %edx            # imm = 0x9C0
leaq 0x4f22(%rip), %rcx      # 0xa727
callq 0x10b0
jmp 0x580c
jmp 0x580e
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x12c(%rbp)
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rcx
addq $0x10, %rcx
movq %rcx, 0x42068(%rax)
movq -0x10(%rbp), %rcx
movq 0x42070(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x42070(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0x2b60
cmpl $0x0, %eax
je 0x598c
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rax
movslq -0x12c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rdi
movq -0x138(%rbp), %rsi
movl -0x12c(%rbp), %edx
movq -0x140(%rbp), %rcx
callq 0x9840
movq %rax, -0x148(%rbp)
movl -0x12c(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rcx
movslq %edx, %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movq %rcx, 0x42070(%rax)
movq -0x148(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x42070(%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, 0x42070(%rdx)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl 0x42078(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x42078(%rax)
movq -0x10(%rbp), %rax
addq $0x4a090, %rax          # imm = 0x4A090
movq -0x10(%rbp), %rcx
movslq 0x42078(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42088(%rax)
movq -0x10(%rbp), %rax
addq $0x4a090, %rax          # imm = 0x4A090
movq -0x10(%rbp), %rcx
movslq 0x42078(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42068(%rax)
jmp 0x5aad
movq -0x138(%rbp), %rdi
callq 0x3a40
cmpl $0x0, %eax
je 0x5a79
movq -0x138(%rbp), %rdi
callq 0x3a90
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rax
movslq -0x12c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x160(%rbp)
movq -0x10(%rbp), %rdi
movq -0x150(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x158(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x158(%rbp), %rax
movl 0x14(%rax), %ecx
movl -0x12c(%rbp), %r8d
movq -0x160(%rbp), %r9
callq 0x9880
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42088(%rax)
movl -0x12c(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x42070(%rax), %rcx
movslq %edx, %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movq %rcx, 0x42070(%rax)
movq -0x60(%rbp), %rcx
movq -0x158(%rbp), %rax
movslq 0x18(%rax), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42068(%rax)
jmp 0x5aab
movq -0x138(%rbp), %rdi
callq 0x2c50
cmpl $0x0, %eax
je 0x5aa9
leaq 0x4810(%rip), %rdi      # 0xa2a1
leaq 0x4766(%rip), %rsi      # 0xa1fe
movl $0x9d7, %edx            # imm = 0x9D7
leaq 0x4c83(%rip), %rcx      # 0xa727
callq 0x10b0
jmp 0x5aab
jmp 0x5aad
movq -0x10(%rbp), %rax
movq 0x42068(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x5ad1
movq -0x8(%rbp), %rax
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x250(%rbp), %rax
jmpq *%rax
nopw (%rax,%rax)