// File: /workspace/github_c_makefile_star2_O3/negge[P]xlink/src/xlink.c
// Function: xlink_file_load_omf_module
xlink_module *xlink_file_load_omf_module(xlink_file *file, unsigned int flags) {
  xlink_module *mod;
  xlink_omf omf;
  xlink_data *dat;
  int done;
  int i, j;
  mod = xlink_malloc(sizeof(xlink_module));
  mod->filename = file->name;
  xlink_omf_init(&omf);
  dat = NULL;
  done = 0;
  while (file->size > 0 && !done) {
    xlink_omf_record rec;
    int i;
    xlink_file_load_omf_record(file, &rec);
    xlink_omf_add_record(&omf, &rec);
    switch (rec.type & ~1) {
      case OMF_THEADR :
      case OMF_LHEADR : {
        strcpy(mod->source, xlink_omf_record_read_string(&rec));
        break;
      }
      case OMF_MODEND : {
        done = 1;
        break;
      }
      case OMF_LNAMES :
      case OMF_LLNAMES : {
        while (xlink_omf_record_has_data(&rec)) {
          xlink_name *name;
          name = xlink_malloc(sizeof(xlink_name));
          strcpy(name->str, xlink_omf_record_read_string(&rec));
          XLINK_LIST_ADD(module, name, mod, name);
        }
        break;
      }
      case OMF_SEGDEF : {
        xlink_segment *seg;
        seg = xlink_malloc(sizeof(xlink_segment));
        seg->attrib.b = xlink_omf_record_read_byte(&rec);
        if (seg->attrib.align == 0) {
          seg->frame = xlink_omf_record_read_word(&rec);
          seg->offset = xlink_omf_record_read_byte(&rec);
        }
        else {
          seg->frame = seg->offset = 0;
        }
        seg->length = xlink_omf_record_read_numeric(&rec);
        XLINK_ERROR(seg->attrib.big && seg->length != 0,
         ("Invalid length for 'big' segment, expected 0 got %i", seg->length));
        seg->name =
         xlink_module_get_name(mod, xlink_omf_record_read_index(&rec));
        seg->class =
         xlink_module_get_name(mod, xlink_omf_record_read_index(&rec));
        /* Read and ignore Overlay Name Index */
        xlink_omf_record_read_index(&rec);
        seg->info = 0;
        seg->data = xlink_malloc(seg->length);
        seg->mask = xlink_malloc(CEIL2(seg->length, 3));
        xlink_segment_reset_mask(seg);
        XLINK_LIST_ADD(module, segment, mod, seg);
        break;
      }
      case OMF_GRPDEF : {
        xlink_group *grp;
        grp = xlink_malloc(sizeof(xlink_group));
        grp->name =
         xlink_module_get_name(mod, xlink_omf_record_read_index(&rec));
        grp->nsegments = 0;
        while (xlink_omf_record_has_data(&rec)) {
          unsigned char index;
          xlink_segment *s;
          index = xlink_omf_record_read_byte(&rec);
          XLINK_ERROR(index != 0xFF, ("Invalid segment index %i", index));
          s = xlink_module_get_segment(mod, xlink_omf_record_read_index(&rec));
          XLINK_ERROR(s->group != NULL,
           ("Cannot add segment %s to group %s, already added to group %s:%i",
           xlink_segment_get_name(s), xlink_group_get_name(grp), s->group->name,
           s->group->index));
          s->group = grp;
          xlink_group_add_segment(grp, s);
        }
        XLINK_LIST_ADD(module, group, mod, grp);
        break;
      }
      case OMF_PUBDEF :
      case OMF_LPUBDEF : {
        int group_idx;
        int segment_idx;
        xlink_public base;
        group_idx = xlink_omf_record_read_index(&rec);
        segment_idx = xlink_omf_record_read_index(&rec);
        base.group = group_idx ? xlink_module_get_group(mod, group_idx) : NULL;
        base.segment =
         segment_idx ? xlink_module_get_segment(mod, segment_idx) : NULL;
        base.base_frame =
         base.segment == NULL ? xlink_omf_record_read_word(&rec) : 0;
        base.is_local = ((rec.type & ~1) == OMF_LPUBDEF);
        while (xlink_omf_record_has_data(&rec)) {
          xlink_public *pub;
          pub = xlink_malloc(sizeof(xlink_public));
          *pub = base;
          strcpy(pub->name, xlink_omf_record_read_string(&rec));
          pub->offset = xlink_omf_record_read_numeric(&rec);
          pub->type_idx = xlink_omf_record_read_index(&rec);
          XLINK_LIST_ADD(module, public, mod, pub);
          if (pub->segment) {
            xlink_segment_add_public(pub->segment, pub);
          }
        }
        break;
      }
      case OMF_EXTDEF :
      case OMF_LEXTDEF : {
        xlink_extern base;
        base.is_local = (rec.type == OMF_LEXTDEF);
        while (xlink_omf_record_has_data(&rec)) {
          xlink_extern *ext;
          ext = xlink_malloc(sizeof(xlink_extern));
          *ext = base;
          strcpy(ext->name, xlink_omf_record_read_string(&rec));
          ext->type_idx = xlink_omf_record_read_index(&rec);
          XLINK_LIST_ADD(module, extern, mod, ext);
        }
        break;
      }
      case OMF_LEDATA :
      case OMF_LIDATA : {
        xlink_segment *seg;
        seg = xlink_module_get_segment(mod, xlink_omf_record_read_index(&rec));
        seg->info |= SEG_HAS_DATA;
        dat = xlink_malloc(sizeof(xlink_data));
        dat->segment = seg;
        dat->offset = xlink_omf_record_read_numeric(&rec);
        dat->is_iterated = rec.type & 0x2;
        dat->length = xlink_omf_record_data_left(&rec);
        dat->data = xlink_malloc(dat->length);
        dat->mask = xlink_malloc(CEIL2(dat->length, 3));
        memcpy(dat->data, &rec.buf[rec.idx], dat->length);
        xlink_data_reset_mask(dat);
        if (!dat->is_iterated) {
          XLINK_ERROR(dat->offset + dat->length > seg->length,
           ("LEDATA wrote past end of segment %s, offset = %i but length = %i",
           xlink_segment_get_name(seg), dat->offset + dat->length,
           seg->length));
          memcpy(&seg->data[dat->offset], &rec.buf[rec.idx], dat->length);
          for (i = 0; i < dat->length; i++) {
            XLINK_ERROR(XLINK_GET_BIT(seg->mask, dat->offset + i),
             ("LEDATA overwrote existing data in segment %s, offset = %i",
             xlink_segment_get_name(seg), dat->offset + i));
            XLINK_SET_BIT(seg->mask, dat->offset + i, 1);
          }
        }
        else {
          int size;
          size = xlink_omf_record_load_iterated(&rec, &seg->data[dat->offset],
           seg->length - dat->offset);
          for (i = 0; i < size; i++) {
            XLINK_ERROR(XLINK_GET_BIT(seg->mask, dat->offset + i),
             ("LIDATA overwrote existing data in segment %s, offset = %i",
             xlink_segment_get_name(seg), dat->offset + i));
            XLINK_SET_BIT(seg->mask, dat->offset + i, 1);
          }
        }
        XLINK_LIST_ADD(module, data, mod, dat);
        xlink_segment_add_data(dat->segment, dat);
        break;
      }
      case OMF_FIXUPP : {
        while (xlink_omf_record_has_data(&rec)) {
          unsigned char byte;
          byte = xlink_omf_record_read_byte(&rec);
          if (byte & 0x80) {
            xlink_segment *seg;
            xlink_reloc *rel;
            xlink_omf_fixup_locat locat;
            xlink_omf_fixup_fixdata fixdata;
            const unsigned char *data;
            XLINK_ERROR(dat == NULL, ("Got FIXUP before LxDATA record"));
            XLINK_ERROR(dat->is_iterated,
             ("FIXUP records for LIDATA not yet supported"));
            seg = dat->segment;
            rel = xlink_malloc(sizeof(xlink_reloc));
            rel->segment = seg;
            locat.b0 = byte;
            locat.b1 = xlink_omf_record_read_byte(&rec);
            XLINK_ERROR(locat.high != 1, ("Expecting FIXUP subrecord"));
            rel->offset = dat->offset + locat.offset;
            rel->mode = locat.mode;
            rel->location = locat.location;
            XLINK_ERROR(
             seg->length < rel->offset + OMF_FIXUP_SIZE[rel->location],
             ("FIXUP offset %i past segment end %i", rel->offset, seg->length));
            for (i = 0; i < OMF_FIXUP_SIZE[rel->location]; i++) {
              XLINK_ERROR(XLINK_GET_BIT(seg->mask, rel->offset + i) == 0,
               ("FIXUP modifies uninitialized data, location %i",
               rel->offset + i));
            }
            fixdata.b = xlink_omf_record_read_byte(&rec);
            if (!fixdata.th_frame) {
              rel->frame = fixdata.frame;
              rel->frame_idx = 0;
              if (fixdata.frame < OMF_FRAME_LOC) {
                rel->frame_idx = xlink_omf_record_read_index(&rec);
                switch (rel->frame) {
                  case OMF_FRAME_SEG : {
                    xlink_module_get_segment(mod, rel->frame_idx);
                    break;
                  }
                  case OMF_FRAME_GRP : {
                    xlink_module_get_group(mod, rel->frame_idx);
                    break;
                  }
                  case OMF_FRAME_EXT : {
                    xlink_module_get_extern(mod, rel->frame_idx);
                    break;
                  }
                }
              }
            }
            else {
              // TODO: Get frame info from thread in xlink_omf struct
            }
            if (!fixdata.th_target) {
              rel->target = (fixdata.no_disp << 2) + fixdata.target;
              rel->target_idx = xlink_omf_record_read_index(&rec);
              switch (rel->target) {
                case OMF_TARGET_SEG :
                case OMF_TARGET_SEG_DISP : {
                  xlink_module_get_segment(mod, rel->target_idx);
                  break;
                }
                case OMF_TARGET_GRP :
                case OMF_TARGET_GRP_DISP : {
                  xlink_module_get_group(mod, rel->target_idx);
                  break;
                }
                case OMF_TARGET_EXT :
                case OMF_TARGET_EXT_DISP : {
                  xlink_module_get_extern(mod, rel->target_idx);
                  break;
                }
              }
            }
            else {
              // TODO: Get target info from thread in xlink_omf struct
            }
            if (!fixdata.no_disp) {
              rel->disp = xlink_omf_record_read_numeric(&rec);
            }
            data = seg->data + rel->offset;
            switch (rel->location) {
              case OMF_LOCATION_8BIT :
              case OMF_LOCATION_8BIT_HIGH : {
                rel->addend.offset = *(int8_t *)data;
                break;
              }
              case OMF_LOCATION_16BIT :
              case OMF_LOCATION_SEGMENT :
              case OMF_LOCATION_16BIT_LOADER : {
                rel->addend.offset = *(int16_t *)data;
                break;
              }
              case OMF_LOCATION_FAR : {
                rel->addend.segment = *(uint16_t *)(data + 2),
                rel->addend.offset = *(int16_t *)data;
                break;
              }
              case OMF_LOCATION_32BIT :
              case OMF_LOCATION_32BIT_LOADER : {
                rel->addend.offset = *(int32_t *)data;
                break;
              }
              case OMF_LOCATION_48BIT :
              case OMF_LOCATION_48BIT_PHARLAP : {
                rel->addend.segment = *(uint16_t *)(data + 4),
                rel->addend.offset = *(int32_t *)data;
                break;
              }
              default : {
                XLINK_ERROR(1, ("Unsupported location %i", rel->location));
              }
            }
            XLINK_LIST_ADD(module, reloc, mod, rel);
            xlink_segment_add_reloc(rel->segment, rel);
          }
          else {
            xlink_omf_fixup_thread th;
            int index;
            XLINK_ERROR(th.high != 0, ("Expecting THREAD subrecord"));
            index = 0;
            if (th.method < OMF_FRAME_LOC) {
              index = xlink_omf_record_read_index(&rec);
            }
          }
        }
      }
    }
  }
  XLINK_ERROR(!done, ("Got EOF before reading MODEND in %s", file->name));
  for (i = 1; i <= mod->nsegments; i++) {
    xlink_segment *seg;
    seg = xlink_module_get_segment(mod, i);
    /* Check that all segments are either fully populated or uninitialized */
    if (seg->info & SEG_HAS_DATA) {
      for (j = 0; j < seg->length; j++) {
        XLINK_ERROR(XLINK_GET_BIT(seg->mask, j) == 0,
         ("Missing data for segment %s, offset = %i",
         xlink_segment_get_name(seg), j));
      }
    }
    else {
      free(seg->data);
      free(seg->mask);
      seg->data = seg->mask = NULL;
    }
    /* Sort the PUBDEF and FIXUPP records by their offset into segment */
    qsort(seg->publics, seg->npublics, sizeof(xlink_public *), pub_comp);
    qsort(seg->relocs, seg->nrelocs, sizeof(xlink_reloc *), rel_comp);
    if ((seg->info & SEG_HAS_DATA) == 0) {
      XLINK_ERROR(seg->nrelocs != 0,
       ("Uninitialized segment %s has %i relocations, should have none",
       xlink_segment_get_name(seg), seg->nrelocs));
    }
  }
  if (flags & MOD_SPLIT) {
    xlink_module_split_segments(mod);
  }
  if (flags & MOD_DUMP) {
    printf("Module: %s\n", mod->filename);
    xlink_omf_dump_records(&omf);
    xlink_module_dump_names(mod);
    xlink_module_dump_symbols(mod);
    xlink_module_dump_segments(mod);
    xlink_omf_dump_lxdata(&omf, mod);
    xlink_module_dump_relocations(mod);
  }
  xlink_omf_clear(&omf);
  return mod;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, 0x54(%rsp)
movq %rdi, %r12
movl $0x188, %edi            # imm = 0x188
callq 0x8520
movq (%r12), %rsi
movq %rsi, (%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
cmpl $0x0, 0x8(%r12)
je 0x5acf
movq %rax, %rbx
addq $0x18, %rax
movq %rax, 0x70(%rsp)
xorl %r15d, %r15d
leaq 0xe87e(%rip), %r13      # 0x13530
movq %r12, 0x30(%rsp)
movq %rbx, 0x48(%rsp)
movq %r15, 0x18(%rsp)
movq %r12, %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x5da6
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x2ca6
movzbl 0x14(%rsp), %eax
movl %eax, %r15d
andl $-0x2, %r15d
cmpl $0x95, %r15d
jle 0x4d90
cmpl $0xb3, %r15d
jg 0x4dd3
addl $0xffffff6a, %r15d      # imm = 0xFFFFFF6A
cmpl $0xc, %r15d
ja 0x5973
movl %eax, 0x40(%rsp)
leaq 0x5328(%rip), %rcx      # 0xa048
movslq (%rcx,%r15,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %r12
movslq 0x10(%rsp), %rax
leaq 0x1(%rax), %r14
movzbl (%r12,%rax), %esi
testb %sil, %sil
jns 0x4d54
andl $0x7f, %esi
shll $0x8, %esi
addl $0x2, %eax
movzbl (%r12,%r14), %ecx
orl %ecx, %esi
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2e36
movq %rax, %r13
orb $0x1, 0x30(%rax)
movl $0x38, %edi
callq 0x8520
movq %rax, %r15
movq %r13, 0x10(%rax)
movslq %r14d, %r14
testb $0x1, 0x40(%rsp)
jne 0x50ab
movzwl (%r12,%r14), %eax
addl $0x2, %r14d
jmp 0x50b3
cmpl $0x89, %r15d
jle 0x4ed1
cmpl $0x8c, %r15d
je 0x4f1a
cmpl $0x90, %r15d
je 0x5037
cmpl $0x8a, %r15d
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %r15
jne 0x5abf
jmp 0x5ae2
cmpl $0xb4, %r15d
je 0x4f1a
cmpl $0xb6, %r15d
je 0x5037
cmpl $0xca, %r15d
movq 0x30(%rsp), %r12
jne 0x5973
movzwl 0x16(%rsp), %eax
movl 0x10(%rsp), %ebp
movl %eax, 0x28(%rsp)
subl %ebp, %eax
addl $0x2, %eax
testl %eax, %eax
jle 0x5973
movq 0x8(%rsp), %r13
movl $0x110, %edi            # imm = 0x110
callq 0x8520
movq %rax, %r14
movslq %ebp, %rax
incl %ebp
movzbl (%r13,%rax), %r12d
testq %r12, %r12
je 0x4e58
movslq %ebp, %rsi
addq %r13, %rsi
leaq 0xe6e8(%rip), %r15      # 0x13530
movq %r15, %rdi
movq %r12, %rdx
callq 0x2140
movq %r12, %rax
jmp 0x4e61
xorl %eax, %eax
leaq 0xe6cf(%rip), %r15      # 0x13530
movq %r14, %rdi
addq $0x10, %rdi
movb $0x0, (%rax,%r15)
addl %r12d, %ebp
movq %r15, %rsi
callq 0x2050
movslq 0x120(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r14)
movq %rbx, 0x8(%r14)
movl %ecx, 0x120(%rbx)
movq 0x118(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x118(%rbx)
movslq 0x120(%rbx), %rcx
movq %r14, -0x8(%rax,%rcx,8)
movl 0x28(%rsp), %eax
subl %ebp, %eax
addl $0x2, %eax
testl %eax, %eax
jg 0x4e1e
movl %ebp, 0x10(%rsp)
jmp 0x58f4
cmpl $0x80, %r15d
je 0x4ee7
cmpl $0x82, %r15d
jne 0x5973
movq 0x8(%rsp), %rsi
movslq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rax
movl %eax, 0x10(%rsp)
movzbl (%rsi,%rcx), %r14d
testq %r14, %r14
je 0x5902
addq %rax, %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x2140
jmp 0x5905
xorl %ebp, %ebp
cmpl $0xb4, %eax
sete %al
movzwl 0x16(%rsp), %ecx
movl 0x10(%rsp), %r15d
movl %ecx, 0x28(%rsp)
subl %r15d, %ecx
addl $0x2, %ecx
testl %ecx, %ecx
jle 0x596e
movb %al, %bpl
movq 0x8(%rsp), %r13
movl $0x120, %edi            # imm = 0x120
callq 0x8520
movq %rax, %r14
movl %ebp, %ebx
movl %ebp, 0x114(%rax)
movslq %r15d, %rax
movl %r15d, %ebp
incl %ebp
movzbl (%r13,%rax), %r15d
testq %r15, %r15
je 0x4f8d
movslq %ebp, %rsi
addq %r13, %rsi
leaq 0xe5b3(%rip), %r12      # 0x13530
movq %r12, %rdi
movq %r15, %rdx
callq 0x2140
movq %r15, %rax
jmp 0x4f96
xorl %eax, %eax
leaq 0xe59a(%rip), %r12      # 0x13530
leaq 0x10(%r14), %rdi
movb $0x0, (%rax,%r12)
addl %r15d, %ebp
movq %r12, %rsi
callq 0x2050
movslq %ebp, %r15
movzbl (%r13,%r15), %eax
incq %r15
testb %al, %al
jns 0x4fce
andl $0x7f, %eax
shll $0x8, %eax
addl $0x2, %ebp
movzbl (%r13,%r15), %ecx
orl %ecx, %eax
movl %ebp, %r15d
movl %ebx, %ebp
movl %eax, 0x110(%r14)
movq 0x48(%rsp), %rbx
movslq 0x160(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r14)
movq %rbx, 0x8(%r14)
movl %ecx, 0x160(%rbx)
movq 0x158(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x158(%rbx)
movslq 0x160(%rbx), %rcx
movq %r14, -0x8(%rax,%rcx,8)
movl 0x28(%rsp), %eax
subl %r15d, %eax
addl $0x2, %eax
testl %eax, %eax
jg 0x4f48
movl %r15d, 0x10(%rsp)
jmp 0x58f4
movq 0x8(%rsp), %r12
movslq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rax
movzbl (%r12,%rcx), %esi
testb %sil, %sil
jns 0x5061
andl $0x7f, %esi
shll $0x8, %esi
addl $0x2, %ecx
movzbl (%r12,%rax), %eax
orl %eax, %esi
movl %ecx, %eax
movslq %eax, %rcx
leaq 0x1(%rcx), %r13
movl %r13d, 0x10(%rsp)
movzbl (%r12,%rcx), %r14d
testb %r14b, %r14b
jns 0x5091
andl $0x7f, %r14d
shll $0x8, %r14d
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movzbl (%r12,%r13), %ecx
orl %ecx, %r14d
movl %eax, %r13d
testl %esi, %esi
je 0x5719
movq %rbx, %rdi
callq 0x2ee4
movq %rax, 0x40(%rsp)
jmp 0x5722
movl (%r12,%r14), %eax
addl $0x4, %r14d
movl %r14d, 0x10(%rsp)
movl %eax, 0x18(%r15)
movl 0x40(%rsp), %eax
andl $0x2, %eax
movl %eax, 0x1c(%r15)
movzwl 0x16(%rsp), %eax
subl %r14d, %eax
addl $0x2, %eax
movl %eax, 0x20(%r15)
movslq %eax, %rdi
callq 0x8520
movq %rax, 0x28(%r15)
movl 0x20(%r15), %eax
addl $0x7, %eax
sarl $0x3, %eax
movslq %eax, %rdi
callq 0x8520
movq %rax, 0x30(%r15)
movq 0x28(%r15), %rdi
movslq %r14d, %rax
addq %rax, %r12
movslq 0x20(%r15), %rdx
movq %r12, %rsi
callq 0x2140
movq 0x30(%r15), %rdi
movl 0x20(%r15), %eax
addl $0x7, %eax
sarl $0x3, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x20d0
cmpl $0x0, 0x1c(%r15)
je 0x563b
movl 0x18(%r15), %esi
movl 0x1c(%r13), %edx
subl %esi, %edx
addq 0x38(%r13), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4b6e
testl %eax, %eax
movq 0x30(%rsp), %r12
jle 0x56a7
xorl %r14d, %r14d
movq 0x40(%r13), %rdx
movl 0x18(%r15), %r8d
addl %r14d, %r8d
movl %r8d, %esi
movl %r8d, %ecx
andb $0x7, %cl
movl $0x1, %edi
shll %cl, %edi
shrl $0x3, %esi
movzbl (%rdx,%rsi), %ecx
andl $0x7, %r8d
btl %r8d, %ecx
jb 0x5c47
orb %cl, %dil
movb %dil, (%rdx,%rsi)
incl %r14d
cmpl %r14d, %eax
jne 0x5159
jmp 0x56a7
movl $0x28, %edi
callq 0x8520
movq %rax, %r12
movq 0x8(%rsp), %rcx
movslq 0x10(%rsp), %rax
leaq 0x1(%rax), %r15
movzbl (%rcx,%rax), %esi
testb %sil, %sil
jns 0x51d4
andl $0x7f, %esi
shll $0x8, %esi
addl $0x2, %eax
movzbl (%rcx,%r15), %ecx
orl %ecx, %esi
movl %eax, %r15d
movq %rbx, %rdi
callq 0x2d88
movq %rax, 0x10(%r12)
movl $0x0, 0x20(%r12)
movzwl 0x16(%rsp), %ebp
movl %ebp, %eax
subl %r15d, %eax
addl $0x2, %eax
testl %eax, %eax
jle 0x592d
movq 0x8(%rsp), %r13
movslq %r15d, %rax
movb (%r13,%rax), %al
cmpb $-0x1, %al
jne 0x5d6e
movslq %r15d, %rax
movzbl 0x1(%r13,%rax), %esi
addq $0x2, %rax
testb %sil, %sil
js 0x522b
movl %eax, %r15d
jmp 0x523d
andl $0x7f, %esi
shll $0x8, %esi
addl $0x3, %r15d
movzbl (%r13,%rax), %eax
orl %eax, %esi
movq %rbx, %rdi
callq 0x2e36
movq %rax, %r14
cmpq $0x0, 0x48(%rax)
jne 0x5c5c
movq %r12, 0x48(%r14)
movslq 0x20(%r12), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x20(%r12)
movq 0x18(%r12), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x18(%r12)
movslq 0x20(%r12), %rcx
movq %r14, -0x8(%rax,%rcx,8)
movl %ebp, %eax
subl %r15d, %eax
addl $0x2, %eax
testl %eax, %eax
jle 0x5921
movslq %r15d, %rax
movb (%r13,%rax), %al
cmpb $-0x1, %al
je 0x5214
jmp 0x5d73
movl $0x80, %edi
callq 0x8520
movq %rax, %r13
movq 0x8(%rsp), %r14
movslq 0x10(%rsp), %rdx
leaq 0x1(%rdx), %rcx
movb (%r14,%rdx), %al
movb %al, 0x10(%r13)
cmpb $0x1f, %al
ja 0x597d
movzwl (%r14,%rcx), %ecx
movl %ecx, 0x14(%r13)
leal 0x4(%rdx), %ecx
movzbl 0x3(%r14,%rdx), %edx
jmp 0x5987
movzwl 0x16(%rsp), %ecx
movl 0x10(%rsp), %r15d
movl %ecx, %eax
subl %r15d, %eax
addl $0x2, %eax
testl %eax, %eax
jle 0x5973
movq 0x8(%rsp), %r12
movl 0x10(%rsp), %eax
movq %rax, 0x28(%rsp)
movl %ecx, 0x3c(%rsp)
movslq %r15d, %r14
movzbl (%r12,%r14), %ebp
testb %bpl, %bpl
js 0x533d
movb 0x1(%r12,%r14), %al
shrb $0x7, %al
movzbl %al, %eax
addl %eax, %r15d
addl $0x2, %r15d
jmp 0x5609
movq %r12, %r13
movq 0x18(%rsp), %r12
testq %r12, %r12
je 0x5ceb
cmpl $0x0, 0x1c(%r12)
jne 0x5cd9
movq 0x10(%r12), %rbx
movl $0x40, %edi
callq 0x8520
movq %rbx, 0x10(%rax)
movzbl 0x1(%r13,%r14), %ecx
movl %ebp, %esi
andl $0x3, %esi
shll $0x8, %esi
orl %ecx, %esi
addl 0x18(%r12), %esi
movl %esi, 0x18(%rax)
movl %ebp, %ecx
shrl $0x6, %ecx
andl $0x1, %ecx
movl %ecx, 0x1c(%rax)
shrl $0x2, %ebp
andl $0xf, %ebp
movq %rax, %rdi
movl %ebp, 0x20(%rax)
movl 0x1c(%rbx), %edx
leaq 0x4d8a(%rip), %rax      # 0xa130
movl (%rax,%rbp,4), %eax
leal (%rax,%rsi), %ecx
cmpl %ecx, %edx
jb 0x5cc0
movq %rbx, %r8
movl $0x2a7f, %ecx           # imm = 0x2A7F
btl %ebp, %ecx
movq %r13, %r12
movq %rdi, %r13
jae 0x53f3
movq 0x40(%r8), %rcx
cmpl $0x2, %eax
movl $0x1, %edx
cmovll %edx, %eax
movl %esi, %edx
shrl $0x3, %edx
movzbl (%rcx,%rdx), %edx
movl %esi, %edi
andl $0x7, %edi
btl %edi, %edx
jae 0x5c2b
incl %esi
decl %eax
jne 0x53d6
leaq 0x3(%r14), %rdx
movzbl 0x2(%r12,%r14), %ebp
testb %bpl, %bpl
js 0x5431
movl %ebp, %eax
shrl $0x4, %eax
movl %eax, 0x24(%r13)
movl $0x0, 0x2c(%r13)
cmpb $0x3f, %bpl
movq 0x48(%rsp), %rbx
ja 0x5494
addq $0x4, %r14
movzbl (%r12,%rdx), %esi
testb %sil, %sil
js 0x5438
movl %r14d, %edx
jmp 0x544c
movq 0x48(%rsp), %rbx
jmp 0x5494
andl $0x7f, %esi
shll $0x8, %esi
addl $0x5, %r15d
movzbl (%r12,%r14), %ecx
orl %ecx, %esi
movl %r15d, %edx
movl %esi, 0x2c(%r13)
cmpb $0x2, %al
je 0x5480
movzbl %al, %eax
cmpl $0x1, %eax
je 0x5470
testl %eax, %eax
jne 0x5494
movq %rbx, %rdi
movq %r8, %r14
movq %rdx, %r15
callq 0x2e36
jmp 0x548e
movq %rbx, %rdi
movq %r8, %r14
movq %rdx, %r15
callq 0x2ee4
jmp 0x548e
movq %rbx, %rdi
movq %r8, %r14
movq %rdx, %r15
callq 0x30ee
movq %r15, %rdx
movq %r14, %r8
testb $0x8, %bpl
jne 0x54fc
movl %ebp, %eax
andl $0x7, %eax
movl %eax, 0x28(%r13)
movslq %edx, %r15
movzbl (%r12,%r15), %esi
incq %r15
testb %sil, %sil
jns 0x54c6
andl $0x7f, %esi
shll $0x8, %esi
addl $0x2, %edx
movzbl (%r12,%r15), %ecx
orl %ecx, %esi
movl %edx, %r15d
movl %esi, 0x30(%r13)
cmpb $0x6, %al
ja 0x551c
movzbl %al, %eax
movl $0x11, %ecx
btl %eax, %ecx
jb 0x550e
movl $0x22, %ecx
btl %eax, %ecx
jb 0x5501
movl $0x44, %ecx
btl %eax, %ecx
jae 0x551c
movq %rbx, %rdi
movq %r8, %r14
callq 0x30ee
jmp 0x5519
movl %edx, %r15d
jmp 0x551c
movq %rbx, %rdi
movq %r8, %r14
callq 0x2ee4
jmp 0x5519
movq %rbx, %rdi
movq %r8, %r14
callq 0x2e36
movq %r14, %r8
testb $0x4, %bpl
jne 0x5543
movslq %r15d, %r15
testb $0x1, 0x40(%rsp)
jne 0x5537
movzwl (%r12,%r15), %eax
addl $0x2, %r15d
jmp 0x553f
movl (%r12,%r15), %eax
addl $0x4, %r15d
movl %eax, 0x34(%r13)
movl 0x20(%r13), %esi
cmpq $0xd, %rsi
ja 0x5d32
movq 0x38(%r8), %rax
movl 0x18(%r13), %ecx
leaq 0x4b1c(%rip), %rdi      # 0xa07c
movslq (%rdi,%rsi,4), %rdx
addq %rdi, %rdx
jmpq *%rdx
movsbl (%rax,%rcx), %eax
jmp 0x558c
movzwl 0x4(%rax,%rcx), %edx
movw %dx, 0x38(%r13)
movl (%rax,%rcx), %eax
jmp 0x558c
movzwl 0x2(%rax,%rcx), %edx
movw %dx, 0x38(%r13)
movswl (%rax,%rcx), %eax
movl %eax, 0x3c(%r13)
movslq 0x180(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r13)
movq %rbx, 0x8(%r13)
movl %ecx, 0x180(%rbx)
movq 0x178(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x178(%rbx)
movslq 0x180(%rbx), %rcx
movq %r13, -0x8(%rax,%rcx,8)
movq 0x10(%r13), %r14
movslq 0x78(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x78(%r14)
movq 0x70(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x70(%r14)
movslq 0x78(%r14), %rcx
movq %r13, -0x8(%rax,%rcx,8)
leaq 0xdf2b(%rip), %r13      # 0x13530
movl 0x3c(%rsp), %ecx
movl %ecx, %eax
subl %r15d, %eax
addl $0x2, %eax
movq %r15, 0x28(%rsp)
testl %eax, %eax
jg 0x5319
movq 0x28(%rsp), %rax
movl %eax, 0x10(%rsp)
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %r15
movq 0x48(%rsp), %rbx
jmp 0x5abf
movl 0x18(%r15), %edi
movslq 0x20(%r15), %rdx
leal (%rdx,%rdi), %eax
cmpl 0x1c(%r13), %eax
ja 0x5d43
addq 0x38(%r13), %rdi
movq %r12, %rsi
callq 0x2140
cmpl $0x0, 0x20(%r15)
movq 0x30(%rsp), %r12
jle 0x56a7
xorl %r14d, %r14d
movq 0x40(%r13), %rax
movl 0x18(%r15), %edi
addl %r14d, %edi
movl %edi, %edx
movl %edi, %ecx
andb $0x7, %cl
movl $0x1, %esi
shll %cl, %esi
shrl $0x3, %edx
movzbl (%rax,%rdx), %ecx
andl $0x7, %edi
btl %edi, %ecx
jb 0x5c9a
orb %cl, %sil
movb %sil, (%rax,%rdx)
incl %r14d
cmpl 0x20(%r15), %r14d
jl 0x566b
movslq 0x170(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r15)
movq %rbx, 0x8(%r15)
movl %ecx, 0x170(%rbx)
movq 0x168(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x168(%rbx)
movslq 0x170(%rbx), %rcx
movq %r15, -0x8(%rax,%rcx,8)
movq 0x10(%r15), %r14
movslq 0x68(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x68(%r14)
movq 0x60(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x60(%r14)
movslq 0x68(%r14), %rcx
movq %r15, -0x8(%rax,%rcx,8)
jmp 0x5ab8
movq $0x0, 0x40(%rsp)
testl %r14d, %r14d
je 0x5746
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e36
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x5746
movl $0x0, 0x3c(%rsp)
jmp 0x5764
movslq %r13d, %r13
movzwl (%r12,%r13), %eax
movl %eax, 0x3c(%rsp)
addl $0x2, %r13d
movl %r13d, 0x10(%rsp)
movq $0x0, 0x28(%rsp)
xorl %edx, %edx
cmpb $-0x4a, %r15b
sete %al
movzwl 0x16(%rsp), %ecx
subl %r13d, %ecx
addl $0x2, %ecx
testl %ecx, %ecx
jle 0x58f4
movb %al, %dl
movl %edx, 0x5c(%rsp)
movq 0x8(%rsp), %rbp
movb 0x14(%rsp), %al
movb %al, 0x27(%rsp)
movzwl 0x16(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0x10(%rsp), %r12d
movl $0x130, %edi            # imm = 0x130
callq 0x8520
movq %rax, %r14
movq 0x40(%rsp), %rax
movq %rax, 0x10(%r14)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%r14)
movl 0x3c(%rsp), %eax
movl %eax, 0x20(%r14)
movl 0x5c(%rsp), %eax
movl %eax, 0x12c(%r14)
movslq %r12d, %rax
incl %r12d
movzbl (%rbp,%rax), %r15d
testq %r15, %r15
je 0x5801
movslq %r12d, %rsi
addq %rbp, %rsi
leaq 0xdd3f(%rip), %r13      # 0x13530
movq %r13, %rdi
movq %r15, %rdx
callq 0x2140
movq %r15, %rax
jmp 0x580a
xorl %eax, %eax
leaq 0xdd26(%rip), %r13      # 0x13530
leaq 0x24(%r14), %rdi
movb $0x0, (%rax,%r13)
addl %r15d, %r12d
movq %r13, %rsi
callq 0x2050
movslq %r12d, %rax
testb $0x1, 0x27(%rsp)
jne 0x5832
movzwl (%rbp,%rax), %ecx
addl $0x2, %eax
jmp 0x5839
movl (%rbp,%rax), %ecx
addl $0x4, %eax
movl %ecx, 0x124(%r14)
movslq %eax, %r12
movzbl (%rbp,%r12), %ecx
incq %r12
testb %cl, %cl
jns 0x5864
andl $0x7f, %ecx
shll $0x8, %ecx
addl $0x2, %eax
movzbl (%rbp,%r12), %edx
orl %edx, %ecx
movl %eax, %r12d
movl %ecx, 0x128(%r14)
movslq 0x150(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r14)
movq %rbx, 0x8(%r14)
movl %ecx, 0x150(%rbx)
movq 0x148(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x148(%rbx)
movslq 0x150(%rbx), %rcx
movq %r14, -0x8(%rax,%rcx,8)
movq 0x18(%r14), %r15
testq %r15, %r15
je 0x58dd
movslq 0x58(%r15), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x58(%r15)
movq 0x50(%r15), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x50(%r15)
movslq 0x58(%r15), %rcx
movq %r14, -0x8(%rax,%rcx,8)
movl 0x58(%rsp), %eax
subl %r12d, %eax
addl $0x2, %eax
testl %eax, %eax
jg 0x57a1
movl %r12d, 0x10(%rsp)
movq 0x30(%rsp), %r12
leaq 0xdc30(%rip), %r13      # 0x13530
jmp 0x5973
xorl %r14d, %r14d
movq 0x18(%rsp), %r15
movb $0x0, (%r14,%r13)
movq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x2050
jmp 0x5abf
movl %r15d, 0x10(%rsp)
leaq 0xdc03(%rip), %r13      # 0x13530
movslq 0x140(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r12)
movq %rbx, 0x8(%r12)
movl %ecx, 0x140(%rbx)
movq 0x138(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x138(%rbx)
movslq 0x140(%rbx), %rcx
movq %r12, -0x8(%rax,%rcx,8)
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %r15
jmp 0x5abf
movl $0x0, 0x14(%r13)
xorl %edx, %edx
movl %edx, 0x18(%r13)
movslq %ecx, %rcx
testb $0x1, 0x40(%rsp)
jne 0x599f
movzwl (%r14,%rcx), %esi
addl $0x2, %ecx
jmp 0x59a6
movl (%r14,%rcx), %esi
addl $0x4, %ecx
movl %ecx, 0x10(%rsp)
movl %esi, 0x1c(%r13)
testb $0x2, %al
je 0x59ba
testl %esi, %esi
jne 0x5d26
movslq %ecx, %r15
movzbl (%r14,%r15), %esi
incq %r15
testb %sil, %sil
jns 0x59dd
andl $0x7f, %esi
shll $0x8, %esi
addl $0x2, %ecx
movzbl (%r14,%r15), %eax
orl %eax, %esi
movl %ecx, %r15d
movq %rbx, %rdi
callq 0x2d88
movq %rax, 0x20(%r13)
movslq %r15d, %r12
movzbl (%r14,%r12), %esi
incq %r12
testb %sil, %sil
jns 0x5a0d
andl $0x7f, %esi
shll $0x8, %esi
addl $0x2, %r15d
movzbl (%r14,%r12), %eax
orl %eax, %esi
movl %r15d, %r12d
movq 0x18(%rsp), %r15
movq %rbx, %rdi
callq 0x2d88
movq %rax, 0x28(%r13)
movslq %r12d, %rax
cmpb $0x0, (%r14,%rax)
jns 0x5a31
addl $0x2, %r12d
movl %r12d, 0x10(%rsp)
movl $0x0, 0x30(%r13)
movslq 0x1c(%r13), %rdi
callq 0x8520
movq %rax, 0x38(%r13)
movl 0x1c(%r13), %eax
addl $0x7, %eax
sarl $0x3, %eax
movslq %eax, %rdi
callq 0x8520
movq %rax, 0x40(%r13)
movl 0x1c(%r13), %ecx
addl $0x7, %ecx
sarl $0x3, %ecx
movslq %ecx, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x20d0
movslq 0x130(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%r13)
movq %rbx, 0x8(%r13)
movl %ecx, 0x130(%rbx)
movq 0x128(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x8540
movq %rax, 0x128(%rbx)
movslq 0x130(%rbx), %rcx
movq %r13, -0x8(%rax,%rcx,8)
movq 0x30(%rsp), %r12
leaq 0xda71(%rip), %r13      # 0x13530
cmpl $0x0, 0x8(%r12)
jne 0x4cbc
movq (%r12), %rsi
leaq 0x51be(%rip), %rdi      # 0xac94
xorl %eax, %eax
callq 0x22ef
jmp 0x5d02
cmpl $0x0, 0x130(%rbx)
jle 0x5bae
movl $0x1, %r14d
leaq -0xfae(%rip), %r15      # 0x4b4e
leaq -0xfa2(%rip), %r12      # 0x4b61
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e36
movq %rax, %r13
testb $0x1, 0x30(%rax)
jne 0x5b33
movq 0x38(%r13), %rdi
callq 0x2030
movq 0x40(%r13), %rdi
callq 0x2030
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r13)
jmp 0x5b5e
movl 0x1c(%r13), %eax
testl %eax, %eax
jle 0x5b5e
movq 0x40(%r13), %rcx
xorl %ebp, %ebp
movl %ebp, %edx
shrl $0x3, %edx
movzbl (%rcx,%rdx), %edx
movl %ebp, %esi
andl $0x7, %esi
btl %esi, %edx
jae 0x5d0c
incl %ebp
cmpl %ebp, %eax
jne 0x5b41
movq 0x50(%r13), %rdi
movslq 0x58(%r13), %rsi
movl $0x8, %edx
movq %r15, %rcx
callq 0x2070
movq 0x70(%r13), %rdi
movslq 0x78(%r13), %rsi
movl $0x8, %edx
movq %r12, %rcx
callq 0x2070
testb $0x1, 0x30(%r13)
jne 0x5b9a
cmpl $0x0, 0x78(%r13)
jne 0x5d87
leal 0x1(%r14), %eax
cmpl 0x130(%rbx), %r14d
movl %eax, %r14d
jl 0x5b03
movl 0x54(%rsp), %ebp
testb $0x4, %bpl
je 0x5bc0
movq %rbx, %rdi
callq 0x45fb
testb $0x1, %bpl
je 0x5c0f
movq (%rbx), %rsi
leaq 0x514f(%rip), %rdi      # 0xad1f
xorl %eax, %eax
callq 0x20c0
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x3dd2
movq %rbx, %rdi
callq 0x401a
movq %rbx, %rdi
callq 0x40a1
movq %rbx, %rdi
callq 0x425d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3e7f
movq %rbx, %rdi
callq 0x441a
movq 0x60(%rsp), %rdi
callq 0x2030
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rax
movl %eax, 0x10(%rsp)
leaq 0x502a(%rip), %rdi      # 0xac65
xorl %eax, %eax
callq 0x22ef
jmp 0x5d02
movq %r13, %rdi
callq 0x26f9
addl 0x18(%r15), %r14d
leaq 0x4f87(%rip), %rdi      # 0xabe1
jmp 0x5cad
movl %r15d, 0x10(%rsp)
movq %r14, %rdi
callq 0x26f9
movq %r12, %rdi
callq 0x2870
movq 0x48(%r14), %rax
movq 0x10(%rax), %rcx
movl (%rax), %r8d
leaq 0x4ea3(%rip), %rdi      # 0xab26
leaq 0xd3a6(%rip), %rsi      # 0x13030
leaq 0xd59f(%rip), %rdx      # 0x13230
xorl %eax, %eax
callq 0x22ef
jmp 0x5d02
movq %r13, %rdi
callq 0x26f9
addl 0x18(%r15), %r14d
leaq 0x4efa(%rip), %rdi      # 0xaba7
leaq 0xd37c(%rip), %rsi      # 0x13030
movl %r14d, %edx
xorl %eax, %eax
callq 0x22ef
jmp 0x5d02
movq 0x28(%rsp), %rax
movl %eax, 0x10(%rsp)
leaq 0x4d7e(%rip), %rdi      # 0xaa4e
xorl %eax, %eax
callq 0x22ef
jmp 0x5d02
movq 0x28(%rsp), %rax
movl %eax, 0x10(%rsp)
leaq 0x4f51(%rip), %rdi      # 0xac3a
jmp 0x5cfb
movq 0x28(%rsp), %rax
movl %eax, 0x10(%rsp)
leaq 0x4f20(%rip), %rdi      # 0xac1b
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
movq %r13, %rdi
callq 0x26f9
leaq 0x4f9d(%rip), %rdi      # 0xacb8
leaq 0xd30e(%rip), %rsi      # 0x13030
movl %ebp, %edx
jmp 0x5cb7
leaq 0x4dac(%rip), %rdi      # 0xaad9
jmp 0x5c3b
movl %r15d, 0x10(%rsp)
leaq 0x483e(%rip), %rdi      # 0xa57c
jmp 0x5c3b
movq %r13, %rdi
callq 0x26f9
movl 0x20(%r15), %edx
addl 0x18(%r15), %edx
movl 0x1c(%r13), %ecx
leaq 0x4e08(%rip), %rdi      # 0xab66
leaq 0xd2cb(%rip), %rsi      # 0x13030
xorl %eax, %eax
callq 0x22ef
jmp 0x5d02
movl 0x10(%rsp), %r15d
movl %r15d, 0x10(%rsp)
movzbl %al, %esi
leaq 0x4d8b(%rip), %rdi      # 0xab0d
jmp 0x5c3b
movq %r13, %rdi
callq 0x26f9
movl 0x78(%r13), %edx
leaq 0x4f47(%rip), %rdi      # 0xace1
leaq 0xd28f(%rip), %rsi      # 0x13030
jmp 0x5cb7