// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq %rdi, %r12
movq 0x18(%rsi), %rax
movq 0x28(%rsi), %rbx
movq 0x30(%rsi), %r14
movq %rbx, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %rbx, %rdi
callq 0x6929
xorl %ecx, %ecx
cmpl $0x3f3, %eax            # imm = 0x3F3
sete %cl
movl %ecx, 0x40(%rsp)
cmpq $0x3, %r14
jbe 0x10de5
movq %rbx, %rdi
callq 0x6929
cmpl $0x3fa, %eax            # imm = 0x3FA
jne 0x10e0e
leaq 0x1223d(%rip), %rdi     # 0x2300d
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x52b0
movq $0x0, 0x10(%rsp)
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbf8e
leaq 0x20(%rsp), %r14
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
xorl %edi, %edi
movq $0x0, 0x58(%rsp)
movq $0x0, 0x18(%rsp)
movq %r12, 0x48(%rsp)
movq %r15, 0x50(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x6929
testl %eax, %eax
je 0x10dee
movl %eax, %ebp
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leal -0x3e7(%rax), %ecx
cmpl $0x17, %ecx
ja 0x1118a
leaq 0x12050(%rip), %rdx     # 0x22ec0
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
testq %r13, %r13
je 0x11691
movq %r14, %rdi
callq 0x128dd
cmpq $0x4, 0x30(%rsp)
jb 0x11271
movq 0x28(%rsp), %rdi
callq 0x6929
testl %eax, %eax
je 0x11271
movl %eax, %ebx
movq %r14, %rdi
callq 0x12976
movq %rax, %rbp
shrl $0x18, %ebx
cmpl $0xcf, %ebx
jg 0x10f59
leal -0x81(%rbx), %eax
cmpl $0xa, %eax
ja 0x10f1a
leaq 0x1205a(%rip), %rcx     # 0x22f30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12bee
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
jmp 0x1114d
cmpl $0x3, %ebx
ja 0x11169
movl %ebx, %eax
leaq 0x11ff4(%rip), %rcx     # 0x22f20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
jmp 0x110c5
cmpl $0xd1, %ebx
jg 0x10fb0
cmpl $0xd0, %ebx
je 0x10fe1
cmpl $0xd1, %ebx
jne 0x11169
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12bee
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0xa, %r8d
jmp 0x110e1
cmpl $0xd2, %ebx
je 0x1101c
cmpl $0xe5, %ebx
jne 0x11169
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x2, %r8d
movl $0x18, %r9d
jmp 0x11153
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12bee
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0xa, %r8d
jmp 0x1114d
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12bee
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0xa, %r8d
jmp 0x1110f
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x1, %r8d
jmp 0x110bf
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movl $0x12, %edi
movq %rbp, %rdx
movl $0x3, %r8d
jmp 0x11181
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
jmp 0x110e1
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x2, %r8d
movl $0x2, %r9d
callq 0x12bee
jmp 0x11158
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x2, %r8d
movl $0x10, %r9d
jmp 0x11153
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x2, %r8d
jmp 0x1110f
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
movl $0x8, %r9d
jmp 0x11153
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12bee
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x2, %r8d
movl $0x20, %r9d
callq 0x12cba
cmpq $0x3, 0x30(%rsp)
ja 0x10e96
jmp 0x11271
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movl $0x12, %edi
movq %rbp, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x6f14
jmp 0x11158
cmpl $0x4e9, %eax            # imm = 0x4E9
je 0x111e2
cmpl $0x4ec, %eax            # imm = 0x4EC
jne 0x1125c
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x2, %ecx
movl $0x18, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11f11(%rip), %rdx     # 0x230ee
jmp 0x117d8
cmpq $0x0, 0x10(%rsp)
je 0x11237
testq %r13, %r13
jne 0x11237
movq %r14, %rdi
callq 0x128dd
movq 0x58(%rsp), %r13
testq %r13, %r13
je 0x116c7
movq %r13, %rdi
callq 0x6929
cmpl $0xc0000000, %eax       # imm = 0xC0000000
jb 0x116d7
addq $0x8, %r13
xorl %r15d, %r15d
jmp 0x116e6
leaq 0x11ef3(%rip), %rdi     # 0x2311e
xorl %eax, %eax
callq 0x52b0
jmp 0x1180b
movq 0x10(%rsp), %rax
testq %rax, %rax
movq 0x10(%r15), %rsi
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x10, %edi
leaq 0x11e0b(%rip), %rdx     # 0x23062
jmp 0x117d8
movq 0x10(%r15), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
jmp 0x1180b
movq %r14, %rdi
callq 0x128dd
jmp 0x1180b
cmpq 0x20(%rsp), %rbx
je 0x117b9
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rcx
movl $0x10, %edi
leaq 0x11d97(%rip), %rdx     # 0x23034
jmp 0x117d8
movq %r14, %rdi
callq 0x128dd
testq %r13, %r13
jne 0x11863
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11e7c(%rip), %rdx     # 0x2314f
jmp 0x11801
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x2, %ecx
movl $0x8, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11d83(%rip), %rdx     # 0x2309c
jmp 0x117d8
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x2, %ecx
movl $0x20, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11d4c(%rip), %rdx     # 0x230ab
jmp 0x117d8
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movl $0x20, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11cc5(%rip), %rdx     # 0x2306a
jmp 0x117d8
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movl $0x10, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11cd0(%rip), %rdx     # 0x230bb
jmp 0x117d8
testq %r13, %r13
je 0x117e1
movq %r14, %rdi
callq 0x128dd
movq %r14, %rdi
callq 0x128dd
movl %eax, %ebx
cmpl $0x3, %eax
jl 0x1187f
movq %r14, %rdi
callq 0x128dd
movl %eax, %ebp
movq %r14, %rdi
callq 0x128dd
cmpl $0x4c494e45, %eax       # imm = 0x4C494E45
jne 0x119a1
movq %r13, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x30, %r8d
callq 0xb36a
movq %rax, %r14
movl $0x3, %eax
cmpq $0x4, 0x30(%rsp)
jb 0x11468
movq 0x28(%rsp), %rdi
callq 0x6929
addl $0x3, %eax
subl %eax, %ebx
leaq 0x20(%rsp), %rdi
callq 0x12976
movq %rax, 0x10(%r14)
movl %ebx, %edi
sarl %edi
movl %edi, 0x18(%r14)
shlq $0x2, %rdi
callq 0x6638
movq %rax, %r15
movq %rax, 0x20(%r14)
movl 0x18(%r14), %edi
shlq $0x2, %rdi
callq 0x6638
movq %rax, 0x28(%r14)
testl %ebx, %ebx
jle 0x11a7d
movq %rax, %r12
movq %r13, 0x60(%rsp)
addl $0x2, %ebx
xorl %r14d, %r14d
movl %ebp, %r13d
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x128dd
movl %eax, (%r15,%r14)
movq %rbp, %rdi
callq 0x128dd
addl %r13d, %eax
movl %eax, (%r12,%r14)
addq $0x4, %r14
addl $-0x2, %ebx
cmpl $0x2, %ebx
ja 0x114bf
movq 0x48(%rsp), %r12
movq 0x50(%rsp), %r15
movq %rbp, %r14
movq 0x8(%rsp), %rdi
movq 0x60(%rsp), %r13
jmp 0x11810
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x2, %ecx
movl $0x10, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11b49(%rip), %rdx     # 0x2308c
jmp 0x117d8
testq %r13, %r13
jne 0x117c2
movq %r14, %rdi
callq 0x128dd
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0xbf8e
movq %r14, %rdi
callq 0x12976
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xbeac
movq %rax, 0x10(%rsp)
xorl %edi, %edi
xorl %r13d, %r13d
jmp 0x11810
cmpq $0x0, 0x10(%rsp)
je 0x11733
testq %r13, %r13
jne 0x11733
movq %r14, %rdi
callq 0x128dd
movq %r14, %rdi
callq 0x12976
movq %rax, 0x18(%rsp)
jmp 0x11808
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0xa, %ecx
movl $0x10, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11ad7(%rip), %rdx     # 0x230d7
jmp 0x117d8
cmpl $0x0, 0x40(%rsp)
je 0x11821
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x12b20
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11a34(%rip), %rdx     # 0x2307a
jmp 0x117d8
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0xa, %ecx
movl $0x8, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11a57(%rip), %rdx     # 0x230e3
jmp 0x117d8
movq 0x10(%r15), %rsi
cmpl $0x3ef, %ebp            # imm = 0x3EF
leaq 0x11a65(%rip), %rdx     # 0x23107
leaq 0x11a55(%rip), %rax     # 0x230fe
cmoveq %rax, %rdx
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
jmp 0x11801
movl %ebp, %r15d
shrl $0x18, %r15d
andl $-0x40, %r15d
xorl %r13d, %r13d
jmp 0x116e6
movl %eax, %r15d
shrl $0x18, %r15d
andl $-0x40, %r15d
addq $0x4, %r13
movq 0x18(%rsp), %rcx
cmpl $0x1, 0x80(%r12)
jne 0x1177a
testq %rcx, %rcx
jne 0x1177a
movzwl %bp, %eax
cmpl $0x3ea, %eax            # imm = 0x3EA
jg 0x11758
leaq 0x1193a(%rip), %rbx     # 0x2304a
cmpl $0x3e9, %eax            # imm = 0x3E9
je 0x11892
movl $0x0, %ecx
cmpl $0x3ea, %eax            # imm = 0x3EA
jne 0x1177a
leaq 0x11922(%rip), %rbx     # 0x23050
jmp 0x11892
movq 0x10(%rsp), %rax
testq %rax, %rax
movq 0x10(%r15), %rsi
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x118ed(%rip), %rdx     # 0x23040
jmp 0x117d8
cmpl $0x3eb, %eax            # imm = 0x3EB
je 0x1188b
movl $0x0, %ecx
leaq 0x118db(%rip), %rbx     # 0x2304a
cmpl $0x4e9, %eax            # imm = 0x4E9
je 0x11892
testq %rcx, %rcx
jne 0x11886
cmpl $0x0, 0x40(%rsp)
movq %rcx, %rbx
je 0x11892
movl $0xa, %edi
callq 0x6638
movq %rax, %rbx
movq 0x28(%rsp), %rdx
movq %rax, %rdi
leaq 0x118ae(%rip), %rsi     # 0x2305b
xorl %eax, %eax
callq 0x5250
jmp 0x11892
testq %r13, %r13
je 0x119ca
movq 0x10(%r15), %rsi
movq 0x20(%r13), %rdx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movl $0xf, %edi
xorl %eax, %eax
callq 0x6f14
jmp 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11912(%rip), %rdx     # 0x23113
xorl %eax, %eax
callq 0x6f14
xorl %r13d, %r13d
movq 0x8(%rsp), %rdi
cmpq $0x3, 0x30(%rsp)
ja 0x10e3d
jmp 0x10dee
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0xa, %ecx
movl $0x20, %r8d
callq 0x129d7
testl %eax, %eax
jne 0x1180b
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x1186d(%rip), %rdx     # 0x230cb
jmp 0x117d8
movq 0x10(%rsp), %rax
leaq 0x20(%rax), %rdi
movq %r13, %rsi
callq 0x6729
movq $0x0, 0x18(%rsp)
jmp 0x11808
movl %ebx, %ebx
jmp 0x119a4
movq %rcx, %rbx
jmp 0x11892
leaq 0x117c4(%rip), %rbx     # 0x23056
movq %r13, 0x58(%rsp)
movq %r14, %rdi
callq 0x128dd
movl %eax, %r12d
movq 0x28(%rsp), %r14
shll $0x2, %r12d
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0xc0a9
movq %rax, %r13
movl %r15d, %eax
orb $0x1, %al
movb %al, 0x2d(%r13)
movq 0x48(%rsp), %rcx
movl 0x88(%rcx), %ecx
cmpb $0x3, %cl
movl $0x2, %edx
cmovbl %edx, %ecx
movb %cl, 0x2f(%r13)
movq 0x8(%rsp), %rdi
movl %edi, 0x28(%r13)
movzwl %bp, %esi
movb $0x5, %cl
movb $0x1, %dl
cmpl $0x3ea, %esi            # imm = 0x3EA
jg 0x11912
cmpl $0x3e9, %esi            # imm = 0x3E9
je 0x11943
cmpl $0x3ea, %esi            # imm = 0x3EA
jne 0x1194b
movb $0x3, %cl
movb $0x2, %dl
jmp 0x11943
cmpl $0x3eb, %esi            # imm = 0x3EB
je 0x1192c
cmpl $0x4e9, %esi            # imm = 0x4E9
jne 0x1194b
orb $0x21, %r15b
movb %r15b, 0x2d(%r13)
jmp 0x11940
orb $0x3, %r15b
movb %r15b, 0x2d(%r13)
movq $0x0, 0x40(%r13)
movb $0x3, %dl
movb $0x3, %cl
movl %r15d, %eax
movb %dl, 0x2c(%r13)
movb %cl, 0x2e(%r13)
incl %edi
testb $0x2, %al
jne 0x11988
subq %r12, 0x30(%rsp)
movq 0x50(%rsp), %r15
jns 0x11974
movq 0x38(%rsp), %rsi
movq %rdi, %rbp
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
movq %rbp, %rdi
addq %r12, %r14
movq %r14, 0x28(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x48(%rsp), %r12
jmp 0x11997
movq %rbx, 0x18(%rsp)
movq 0x48(%rsp), %r12
movq 0x50(%rsp), %r15
leaq 0x20(%rsp), %r14
jmp 0x11810
addl $-0x2, %ebx
shlq $0x2, %rbx
subq %rbx, 0x30(%rsp)
jns 0x119c0
movq 0x38(%rsp), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
addq %rbx, 0x28(%rsp)
jmp 0x1180b
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0xbf8e
movq 0x18(%r15), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xbeac
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x128dd
movq %r14, %rdi
callq 0x128dd
leal 0x2(%rax), %ebx
testl %eax, %eax
movl $0x1, %eax
cmovel %eax, %ebx
shlq $0x2, %rbx
subq %rbx, 0x30(%rsp)
jns 0x11a29
movq 0x38(%rsp), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
addq %rbx, 0x28(%rsp)
movq %r14, %rdi
callq 0x128dd
movl %eax, %ebp
movq %r14, %rdi
callq 0x128dd
movl %eax, %ebx
subl %ebp, %eax
movq 0x28(%rsp), %r13
cmpl $-0x1, %eax
movq %r13, 0x58(%rsp)
je 0x11586
notl %ebx
addl %ebp, %ebx
movq %r14, %rdi
callq 0x128dd
cmpl $0xc0000000, %eax       # imm = 0xC0000000
jb 0x11a72
movq %r14, %rdi
callq 0x128dd
xorl %edi, %edi
incl %ebx
jne 0x11a5b
jmp 0x11588
movq 0x48(%rsp), %r12
movq 0x50(%rsp), %r15
leaq 0x20(%rsp), %r14
jmp 0x1180b