// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq 0x18(%rsi), %rax
movq 0x28(%rsi), %rdi
movq 0x30(%rsi), %rcx
movq %rdi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x695d
xorl %ecx, %ecx
cmpl $0x3f3, %eax            # imm = 0x3F3
sete %cl
movl %ecx, 0x28(%rsp)
cmpq $0x3, 0x18(%rsp)
jbe 0x10f7a
movq 0x10(%rsp), %rdi
callq 0x695d
cmpl $0x3fa, %eax            # imm = 0x3FA
jne 0x10f7a
leaq 0x120c8(%rip), %rdi     # 0x2302d
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x52b0
movq $0x0, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
xorl %r12d, %r12d
movq $0x0, (%rsp)
movq %rbx, 0x48(%rsp)
cmpq $0x4, 0x18(%rsp)
movl $0x0, %r13d
jb 0x10fc0
movq 0x10(%rsp), %rdi
callq 0x695d
movl %eax, %r13d
testl %r13d, %r13d
leaq 0x8(%rsp), %rbp
je 0x11c19
movl %r13d, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leal -0x3e7(%rax), %ecx
cmpl $0x17, %ecx
ja 0x11324
leaq 0x11ef4(%rip), %rdx     # 0x22ee0
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
testq %r12, %r12
je 0x11835
movq %rbp, %rdi
callq 0x12a55
xorl %r14d, %r14d
cmpq $0x4, 0x18(%rsp)
jb 0x1101e
movq 0x10(%rsp), %rdi
callq 0x695d
movl %eax, %r14d
testl %r14d, %r14d
je 0x11415
movq %rbp, %rdi
callq 0x12ae1
movq %rax, %r13
shrl $0x18, %r14d
cmpl $0xcf, %r14d
jg 0x110e0
leal -0x81(%r14), %eax
cmpl $0xa, %eax
ja 0x1109a
leaq 0x11efa(%rip), %rcx     # 0x22f50
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12d59
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x1, %r8d
jmp 0x112f1
cmpl $0x3, %r14d
ja 0x11301
movl %r14d, %eax
leaq 0x11e92(%rip), %rcx     # 0x22f40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
callq 0x12d59
jmp 0x11006
cmpl $0xd1, %r14d
jg 0x1113e
cmpl $0xd0, %r14d
je 0x11176
cmpl $0xd1, %r14d
jne 0x11301
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12d59
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0xa, %r8d
jmp 0x11275
cmpl $0xd2, %r14d
je 0x111b1
cmpl $0xe5, %r14d
jne 0x11301
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x2, %r8d
movl $0x18, %r9d
callq 0x12e25
jmp 0x11006
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12d59
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0xa, %r8d
jmp 0x112f1
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12d59
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0xa, %r8d
jmp 0x112ab
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x1, %r8d
jmp 0x11253
movq 0x10(%r15), %rsi
movq (%rsp), %rax
movq 0x18(%rax), %rcx
movl $0x12, %edi
movq %r13, %rdx
movl $0x3, %r8d
jmp 0x11318
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x1, %r8d
jmp 0x11275
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x2, %r8d
movl $0x2, %r9d
callq 0x12d59
jmp 0x11006
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x2, %r8d
movl $0x10, %r9d
callq 0x12e25
jmp 0x11006
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x2, %r8d
jmp 0x112ab
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x1, %r8d
movl $0x8, %r9d
callq 0x12e25
jmp 0x11006
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
movl $0x3, %r8d
movl $0x2, %r9d
callq 0x12d59
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x2, %r8d
movl $0x20, %r9d
callq 0x12e25
jmp 0x11006
movq 0x10(%r15), %rsi
movq (%rsp), %rax
movq 0x18(%rax), %rcx
movl $0x12, %edi
movq %r13, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x6f84
jmp 0x11006
cmpl $0x4e9, %eax            # imm = 0x4E9
je 0x1137b
cmpl $0x4ec, %eax            # imm = 0x4EC
jne 0x11400
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movl $0x18, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11d98(%rip), %rdx     # 0x2310e
jmp 0x11b46
cmpq $0x0, (%rsp)
je 0x113dc
testq %r12, %r12
jne 0x113dc
movq %rbp, %rdi
callq 0x12a55
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11875
movq %r15, %rbx
movq %rdi, %r15
callq 0x695d
cmpl $0xc0000000, %eax       # imm = 0xC0000000
movq 0x40(%rsp), %r12
jb 0x11890
addq $0x8, %r15
movq %r15, 0x30(%rsp)
xorl %r14d, %r14d
jmp 0x118a4
leaq 0x11d6e(%rip), %rdi     # 0x2313e
xorl %eax, %eax
callq 0x52b0
jmp 0x10fa5
movq (%rsp), %rax
testq %rax, %rax
movq 0x10(%r15), %rsi
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x10, %edi
leaq 0x11c87(%rip), %rdx     # 0x23082
jmp 0x11b46
movq 0x10(%r15), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
jmp 0x10fa5
movq %rbp, %rdi
callq 0x12a55
jmp 0x10fa5
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0x1193f
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rcx
movl $0x10, %edi
leaq 0x11c0e(%rip), %rdx     # 0x23054
jmp 0x11b46
movq %rbp, %rdi
callq 0x12a55
testq %r12, %r12
jne 0x119a8
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11cf4(%rip), %rdx     # 0x2316f
jmp 0x11866
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movl $0x8, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11bfc(%rip), %rdx     # 0x230bc
jmp 0x11b46
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movl $0x20, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11bc6(%rip), %rdx     # 0x230cb
jmp 0x11b46
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x1, %ecx
movl $0x20, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11b40(%rip), %rdx     # 0x2308a
jmp 0x11b46
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x1, %ecx
movl $0x10, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11b4c(%rip), %rdx     # 0x230db
jmp 0x11b46
testq %r12, %r12
je 0x11b27
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x12a55
movq %r13, %rdi
callq 0x12a55
movl %eax, %r14d
cmpl $0x3, %eax
movq %r15, 0x58(%rsp)
jl 0x119c9
movq %r13, %rdi
callq 0x12a55
movl %eax, %ebp
movq %r13, %rdi
callq 0x12a55
cmpl $0x4c494e45, %eax       # imm = 0x4C494E45
jne 0x11aef
movl %ebp, 0x54(%rsp)
movq %r12, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x30, %r8d
callq 0xb42d
movq %rax, %rbx
movl $0x3, %eax
cmpq $0x4, 0x18(%rsp)
jb 0x1161b
movq 0x10(%rsp), %rdi
callq 0x695d
addl $0x3, %eax
subl %eax, %r14d
movq %r13, %rdi
callq 0x12ae1
movq %rax, 0x10(%rbx)
movl %r14d, %edi
sarl %edi
movl %edi, 0x18(%rbx)
shlq $0x2, %rdi
callq 0x6668
movq %rax, 0x60(%rsp)
movq %rax, 0x20(%rbx)
movl 0x18(%rbx), %edi
shlq $0x2, %rdi
callq 0x6668
movq %rax, 0x28(%rbx)
testl %r14d, %r14d
movl 0x54(%rsp), %ebx
jle 0x11b14
movq %rax, %r13
addl $0x2, %r14d
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0x12a55
movq 0x60(%rsp), %rcx
movl %eax, (%rcx,%r15)
movq %rbp, %rdi
callq 0x12a55
addl %ebx, %eax
movl %eax, (%r13,%r15)
addq $0x4, %r15
addl $-0x2, %r14d
cmpl $0x2, %r14d
jg 0x1166b
jmp 0x11b14
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movl $0x10, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x119c9(%rip), %rdx     # 0x230ac
jmp 0x11b46
testq %r12, %r12
jne 0x11948
movq %rbp, %rdi
callq 0x12a55
movq %rbx, %rdi
movq (%rsp), %rsi
movl $0x1, %edx
callq 0xc040
movq %rbp, %rdi
callq 0x12ae1
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xbf5e
movq %rax, (%rsp)
movq $0x0, 0x38(%rsp)
xorl %r12d, %r12d
jmp 0x10fa5
cmpq $0x0, (%rsp)
je 0x118f3
testq %r12, %r12
jne 0x118f3
movq %rbp, %rdi
callq 0x12a55
movq %rbp, %rdi
callq 0x12ae1
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
jmp 0x10fa5
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0xa, %ecx
movl $0x10, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11951(%rip), %rdx     # 0x230f7
jmp 0x11b46
cmpl $0x0, 0x28(%rsp)
je 0x11963
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x12c8b
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x118af(%rip), %rdx     # 0x2309a
jmp 0x11b46
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0xa, %ecx
movl $0x8, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x118d3(%rip), %rdx     # 0x23103
jmp 0x11b46
movq 0x10(%r15), %rsi
cmpl $0x3ef, %r13d           # imm = 0x3EF
leaq 0x118e0(%rip), %rdx     # 0x23127
leaq 0x118d0(%rip), %rax     # 0x2311e
cmoveq %rax, %rdx
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
xorl %eax, %eax
callq 0x6f84
xorl %r12d, %r12d
jmp 0x10fa5
movl %r13d, %r14d
shrl $0x18, %r14d
andl $-0x40, %r14d
movq $0x0, 0x30(%rsp)
movq 0x40(%rsp), %r12
jmp 0x118ac
movl %eax, %r14d
shrl $0x18, %r14d
andl $-0x40, %r14d
addq $0x4, %r15
movq %r15, 0x30(%rsp)
movq %rbx, %r15
movq 0x48(%rsp), %rbx
cmpl $0x1, 0x80(%rbx)
setne %al
testq %r12, %r12
setne %cl
orb %al, %cl
jne 0x119d8
movzwl %r13w, %eax
cmpl $0x3ea, %eax            # imm = 0x3EA
jg 0x11917
cmpl $0x3e9, %eax            # imm = 0x3E9
je 0x11933
movl $0x0, %r12d
cmpl $0x3ea, %eax            # imm = 0x3EA
jne 0x119d8
leaq 0x11782(%rip), %r12     # 0x23070
jmp 0x119d8
movq (%rsp), %rax
testq %rax, %rax
movq 0x10(%r15), %rsi
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x1174e(%rip), %rdx     # 0x23060
jmp 0x11b46
cmpl $0x3eb, %eax            # imm = 0x3EB
je 0x119d1
movl $0x0, %r12d
cmpl $0x4e9, %eax            # imm = 0x4E9
jne 0x119d8
leaq 0x11730(%rip), %r12     # 0x2306a
jmp 0x119d8
testq %r12, %r12
je 0x11b52
movq 0x10(%r15), %rsi
movq 0x20(%r12), %rdx
movq (%rsp), %rax
movq 0x18(%rax), %rcx
movl $0xf, %edi
jmp 0x11b46
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0xa, %ecx
movl $0x20, %r8d
callq 0x12b42
testl %eax, %eax
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x11748(%rip), %rdx     # 0x230eb
jmp 0x11b46
movq (%rsp), %rax
leaq 0x20(%rax), %rdi
movq %r12, %rsi
callq 0x6759
movq $0x0, 0x40(%rsp)
xorl %r12d, %r12d
jmp 0x10fa5
movl %r14d, %r14d
jmp 0x11af3
leaq 0x1169e(%rip), %r12     # 0x23076
testq %r12, %r12
jne 0x11a07
cmpl $0x0, 0x28(%rsp)
je 0x11a07
movl $0xa, %edi
callq 0x6668
movq %rax, %r12
movq 0x10(%rsp), %rdx
movq %rax, %rdi
leaq 0x1167b(%rip), %rsi     # 0x2307b
xorl %eax, %eax
callq 0x5250
movq %rbp, %rdi
callq 0x12a55
movl %eax, %ebp
movq 0x10(%rsp), %rdx
shll $0x2, %ebp
movq (%rsp), %rdi
movq %r12, 0x40(%rsp)
movq %r12, %rsi
movq %rbp, %rcx
callq 0xc156
movq %rax, %r12
movl %r14d, %eax
orb $0x1, %al
movb %al, 0x2d(%r12)
movl 0x88(%rbx), %eax
cmpb $0x3, %al
movl $0x2, %ecx
cmovbl %ecx, %eax
movb %al, 0x2f(%r12)
movq 0x38(%rsp), %rsi
movl %esi, 0x28(%r12)
movzwl %r13w, %edx
movb $0x5, %al
movb $0x1, %cl
cmpl $0x3ea, %edx            # imm = 0x3EA
jg 0x11a7f
cmpl $0x3e9, %edx            # imm = 0x3E9
je 0x11ab0
cmpl $0x3ea, %edx            # imm = 0x3EA
jne 0x11aba
movb $0x3, %al
movb $0x2, %cl
jmp 0x11ab0
cmpl $0x3eb, %edx            # imm = 0x3EB
je 0x11a9a
cmpl $0x4e9, %edx            # imm = 0x4E9
jne 0x11aba
orb $0x21, %r14b
movb %r14b, 0x2d(%r12)
jmp 0x11ab0
orb $0x3, %r14b
movb %r14b, 0x2d(%r12)
movq $0x0, 0x40(%r12)
movb $0x3, %cl
movb $0x3, %al
movb %cl, 0x2c(%r12)
movb %al, 0x2e(%r12)
incl %esi
movq %rsi, 0x38(%rsp)
testb $0x2, 0x2d(%r12)
jne 0x10fa5
subq %rbp, 0x18(%rsp)
jns 0x11ae5
movq 0x20(%rsp), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
addq %rbp, 0x10(%rsp)
jmp 0x10fa5
addl $-0x2, %r14d
shlq $0x2, %r14
subq %r14, 0x18(%rsp)
jns 0x11b0f
movq 0x20(%rsp), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
addq %r14, 0x10(%rsp)
testq %r12, %r12
movq 0x58(%rsp), %r15
movq 0x48(%rsp), %rbx
jne 0x10fa5
movq 0x10(%r15), %rsi
movq (%rsp), %rax
testq %rax, %rax
cmoveq %r15, %rax
movq 0x18(%rax), %rcx
movl $0x11, %edi
leaq 0x115ed(%rip), %rdx     # 0x23133
xorl %eax, %eax
callq 0x6f84
jmp 0x10fa5
movq %rbx, %rdi
movq (%rsp), %rsi
movl $0x1, %edx
callq 0xc040
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbf5e
movq %rax, (%rsp)
movq %rbp, %rdi
callq 0x12a55
movq %rbp, %rdi
callq 0x12a55
leal 0x2(%rax), %r14d
testl %eax, %eax
movl $0x1, %eax
cmovel %eax, %r14d
shlq $0x2, %r14
subq %r14, 0x18(%rsp)
jns 0x11bb1
movq 0x20(%rsp), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
addq %r14, 0x10(%rsp)
movq %rbp, %rdi
callq 0x12a55
movl %eax, %r14d
movq %rbp, %rdi
callq 0x12a55
movl %eax, %ebp
subl %r14d, %eax
movq 0x10(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movl $0x0, %r12d
cmpl $-0x1, %eax
je 0x10fa5
notl %ebp
addl %r14d, %ebp
leaq 0x8(%rsp), %rdi
callq 0x12a55
cmpl $0xc0000000, %eax       # imm = 0xC0000000
jb 0x11c10
leaq 0x8(%rsp), %rdi
callq 0x12a55
incl %ebp
jne 0x11bf5
jmp 0x11724
movq %rbx, %rdi
movq (%rsp), %rsi
movl $0x1, %edx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc040