// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: multiSelect
static int multiSelect(
  Parse *pParse,        /* Parsing context */
  Select *p,            /* The right-most of SELECTs to be coded */
  SelectDest *pDest     /* What to do with query results */
){
  int rc = SQLITE_OK;   /* Success code from a subroutine */
  Select *pPrior;       /* Another SELECT immediately to our left */
  Vdbe *v;              /* Generate code to this VDBE */
  SelectDest dest;      /* Alternative data destination */
  Select *pDelete = 0;  /* Chain of simple selects to delete */
  sqlite3 *db;          /* Database connection */
#ifndef SQLITE_OMIT_EXPLAIN
  int iSub1;            /* EQP id of left-hand query */
  int iSub2;            /* EQP id of right-hand query */
#endif

  /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs.  Only
  ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
  */
  assert( p && p->pPrior );  /* Calling function guarantees this much */
  db = pParse->db;
  pPrior = p->pPrior;
  assert( pPrior->pRightmost!=pPrior );
  assert( pPrior->pRightmost==p->pRightmost );
  dest = *pDest;
  if( pPrior->pOrderBy ){
    sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before",
      selectOpName(p->op));
    rc = 1;
    goto multi_select_end;
  }
  if( pPrior->pLimit ){
    sqlite3ErrorMsg(pParse,"LIMIT clause should come after %s not before",
      selectOpName(p->op));
    rc = 1;
    goto multi_select_end;
  }

  v = sqlite3GetVdbe(pParse);
  assert( v!=0 );  /* The VDBE already created by calling function */

  /* Create the destination temporary table if necessary
  */
  if( dest.eDest==SRT_EphemTab ){
    assert( p->pEList );
    sqlite3VdbeAddOp2(v, OP_OpenEphemeral, dest.iSDParm, p->pEList->nExpr);
    sqlite3VdbeChangeP5(v, BTREE_UNORDERED);
    dest.eDest = SRT_Table;
  }

  /* Make sure all SELECTs in the statement have the same number of elements
  ** in their result sets.
  */
  assert( p->pEList && pPrior->pEList );
  if( p->pEList->nExpr!=pPrior->pEList->nExpr ){
    if( p->selFlags & SF_Values ){
      sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms");
    }else{
      sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
        " do not have the same number of result columns", selectOpName(p->op));
    }
    rc = 1;
    goto multi_select_end;
  }

  /* Compound SELECTs that have an ORDER BY clause are handled separately.
  */
  if( p->pOrderBy ){
    return multiSelectOrderBy(pParse, p, pDest);
  }

  /* Generate code for the left and right SELECT statements.
  */
  switch( p->op ){
    case TK_ALL: {
      int addr = 0;
      int nLimit;
      assert( !pPrior->pLimit );
      pPrior->iLimit = p->iLimit;
      pPrior->iOffset = p->iOffset;
      pPrior->pLimit = p->pLimit;
      pPrior->pOffset = p->pOffset;
      explainSetInteger(iSub1, pParse->iNextSelectId);
      rc = sqlite3Select(pParse, pPrior, &dest);
      p->pLimit = 0;
      p->pOffset = 0;
      if( rc ){
        goto multi_select_end;
      }
      p->pPrior = 0;
      p->iLimit = pPrior->iLimit;
      p->iOffset = pPrior->iOffset;
      if( p->iLimit ){
        addr = sqlite3VdbeAddOp1(v, OP_IfZero, p->iLimit);
        VdbeComment((v, "Jump ahead if LIMIT reached"));
      }
      explainSetInteger(iSub2, pParse->iNextSelectId);
      rc = sqlite3Select(pParse, p, &dest);
      testcase( rc!=SQLITE_OK );
      pDelete = p->pPrior;
      p->pPrior = pPrior;
      p->nSelectRow += pPrior->nSelectRow;
      if( pPrior->pLimit
       && sqlite3ExprIsInteger(pPrior->pLimit, &nLimit)
       && nLimit>0 && p->nSelectRow > (u64)nLimit 
      ){
        p->nSelectRow = nLimit;
      }
      if( addr ){
        sqlite3VdbeJumpHere(v, addr);
      }
      break;
    }
    case TK_EXCEPT:
    case TK_UNION: {
      int unionTab;    /* Cursor number of the temporary table holding result */
      u8 op = 0;       /* One of the SRT_ operations to apply to self */
      int priorOp;     /* The SRT_ operation to apply to prior selects */
      Expr *pLimit, *pOffset; /* Saved values of p->nLimit and p->nOffset */
      int addr;
      SelectDest uniondest;

      testcase( p->op==TK_EXCEPT );
      testcase( p->op==TK_UNION );
      priorOp = SRT_Union;
      if( dest.eDest==priorOp && ALWAYS(!p->pLimit &&!p->pOffset) ){
        /* We can reuse a temporary table generated by a SELECT to our
        ** right.
        */
        assert( p->pRightmost!=p );  /* Can only happen for leftward elements
                                     ** of a 3-way or more compound */
        assert( p->pLimit==0 );      /* Not allowed on leftward elements */
        assert( p->pOffset==0 );     /* Not allowed on leftward elements */
        unionTab = dest.iSDParm;
      }else{
        /* We will need to create our own temporary table to hold the
        ** intermediate results.
        */
        unionTab = pParse->nTab++;
        assert( p->pOrderBy==0 );
        addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, unionTab, 0);
        assert( p->addrOpenEphm[0] == -1 );
        p->addrOpenEphm[0] = addr;
        p->pRightmost->selFlags |= SF_UsesEphemeral;
        assert( p->pEList );
      }

      /* Code the SELECT statements to our left
      */
      assert( !pPrior->pOrderBy );
      sqlite3SelectDestInit(&uniondest, priorOp, unionTab);
      explainSetInteger(iSub1, pParse->iNextSelectId);
      rc = sqlite3Select(pParse, pPrior, &uniondest);
      if( rc ){
        goto multi_select_end;
      }

      /* Code the current SELECT statement
      */
      if( p->op==TK_EXCEPT ){
        op = SRT_Except;
      }else{
        assert( p->op==TK_UNION );
        op = SRT_Union;
      }
      p->pPrior = 0;
      pLimit = p->pLimit;
      p->pLimit = 0;
      pOffset = p->pOffset;
      p->pOffset = 0;
      uniondest.eDest = op;
      explainSetInteger(iSub2, pParse->iNextSelectId);
      rc = sqlite3Select(pParse, p, &uniondest);
      testcase( rc!=SQLITE_OK );
      /* Query flattening in sqlite3Select() might refill p->pOrderBy.
      ** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */
      sqlite3ExprListDelete(db, p->pOrderBy);
      pDelete = p->pPrior;
      p->pPrior = pPrior;
      p->pOrderBy = 0;
      if( p->op==TK_UNION ) p->nSelectRow += pPrior->nSelectRow;
      sqlite3ExprDelete(db, p->pLimit);
      p->pLimit = pLimit;
      p->pOffset = pOffset;
      p->iLimit = 0;
      p->iOffset = 0;

      /* Convert the data in the temporary table into whatever form
      ** it is that we currently need.
      */
      assert( unionTab==dest.iSDParm || dest.eDest!=priorOp );
      if( dest.eDest!=priorOp ){
        int iCont, iBreak, iStart;
        assert( p->pEList );
        if( dest.eDest==SRT_Output ){
          Select *pFirst = p;
          while( pFirst->pPrior ) pFirst = pFirst->pPrior;
          generateColumnNames(pParse, 0, pFirst->pEList);
        }
        iBreak = sqlite3VdbeMakeLabel(v);
        iCont = sqlite3VdbeMakeLabel(v);
        computeLimitRegisters(pParse, p, iBreak);
        sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak);
        iStart = sqlite3VdbeCurrentAddr(v);
        selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr,
                        0, 0, &dest, iCont, iBreak);
        sqlite3VdbeResolveLabel(v, iCont);
        sqlite3VdbeAddOp2(v, OP_Next, unionTab, iStart);
        sqlite3VdbeResolveLabel(v, iBreak);
        sqlite3VdbeAddOp2(v, OP_Close, unionTab, 0);
      }
      break;
    }
    default: assert( p->op==TK_INTERSECT ); {
      int tab1, tab2;
      int iCont, iBreak, iStart;
      Expr *pLimit, *pOffset;
      int addr;
      SelectDest intersectdest;
      int r1;

      /* INTERSECT is different from the others since it requires
      ** two temporary tables.  Hence it has its own case.  Begin
      ** by allocating the tables we will need.
      */
      tab1 = pParse->nTab++;
      tab2 = pParse->nTab++;
      assert( p->pOrderBy==0 );

      addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tab1, 0);
      assert( p->addrOpenEphm[0] == -1 );
      p->addrOpenEphm[0] = addr;
      p->pRightmost->selFlags |= SF_UsesEphemeral;
      assert( p->pEList );

      /* Code the SELECTs to our left into temporary table "tab1".
      */
      sqlite3SelectDestInit(&intersectdest, SRT_Union, tab1);
      explainSetInteger(iSub1, pParse->iNextSelectId);
      rc = sqlite3Select(pParse, pPrior, &intersectdest);
      if( rc ){
        goto multi_select_end;
      }

      /* Code the current SELECT into temporary table "tab2"
      */
      addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tab2, 0);
      assert( p->addrOpenEphm[1] == -1 );
      p->addrOpenEphm[1] = addr;
      p->pPrior = 0;
      pLimit = p->pLimit;
      p->pLimit = 0;
      pOffset = p->pOffset;
      p->pOffset = 0;
      intersectdest.iSDParm = tab2;
      explainSetInteger(iSub2, pParse->iNextSelectId);
      rc = sqlite3Select(pParse, p, &intersectdest);
      testcase( rc!=SQLITE_OK );
      pDelete = p->pPrior;
      p->pPrior = pPrior;
      if( p->nSelectRow>pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow;
      sqlite3ExprDelete(db, p->pLimit);
      p->pLimit = pLimit;
      p->pOffset = pOffset;

      /* Generate code to take the intersection of the two temporary
      ** tables.
      */
      assert( p->pEList );
      if( dest.eDest==SRT_Output ){
        Select *pFirst = p;
        while( pFirst->pPrior ) pFirst = pFirst->pPrior;
        generateColumnNames(pParse, 0, pFirst->pEList);
      }
      iBreak = sqlite3VdbeMakeLabel(v);
      iCont = sqlite3VdbeMakeLabel(v);
      computeLimitRegisters(pParse, p, iBreak);
      sqlite3VdbeAddOp2(v, OP_Rewind, tab1, iBreak);
      r1 = sqlite3GetTempReg(pParse);
      iStart = sqlite3VdbeAddOp2(v, OP_RowKey, tab1, r1);
      sqlite3VdbeAddOp4Int(v, OP_NotFound, tab2, iCont, r1, 0);
      sqlite3ReleaseTempReg(pParse, r1);
      selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr,
                      0, 0, &dest, iCont, iBreak);
      sqlite3VdbeResolveLabel(v, iCont);
      sqlite3VdbeAddOp2(v, OP_Next, tab1, iStart);
      sqlite3VdbeResolveLabel(v, iBreak);
      sqlite3VdbeAddOp2(v, OP_Close, tab2, 0);
      sqlite3VdbeAddOp2(v, OP_Close, tab1, 0);
      break;
    }
  }

  explainComposite(pParse, p->op, iSub1, iSub2, p->op!=TK_ALL);

  /* Compute collating sequences used by 
  ** temporary tables needed to implement the compound select.
  ** Attach the KeyInfo structure to all temporary tables.
  **
  ** This section is run by the right-most SELECT statement only.
  ** SELECT statements to the left always skip this part.  The right-most
  ** SELECT might also skip this part if it has no ORDER BY clause and
  ** no temp tables are required.
  */
  if( p->selFlags & SF_UsesEphemeral ){
    int i;                        /* Loop counter */
    KeyInfo *pKeyInfo;            /* Collating sequence for the result set */
    Select *pLoop;                /* For looping through SELECT statements */
    CollSeq **apColl;             /* For looping through pKeyInfo->aColl[] */
    int nCol;                     /* Number of columns in result set */

    assert( p->pRightmost==p );
    nCol = p->pEList->nExpr;
    pKeyInfo = sqlite3KeyInfoAlloc(db, nCol);
    if( !pKeyInfo ){
      rc = SQLITE_NOMEM;
      goto multi_select_end;
    }
    for(i=0, apColl=pKeyInfo->aColl; i<nCol; i++, apColl++){
      *apColl = multiSelectCollSeq(pParse, p, i);
      if( 0==*apColl ){
        *apColl = db->pDfltColl;
      }
    }

    for(pLoop=p; pLoop; pLoop=pLoop->pPrior){
      for(i=0; i<2; i++){
        int addr = pLoop->addrOpenEphm[i];
        if( addr<0 ){
          /* If [0] is unused then [1] is also unused.  So we can
          ** always safely abort as soon as the first unused slot is found */
          assert( pLoop->addrOpenEphm[1]<0 );
          break;
        }
        sqlite3VdbeChangeP2(v, addr, nCol);
        sqlite3VdbeChangeP4(v, addr, (char*)pKeyInfo, P4_KEYINFO);
        pLoop->addrOpenEphm[i] = -1;
      }
    }
    sqlite3DbFree(db, pKeyInfo);
  }

multi_select_end:
  pDest->iSdst = dest.iSdst;
  pDest->nSdst = dest.nSdst;
  sqlite3SelectDelete(db, pDelete);
  return rc;
}

// 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, -0x24(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x6cc87
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %edi
callq 0x70910
movq -0x128(%rbp), %rdi
movq %rax, %rdx
leaq 0x437ec(%rip), %rsi     # 0xb0460
movb $0x0, %al
callq 0x136f0
movl $0x1, -0x24(%rbp)
jmp 0x6d7b8
movq -0x30(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x6ccce
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %edi
callq 0x70910
movq -0x130(%rbp), %rdi
movq %rax, %rdx
leaq 0x437d5(%rip), %rsi     # 0xb0490
movb $0x0, %al
callq 0x136f0
movl $0x1, -0x24(%rbp)
jmp 0x6d7b8
movq -0x10(%rbp), %rdi
callq 0x5e000
movq %rax, -0x38(%rbp)
movzbl -0x48(%rbp), %eax
cmpl $0x9, %eax
jne 0x6cd10
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movl $0x33, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl $0x8, %esi
callq 0x5e540
movb $0x8, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
je 0x6cd86
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x6cd4a
movq -0x10(%rbp), %rdi
leaq 0x4377c(%rip), %rsi     # 0xb04bd
movb $0x0, %al
callq 0x136f0
jmp 0x6cd7a
movq -0x10(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %edi
callq 0x70910
movq -0x138(%rbp), %rdi
movq %rax, %rdx
leaq 0x43778(%rip), %rsi     # 0xb04eb
movb $0x0, %al
callq 0x136f0
movl $0x1, -0x24(%rbp)
jmp 0x6d7b8
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x6cdaa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x70970
movl %eax, -0x4(%rbp)
jmp 0x6d7df
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0x13c(%rbp)
subl $0x70, %eax
je 0x6cf5d
jmp 0x6cdc3
movl -0x13c(%rbp), %eax
subl $0x71, %eax
je 0x6cde4
jmp 0x6cdd0
movl -0x13c(%rbp), %eax
subl $0x72, %eax
je 0x6cf5d
jmp 0x6d27f
movl $0x0, -0x64(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x529a0
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x70(%rax)
cmpl $0x0, -0x24(%rbp)
je 0x6ce6b
jmp 0x6d7b8
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x6ceb5
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
movl $0x80, %esi
callq 0x5ecf0
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x529a0
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x6cf46
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rdi
leaq -0x68(%rbp), %rsi
callq 0x65040
cmpl $0x0, %eax
je 0x6cf46
cmpl $0x0, -0x68(%rbp)
jle 0x6cf46
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x68(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x6cf46
movslq -0x68(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpl $0x0, -0x64(%rbp)
je 0x6cf58
movq -0x38(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x5e090
jmp 0x6d5db
movb $0x0, -0x6d(%rbp)
movl $0x1, -0x74(%rbp)
movzbl -0x48(%rbp), %eax
cmpl -0x74(%rbp), %eax
jne 0x6cf8f
movq -0x18(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x6cf8f
movq -0x18(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x6cf8f
movl -0x44(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x6cfda
movq -0x10(%rbp), %rcx
movl 0x54(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x54(%rcx)
movl %eax, -0x6c(%rbp)
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl $0x33, %esi
xorl %ecx, %ecx
callq 0x5e0c0
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movzwl 0xa(%rax), %ecx
orl $0x8, %ecx
movw %cx, 0xa(%rax)
movl -0x74(%rbp), %esi
movl -0x6c(%rbp), %edx
leaq -0x9c(%rbp), %rdi
callq 0x5ef20
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x9c(%rbp), %rdx
callq 0x529a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x6d01b
jmp 0x6d7b8
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x72, %eax
jne 0x6d02e
movb $0x2, -0x6d(%rbp)
jmp 0x6d032
movb $0x1, -0x6d(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x70(%rax)
movb -0x6d(%rbp), %al
movb %al, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x9c(%rbp), %rdx
callq 0x529a0
movl %eax, -0x24(%rbp)
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x47460
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x70, %eax
jne 0x6d0f4
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x47330
movq -0x80(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x88(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movzbl -0x48(%rbp), %eax
cmpl -0x74(%rbp), %eax
je 0x6d27a
movzbl -0x48(%rbp), %eax
cmpl $0x5, %eax
jne 0x6d190
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x6d179
movq -0xb0(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0x6d157
movq -0x10(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x70140
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, -0xa4(%rbp)
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0xa4(%rbp), %edx
callq 0x6d8c0
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl -0xa4(%rbp), %ecx
movl $0x65, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
callq 0x5e520
movl %eax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl -0x6c(%rbp), %ecx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %r8d
movl -0xa0(%rbp), %r10d
movl -0xa4(%rbp), %eax
xorl %r9d, %r9d
leaq -0x48(%rbp), %r11
movq $0x0, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x6e7c0
movq -0x38(%rbp), %rdi
movl -0xa0(%rbp), %esi
callq 0x677f0
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl -0xa8(%rbp), %ecx
movl $0x7, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xa4(%rbp), %esi
callq 0x677f0
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl $0x36, %esi
xorl %ecx, %ecx
callq 0x5e0c0
jmp 0x6d5db
movq -0x10(%rbp), %rcx
movl 0x54(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x54(%rcx)
movl %eax, -0xb4(%rbp)
movq -0x10(%rbp), %rcx
movl 0x54(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x54(%rcx)
movl %eax, -0xb8(%rbp)
movq -0x38(%rbp), %rdi
movl -0xb4(%rbp), %edx
movl $0x33, %esi
xorl %ecx, %ecx
callq 0x5e0c0
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movzwl 0xa(%rax), %ecx
orl $0x8, %ecx
movw %cx, 0xa(%rax)
movl -0xb4(%rbp), %edx
leaq -0xec(%rbp), %rdi
movl $0x1, %esi
callq 0x5ef20
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0xec(%rbp), %rdx
callq 0x529a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x6d32b
jmp 0x6d7b8
movq -0x38(%rbp), %rdi
movl -0xb8(%rbp), %edx
movl $0x33, %esi
xorl %ecx, %ecx
callq 0x5e0c0
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x70(%rax)
movl -0xb8(%rbp), %eax
movl %eax, -0xe8(%rbp)
movq -0x10(%rbp), %rax
movl 0x214(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0xec(%rbp), %rdx
callq 0x529a0
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jbe 0x6d400
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x47330
movq -0xd0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0xd8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x70(%rax)
movzbl -0x48(%rbp), %eax
cmpl $0x5, %eax
jne 0x6d47c
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x6d465
movq -0xf8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0xf8(%rbp)
jmp 0x6d443
movq -0x10(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x70140
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, -0xc0(%rbp)
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0xc0(%rbp), %edx
callq 0x6d8c0
movq -0x38(%rbp), %rdi
movl -0xb4(%rbp), %edx
movl -0xc0(%rbp), %ecx
movl $0x65, %esi
callq 0x5e0c0
movq -0x10(%rbp), %rdi
callq 0x66a70
movl %eax, -0xf0(%rbp)
movq -0x38(%rbp), %rdi
movl -0xb4(%rbp), %edx
movl -0xf0(%rbp), %ecx
movl $0x5c, %esi
callq 0x5e0c0
movl %eax, -0xc4(%rbp)
movq -0x38(%rbp), %rdi
movl -0xb8(%rbp), %edx
movl -0xbc(%rbp), %ecx
movl -0xf0(%rbp), %r8d
movl $0x3c, %esi
xorl %r9d, %r9d
callq 0x6b080
movq -0x10(%rbp), %rdi
movl -0xf0(%rbp), %esi
callq 0x66ac0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl -0xb4(%rbp), %ecx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %r8d
movl -0xbc(%rbp), %r10d
movl -0xc0(%rbp), %eax
xorl %r9d, %r9d
leaq -0x48(%rbp), %r11
movq $0x0, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x6e7c0
movq -0x38(%rbp), %rdi
movl -0xbc(%rbp), %esi
callq 0x677f0
movq -0x38(%rbp), %rdi
movl -0xb4(%rbp), %edx
movl -0xc4(%rbp), %ecx
movl $0x7, %esi
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xc0(%rbp), %esi
callq 0x677f0
movq -0x38(%rbp), %rdi
movl -0xb8(%rbp), %edx
movl $0x36, %esi
xorl %ecx, %ecx
callq 0x5e0c0
movq -0x38(%rbp), %rdi
movl -0xb4(%rbp), %edx
movl $0x36, %esi
xorl %ecx, %ecx
callq 0x5e0c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %esi
movl -0x5c(%rbp), %edx
movl -0x60(%rbp), %ecx
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x71, %eax
setne %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x71650
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6d7b6
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x11c(%rbp)
movq -0x58(%rbp), %rdi
movl -0x11c(%rbp), %esi
callq 0x4a710
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x6d655
movl $0x7, -0x24(%rbp)
jmp 0x6d7b8
movl $0x0, -0xfc(%rbp)
movq -0x108(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x118(%rbp)
movl -0xfc(%rbp), %eax
cmpl -0x11c(%rbp), %eax
jge 0x6d6e4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0xfc(%rbp), %edx
callq 0x71720
movq %rax, %rcx
movq -0x118(%rbp), %rax
movq %rcx, (%rax)
movq -0x118(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
jne 0x6d6bf
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x118(%rbp), %rax
movq %rcx, (%rax)
jmp 0x6d6c1
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
movq -0x118(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x118(%rbp)
jmp 0x6d671
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x110(%rbp)
je 0x6d7a6
movl $0x0, -0xfc(%rbp)
cmpl $0x2, -0xfc(%rbp)
jge 0x6d78d
movq -0x110(%rbp), %rax
movslq -0xfc(%rbp), %rcx
movl 0x14(%rax,%rcx,4), %eax
movl %eax, -0x120(%rbp)
cmpl $0x0, -0x120(%rbp)
jge 0x6d733
jmp 0x6d78d
movq -0x38(%rbp), %rdi
movl -0x120(%rbp), %esi
movl -0x11c(%rbp), %edx
callq 0x13b40
movq -0x38(%rbp), %rdi
movl -0x120(%rbp), %esi
movq -0x108(%rbp), %rdx
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
callq 0x13c20
movq -0x110(%rbp), %rax
movslq -0xfc(%rbp), %rcx
movl $0xffffffff, 0x14(%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x6d707
jmp 0x6d78f
movq -0x110(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x110(%rbp)
jmp 0x6d6ef
movq -0x58(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x9cd0
jmp 0x6d7b8
movl -0x40(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x47420
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax,%rax)