// File: /workspace/github_c_makefile_star2_O2/orangeduck[P]mpc/mpc.c
// Function: mpc_parse_run
static int mpc_parse_run(mpc_input_t *i, mpc_parser_t *p, mpc_result_t *r, mpc_err_t **e, int depth) {

  int j = 0, k = 0;
  mpc_result_t results_stk[MPC_PARSE_STACK_MIN];
  mpc_result_t *results;

  if (depth == MPC_MAX_RECURSION_DEPTH)
  {
    MPC_FAILURE(mpc_err_fail(i, "Maximum recursion depth exceeded!"));
  }

  switch (p->type) {

    /* Basic Parsers */

    case MPC_TYPE_ANY:     MPC_PRIMITIVE(mpc_input_any(i, (char**)&r->output));
    case MPC_TYPE_SINGLE:  MPC_PRIMITIVE(mpc_input_char(i, p->data.single.x, (char**)&r->output));
    case MPC_TYPE_RANGE:   MPC_PRIMITIVE(mpc_input_range(i, p->data.range.x, p->data.range.y, (char**)&r->output));
    case MPC_TYPE_ONEOF:   MPC_PRIMITIVE(mpc_input_oneof(i, p->data.string.x, (char**)&r->output));
    case MPC_TYPE_NONEOF:  MPC_PRIMITIVE(mpc_input_noneof(i, p->data.string.x, (char**)&r->output));
    case MPC_TYPE_SATISFY: MPC_PRIMITIVE(mpc_input_satisfy(i, p->data.satisfy.f, (char**)&r->output));
    case MPC_TYPE_STRING:  MPC_PRIMITIVE(mpc_input_string(i, p->data.string.x, (char**)&r->output));
    case MPC_TYPE_ANCHOR:  MPC_PRIMITIVE(mpc_input_anchor(i, p->data.anchor.f, (char**)&r->output));
    case MPC_TYPE_SOI:     MPC_PRIMITIVE(mpc_input_soi(i, (char**)&r->output));
    case MPC_TYPE_EOI:     MPC_PRIMITIVE(mpc_input_eoi(i, (char**)&r->output));

    /* Other parsers */

    case MPC_TYPE_UNDEFINED: MPC_FAILURE(mpc_err_fail(i, "Parser Undefined!"));
    case MPC_TYPE_PASS:      MPC_SUCCESS(NULL);
    case MPC_TYPE_FAIL:      MPC_FAILURE(mpc_err_fail(i, p->data.fail.m));
    case MPC_TYPE_LIFT:      MPC_SUCCESS(p->data.lift.lf());
    case MPC_TYPE_LIFT_VAL:  MPC_SUCCESS(p->data.lift.x);
    case MPC_TYPE_STATE:     MPC_SUCCESS(mpc_input_state_copy(i));

    /* Application Parsers */

    case MPC_TYPE_APPLY:
      if (mpc_parse_run(i, p->data.apply.x, r, e, depth+1)) {
        MPC_SUCCESS(mpc_parse_apply(i, p->data.apply.f, r->output));
      } else {
        MPC_FAILURE(r->output);
      }

    case MPC_TYPE_APPLY_TO:
      if (mpc_parse_run(i, p->data.apply_to.x, r, e, depth+1)) {
        MPC_SUCCESS(mpc_parse_apply_to(i, p->data.apply_to.f, r->output, p->data.apply_to.d));
      } else {
        MPC_FAILURE(r->error);
      }

    case MPC_TYPE_CHECK:
      if (mpc_parse_run(i, p->data.check.x, r, e, depth+1)) {
        if (p->data.check.f(&r->output)) {
          MPC_SUCCESS(r->output);
        } else {
          mpc_parse_dtor(i, p->data.check.dx, r->output);
          MPC_FAILURE(mpc_err_fail(i, p->data.check.e));
        }
      } else {
        MPC_FAILURE(r->error);
      }

    case MPC_TYPE_CHECK_WITH:
      if (mpc_parse_run(i, p->data.check_with.x, r, e, depth+1)) {
        if (p->data.check_with.f(&r->output, p->data.check_with.d)) {
          MPC_SUCCESS(r->output);
        } else {
          mpc_parse_dtor(i, p->data.check.dx, r->output);
          MPC_FAILURE(mpc_err_fail(i, p->data.check_with.e));
        }
      } else {
        MPC_FAILURE(r->error);
      }

    case MPC_TYPE_EXPECT:
      mpc_input_suppress_enable(i);
      if (mpc_parse_run(i, p->data.expect.x, r, e, depth+1)) {
        mpc_input_suppress_disable(i);
        MPC_SUCCESS(r->output);
      } else {
        mpc_input_suppress_disable(i);
        MPC_FAILURE(mpc_err_new(i, p->data.expect.m));
      }

    case MPC_TYPE_PREDICT:
      mpc_input_backtrack_disable(i);
      if (mpc_parse_run(i, p->data.predict.x, r, e, depth+1)) {
        mpc_input_backtrack_enable(i);
        MPC_SUCCESS(r->output);
      } else {
        mpc_input_backtrack_enable(i);
        MPC_FAILURE(r->error);
      }

    /* Optional Parsers */

    /* TODO: Update Not Error Message */

    case MPC_TYPE_NOT:
      mpc_input_mark(i);
      mpc_input_suppress_enable(i);
      if (mpc_parse_run(i, p->data.not.x, r, e, depth+1)) {
        mpc_input_rewind(i);
        mpc_input_suppress_disable(i);
        mpc_parse_dtor(i, p->data.not.dx, r->output);
        MPC_FAILURE(mpc_err_new(i, "opposite"));
      } else {
        mpc_input_unmark(i);
        mpc_input_suppress_disable(i);
        MPC_SUCCESS(p->data.not.lf());
      }

    case MPC_TYPE_MAYBE:
      if (mpc_parse_run(i, p->data.not.x, r, e, depth+1)) {
        MPC_SUCCESS(r->output);
      } else {
        *e = mpc_err_merge(i, *e, r->error);
        MPC_SUCCESS(p->data.not.lf());
      }

    /* Repeat Parsers */

    case MPC_TYPE_MANY:

      results = results_stk;

      while (mpc_parse_run(i, p->data.repeat.x, &results[j], e, depth+1)) {
        j++;
        results = mpc_grow_results(i, j, results_stk, results);
      }

      *e = mpc_err_merge(i, *e, results[j].error);

      MPC_SUCCESS(
        mpc_parse_fold(i, p->data.repeat.f, j, (mpc_val_t**)results);
        if (j >= MPC_PARSE_STACK_MIN) { mpc_free(i, results); });

    case MPC_TYPE_MANY1:

      results = results_stk;

      while (mpc_parse_run(i, p->data.repeat.x, &results[j], e, depth+1)) {
        j++;
        results = mpc_grow_results(i, j, results_stk, results);
      }

      if (j == 0) {
        MPC_FAILURE(
          mpc_err_many1(i, results[j].error);
          if (j >= MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
      } else {

        *e = mpc_err_merge(i, *e, results[j].error);

        MPC_SUCCESS(
          mpc_parse_fold(i, p->data.repeat.f, j, (mpc_val_t**)results);
          if (j >= MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
      }

   case MPC_TYPE_SEPBY1:

      results = results_stk;

      if(mpc_parse_run(i, p->data.sepby1.x, &results[j], e, depth+1)){
        j++;
        results = mpc_grow_results(i, j, results_stk, results);

        while (
          mpc_parse_run(i, p->data.sepby1.sep, &results[j], e, depth+1) &&
          mpc_parse_run(i, p->data.sepby1.x, &results[j], e, depth+1)
        ) {
          j++;
          results = mpc_grow_results(i, j, results_stk, results);
        }
      }

      if (j == 0) {
        MPC_FAILURE(
          mpc_err_many1(i, results[j].error);
          if (j >= MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
      } else {
        *e = mpc_err_merge(i, *e, results[j].error);

        MPC_SUCCESS(
          mpc_parse_fold(i, p->data.repeat.f, j, (mpc_val_t**)results);
          if (j >= MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
      }

    case MPC_TYPE_COUNT:

      results = p->data.repeat.n > MPC_PARSE_STACK_MIN
        ? mpc_malloc(i, sizeof(mpc_result_t) * p->data.repeat.n)
        : results_stk;

      while (mpc_parse_run(i, p->data.repeat.x, &results[j], e, depth+1)) {
        j++;
        if (j == p->data.repeat.n) { break; }
      }

      if (j == p->data.repeat.n) {
        MPC_SUCCESS(
          mpc_parse_fold(i, p->data.repeat.f, j, (mpc_val_t**)results);
          if (p->data.repeat.n > MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
      } else {
        for (k = 0; k < j; k++) {
          mpc_parse_dtor(i, p->data.repeat.dx, results[k].output);
        }
        MPC_FAILURE(
          mpc_err_count(i, results[j].error, p->data.repeat.n);
          if (p->data.repeat.n > MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
      }

    /* Combinatory Parsers */

    case MPC_TYPE_OR:

      if (p->data.or.n == 0) { MPC_SUCCESS(NULL); }

      results = p->data.or.n > MPC_PARSE_STACK_MIN
        ? mpc_malloc(i, sizeof(mpc_result_t) * p->data.or.n)
        : results_stk;

      for (j = 0; j < p->data.or.n; j++) {
        if (mpc_parse_run(i, p->data.or.xs[j], &results[j], e, depth+1)) {
          MPC_SUCCESS(results[j].output;
            if (p->data.or.n > MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
        } else {
          *e = mpc_err_merge(i, *e, results[j].error);
        }
      }

      MPC_FAILURE(NULL;
        if (p->data.or.n > MPC_PARSE_STACK_MIN) { mpc_free(i, results); });

    case MPC_TYPE_AND:
      if (p->data.and.n == 0) { MPC_SUCCESS(NULL); }

      results = p->data.or.n > MPC_PARSE_STACK_MIN
        ? mpc_malloc(i, sizeof(mpc_result_t) * p->data.or.n)
        : results_stk;

      mpc_input_mark(i);
      for (j = 0; j < p->data.and.n; j++) {
        if (!mpc_parse_run(i, p->data.and.xs[j], &results[j], e, depth+1)) {
          mpc_input_rewind(i);
          for (k = 0; k < j; k++) {
            mpc_parse_dtor(i, p->data.and.dxs[k], results[k].output);
          }
          MPC_FAILURE(results[j].error;
            if (p->data.or.n > MPC_PARSE_STACK_MIN) { mpc_free(i, results); });
        }
      }
      mpc_input_unmark(i);
      MPC_SUCCESS(
        mpc_parse_fold(i, p->data.and.f, j, (mpc_val_t**)results);
        if (p->data.or.n > MPC_PARSE_STACK_MIN) { mpc_free(i, results); });

    /* End */

    default:

      MPC_FAILURE(mpc_err_fail(i, "Unknown Parser Type Id!"));
  }

  return 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r13
movq %rdi, %r14
cmpl $0x3e8, %r8d            # imm = 0x3E8
jne 0x4e27
leaq 0x786d(%rip), %rsi      # 0xc681
movq %r14, %rdi
callq 0x4d5c
movq %rax, (%r13)
xorl %ebp, %ebp
jmp 0x566e
movq %rsi, %r15
movzbl 0x30(%rsi), %eax
cmpq $0x1d, %rax
ja 0x52fc
movl %r8d, %ebp
movq %rcx, %r12
leaq 0x71f3(%rip), %rcx      # 0xc038
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x784e(%rip), %rsi      # 0xc6a3
jmp 0x4e14
xorl %ebp, %ebp
cmpb $0x0, 0x68(%r14)
sete %bpl
andq $0x0, (%r13)
jmp 0x566e
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x4e20
movq (%r13), %rsi
movq %r14, %rdi
movq 0x10(%r15), %r14
movq 0x18(%r15), %rbx
callq 0x58c7
movq %rax, %rdi
movq %rbx, %rsi
callq *%r14
jmp 0x5667
movq 0x8(%r15), %rbx
movq %r14, %r15
movq %r14, %rdi
callq 0xb10c
movq %rbx, %r14
movb (%r14), %al
testb %al, %al
je 0x5528
movsbl %al, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0xafe1
incq %r14
testl %eax, %eax
jne 0x4ebb
movq %r15, %rdi
callq 0xb1a5
jmp 0x53bd
movq 0x8(%r15), %rbx
movq %r14, %rdi
callq 0xb4e0
testl %eax, %eax
jne 0x53bd
movq %r14, %rdi
callq 0xb4f1
movsbl %al, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4220
testq %rax, %rax
je 0x52ca
movq %r14, %rdi
movl %ebp, %esi
jmp 0x5209
movq 0x10(%r15), %rax
jmp 0x5667
movb 0x8(%r15), %bpl
movb 0x9(%r15), %bl
movq %r14, %rdi
callq 0xb4e0
testl %eax, %eax
jne 0x53bd
movq %r14, %rdi
callq 0xb4f1
cmpb %bpl, %al
jl 0x4f59
cmpb %bl, %al
jle 0x52e9
movsbl %al, %esi
movq %r14, %rdi
jmp 0x5209
movsbl 0x8(%r15), %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0xafe1
jmp 0x5230
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
xorl %ebp, %ebp
testl %eax, %eax
je 0x566e
movq %r13, %rdi
callq *0x18(%r15)
testl %eax, %eax
jne 0x566b
movq 0x10(%r15), %rsi
movq (%r13), %rdx
movq %r14, %rdi
callq 0xb034
movq 0x20(%r15), %rsi
jmp 0x54c3
movl 0x8(%r15), %esi
testq %rsi, %rsi
je 0x53a3
cmpl $0x5, %esi
movq %r13, 0x8(%rsp)
jl 0x56ab
shlq $0x3, %rsi
movq %r14, %rdi
callq 0xaf8f
jmp 0x56b0
movq 0x8(%r15), %rsi
jmp 0x4e14
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x4e20
movq %r14, %r12
movq 0x10(%r15), %r14
movq (%r13), %rbx
cmpq 0xbfb0(%rip), %r14      # 0x10fd8
je 0x5808
cmpq 0xbf53(%rip), %r14      # 0x10f88
je 0x583f
movq %r12, %rdi
movq %rbx, %rsi
callq 0x58c7
movq %rax, %rdi
callq *%r14
movq %rax, %r15
jmp 0x585c
callq *0x8(%r15)
jmp 0x5667
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0xaf8f
movups 0x10(%r14), %xmm0
movups 0x20(%r14), %xmm1
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
jmp 0x5667
decl 0x4c(%r14)
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
incl 0x4c(%r14)
jmp 0x5670
movq %r15, (%rsp)
movq %r13, 0x8(%rsp)
incl %ebp
leaq 0x20(%rsp), %rbx
movq %r14, %r15
xorl %r14d, %r14d
xorl %r13d, %r13d
movq (%rsp), %rax
movq 0x18(%rax), %rsi
leaq (%rbx,%r14), %rdx
movq %r15, %rdi
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x518b
incq %r13
movq %r15, %rdi
movl %r13d, %esi
leaq 0x20(%rsp), %rdx
movq %rbx, %rcx
callq 0xb2a4
movq %rax, %rbx
addq $0x8, %r14
jmp 0x50bb
incl 0x48(%r14)
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
decl 0x48(%r14)
testl %eax, %eax
jne 0x566b
movq 0x10(%r15), %rsi
jmp 0x528b
movq %r15, (%rsp)
movq %r13, 0x8(%rsp)
incl %ebp
leaq 0x20(%rsp), %rbx
movq %r14, %r15
xorl %r14d, %r14d
xorl %r13d, %r13d
movq (%rsp), %rax
movq 0x18(%rax), %rsi
leaq (%rbx,%r14), %rdx
movq %r15, %rdi
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x5182
incq %r13
movq %r15, %rdi
movl %r13d, %esi
leaq 0x20(%rsp), %rdx
movq %rbx, %rcx
callq 0xb2a4
movq %rax, %rbx
addq $0x8, %r14
jmp 0x5145
testq %r13, %r13
je 0x5641
movq (%r12), %rsi
movq (%rbx,%r13,8), %rdx
movq %r15, %rdi
callq 0x5930
movq %rax, (%r12)
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movq %r15, %rdi
movl %r13d, %edx
movq %rbx, %rcx
callq 0xb2dd
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rbp
cmpq $0x4, %r13
jb 0x566e
movq %r15, %rdi
jmp 0x572f
movq %r15, %rax
movq %r14, %r15
movq 0x8(%rax), %r14
movq %r15, %rdi
callq 0xb4e0
testl %eax, %eax
jne 0x53bd
movq %r15, %rdi
callq 0xb4f1
movsbl %al, %ebx
movl %ebx, %edi
callq *%r14
movq %r15, %rdi
movl %ebx, %esi
testl %eax, %eax
jne 0x52ef
callq 0xb6cd
jmp 0x53bd
movq %r14, %rdi
movq 0x8(%r15), %r14
andq $0x0, (%r13)
movsbl 0x68(%rdi), %ebx
callq 0xb5fc
movsbl %al, %esi
movl %ebx, %edi
callq *%r14
testl %eax, %eax
jne 0x566b
jmp 0x53bd
movq %r14, %rdi
callq 0xb10c
incl 0x48(%r14)
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
movq %r14, %rdi
testl %eax, %eax
je 0x565a
callq 0xb1a5
decl 0x48(%r14)
movq 0x10(%r15), %rsi
movq (%r13), %rdx
movq %r14, %rdi
callq 0xb034
leaq 0x742a(%rip), %rsi      # 0xc6b5
movq %r14, %rdi
callq 0xb05a
jmp 0x4e1c
movq 0x8(%r15), %rbx
movq %r14, %rdi
callq 0xb4e0
testl %eax, %eax
jne 0x53bd
movq %r14, %rdi
callq 0xb4f1
movsbl %al, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4220
testq %rax, %rax
je 0x4f19
movq %r14, %rdi
movl %ebp, %esi
jmp 0x52ef
movq %r14, %rdi
callq 0xb4e0
testl %eax, %eax
jne 0x53bd
movq %r14, %rdi
callq 0xb4f1
movsbl %al, %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0xb55b
jmp 0x566b
leaq 0x73bb(%rip), %rsi      # 0xc6be
jmp 0x4e14
movslq 0x8(%r15), %rsi
cmpq $0x5, %rsi
movq %r13, 0x8(%rsp)
jl 0x5558
shlq $0x3, %rsi
movq %r14, %rdi
callq 0xaf8f
movq %rax, %rbx
jmp 0x555d
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
pushq $0x1
popq %rbp
testl %eax, %eax
jne 0x566e
movq (%r12), %rsi
movq (%r13), %rdx
movq %r14, %rdi
callq 0x5930
movq %rax, (%r12)
callq *0x18(%r15)
jmp 0x54cb
movl 0x8(%r15), %esi
testq %rsi, %rsi
je 0x53a3
cmpl $0x5, %esi
movq %r13, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %r12, 0x40(%rsp)
jl 0x5737
shlq $0x3, %rsi
movq %r14, %rdi
callq 0xaf8f
movq %rax, %r13
jmp 0x573c
andq $0x0, (%r13)
jmp 0x566b
andq $0x0, (%r13)
cmpl $0x0, 0x28(%r14)
je 0x567f
andq $0x0, (%r13)
jmp 0x4e20
movq 0x18(%r15), %rsi
incl %ebp
leaq 0x20(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x5699
movq %r13, 0x8(%rsp)
pushq $0x1
popq %rax
movq %rax, 0x18(%rsp)
movq %r14, 0x10(%rsp)
pushq $0x8
popq %rcx
pushq $0x2
popq %rax
movl %eax, (%rsp)
movq %rbx, %rax
movq 0x20(%r15), %rsi
movq %rax, %r14
movq %rcx, %r13
leaq (%rax,%rcx), %rbx
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x54d4
movq 0x18(%r15), %rsi
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x54d4
incq 0x18(%rsp)
movq 0x10(%rsp), %rdi
movl (%rsp), %ebx
movl %ebx, %esi
leaq 0x20(%rsp), %rdx
movq %r14, %rcx
callq 0xb2a4
movq %r13, %rcx
addq $0x8, %rcx
incl %ebx
movl %ebx, (%rsp)
jmp 0x5409
movq 0x8(%r15), %rsi
incl %ebp
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
xorl %ebp, %ebp
testl %eax, %eax
je 0x566e
movq 0x20(%r15), %rsi
movq %r13, %rdi
callq *0x18(%r15)
testl %eax, %eax
jne 0x566b
movq 0x10(%r15), %rsi
movq (%r13), %rdx
movq %r14, %rdi
callq 0xb034
movq 0x28(%r15), %rsi
movq %r14, %rdi
callq 0x4d5c
movq %rax, (%r13)
jmp 0x566e
movq (%r12), %rsi
movq 0x18(%rsp), %rbx
movl %ebx, %eax
movq %r14, %r13
movq (%r14,%rax,8), %rdx
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x5930
movq %rax, (%r12)
movq 0x10(%r15), %rsi
movq %r14, %rdi
movl %ebx, %edx
movq %r13, %rcx
callq 0xb2dd
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rbp
cmpq $0x4, %rbx
jb 0x566e
movq %r14, %rdi
movq %r13, %rsi
jmp 0x5835
movq %r15, %rdi
callq 0xb1f6
movq %rbx, %rdi
callq 0x41c0
leaq 0x1(%rax), %rsi
movq %r15, %rdi
callq 0xaf8f
movq %rax, (%r13)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40e0
jmp 0x566b
leaq 0x20(%rsp), %rbx
incl %ebp
xorl %r13d, %r13d
movq %rbx, (%rsp)
movq 0x18(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
movl 0x8(%r15), %edx
testl %eax, %eax
je 0x558f
incq %r13
addq $0x8, %rbx
cmpq %rdx, %r13
jne 0x5566
cmpl %r13d, %edx
jne 0x55a0
movq 0x10(%r15), %rsi
movq %r14, %rdi
jmp 0x570a
movq %r15, %r12
movq %r14, %r15
xorl %ebx, %ebx
testl %r13d, %r13d
movl $0x0, %r14d
cmovgl %r13d, %r14d
movq (%rsp), %rbp
cmpq %rbx, %r14
je 0x55d5
movq 0x20(%r12), %rsi
movq (%rbp,%rbx,8), %rdx
movq %r15, %rdi
callq 0xb034
incq %rbx
jmp 0x55b9
movslq %r13d, %rax
movq (%rbp,%rax,8), %rax
movq %rax, 0x18(%rsp)
movl 0x8(%r12), %ebx
pushq $0xa
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
addl $0x6, %eax
movslq %eax, %rsi
movq %r15, %rdi
callq 0xaf8f
xorl %ebp, %ebp
testq %rax, %rax
je 0x5818
movq %rax, %r13
leaq 0x70d9(%rip), %rsi      # 0xc6eb
movq %rax, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x4760
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0xb7ec
movq %rax, %rbx
movq %r15, %rdi
movq %r13, %rsi
callq 0xb49e
jmp 0x581a
movq (%rbx,%r13,8), %rsi
movq %r15, %rdi
callq 0xb4d4
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x4e20
callq 0xb1f6
decl 0x48(%r14)
callq *0x18(%r15)
movq %rax, (%r13)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0xb4e0
testl %eax, %eax
je 0x53bd
movl $0x1, 0x28(%r14)
jmp 0x566b
movq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0xb4d4
jmp 0x4e1c
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
callq 0xb10c
incl %ebp
xorl %r13d, %r13d
movslq 0x8(%r15), %rax
cmpq %rax, %r13
jge 0x56f8
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %rsi
movq (%rsp), %rax
leaq (%rax,%r13,8), %rbx
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
je 0x57b3
incq %r13
jmp 0x56c1
movq %r14, %rdi
callq 0xb1f6
movq 0x10(%r15), %rsi
movq %r14, %rdi
movl %r13d, %edx
movq (%rsp), %rbx
movq %rbx, %rcx
callq 0xb2dd
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rbp
cmpl $0x5, 0x8(%r15)
jl 0x566e
movq %r14, %rdi
movq %rbx, %rsi
jmp 0x5835
leaq 0x20(%rsp), %r13
incl %ebp
xorl %r14d, %r14d
movq %r13, (%rsp)
movq 0x40(%rsp), %rbx
movslq 0x8(%r15), %rax
cmpq %rax, %r14
jge 0x5796
movq %r15, %r12
movq 0x10(%r15), %rax
movq (%rax,%r14,8), %rsi
movq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r13, %rdx
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x4df0
testl %eax, %eax
jne 0x57f7
movq (%rbx), %rsi
movq (%r13), %rdx
movq %r15, %rdi
callq 0x5930
movq %rax, (%rbx)
incq %r14
addq $0x8, %r13
movq %r12, %r15
jmp 0x574a
movq 0x8(%rsp), %rax
andq $0x0, (%rax)
xorl %ebp, %ebp
cmpl $0x5, 0x8(%r15)
jl 0x566e
movq 0x10(%rsp), %rdi
jmp 0x5831
movq %r15, %r12
movq %r14, %r15
movq %r14, %rdi
callq 0xb1a5
xorl %r14d, %r14d
movq (%rsp), %rbp
cmpq %r14, %r13
je 0x57e8
movq 0x20(%r12), %rax
movq (%rax,%r14,8), %rsi
movq (%rbp,%r14,8), %rdx
movq %r15, %rdi
callq 0xb034
incq %r14
jmp 0x57c8
movq (%rbx), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
jmp 0x5822
movq (%r13), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rbp
jmp 0x5822
movq %r12, %rdi
movq %rbx, %rsi
callq 0xb49e
xorl %r15d, %r15d
jmp 0x585c
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
cmpl $0x5, 0x8(%r12)
jl 0x566e
movq %r15, %rdi
movq (%rsp), %rsi
callq 0xb49e
jmp 0x566e
leaq 0x6f2b(%rip), %rdi      # 0xc771
movq %rbx, %rsi
callq 0x4820
movq %rax, %r15
movq %r12, %rdi
movq %rbx, %rsi
callq 0xb49e
movq %r15, (%r13)
jmp 0x566b