// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: linker_join
void linker_join(struct GlobalVars *gv)
/* Join the sections with same name and type, or as defined by a
   linker script. Calculate their virtual address and size. */
{
  struct ObjectUnit *obj;
  struct Section *sec,*nextsec;

  if (gv->trace_file)
    fprintf(gv->trace_file,"Joining selected sections:\n");

  if (gv->use_ldscript) {
    /* Linkage rules are defined by a linker script, which means there */
    /* are predefined LinkedSection structures which can be used. */
    struct LinkedSection *ls,*maxls=NULL;
    char *filepattern,**secpatterns;
    unsigned long maxsize = 0;

    init_secdef_parse(gv);
    /* Handle one section definition after the other from the
       linker script's SECTIONS block. The script parser cares
       for commands, symbol-definitions and address-assignments. */

    while (ls = next_secdef(gv)) {
      /* Phase 1: read file/section patterns and determine which alignment
         and flags are required for the sections to merge with us */
      while (test_pattern(gv,&filepattern,&secpatterns)) {
        for (obj=(struct ObjectUnit *)gv->selobjects.first;
             obj->n.next!=NULL; obj=(struct ObjectUnit *)obj->n.next) {

          if (obj->lnkfile->type != ID_SHAREDOBJ &&
              pattern_match(filepattern,obj->lnkfile->filename)) {
            for (sec=(struct Section *)obj->sections.first;
                 sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
              if (sec->lnksec==NULL
                  && patternlist_match(secpatterns,sec->name)) {
                /* File name and section name are matching the patterns,
                   so try to merge and check alignments */
                uint8_t f;

                if ((f = cmpsecflags(gv,ls,sec->flags)) == 0xff) {
                  /* no warning, because the linker-script should know... */
                  f = ls->flags ? ls->flags : sec->flags;
                }
                merge_sec_attrs(ls,sec,f&~SF_PORTABLE_MASK);
                sec->lnksec = ls;  /* will be reset for phase 2 */
              }
            }
          }
        }
        free_patterns(filepattern,secpatterns);
      }

      /* align this section to the maximum required alignment */
      align_address(ls->relocmem,ls->destmem,ls->alignment);
      ls->base = ls->relocmem->current;
      ls->copybase = ls->destmem->current;

      /* reset lnksec pointers for phase 2 */
      for (obj=(struct ObjectUnit *)gv->selobjects.first;
           obj->n.next!=NULL; obj=(struct ObjectUnit *)obj->n.next) {
        if (obj->lnkfile->type!=ID_SHAREDOBJ && !listempty(&obj->sections)) {
          for (sec=(struct Section *)obj->sections.first;
               sec->n.next!=NULL; sec=(struct Section *)sec->n.next)
            sec->lnksec = NULL;
        }
      }

      /* Phase 2: read next patterns and merge matching sections for real */
      while (next_pattern(gv,&filepattern,&secpatterns)) {
        for (obj=(struct ObjectUnit *)gv->selobjects.first;
             obj->n.next!=NULL; obj=(struct ObjectUnit *)obj->n.next) {

          if (obj->lnkfile->type != ID_SHAREDOBJ &&
              pattern_match(filepattern,obj->lnkfile->filename)) {
            sec = (struct Section *)obj->sections.first;
            while (nextsec = (struct Section *)sec->n.next) {
              if (sec->lnksec==NULL
                  && patternlist_match(secpatterns,sec->name)) {

                /* File name and section name are matching the patterns,
                   so join it into the current LinkedSection. */
                align_address(ls->relocmem,ls->destmem,sec->alignment);
                sec->filldata = gv->filldata;
                sec->lnksec = ls;
                sec->va = ls->relocmem->current;
                sec->offset = sec->va - ls->base;
                update_address(ls->relocmem,ls->destmem,sec->size);

                /* allocate COMMON symbols, if required */
                if ((!strcmp(sec->name,gv->common_sec_name) ||
                     !strcmp(sec->name,gv->scommon_sec_name)) &&
                    (!gv->dest_object || gv->alloc_common)) {
                  update_address(ls->relocmem,ls->destmem,
                                 allocate_common(gv,sec,
                                                 ls->relocmem->current));
                }

                addtail(&ls->sections,remnode(&sec->n));

                if (!is_ld_script(sec->obj) &&
                    (gv->scriptflags & LDSF_KEEP)) {
                /* @@@ KEEP for one section will prevent all merged
                   sections from being deleted - ok??? */
                  ls->ld_flags |= LSF_PRESERVE;
                  ls->flags |= SF_ALLOC;  /* @@@ keep implies ALLOC? */
                }
              }
              sec = nextsec;
            }
          }
        }
        free_patterns(filepattern,secpatterns);

        /* keep section size up to date */
        ls->size = ls->relocmem->current - ls->base;
        if (sec = last_initialized(ls))
          ls->filesize = (sec->va + sec->size) - ls->base;
        else
          ls->filesize = 0;  /* whole contents is uninitialized */

        if (ls->size>maxsize || maxsize==0) {  /* finds largest section */
          maxsize = ls->size;
          maxls = ls;
        }
      }
    }

    /* Check if there are any sections left, which were not recognized */
    /* by the linker script rules */
    for (obj=(struct ObjectUnit *)gv->selobjects.first;
         obj->n.next!=NULL; obj=(struct ObjectUnit *)obj->n.next) {
      if (obj->lnkfile->type!=ID_SHAREDOBJ && !listempty(&obj->sections)) {
        for (sec=(struct Section *)obj->sections.first; sec->n.next!=NULL;
             sec=(struct Section *)sec->n.next) {
          int i;

          if (sec->size==0 && (*(sec->name)==0 || is_ld_script(sec->obj))) {
            /* @@@ move section without name and contents into biggest
               LinkedSection - might be a dummy or linker script section
               with abs symbols */
            sec->filldata = gv->filldata;
            sec->lnksec = maxls;
            sec->va = maxls->relocmem->current;
            sec->offset = sec->va - maxls->base;
            addtail(&maxls->sections,remnode(&sec->n));
          }
          else {
            /* Section was not recognized by target linker script */
            error(64,getobjname(obj),sec->name);

            /* kill unallocated common symbols */
            for (i=0; i<OBJSYMHTABSIZE; i++) {
              struct Symbol *sym;

              for (sym = sec->obj->objsyms[i]; sym; sym=sym->obj_chain) {
                if (sym->relsect==sec && sym->type==SYM_COMMON)
                  sym->type = SYM_ABS; /* to prevent an internal error */
              }
            }
          }
        }
      }
    }
  }


  else {  /* !gv->use_ldscript */
    /* Default linkage rules. Link all code, all data, all bss. */
    unsigned long va = 0;
    bool baseincr = (fff[gv->dest_format]->flags&FFF_BASEINCR) != 0;
    uint8_t stype;
    struct LinkedSection *ls,*newls;

    /* join sections, beginning with ST_CODE, then ST_DATA and ST_UDATA */
    for (stype=0; stype<=ST_LAST; stype++) {
      struct list seclist;

      /* collect all sections of current type */
      initlist(&seclist);
      for (obj=(struct ObjectUnit *)gv->selobjects.first;
           obj->n.next!=NULL; obj=(struct ObjectUnit *)obj->n.next) {

        if (obj->lnkfile->type != ID_SHAREDOBJ) {
          sec = (struct Section *)obj->sections.first;
          while (nextsec = (struct Section *)sec->n.next) {
            if (sec->type == stype)
              addtail(&seclist,remnode(&sec->n));
            sec = nextsec;
          }
        }
      }

      /* Phase 1: link sec. which fit together, obeying target linking rules*/
      do {
        bool create_allowed = TRUE;

        for (sec=(struct Section *)seclist.first;
             sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
          ls = get_matching_lnksec(gv,sec,NULL);
          if (!ls && create_allowed) {
            Dprintf("new: %s(%s) -> %s\n",getobjname(sec->obj),
                    sec->name,sec->name);
            ls = create_lnksect(gv,sec->name,sec->type,sec->flags,
                                sec->protection,sec->alignment);
            create_allowed = FALSE;
          }
          if (ls)
            addtail(&ls->sections,remnode(&sec->n));
        }
      }
      while (!(listempty(&seclist)));
    }

    /* Phase 2: resolve dependencies between created LinkedSections */
    do {
      newls = NULL;
      for (ls=(struct LinkedSection *)gv->lnksec.first;
           ls->n.next!=NULL; ls=(struct LinkedSection *)ls->n.next) {
        for (sec=(struct Section *)ls->sections.first;
             sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
          if (newls = get_matching_lnksec(gv,sec,ls)) {
            /* another LinkedSection matches too - merge them! */
            break;
          }
        }
        if (newls) {
          /* merge with matching LinkedSection, dump the newer one */
          struct Section *firstbss;
          uint8_t tgtfl;

          if (newls->index > ls->index) {
            /* ls is older, so keep it instead of newls */
            struct LinkedSection *dumls = newls;
            newls = ls;
            ls = dumls;
          }
          firstbss = find_first_bss_sec(newls);
          tgtfl = ls->flags & ~SF_PORTABLE_MASK;

          while (sec = (struct Section *)remhead(&ls->sections)) {
            merge_sec_attrs(newls,sec,tgtfl);
            if (!(sec->flags & SF_UNINITIALIZED) && firstbss!=NULL)
              insertbefore(&sec->n,&firstbss->n);
            else
              addtail(&newls->sections,&sec->n);
          }
          remnode(&ls->n);
          free(ls);
          break;
        }
      }
    }
    while (newls);

    /* Phase 3: calculate offsets and sizes for final LinkedSections */
    for (ls=(struct LinkedSection *)gv->lnksec.first;
         ls->n.next!=NULL; ls=(struct LinkedSection *)ls->n.next) {
      ls->base = ls->copybase = va;

      for (sec=(struct Section *)ls->sections.first;
           sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
        unsigned long abytes = align(ls->base+ls->size,sec->alignment);

        sec->lnksec = ls;
        sec->offset = ls->size + abytes;
        sec->va = ls->base + sec->offset;
        ls->size += sec->size + abytes;
        if (baseincr)
          va += sec->size + abytes;
        if (!(sec->flags & SF_UNINITIALIZED))
          ls->filesize += sec->size + abytes;

        /* allocate COMMON symbols, if required */
        if ((!strcmp(sec->name,gv->common_sec_name) ||
             !strcmp(sec->name,gv->scommon_sec_name)) &&
            (!gv->dest_object || gv->alloc_common)) {
          unsigned long n = allocate_common(gv,sec,ls->base+ls->size);

          ls->size += n;
          if (baseincr)
            va += n;
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
movq 0xa0(%rdi), %rcx
testq %rcx, %rcx
je 0x7f81
leaq 0x18305(%rip), %rdi     # 0x2027b
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x5280
cmpl $0x0, 0x244(%r14)
movq %r14, 0x8(%rsp)
je 0x83b7
movq %r14, %rdi
callq 0xe379
leaq 0x138(%r14), %rbp
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rbp, 0x40(%rsp)
movq %r14, %rdi
callq 0xdfbd
testq %rax, %rax
je 0x82c2
movq %rax, %r13
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0xcff5
testl %eax, %eax
je 0x8080
movq %rbp, %rbx
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
je 0x806c
movq 0x10(%rbx), %rax
cmpb $0x4, 0x39(%rax)
je 0x7feb
movq 0x28(%rsp), %rdi
movq 0x18(%rax), %rsi
callq 0xf370
testl %eax, %eax
je 0x7feb
leaq 0x20(%rbx), %r15
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0x7feb
cmpq $0x0, 0x18(%r15)
jne 0x8014
movq 0x20(%rsp), %rdi
movq 0x20(%r15), %rsi
callq 0xf383
testl %eax, %eax
je 0x8014
movzbl 0x2d(%r15), %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x86c2
cmpb $-0x1, %al
jne 0x8056
movb 0x21(%r13), %al
testb %al, %al
jne 0x8056
movb 0x2d(%r15), %al
andb $-0x20, %al
movzbl %al, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x8701
movq %r13, 0x18(%r15)
jmp 0x8014
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xcfb7
jmp 0x7fce
movq 0x28(%r13), %rsi
movq 0x30(%r13), %rdi
movzbl 0x23(%r13), %edx
callq 0xcf8c
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
movq 0x20(%rcx), %rcx
movq %rcx, 0x40(%r13)
movq 0x20(%rax), %rax
movq %rax, 0x38(%r13)
movq %rbp, %rax
movq (%rax), %rax
cmpq $0x0, (%rax)
je 0x80e1
movq 0x10(%rax), %rcx
cmpb $0x4, 0x39(%rcx)
je 0x80ad
movq 0x20(%rax), %rcx
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x80ad
testq %rdx, %rdx
je 0x80ad
movq %rdx, %rsi
andq $0x0, 0x18(%rcx)
movq (%rdx), %rdx
movq %rsi, %rcx
jmp 0x80cc
leaq 0x60(%r13), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0xd505
testl %eax, %eax
je 0x7fba
movq (%rbp), %rbp
cmpq $0x0, (%rbp)
je 0x8243
movq 0x10(%rbp), %rax
cmpb $0x4, 0x39(%rax)
je 0x8103
movq 0x28(%rsp), %rdi
movq 0x18(%rax), %rsi
callq 0xf370
testl %eax, %eax
je 0x8103
movq 0x20(%rbp), %rbx
movq %rbx, %r15
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x8103
cmpq $0x0, 0x18(%r15)
jne 0x8132
movq 0x20(%rsp), %rdi
movq 0x20(%r15), %rsi
callq 0xf383
testl %eax, %eax
je 0x8132
movq 0x28(%r13), %rsi
movq 0x30(%r13), %rdi
movzbl 0x2f(%r15), %edx
callq 0xcf8c
movzwl 0x200(%r14), %eax
movw %ax, 0x94(%r15)
movq %r13, 0x18(%r15)
movq 0x30(%r13), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x30(%r15)
subq 0x40(%r13), %rax
movq %rax, 0x38(%r15)
movq 0x28(%r13), %rsi
movq 0x48(%r15), %rdx
callq 0xceef
movq 0x20(%r15), %r12
movq 0x220(%r14), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
je 0x81c7
movq 0x228(%r14), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
jne 0x8201
cmpl $0x0, 0x54(%r14)
je 0x81d5
cmpl $0x0, 0x64(%r14)
je 0x8201
movq 0x28(%r13), %r12
movq 0x30(%r13), %r14
movq 0x20(%r14), %rdx
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x8828
movq %r14, %rdi
movq 0x8(%rsp), %r14
movq %r12, %rsi
movq %rax, %rdx
callq 0xceef
movq %r15, %rdi
callq 0x6444
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x6414
movq 0x10(%r15), %rdi
callq 0xcec5
testl %eax, %eax
jne 0x8132
testb $0x1, 0x248(%r14)
je 0x8132
orb $0x2, 0x24(%r13)
orb $0x1, 0x21(%r13)
jmp 0x8132
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xcfb7
movq 0x30(%r13), %rax
movq 0x40(%r13), %rcx
movq 0x20(%rax), %rax
subq %rcx, %rax
movq %rax, 0x48(%r13)
movq 0x70(%r13), %rsi
movq 0x40(%rsp), %rbp
movq %rsi, %rdx
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
je 0x828d
testb $0x2, 0x2d(%rdx)
jne 0x826e
movq 0x30(%rdx), %rsi
subq %rcx, %rsi
addq 0x48(%rdx), %rsi
jmp 0x828f
xorl %esi, %esi
movq 0x10(%rsp), %rdi
cmpq %rdi, %rax
seta %cl
movq %rsi, 0x50(%r13)
testq %rdi, %rdi
sete %dl
orb %cl, %dl
cmovneq %rax, %rdi
movq %rdi, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmovneq %r13, %rax
movq %rax, 0x18(%rsp)
jmp 0x80e9
movq 0x18(%rsp), %r13
leaq 0x60(%r13), %r15
movq %rbp, %rbx
pushq $0x40
popq %rbp
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
je 0x86b3
movq 0x10(%rbx), %rax
cmpb $0x4, 0x39(%rax)
je 0x82d1
movq 0x20(%rbx), %r12
movq (%r12), %rax
testq %rax, %rax
je 0x82d1
testq %rax, %rax
je 0x82d1
cmpq $0x0, 0x48(%r12)
je 0x8353
movq %rbx, %rdi
callq 0x6e1c
movq 0x20(%r12), %rdx
movl %ebp, %edi
movq %rax, %rsi
xorl %eax, %eax
callq 0x6c19
movq 0x10(%r12), %rax
movq 0x48(%rax), %rax
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x83aa
leaq (%rax,%rcx,8), %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x834e
cmpq %r12, 0x38(%rdx)
jne 0x8348
cmpb $0x3, 0x40(%rdx)
jne 0x8348
movb $0x1, 0x40(%rdx)
addq $0x18, %rdx
jmp 0x8330
incq %rcx
jmp 0x8326
movq 0x20(%r12), %rax
cmpb $0x0, (%rax)
je 0x836b
movq 0x10(%r12), %rdi
callq 0xcec5
testl %eax, %eax
je 0x8302
movzwl 0x200(%r14), %eax
movw %ax, 0x94(%r12)
movq %r13, 0x18(%r12)
movq 0x30(%r13), %rax
movq 0x20(%rax), %rax
movq %rax, 0x30(%r12)
subq 0x40(%r13), %rax
movq %rax, 0x38(%r12)
movq %r12, %rdi
callq 0x6444
movq %r15, %rdi
movq %rax, %rsi
callq 0x6414
movq (%r12), %r12
movq (%r12), %rax
jmp 0x82f5
movzbl 0x50(%r14), %eax
leaq 0x26dcd(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rax
movl 0xac(%rax), %eax
movl %eax, 0x18(%rsp)
leaq 0x138(%r14), %rax
movq %rax, (%rsp)
xorl %ebp, %ebp
leaq 0x28(%rsp), %r14
pushq $0x1
popq %r13
cmpb $0x5, %bpl
je 0x84cc
movq %r14, %rdi
callq 0x63c8
movq (%rsp), %rbx
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
je 0x8437
movq 0x10(%rbx), %rax
cmpb $0x4, 0x39(%rax)
je 0x83fd
movq 0x20(%rbx), %r15
movq %r15, %rdi
movq (%r15), %r15
testq %r15, %r15
je 0x83fd
cmpb %bpl, 0x2c(%rdi)
jne 0x8414
callq 0x6444
movq %r14, %rdi
movq %rax, %rsi
callq 0x6414
jmp 0x8414
movl %r13d, %ebx
movq %r14, %r15
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0x84af
movq 0x8(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x88ec
movq %rax, %r12
testq %rax, %rax
sete %al
testl %ebx, %ebx
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8491
movq 0x20(%r15), %rsi
movzbl 0x2c(%r15), %edx
movzbl 0x2d(%r15), %ecx
movzbl 0x2e(%r15), %r8d
movzbl 0x2f(%r15), %r9d
movq 0x8(%rsp), %rdi
callq 0xbcdb
movq %rax, %r12
xorl %ebx, %ebx
testq %r12, %r12
je 0x843d
addq $0x60, %r12
movq %r15, %rdi
callq 0x6444
movq %r12, %rdi
movq %rax, %rsi
callq 0x6414
jmp 0x843d
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
movl %r13d, %ebx
movq %r14, %r15
jne 0x843d
incb %bpl
jmp 0x83e7
movq 0x8(%rsp), %rax
leaq 0x1c0(%rax), %rbx
movq %rbx, %r12
movq (%r12), %r12
cmpq $0x0, (%r12)
je 0x85a4
leaq 0x60(%r12), %r15
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0x84db
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x88ec
testq %rax, %rax
je 0x84ef
movq %rax, %r14
movl 0x10(%rax), %eax
cmpl 0x10(%r12), %eax
movq %r12, %r13
cmovgq %r14, %r13
cmovgq %r12, %r14
movq %r14, %rdi
callq 0xb7d0
movq %rax, %r12
movb 0x21(%r13), %al
andb $-0x20, %al
leaq 0x60(%r13), %rcx
movq %rcx, (%rsp)
leaq 0x60(%r14), %rcx
movq %rcx, 0x10(%rsp)
movzbl %al, %r15d
movq (%rsp), %rdi
callq 0x642a
testq %rax, %rax
je 0x858f
movq %rax, %rbp
movq %r14, %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x8701
testb $0x2, 0x2d(%rbp)
jne 0x8580
testq %r12, %r12
je 0x8580
movq %rbp, %rdi
movq %r12, %rsi
callq 0x63d9
jmp 0x8549
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x6414
jmp 0x8549
movq %r13, %rdi
callq 0x6444
movq %r13, %rdi
callq 0x5040
jmp 0x84d8
xorl %ebp, %ebp
movq 0x8(%rsp), %r13
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
je 0x86b3
movq %rbp, 0x38(%rbx)
movq %rbp, 0x40(%rbx)
movq %rbx, (%rsp)
leaq 0x60(%rbx), %r14
movq %rbp, %rbx
movq (%r14), %r14
cmpq $0x0, (%r14)
je 0x86a7
movq (%rsp), %r12
movq 0x48(%r12), %rdi
addq 0x40(%r12), %rdi
movzbl 0x2f(%r14), %esi
callq 0x6a1e
movq %r12, 0x18(%r14)
movq 0x48(%r12), %r15
leaq (%r15,%rax), %rcx
movq %rcx, 0x38(%r14)
movq 0x40(%r12), %rdx
movq %rdx, 0x10(%rsp)
addq %rdx, %rcx
addq 0x48(%r14), %rax
addq %rax, %r15
testb $0x1, 0x18(%rsp)
movq %rcx, 0x30(%r14)
movq %r15, 0x48(%r12)
movl $0x0, %ebp
cmovneq %rax, %rbp
testb $0x2, 0x2d(%r14)
jne 0x8638
addq %rax, 0x50(%r12)
addq %rbx, %rbp
movq 0x20(%r14), %r12
movq 0x220(%r13), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
je 0x8669
movq 0x228(%r13), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
jne 0x85c8
cmpl $0x0, 0x54(%r13)
je 0x867b
cmpl $0x0, 0x64(%r13)
je 0x85c8
addq 0x10(%rsp), %r15
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8828
movq (%rsp), %rcx
addq %rax, 0x48(%rcx)
addq %rax, %rbp
testb $0x1, 0x18(%rsp)
cmoveq %rbx, %rbp
jmp 0x85c8
movq %rbx, %rbp
movq (%rsp), %rbx
jmp 0x85ab
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq