// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: multiSelectOrderBy
static int multiSelectOrderBy(
  Parse *pParse,        /* Parsing context */
  Select *p,            /* The right-most of SELECTs to be coded */
  SelectDest *pDest     /* What to do with query results */
){
  int i, j;             /* Loop counters */
  Select *pPrior;       /* Another SELECT immediately to our left */
  Vdbe *v;              /* Generate code to this VDBE */
  SelectDest destA;     /* Destination for coroutine A */
  SelectDest destB;     /* Destination for coroutine B */
  int regAddrA;         /* Address register for select-A coroutine */
  int regEofA;          /* Flag to indicate when select-A is complete */
  int regAddrB;         /* Address register for select-B coroutine */
  int regEofB;          /* Flag to indicate when select-B is complete */
  int addrSelectA;      /* Address of the select-A coroutine */
  int addrSelectB;      /* Address of the select-B coroutine */
  int regOutA;          /* Address register for the output-A subroutine */
  int regOutB;          /* Address register for the output-B subroutine */
  int addrOutA;         /* Address of the output-A subroutine */
  int addrOutB = 0;     /* Address of the output-B subroutine */
  int addrEofA;         /* Address of the select-A-exhausted subroutine */
  int addrEofB;         /* Address of the select-B-exhausted subroutine */
  int addrAltB;         /* Address of the A<B subroutine */
  int addrAeqB;         /* Address of the A==B subroutine */
  int addrAgtB;         /* Address of the A>B subroutine */
  int regLimitA;        /* Limit register for select-A */
  int regLimitB;        /* Limit register for select-A */
  int regPrev;          /* A range of registers to hold previous output */
  int savedLimit;       /* Saved value of p->iLimit */
  int savedOffset;      /* Saved value of p->iOffset */
  int labelCmpr;        /* Label for the start of the merge algorithm */
  int labelEnd;         /* Label for the end of the overall SELECT stmt */
  int j1;               /* Jump instructions that get retargetted */
  int op;               /* One of TK_ALL, TK_UNION, TK_EXCEPT, TK_INTERSECT */
  KeyInfo *pKeyDup = 0; /* Comparison information for duplicate removal */
  KeyInfo *pKeyMerge;   /* Comparison information for merging rows */
  sqlite3 *db;          /* Database connection */
  ExprList *pOrderBy;   /* The ORDER BY clause */
  int nOrderBy;         /* Number of terms in the ORDER BY clause */
  int *aPermute;        /* Mapping from ORDER BY terms to result set columns */
#ifndef SQLITE_OMIT_EXPLAIN
  int iSub1;            /* EQP id of left-hand query */
  int iSub2;            /* EQP id of right-hand query */
#endif

  assert( p->pOrderBy!=0 );
  assert( pKeyDup==0 ); /* "Managed" code needs this.  Ticket #3382. */
  db = pParse->db;
  v = pParse->pVdbe;
  assert( v!=0 );       /* Already thrown the error if VDBE alloc failed */
  labelEnd = sqlite3VdbeMakeLabel(v);
  labelCmpr = sqlite3VdbeMakeLabel(v);


  /* Patch up the ORDER BY clause
  */
  op = p->op;  
  pPrior = p->pPrior;
  assert( pPrior->pOrderBy==0 );
  pOrderBy = p->pOrderBy;
  assert( pOrderBy );
  nOrderBy = pOrderBy->nExpr;

  /* For operators other than UNION ALL we have to make sure that
  ** the ORDER BY clause covers every term of the result set.  Add
  ** terms to the ORDER BY clause as necessary.
  */
  if( op!=TK_ALL ){
    for(i=1; db->mallocFailed==0 && i<=p->pEList->nExpr; i++){
      struct ExprList_item *pItem;
      for(j=0, pItem=pOrderBy->a; j<nOrderBy; j++, pItem++){
        assert( pItem->iOrderByCol>0 );
        if( pItem->iOrderByCol==i ) break;
      }
      if( j==nOrderBy ){
        Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
        if( pNew==0 ) return SQLITE_NOMEM;
        pNew->flags |= EP_IntValue;
        pNew->u.iValue = i;
        pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew);
        if( pOrderBy ) pOrderBy->a[nOrderBy++].iOrderByCol = (u16)i;
      }
    }
  }

  /* Compute the comparison permutation and keyinfo that is used with
  ** the permutation used to determine if the next
  ** row of results comes from selectA or selectB.  Also add explicit
  ** collations to the ORDER BY clause terms so that when the subqueries
  ** to the right and the left are evaluated, they use the correct
  ** collation.
  */
  aPermute = sqlite3DbMallocRaw(db, sizeof(int)*nOrderBy);
  if( aPermute ){
    struct ExprList_item *pItem;
    for(i=0, pItem=pOrderBy->a; i<nOrderBy; i++, pItem++){
      assert( pItem->iOrderByCol>0  && pItem->iOrderByCol<=p->pEList->nExpr );
      aPermute[i] = pItem->iOrderByCol - 1;
    }
    pKeyMerge = sqlite3KeyInfoAlloc(db, nOrderBy);
    if( pKeyMerge ){
      for(i=0; i<nOrderBy; i++){
        CollSeq *pColl;
        Expr *pTerm = pOrderBy->a[i].pExpr;
        if( pTerm->flags & EP_Collate ){
          pColl = sqlite3ExprCollSeq(pParse, pTerm);
        }else{
          pColl = multiSelectCollSeq(pParse, p, aPermute[i]);
          if( pColl==0 ) pColl = db->pDfltColl;
          pOrderBy->a[i].pExpr =
             sqlite3ExprAddCollateString(pParse, pTerm, pColl->zName);
        }
        pKeyMerge->aColl[i] = pColl;
        pKeyMerge->aSortOrder[i] = pOrderBy->a[i].sortOrder;
      }
    }
  }else{
    pKeyMerge = 0;
  }

  /* Reattach the ORDER BY clause to the query.
  */
  p->pOrderBy = pOrderBy;
  pPrior->pOrderBy = sqlite3ExprListDup(pParse->db, pOrderBy, 0);

  /* Allocate a range of temporary registers and the KeyInfo needed
  ** for the logic that removes duplicate result rows when the
  ** operator is UNION, EXCEPT, or INTERSECT (but not UNION ALL).
  */
  if( op==TK_ALL ){
    regPrev = 0;
  }else{
    int nExpr = p->pEList->nExpr;
    assert( nOrderBy>=nExpr || db->mallocFailed );
    regPrev = pParse->nMem+1;
    pParse->nMem += nExpr+1;
    sqlite3VdbeAddOp2(v, OP_Integer, 0, regPrev);
    pKeyDup = sqlite3KeyInfoAlloc(db, nExpr);
    if( pKeyDup ){
      for(i=0; i<nExpr; i++){
        pKeyDup->aColl[i] = multiSelectCollSeq(pParse, p, i);
        pKeyDup->aSortOrder[i] = 0;
      }
    }
  }
 
  /* Separate the left and the right query from one another
  */
  p->pPrior = 0;
  sqlite3ResolveOrderGroupBy(pParse, p, p->pOrderBy, "ORDER");
  if( pPrior->pPrior==0 ){
    sqlite3ResolveOrderGroupBy(pParse, pPrior, pPrior->pOrderBy, "ORDER");
  }

  /* Compute the limit registers */
  computeLimitRegisters(pParse, p, labelEnd);
  if( p->iLimit && op==TK_ALL ){
    regLimitA = ++pParse->nMem;
    regLimitB = ++pParse->nMem;
    sqlite3VdbeAddOp2(v, OP_Copy, p->iOffset ? p->iOffset+1 : p->iLimit,
                                  regLimitA);
    sqlite3VdbeAddOp2(v, OP_Copy, regLimitA, regLimitB);
  }else{
    regLimitA = regLimitB = 0;
  }
  sqlite3ExprDelete(db, p->pLimit);
  p->pLimit = 0;
  sqlite3ExprDelete(db, p->pOffset);
  p->pOffset = 0;

  regAddrA = ++pParse->nMem;
  regEofA = ++pParse->nMem;
  regAddrB = ++pParse->nMem;
  regEofB = ++pParse->nMem;
  regOutA = ++pParse->nMem;
  regOutB = ++pParse->nMem;
  sqlite3SelectDestInit(&destA, SRT_Coroutine, regAddrA);
  sqlite3SelectDestInit(&destB, SRT_Coroutine, regAddrB);

  /* Jump past the various subroutines and coroutines to the main
  ** merge loop
  */
  j1 = sqlite3VdbeAddOp0(v, OP_Goto);
  addrSelectA = sqlite3VdbeCurrentAddr(v);


  /* Generate a coroutine to evaluate the SELECT statement to the
  ** left of the compound operator - the "A" select.
  */
  VdbeNoopComment((v, "Begin coroutine for left SELECT"));
  pPrior->iLimit = regLimitA;
  explainSetInteger(iSub1, pParse->iNextSelectId);
  sqlite3Select(pParse, pPrior, &destA);
  sqlite3VdbeAddOp2(v, OP_Integer, 1, regEofA);
  sqlite3VdbeAddOp1(v, OP_Yield, regAddrA);
  VdbeNoopComment((v, "End coroutine for left SELECT"));

  /* Generate a coroutine to evaluate the SELECT statement on 
  ** the right - the "B" select
  */
  addrSelectB = sqlite3VdbeCurrentAddr(v);
  VdbeNoopComment((v, "Begin coroutine for right SELECT"));
  savedLimit = p->iLimit;
  savedOffset = p->iOffset;
  p->iLimit = regLimitB;
  p->iOffset = 0;  
  explainSetInteger(iSub2, pParse->iNextSelectId);
  sqlite3Select(pParse, p, &destB);
  p->iLimit = savedLimit;
  p->iOffset = savedOffset;
  sqlite3VdbeAddOp2(v, OP_Integer, 1, regEofB);
  sqlite3VdbeAddOp1(v, OP_Yield, regAddrB);
  VdbeNoopComment((v, "End coroutine for right SELECT"));

  /* Generate a subroutine that outputs the current row of the A
  ** select as the next output row of the compound select.
  */
  VdbeNoopComment((v, "Output routine for A"));
  addrOutA = generateOutputSubroutine(pParse,
                 p, &destA, pDest, regOutA,
                 regPrev, pKeyDup, P4_KEYINFO_HANDOFF, labelEnd);
  
  /* Generate a subroutine that outputs the current row of the B
  ** select as the next output row of the compound select.
  */
  if( op==TK_ALL || op==TK_UNION ){
    VdbeNoopComment((v, "Output routine for B"));
    addrOutB = generateOutputSubroutine(pParse,
                 p, &destB, pDest, regOutB,
                 regPrev, pKeyDup, P4_KEYINFO_STATIC, labelEnd);
  }

  /* Generate a subroutine to run when the results from select A
  ** are exhausted and only data in select B remains.
  */
  VdbeNoopComment((v, "eof-A subroutine"));
  if( op==TK_EXCEPT || op==TK_INTERSECT ){
    addrEofA = sqlite3VdbeAddOp2(v, OP_Goto, 0, labelEnd);
  }else{  
    addrEofA = sqlite3VdbeAddOp2(v, OP_If, regEofB, labelEnd);
    sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB);
    sqlite3VdbeAddOp1(v, OP_Yield, regAddrB);
    sqlite3VdbeAddOp2(v, OP_Goto, 0, addrEofA);
    p->nSelectRow += pPrior->nSelectRow;
  }

  /* Generate a subroutine to run when the results from select B
  ** are exhausted and only data in select A remains.
  */
  if( op==TK_INTERSECT ){
    addrEofB = addrEofA;
    if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow;
  }else{  
    VdbeNoopComment((v, "eof-B subroutine"));
    addrEofB = sqlite3VdbeAddOp2(v, OP_If, regEofA, labelEnd);
    sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA);
    sqlite3VdbeAddOp1(v, OP_Yield, regAddrA);
    sqlite3VdbeAddOp2(v, OP_Goto, 0, addrEofB);
  }

  /* Generate code to handle the case of A<B
  */
  VdbeNoopComment((v, "A-lt-B subroutine"));
  addrAltB = sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA);
  sqlite3VdbeAddOp1(v, OP_Yield, regAddrA);
  sqlite3VdbeAddOp2(v, OP_If, regEofA, addrEofA);
  sqlite3VdbeAddOp2(v, OP_Goto, 0, labelCmpr);

  /* Generate code to handle the case of A==B
  */
  if( op==TK_ALL ){
    addrAeqB = addrAltB;
  }else if( op==TK_INTERSECT ){
    addrAeqB = addrAltB;
    addrAltB++;
  }else{
    VdbeNoopComment((v, "A-eq-B subroutine"));
    addrAeqB =
    sqlite3VdbeAddOp1(v, OP_Yield, regAddrA);
    sqlite3VdbeAddOp2(v, OP_If, regEofA, addrEofA);
    sqlite3VdbeAddOp2(v, OP_Goto, 0, labelCmpr);
  }

  /* Generate code to handle the case of A>B
  */
  VdbeNoopComment((v, "A-gt-B subroutine"));
  addrAgtB = sqlite3VdbeCurrentAddr(v);
  if( op==TK_ALL || op==TK_UNION ){
    sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB);
  }
  sqlite3VdbeAddOp1(v, OP_Yield, regAddrB);
  sqlite3VdbeAddOp2(v, OP_If, regEofB, addrEofB);
  sqlite3VdbeAddOp2(v, OP_Goto, 0, labelCmpr);

  /* This code runs once to initialize everything.
  */
  sqlite3VdbeJumpHere(v, j1);
  sqlite3VdbeAddOp2(v, OP_Integer, 0, regEofA);
  sqlite3VdbeAddOp2(v, OP_Integer, 0, regEofB);
  sqlite3VdbeAddOp2(v, OP_Gosub, regAddrA, addrSelectA);
  sqlite3VdbeAddOp2(v, OP_Gosub, regAddrB, addrSelectB);
  sqlite3VdbeAddOp2(v, OP_If, regEofA, addrEofA);
  sqlite3VdbeAddOp2(v, OP_If, regEofB, addrEofB);

  /* Implement the main merge loop
  */
  sqlite3VdbeResolveLabel(v, labelCmpr);
  sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY);
  sqlite3VdbeAddOp4(v, OP_Compare, destA.iSdst, destB.iSdst, nOrderBy,
                         (char*)pKeyMerge, P4_KEYINFO_HANDOFF);
  sqlite3VdbeChangeP5(v, OPFLAG_PERMUTE);
  sqlite3VdbeAddOp3(v, OP_Jump, addrAltB, addrAeqB, addrAgtB);

  /* Jump to the this point in order to terminate the query.
  */
  sqlite3VdbeResolveLabel(v, labelEnd);

  /* Set the number of output columns
  */
  if( pDest->eDest==SRT_Output ){
    Select *pFirst = pPrior;
    while( pFirst->pPrior ) pFirst = pFirst->pPrior;
    generateColumnNames(pParse, 0, pFirst->pEList);
  }

  /* Reassembly the compound query so that it will be freed correctly
  ** by the calling function */
  if( p->pPrior ){
    sqlite3SelectDelete(db, p->pPrior);
  }
  p->pPrior = pPrior;

  /*** TBD:  Insert subroutine calls to close cursors on incomplete
  **** subqueries ****/
  explainComposite(pParse, p->op, iSub1, iSub2, 0);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x80(%rbp)
movq $0x0, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, -0xb0(%rbp)
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xdc(%rbp)
cmpl $0x71, -0xb8(%rbp)
je 0x70b7d
movl $0x1, -0x24(%rbp)
movq -0xd0(%rbp), %rax
movzbl 0x50(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x129(%rbp)
jne 0x70a4a
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
setle %al
movb %al, -0x129(%rbp)
movb -0x129(%rbp), %al
testb $0x1, %al
jne 0x70a59
jmp 0x70b7b
movl $0x0, -0x28(%rbp)
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xf8(%rbp)
movl -0x28(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x70aae
movq -0xf8(%rbp), %rax
movzwl 0x1a(%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x70a8f
jmp 0x70aae
jmp 0x70a91
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0xf8(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xf8(%rbp)
jmp 0x70a72
movl -0x28(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jne 0x70b6b
movq -0xd0(%rbp), %rdi
movl $0x81, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x548b0
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
jne 0x70aef
movl $0x7, -0x4(%rbp)
jmp 0x7163f
movq -0x100(%rbp), %rax
movzwl 0x2(%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
movw %cx, 0x2(%rax)
movl -0x24(%rbp), %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq -0x100(%rbp), %rdx
callq 0x54650
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0x70b69
movl -0x24(%rbp), %eax
movw %ax, %cx
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xdc(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0xdc(%rbp)
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movw %cx, 0x1a(%rax)
jmp 0x70b6b
jmp 0x70b6d
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x70a1d
jmp 0x70b7d
movq -0xd0(%rbp), %rdi
movslq -0xdc(%rbp), %rax
shlq $0x2, %rax
movl %eax, %esi
callq 0x134e0
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0x70d5b
movl $0x0, -0x24(%rbp)
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x108(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x70c08
movq -0x108(%rbp), %rax
movzwl 0x1a(%rax), %edx
subl $0x1, %edx
movq -0xe8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x108(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x108(%rbp)
jmp 0x70bc4
movq -0xd0(%rbp), %rdi
movl -0xdc(%rbp), %esi
callq 0x4a710
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
je 0x70d59
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x70d57
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x70c93
movq -0x10(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x659b0
movq %rax, -0x110(%rbp)
jmp 0x70d07
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0xe8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
callq 0x71720
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x110(%rbp)
jne 0x70cd1
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rdi
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rax
movq (%rax), %rdx
callq 0x61710
movq %rax, %rcx
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x110(%rbp), %rdx
movq -0xc8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb 0x18(%rax), %dl
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x70c36
jmp 0x70d59
jmp 0x70d66
movq $0x0, -0xc8(%rbp)
movq -0xd8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0xd8(%rbp), %rsi
xorl %edx, %edx
callq 0x61da0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
cmpl $0x71, -0xb8(%rbp)
jne 0x70dad
movl $0x0, -0xa0(%rbp)
jmp 0x70e6f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x11c(%rbp)
movq -0x10(%rbp), %rax
movl 0x58(%rax), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
movl -0x11c(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
addl 0x58(%rax), %ecx
movl %ecx, 0x58(%rax)
movq -0x38(%rbp), %rdi
movl -0xa0(%rbp), %ecx
movl $0x15, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0xd0(%rbp), %rdi
movl -0x11c(%rbp), %esi
callq 0x4a710
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x70e6d
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x11c(%rbp), %eax
jge 0x70e6b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x71720
movq %rax, %rdx
movq -0xc0(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x70e1f
jmp 0x70e6d
jmp 0x70e6f
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x3ed32(%rip), %rcx     # 0xafbc4
callq 0x66520
movq -0x30(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x70ebe
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x3ed0b(%rip), %rcx     # 0xafbc4
callq 0x66520
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0xb0(%rbp), %edx
callq 0x6d8c0
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x70f7f
cmpl $0x71, -0xb8(%rbp)
jne 0x70f7f
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x98(%rbp)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x9c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x70f39
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x70f46
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x13c(%rbp)
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %edx
movl -0x98(%rbp), %ecx
movl $0x1c, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x98(%rbp), %edx
movl -0x9c(%rbp), %ecx
movl $0x1c, %esi
callq 0x5e0c0
jmp 0x70f93
movl $0x0, -0x9c(%rbp)
movl $0x0, -0x98(%rbp)
movq -0xd0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x47330
movq -0x18(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0xd0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x47330
movq -0x18(%rbp), %rax
movq $0x0, 0x70(%rax)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x58(%rcx)
movl %eax, -0x78(%rbp)
movl -0x5c(%rbp), %edx
leaq -0x48(%rbp), %rdi
movl $0xa, %esi
callq 0x5ef20
movl -0x64(%rbp), %edx
leaq -0x58(%rbp), %rdi
movl $0xa, %esi
callq 0x5ef20
movq -0x38(%rbp), %rdi
movl $0xe, %esi
callq 0x5e060
movl %eax, -0xb4(%rbp)
movq -0x38(%rbp), %rdi
callq 0x5e520
movl %eax, -0x6c(%rbp)
movl -0x98(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0xec(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x529a0
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %ecx
movl $0x15, %esi
movl $0x1, %edx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movq -0x38(%rbp), %rdi
callq 0x5e520
movl %eax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xa4(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xa8(%rbp)
movl -0x9c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0xf0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x529a0
movl -0xa4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0xa8(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x38(%rbp), %rdi
movl -0x68(%rbp), %ecx
movl $0x15, %esi
movl $0x1, %edx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x74(%rbp), %r8d
movl -0xa0(%rbp), %r9d
movq -0xc0(%rbp), %r10
movl -0xb0(%rbp), %eax
leaq -0x48(%rbp), %rdx
movq %r10, (%rsp)
movl $0xfffffff0, 0x8(%rsp)  # imm = 0xFFFFFFF0
movl %eax, 0x10(%rsp)
callq 0x717b0
movl %eax, -0x7c(%rbp)
cmpl $0x71, -0xb8(%rbp)
je 0x711bc
cmpl $0x70, -0xb8(%rbp)
jne 0x711fc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x78(%rbp), %r8d
movl -0xa0(%rbp), %r9d
movq -0xc0(%rbp), %r10
movl -0xb0(%rbp), %eax
leaq -0x58(%rbp), %rdx
movq %r10, (%rsp)
movl $0xffffffef, 0x8(%rsp)  # imm = 0xFFFFFFEF
movl %eax, 0x10(%rsp)
callq 0x717b0
movl %eax, -0x80(%rbp)
cmpl $0x72, -0xb8(%rbp)
je 0x7120e
cmpl $0x73, -0xb8(%rbp)
jne 0x7122c
movq -0x38(%rbp), %rdi
movl -0xb0(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
movl %eax, -0x84(%rbp)
jmp 0x71298
movq -0x38(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0xb0(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movl %eax, -0x84(%rbp)
movq -0x38(%rbp), %rdi
movl -0x78(%rbp), %edx
movl -0x80(%rbp), %ecx
movl $0xf, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movq -0x38(%rbp), %rdi
movl -0x84(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
cmpl $0x73, -0xb8(%rbp)
jne 0x712d1
movl -0x84(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jbe 0x712cf
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x71329
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %edx
movl -0xb0(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movl %eax, -0x88(%rbp)
movq -0x38(%rbp), %rdi
movl -0x74(%rbp), %edx
movl -0x7c(%rbp), %ecx
movl $0xf, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movq -0x38(%rbp), %rdi
movl -0x88(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x74(%rbp), %edx
movl -0x7c(%rbp), %ecx
movl $0xf, %esi
callq 0x5e0c0
movl %eax, -0x8c(%rbp)
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %edx
movl -0x84(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xac(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
cmpl $0x71, -0xb8(%rbp)
jne 0x71398
movl -0x8c(%rbp), %eax
movl %eax, -0x90(%rbp)
jmp 0x71404
cmpl $0x73, -0xb8(%rbp)
jne 0x713be
movl -0x8c(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x71402
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movl %eax, -0x90(%rbp)
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %edx
movl -0x84(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xac(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
jmp 0x71404
movq -0x38(%rbp), %rdi
callq 0x5e520
movl %eax, -0x94(%rbp)
cmpl $0x71, -0xb8(%rbp)
je 0x71425
cmpl $0x70, -0xb8(%rbp)
jne 0x71439
movq -0x38(%rbp), %rdi
movl -0x78(%rbp), %edx
movl -0x80(%rbp), %ecx
movl $0xf, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x11, %esi
callq 0x5ecf0
movq -0x38(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x88(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xac(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xb4(%rbp), %esi
callq 0x5e090
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %ecx
movl $0x15, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x68(%rbp), %ecx
movl $0x15, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %edx
movl -0x6c(%rbp), %ecx
movl $0xf, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x70(%rbp), %ecx
movl $0xf, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %edx
movl -0x84(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x88(%rbp), %ecx
movl $0x27, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xac(%rbp), %esi
callq 0x677f0
movq -0x38(%rbp), %rdi
movq -0xe8(%rbp), %r9
movl $0x23, %esi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
movl $0xfffffff1, (%rsp)     # imm = 0xFFFFFFF1
callq 0x5e1b0
movq -0x38(%rbp), %rdi
movl -0x40(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0xdc(%rbp), %r8d
movq -0xc8(%rbp), %r9
movl $0x24, %esi
movl $0xfffffff0, (%rsp)     # imm = 0xFFFFFFF0
callq 0x5e1b0
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x5e540
movq -0x38(%rbp), %rdi
movl -0x8c(%rbp), %edx
movl -0x90(%rbp), %ecx
movl -0x94(%rbp), %r8d
movl $0x25, %esi
callq 0x5e0f0
movq -0x38(%rbp), %rdi
movl -0xb0(%rbp), %esi
callq 0x677f0
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x5, %eax
jne 0x715ed
movq -0x30(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x715d6
movq -0x128(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x128(%rbp)
jmp 0x715b4
movq -0x10(%rbp), %rdi
movq -0x128(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x70140
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x7160c
movq -0xd0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x47420
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %esi
movl -0xec(%rbp), %edx
movl -0xf0(%rbp), %ecx
xorl %r8d, %r8d
callq 0x71650
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax,%rax)