// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: readconv
static void readconv(struct GlobalVars *gv,struct LinkFile *lf)
/* Read AmigaDOS/EHF hunks and symbols */
{
  struct HunkInfo hi;
  uint32_t w;
  struct ObjectUnit *u=NULL;
  struct Section *s=NULL;
  char *secname=NULL;
  uint8_t *headerattr=NULL;
  uint32_t index=0;

  init_hunkinfo(&hi,lf->filename,lf->data,lf->length);
  if (testword32(&hi) == HUNK_LIB) {
    ierror("readconv(): HUNK_LIB not yet supported");
  }

  /* HUNK_UNIT or HUNK_HEADER */
  else {
    while (w = testword32(&hi)) {
      switch (w & 0x3fffffff) {

        case HUNK_HEADER:
          /* header must be at the beginning of the file */
          if (hi.hunkptr == hi.hunkbase) {
            if (!s) {
              uint32_t n;
              add_objunit(gv,u,TRUE); /* add last one to glob. ObjUnit list */
              index = 0;
              u = create_objunit(gv,lf,lf->filename);
              nextword32(&hi);
              n = nextword32(&hi);
              movehunkptr32(&hi,n?n+2:1);
              w = nextword32(&hi);
              n = nextword32(&hi) - w + 1;  /* number of size specifiers */
              headerattr = hi.hunkptr;  /* remember section attributes */
              while (n--) {
                if ((nextword32(&hi) & 0xc0000000) == 0xc0000000)
                  nextword32(&hi);
              }
            }
            else
              /* Unexpected end of section */
              error(15,lf->pathname,s->name,u->objname);
          }
          else
            /* header appeared twice */
            error(16,lf->pathname,"HUNK_HEADER",lf->filename);
          break;

        case HUNK_UNIT:  /* a new ObjectUnit */
          if (!s) {
            char *uname;
            nextword32(&hi);
            add_objunit(gv,u,TRUE); /* add last one to glob. ObjUnit list */
            index = 0;
            uname = gethunkname(&hi);
            u = create_objunit(gv,lf,uname);
          }
          else
            /* Unexpected end of section */
            error(15,lf->pathname,s->name,u->objname);
          break;

        case HUNK_NAME:  /* name of a section */
          if (u && !s) {
            nextword32(&hi);
            secname = gethunkname(&hi);
          }
          else
            /* misplaced hunk */
            error(17,lf->pathname,"HUNK_NAME",u?u->objname:lf->filename);
          break;

        case HUNK_CODE:
        case HUNK_PPC_CODE:
        case HUNK_DATA:
        case HUNK_BSS:
          if (u && !s) {  /* a new Section */
            uint8_t s_attr;
            unsigned long s_size;
            nextword32(&hi);

            /* determine section attributes */
            if (headerattr) {
              if ((s_attr = (read32be(headerattr)>>24) & 0xc0) == 0xc0) {
                s_attr = 0;  /* ext. mem. type identifier is not supported */
                headerattr += 8;
              }
              else
                headerattr += 4;
            }
            else
              s_attr = (w>>24) & 0xc0;  /* SF_FAST | SF_CHIP */

            if (gv->fix_unnamed==TRUE && !secname) {
              /* assign a name according to the section's type */
              switch (w & 0xffff) {
                case HUNK_PPC_CODE:
                case HUNK_CODE:
                  secname = ".text";
                  break;
                case HUNK_DATA:
                  secname = ".data";
                  break;
                case HUNK_BSS:
                  secname = ".bss";
                  break;
              }
            }
            /* Sections of an executable should never be joined, or */
            /* dangerous things will happen. */
            if (!secname && hi.exec) {
              secname = alloc(10);
              sprintf(secname,"S%08lx",(unsigned long)hi.hunkptr);
            }

            /* create new section node */
            s_size = (unsigned long)nextword32(&hi) & 0x3fffffff;
            s = create_section(u,secname,hi.hunkptr,s_size<<2);
            s->flags = s_attr | SF_ALLOC;
            s->alignment = gv->min_alignment>2 ? gv->min_alignment : 2;
            s->id = index++;
            switch (w & 0xffff) {
              case HUNK_PPC_CODE:
                s->flags |= SF_EHFPPC;  /* section contains PowerPC code */
              case HUNK_CODE:
                s->type = ST_CODE;
                /* @@@@ amigahunk/ehf code is always writeable ??? */
                s->protection = SP_READ | /*SP_WRITE |*/ SP_EXEC;
                break;
              case HUNK_DATA:
                s->type = ST_DATA;
                s->protection = SP_READ | SP_WRITE;
                break;
              case HUNK_BSS:
                s->flags |= SF_UNINITIALIZED;
                s->data = NULL;
                s->type = ST_UDATA;
                s->protection = SP_READ | SP_WRITE;
                break;
            }
            if (!(s->flags & SF_UNINITIALIZED))
              movehunkptr32(&hi,s_size);  /* skip section's contents */
          }
          else
            /* Section appeared twice */
            error(16,lf->pathname,"Section",u?u->objname:lf->filename);
          break;

        case HUNK_ABSRELOC32:
          if (!addlongrelocs(gv,&hi,s,R_ABS,32))
            error(17,lf->pathname,"HUNK_ABSRELOC32",u?u->objname:lf->filename);
          break;

        case HUNK_RELOC32SHORT:
          if (!addshortrelocs32(gv,&hi,s))
            error(17,lf->pathname,"HUNK_RELOC32SHORT",u?u->objname:lf->filename);
          break;

        case HUNK_RELRELOC16:
          if (!addlongrelocs(gv,&hi,s,R_PC,16))
            error(17,lf->pathname,"HUNK_RELRELOC16",u?u->objname:lf->filename);
          break;

        case HUNK_RELRELOC8:
          if (!addlongrelocs(gv,&hi,s,R_PC,8))
            error(17,lf->pathname,"HUNK_RELRELOC8",u?u->objname:lf->filename);
          break;

        case HUNK_RELRELOC32:
          if (!addlongrelocs(gv,&hi,s,R_PC,32))
            error(17,lf->pathname,"HUNK_RELRELOC32",u?u->objname:lf->filename);
          break;

        case HUNK_ABSRELOC16:
          if (!addlongrelocs(gv,&hi,s,R_ABS,16))
            error(17,lf->pathname,"HUNK_ABSRELOC16",u?u->objname:lf->filename);
          break;

        case HUNK_DREL32:
          /* This hunk block has a double meaning. Before Amiga OS 3.0 */
          /* it was often used as RELOC32SHORT, but will appear in */
          /* executables only. */
          if (hi.exec) {
            if (!addshortrelocs32(gv,&hi,s))
              error(17,lf->pathname,"HUNK_RELOC32SHORT",
                    u?u->objname:lf->filename);
          }
          else {
            if (!addlongrelocs(gv,&hi,s,R_SD,32))
              error(17,lf->pathname,"HUNK_DREL32",u?u->objname:lf->filename);
          }
          break;

        case HUNK_DREL16:
          if (!addlongrelocs(gv,&hi,s,R_SD,16))
            error(17,lf->pathname,"HUNK_DREL16",u?u->objname:lf->filename);
          break;

        case HUNK_DREL8:
          if (!addlongrelocs(gv,&hi,s,R_SD,8))
            error(17,lf->pathname,"HUNK_DREL8",u?u->objname:lf->filename);
          break;

        case HUNK_RELRELOC26: /* EHF */
          if (!addlongrelocs(gv,&hi,s,R_PC,24))
            error(17,lf->pathname,"HUNK_RELRELOC26",u?u->objname:lf->filename);
          break;

        case HUNK_EXT:  /* external definitions and references */
        case HUNK_SYMBOL:
          if (s) {
            uint32_t xtype;
            char *xname;

            nextword32(&hi);
            while (xtype = testword32(&hi)) {
              xname = gethunkname(&hi);
              switch (xtype >>= 24) {

                /* Symbol Definitions */
                case EXT_SYMB:  /* local symbol definition (for debugging) */
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_RELOC,SYMB_LOCAL);
                  break;
                case EXT_DEF:  /* global addr. symbol def. (requires reloc) */
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_RELOC,SYMB_GLOBAL);
                  break;
                case EXT_ABS:  /* global def. of absolute symbol */
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_ABS,SYMB_GLOBAL);
                  break;
                case EXT_RES:  /* unsupported type, invalid since OS2.0 */
                  error(18,lf->pathname,xname,u->objname,EXT_RES);
                  break;

                /* Unresolved Symbol References */
                case EXT_ABSREF32:
                  create_xrefs(gv,&hi,s,xname,R_ABS,32);
                  break;
                case EXT_ABSREF16:
                  create_xrefs(gv,&hi,s,xname,R_ABS,16);
                  break;
                case EXT_ABSREF8:
                  create_xrefs(gv,&hi,s,xname,R_ABS,8);
                  break;
                case EXT_RELREF32:
                  create_xrefs(gv,&hi,s,xname,R_PC,32);
                  break;
                case EXT_RELREF26: /* EHF */
                  create_xrefs(gv,&hi,s,xname,R_PC,24);
                  break;
                case EXT_RELREF16:
                  create_xrefs(gv,&hi,s,xname,R_PC,16);
                  break;
                case EXT_RELREF8:
                  create_xrefs(gv,&hi,s,xname,R_PC,8);
                  break;
                case EXT_DEXT32:
                  create_xrefs(gv,&hi,s,xname,R_SD,32);
                  break;
                case EXT_DEXT16:
                  create_xrefs(gv,&hi,s,xname,R_SD,16);
                  break;
                case EXT_DEXT8:
                  create_xrefs(gv,&hi,s,xname,R_SD,8);
                  break;

                case EXT_ABSCOMMON:
                  /* ABSCOMMON was never used and only supported */
                  /* by the VERY old ALink linker on AmigaOS (now */
                  /* it's used by pasm). But I like it... :) */
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_COMMON,SYMB_GLOBAL);
                  create_xrefs(gv,&hi,s,xname,R_ABS,32);
                  break;
                case EXT_RELCOMMON:
                  /* RELCOMMON was introduced in OS3.1 and might */
                  /* only be used by the pasm assembler. */
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_COMMON,SYMB_GLOBAL);
                  create_xrefs(gv,&hi,s,xname,R_PC,32);
                  break;

                /* The following are INOFFICIAL base-relative */
                /* common symbol references, created for vbcc */
                case EXT_DEXT32COMMON:
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_COMMON,SYMB_GLOBAL);
                  create_xrefs(gv,&hi,s,xname,R_SD,32);
                  break;
                case EXT_DEXT16COMMON:
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_COMMON,SYMB_GLOBAL);
                  create_xrefs(gv,&hi,s,xname,R_SD,16);
                  break;
                case EXT_DEXT8COMMON:
                  create_xdef(gv,s,xname,(int32_t)nextword32(&hi),
                              SYM_COMMON,SYMB_GLOBAL);
                  create_xrefs(gv,&hi,s,xname,R_SD,8);
                  break;

                default:  /* unsupported HUNK_EXT sub type */
                  if (xtype & 0x80000000)
                    error(20,lf->pathname,xname,u->objname,xtype>>24);
                  else
                    error(18,lf->pathname,xname,u->objname,xtype>>24);
              }
            }
            nextword32(&hi);
          }
          else
            error(17,lf->pathname,(w==HUNK_EXT) ? "HUNK_EXT" : "HUNK_SYMBOL",
                  u ? u->objname : lf->filename);
          break;

        case HUNK_DEBUG:
          if (!create_debuginfo(gv,&hi,s))
            error(17,lf->pathname,"HUNK_DEBUG",u?u->objname:lf->filename);
          break;

        case HUNK_OVERLAY:
        case HUNK_BREAK:
          ierror("readconv(): HUNK_OVERLAY/BREAK not yet supported");
          break;

        case HUNK_END:
          nextword32(&hi);
          if (s) {
            addtail(&u->sections,&s->n);  /* add Section to ObjectUnit */
            s = NULL;
            secname = NULL;
          }
          else
            error(17,lf->pathname,"HUNK_END",u ? u->objname : lf->filename);
          break;

        default:
          error(13,lf->pathname);  /* File format corrupted */
          break;
      }
    }
    add_objunit(gv,u,TRUE);  /* add last one to glob. ObjUnit list */
    u = NULL;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, 0x28(%rsp)
movq 0x18(%rsi), %rax
movq 0x28(%rsi), %rdi
movq 0x30(%rsi), %rcx
leaq 0x40(%rsp), %rbx
movq %rdi, (%rbx)
movq %rdi, 0x8(%rbx)
movq %rcx, 0x10(%rbx)
movq %rax, 0x18(%rbx)
callq 0x6607
xorl %ecx, %ecx
cmpl $0x3f3, %eax            # imm = 0x3F3
sete %cl
movl %ecx, 0x20(%rbx)
movq %rbx, %rdi
callq 0x11a45
cmpl $0x3fa, %eax            # imm = 0x3FA
jne 0x101d1
leaq 0x10e61(%rip), %rdi     # 0x2101d
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b2c
leaq 0x40(%rsp), %r15
movq $0x0, 0x10(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rbx
movq %r14, 0x18(%rsp)
movq %r15, %rdi
callq 0x11a45
testl %eax, %eax
je 0x10d16
movl %eax, %ebp
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leal -0x3e7(%rax), %ecx
cmpl $0x17, %ecx
ja 0x10526
leaq 0x10c9c(%rip), %rdx     # 0x20ed0
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
testq %r13, %r13
je 0x109c6
movq %r15, %rdi
callq 0x119b7
pushq $0x20
popq %r12
movq %r15, %rdi
callq 0x11a45
testl %eax, %eax
je 0x10608
movl %eax, %r14d
movq %r15, %rdi
callq 0x11a58
movq %rax, %rbp
shrl $0x18, %r14d
leal -0x81(%r14), %eax
cmpl $0xa, %eax
ja 0x102c3
leaq 0x10cb9(%rip), %rcx     # 0x20f40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x3
popq %r8
pushq $0x2
popq %r9
callq 0x11cb6
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x1
jmp 0x10494
cmpl $0x3, %r14d
jbe 0x10317
cmpl $0xd0, %r14d
je 0x1034f
cmpl $0xd1, %r14d
je 0x1042f
cmpl $0xd2, %r14d
je 0x103ba
cmpl $0xe5, %r14d
jne 0x1045f
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x2
popq %r8
pushq $0x18
popq %r9
callq 0x11d7e
jmp 0x10252
movl %r14d, %eax
leaq 0x10c0f(%rip), %rcx     # 0x20f30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x2
popq %r8
pushq $0x1
popq %r9
callq 0x11cb6
jmp 0x10252
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x3
popq %r8
pushq $0x2
popq %r9
callq 0x11cb6
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0xa
jmp 0x10494
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x1
popq %r8
pushq $0x2
popq %r9
callq 0x11cb6
jmp 0x10252
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x1
jmp 0x104b1
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x3
popq %r8
pushq $0x2
popq %r9
callq 0x11cb6
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0xa
jmp 0x104df
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
pushq $0x12
popq %rdi
movq %rbp, %rdx
pushq $0x3
popq %r8
jmp 0x1047a
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x2
popq %r8
movl %r8d, %r9d
callq 0x11cb6
jmp 0x10252
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x3
popq %r8
pushq $0x2
popq %r9
callq 0x11cb6
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0xa
jmp 0x104b1
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
pushq $0x12
popq %rdi
movq %rbp, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x6c19
jmp 0x10252
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x2
popq %r8
movl %r12d, %r9d
callq 0x11d7e
jmp 0x10252
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x2
popq %r8
pushq $0x10
popq %r9
callq 0x11d7e
jmp 0x10252
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x2
jmp 0x104df
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x1
popq %r8
pushq $0x8
popq %r9
callq 0x11d7e
jmp 0x10252
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
pushq $0x3
popq %r8
pushq $0x2
popq %r14
movl %r14d, %r9d
callq 0x11cb6
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl %r14d, %r8d
jmp 0x10496
cmpl $0x4e9, %eax            # imm = 0x4E9
je 0x10578
cmpl $0x4ec, %eax            # imm = 0x4EC
jne 0x105f5
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0x2
popq %rcx
pushq $0x18
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x10b8b(%rip), %rdx     # 0x210fe
jmp 0x10aaa
cmpq $0x0, 0x8(%rsp)
je 0x105d2
testq %r13, %r13
jne 0x105d2
movq %r15, %rdi
callq 0x119b7
movq 0x30(%rsp), %r12
testq %r12, %r12
je 0x109fa
movq %r12, %rdi
callq 0x6607
cmpl $0xc0000000, %eax       # imm = 0xC0000000
movq 0x10(%rsp), %r13
jb 0x10a0f
addq $0x8, %r12
xorl %r14d, %r14d
jmp 0x10a1e
leaq 0x10b68(%rip), %rdi     # 0x2112e
xorl %eax, %eax
callq 0x6b2c
jmp 0x10207
movq 0x8(%rsp), %rax
testq %rax, %rax
movq 0x10(%r14), %rsi
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x10
popq %rdi
leaq 0x10a82(%rip), %rdx     # 0x21072
jmp 0x10aaa
movq 0x10(%r14), %rsi
pushq $0xd
popq %rdi
xorl %eax, %eax
callq 0x6c19
jmp 0x10207
movq %r15, %rdi
callq 0x119b7
movq 0x18(%rsp), %r14
jmp 0x10207
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x10a8d
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rcx
pushq $0x10
popq %rdi
leaq 0x10a08(%rip), %rdx     # 0x21044
jmp 0x10aaa
movq %r15, %rdi
callq 0x119b7
testq %r13, %r13
jne 0x10b20
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x10aef(%rip), %rdx     # 0x2115f
jmp 0x10ad4
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0x2
popq %rcx
pushq $0x8
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x109fc(%rip), %rdx     # 0x210ac
jmp 0x10aaa
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0x2
popq %rcx
pushq $0x20
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x109cb(%rip), %rdx     # 0x210bb
jmp 0x10aaa
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0x1
popq %rcx
pushq $0x20
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x1094a(%rip), %rdx     # 0x2107a
jmp 0x10aaa
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0x1
popq %rcx
pushq $0x10
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x1095b(%rip), %rdx     # 0x210cb
jmp 0x10aaa
testq %r13, %r13
je 0x10ab6
movq %r15, %rdi
callq 0x119b7
movq %r15, %rdi
callq 0x119b7
movl %eax, %ebp
cmpl $0x3, %eax
jl 0x10c5b
movq %r15, %rdi
callq 0x119b7
movl %eax, 0x3c(%rsp)
movq %r15, %rdi
callq 0x119b7
cmpl $0x4c494e45, %eax       # imm = 0x4C494E45
jne 0x10c58
movq %r13, %rdi
pushq $0x1
popq %rdx
movl %edx, %esi
xorl %ecx, %ecx
pushq $0x30
popq %r8
callq 0xae06
movq %rax, %r14
movq %r15, %rdi
callq 0x11a45
subl %eax, %ebp
addl $-0x3, %ebp
movq %r15, %rdi
callq 0x11a58
movq %rax, 0x10(%r14)
movl %ebp, %edi
sarl %edi
movl %edi, 0x18(%r14)
shlq $0x2, %rdi
callq 0x6340
movq %rax, %r12
movq %rax, 0x20(%r14)
movl 0x18(%r14), %edi
shlq $0x2, %rdi
callq 0x6340
movq %rax, %rbx
movq %rax, 0x28(%r14)
xorl %r14d, %r14d
testl %ebp, %ebp
jle 0x10c6a
movq %r15, %rdi
callq 0x119b7
movl %eax, (%r12,%r14)
movq %r15, %rdi
callq 0x119b7
addl 0x3c(%rsp), %eax
movl %eax, (%rbx,%r14)
addl $-0x2, %ebp
addq $0x4, %r14
jmp 0x10816
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0x2
popq %rcx
pushq $0x10
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x1081e(%rip), %rdx     # 0x2109c
jmp 0x10aaa
testq %r13, %r13
jne 0x10a96
movq %r15, %rdi
callq 0x119b7
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb95b
movq %r15, %rdi
callq 0x11a58
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xb87e
movq %rax, 0x8(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
jmp 0x10207
cmpq $0x0, 0x8(%rsp)
je 0x10a6d
testq %r13, %r13
jne 0x10a6d
movq %r15, %rdi
callq 0x119b7
movq %r15, %rdi
callq 0x11a58
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
jmp 0x10207
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0xa
popq %rcx
pushq $0x10
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x107aa(%rip), %rdx     # 0x210e7
jmp 0x10aaa
cmpl $0x0, 0x60(%rsp)
je 0x10ae3
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x11bd4
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x10709(%rip), %rdx     # 0x2108a
jmp 0x10aaa
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0xa
popq %rcx
pushq $0x8
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x10732(%rip), %rdx     # 0x210f3
jmp 0x10aaa
movq 0x10(%r14), %rsi
cmpl $0x3ef, %ebp            # imm = 0x3EF
leaq 0x10740(%rip), %rdx     # 0x21117
leaq 0x10730(%rip), %rax     # 0x2110e
cmoveq %rax, %rdx
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
jmp 0x10ad4
movl %ebp, %r14d
shrl $0x18, %r14d
andl $-0x40, %r14d
xorl %r12d, %r12d
movq 0x10(%rsp), %r13
jmp 0x10a1e
movl %eax, %r14d
shrl $0x18, %r14d
andl $-0x40, %r14d
addq $0x4, %r12
cmpl $0x1, 0x80(%rbx)
setne %al
testq %r13, %r13
setne %cl
orb %al, %cl
jne 0x10b57
cmpw $0x4e9, %bp             # imm = 0x4E9
je 0x10a61
movzwl %bp, %eax
cmpl $0x3ea, %eax            # imm = 0x3EA
je 0x10b42
cmpl $0x3eb, %eax            # imm = 0x3EB
je 0x10b4b
cmpl $0x3e9, %eax            # imm = 0x3E9
jne 0x10b54
leaq 0x105f2(%rip), %r13     # 0x2105a
jmp 0x10b57
movq 0x8(%rsp), %rax
testq %rax, %rax
movq 0x10(%r14), %rsi
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x105c5(%rip), %rdx     # 0x21050
jmp 0x10aaa
testq %r13, %r13
je 0x10c79
movq 0x10(%r14), %rsi
movq 0x20(%r13), %rdx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
pushq $0xf
popq %rdi
xorl %eax, %eax
callq 0x6c19
jmp 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x1064f(%rip), %rdx     # 0x21123
xorl %eax, %eax
callq 0x6c19
xorl %r13d, %r13d
jmp 0x10207
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
pushq $0xa
popq %rcx
pushq $0x20
popq %r8
callq 0x11aba
testl %eax, %eax
jne 0x10207
movq 0x10(%r14), %rsi
movq 0x8(%rsp), %rax
testq %rax, %rax
cmoveq %r14, %rax
movq 0x18(%rax), %rcx
pushq $0x11
popq %rdi
leaq 0x105bd(%rip), %rdx     # 0x210db
jmp 0x10aaa
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %rdi
movq %r13, %rsi
callq 0x6414
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
jmp 0x10207
leaq 0x10517(%rip), %r13     # 0x21060
jmp 0x10b57
leaq 0x10514(%rip), %r13     # 0x21066
jmp 0x10b57
xorl %r13d, %r13d
testq %r13, %r13
movq %r12, 0x30(%rsp)
jne 0x10b89
cmpl $0x0, 0x60(%rsp)
je 0x10b89
pushq $0xa
popq %rdi
callq 0x6340
movq %rax, %r13
movq 0x48(%rsp), %rdx
movq %rax, %rdi
leaq 0x104e9(%rip), %rsi     # 0x2106b
xorl %eax, %eax
callq 0x5260
movq %r15, %rdi
callq 0x119b7
movl %eax, %r12d
movq 0x48(%rsp), %rdx
leal (,%r12,4), %ecx
movq 0x8(%rsp), %rdi
movq %r13, 0x10(%rsp)
movq %r13, %rsi
callq 0xba41
movq %rax, %r13
movl %r14d, %eax
orb $0x1, %al
movb %al, 0x2d(%r13)
movl 0x88(%rbx), %ecx
cmpb $0x3, %cl
pushq $0x2
popq %rdx
cmovbl %edx, %ecx
movb %cl, 0x2f(%r13)
movq 0x20(%rsp), %rdi
movl %edi, 0x28(%r13)
movb $0x5, %cl
movb $0x1, %dl
cmpw $0x3e9, %bp             # imm = 0x3E9
je 0x10c25
movzwl %bp, %esi
cmpl $0x3ea, %esi            # imm = 0x3EA
je 0x10c0b
cmpl $0x3eb, %esi            # imm = 0x3EB
je 0x10c11
cmpl $0x4e9, %esi            # imm = 0x4E9
jne 0x10c2d
orb $0x21, %r14b
movb %r14b, 0x2d(%r13)
jmp 0x10c22
movb $0x3, %cl
movb $0x2, %dl
jmp 0x10c25
orb $0x3, %r14b
movb %r14b, 0x2d(%r13)
andq $0x0, 0x40(%r13)
movb $0x3, %dl
movb $0x3, %cl
movl %r14d, %eax
movb %dl, 0x2c(%r13)
movb %cl, 0x2e(%r13)
incl %edi
movq %rdi, 0x20(%rsp)
testb $0x2, %al
movq 0x18(%rsp), %r14
jne 0x10207
andl $0x3fffffff, %r12d      # imm = 0x3FFFFFFF
movq %r15, %rdi
movl %r12d, %esi
callq 0x11989
jmp 0x10207
addl $-0x2, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x11989
jmp 0x10207
movq 0x28(%rsp), %rbx
movq 0x18(%rsp), %r14
jmp 0x10207
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0xb95b
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb87e
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x119b7
movq %r15, %rdi
callq 0x119b7
leal 0x2(%rax), %esi
testl %eax, %eax
cmovel %ebp, %esi
movq %r15, %rdi
callq 0x11989
movq %r15, %rdi
callq 0x119b7
movl %eax, %ebp
movq %r15, %rdi
callq 0x119b7
movl %eax, %ebx
movq 0x48(%rsp), %r12
notl %ebx
addl %ebp, %ebx
testl %ebx, %ebx
je 0x10cfb
movq %r15, %rdi
callq 0x119b7
cmpl $0xc0000000, %eax       # imm = 0xC0000000
jb 0x10cf7
movq %r15, %rdi
callq 0x119b7
incl %ebx
jmp 0x10cdc
movq %r12, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
movq 0x28(%rsp), %rbx
jmp 0x10207
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb95b