// File: /workspace/github_c_makefile_star2_O0/skeeto[P]flappy/sqlite3.c
// Function: whereLoopAddBtreeIndex
static int whereLoopAddBtreeIndex(
  WhereLoopBuilder *pBuilder,     /* The WhereLoop factory */
  struct SrcList_item *pSrc,      /* FROM clause term being analyzed */
  Index *pProbe,                  /* An index on pSrc */
  LogEst nInMul                   /* log(Number of iterations due to IN) */
){
  WhereInfo *pWInfo = pBuilder->pWInfo;  /* WHERE analyse context */
  Parse *pParse = pWInfo->pParse;        /* Parsing context */
  sqlite3 *db = pParse->db;       /* Database connection malloc context */
  WhereLoop *pNew;                /* Template WhereLoop under construction */
  WhereTerm *pTerm;               /* A WhereTerm under consideration */
  int opMask;                     /* Valid operators for constraints */
  WhereScan scan;                 /* Iterator for WHERE terms */
  Bitmask saved_prereq;           /* Original value of pNew->prereq */
  u16 saved_nLTerm;               /* Original value of pNew->nLTerm */
  u16 saved_nEq;                  /* Original value of pNew->u.btree.nEq */
  u16 saved_nSkip;                /* Original value of pNew->u.btree.nSkip */
  u32 saved_wsFlags;              /* Original value of pNew->wsFlags */
  LogEst saved_nOut;              /* Original value of pNew->nOut */
  int iCol;                       /* Index of the column in the table */
  int rc = SQLITE_OK;             /* Return code */
  LogEst nRowEst;                 /* Estimated index selectivity */
  LogEst rLogSize;                /* Logarithm of table size */
  WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */

  pNew = pBuilder->pNew;
  if( db->mallocFailed ) return SQLITE_NOMEM;

  assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
  assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
  if( pNew->wsFlags & WHERE_BTM_LIMIT ){
    opMask = WO_LT|WO_LE;
  }else if( pProbe->tnum<=0 || (pSrc->jointype & JT_LEFT)!=0 ){
    opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE;
  }else{
    opMask = WO_EQ|WO_IN|WO_ISNULL|WO_GT|WO_GE|WO_LT|WO_LE;
  }
  if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);

  assert( pNew->u.btree.nEq<=pProbe->nKeyCol );
  if( pNew->u.btree.nEq < pProbe->nKeyCol ){
    iCol = pProbe->aiColumn[pNew->u.btree.nEq];
    nRowEst = sqlite3LogEst(pProbe->aiRowEst[pNew->u.btree.nEq+1]);
    if( nRowEst==0 && pProbe->onError==OE_None ) nRowEst = 1;
  }else{
    iCol = -1;
    nRowEst = 0;
  }
  pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, iCol,
                        opMask, pProbe);
  saved_nEq = pNew->u.btree.nEq;
  saved_nSkip = pNew->u.btree.nSkip;
  saved_nLTerm = pNew->nLTerm;
  saved_wsFlags = pNew->wsFlags;
  saved_prereq = pNew->prereq;
  saved_nOut = pNew->nOut;
  pNew->rSetup = 0;
  rLogSize = estLog(sqlite3LogEst(pProbe->aiRowEst[0]));

  /* Consider using a skip-scan if there are no WHERE clause constraints
  ** available for the left-most terms of the index, and if the average
  ** number of repeats in the left-most terms is at least 18.  The magic
  ** number 18 was found by experimentation to be the payoff point where
  ** skip-scan become faster than a full-scan.
  */
  if( pTerm==0
   && saved_nEq==saved_nSkip
   && saved_nEq+1<pProbe->nKeyCol
   && pProbe->aiRowEst[saved_nEq+1]>=18  /* TUNING: Minimum for skip-scan */
  ){
    LogEst nIter;
    pNew->u.btree.nEq++;
    pNew->u.btree.nSkip++;
    pNew->aLTerm[pNew->nLTerm++] = 0;
    pNew->wsFlags |= WHERE_SKIPSCAN;
    nIter = sqlite3LogEst(pProbe->aiRowEst[0]/pProbe->aiRowEst[saved_nEq+1]);
    whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter);
  }
  for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
    int nIn = 0;
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    int nRecValid = pBuilder->nRecValid;
#endif
    if( (pTerm->eOperator==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0)
     && (iCol<0 || pSrc->pTab->aCol[iCol].notNull)
    ){
      continue; /* ignore IS [NOT] NULL constraints on NOT NULL columns */
    }
    if( pTerm->prereqRight & pNew->maskSelf ) continue;

    assert( pNew->nOut==saved_nOut );

    pNew->wsFlags = saved_wsFlags;
    pNew->u.btree.nEq = saved_nEq;
    pNew->nLTerm = saved_nLTerm;
    if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
    pNew->aLTerm[pNew->nLTerm++] = pTerm;
    pNew->prereq = (saved_prereq | pTerm->prereqRight) & ~pNew->maskSelf;
    pNew->rRun = rLogSize; /* Baseline cost is log2(N).  Adjustments below */
    if( pTerm->eOperator & WO_IN ){
      Expr *pExpr = pTerm->pExpr;
      pNew->wsFlags |= WHERE_COLUMN_IN;
      if( ExprHasProperty(pExpr, EP_xIsSelect) ){
        /* "x IN (SELECT ...)":  TUNING: the SELECT returns 25 rows */
        nIn = 46;  assert( 46==sqlite3LogEst(25) );
      }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){
        /* "x IN (value, value, ...)" */
        nIn = sqlite3LogEst(pExpr->x.pList->nExpr);
      }
      pNew->rRun += nIn;
      pNew->u.btree.nEq++;
      pNew->nOut = nRowEst + nInMul + nIn;
    }else if( pTerm->eOperator & (WO_EQ) ){
      assert(
        (pNew->wsFlags & (WHERE_COLUMN_NULL|WHERE_COLUMN_IN|WHERE_SKIPSCAN))!=0
        || nInMul==0
      );
      pNew->wsFlags |= WHERE_COLUMN_EQ;
      if( iCol<0  
       || (pProbe->onError!=OE_None && nInMul==0
           && pNew->u.btree.nEq==pProbe->nKeyCol-1)
      ){
        assert( (pNew->wsFlags & WHERE_COLUMN_IN)==0 || iCol<0 );
        pNew->wsFlags |= WHERE_ONEROW;
      }
      pNew->u.btree.nEq++;
      pNew->nOut = nRowEst + nInMul;
    }else if( pTerm->eOperator & (WO_ISNULL) ){
      pNew->wsFlags |= WHERE_COLUMN_NULL;
      pNew->u.btree.nEq++;
      /* TUNING: IS NULL selects 2 rows */
      nIn = 10;  assert( 10==sqlite3LogEst(2) );
      pNew->nOut = nRowEst + nInMul + nIn;
    }else if( pTerm->eOperator & (WO_GT|WO_GE) ){
      testcase( pTerm->eOperator & WO_GT );
      testcase( pTerm->eOperator & WO_GE );
      pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_BTM_LIMIT;
      pBtm = pTerm;
      pTop = 0;
    }else{
      assert( pTerm->eOperator & (WO_LT|WO_LE) );
      testcase( pTerm->eOperator & WO_LT );
      testcase( pTerm->eOperator & WO_LE );
      pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_TOP_LIMIT;
      pTop = pTerm;
      pBtm = (pNew->wsFlags & WHERE_BTM_LIMIT)!=0 ?
                     pNew->aLTerm[pNew->nLTerm-2] : 0;
    }
    if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
      /* Adjust nOut and rRun for STAT3 range values */
      assert( pNew->nOut==saved_nOut );
      whereRangeScanEst(pParse, pBuilder, pBtm, pTop, pNew);
    }
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    if( nInMul==0 
     && pProbe->nSample 
     && pNew->u.btree.nEq<=pProbe->nSampleCol
     && OptimizationEnabled(db, SQLITE_Stat3) 
    ){
      Expr *pExpr = pTerm->pExpr;
      tRowcnt nOut = 0;
      if( (pTerm->eOperator & (WO_EQ|WO_ISNULL))!=0 ){
        testcase( pTerm->eOperator & WO_EQ );
        testcase( pTerm->eOperator & WO_ISNULL );
        rc = whereEqualScanEst(pParse, pBuilder, pExpr->pRight, &nOut);
      }else if( (pTerm->eOperator & WO_IN)
             &&  !ExprHasProperty(pExpr, EP_xIsSelect)  ){
        rc = whereInScanEst(pParse, pBuilder, pExpr->x.pList, &nOut);
      }
      assert( nOut==0 || rc==SQLITE_OK );
      if( nOut ){
        pNew->nOut = sqlite3LogEst(nOut);
        if( pNew->nOut>saved_nOut ) pNew->nOut = saved_nOut;
      }
    }
#endif
    if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
      /* Each row involves a step of the index, then a binary search of
      ** the main table */
      pNew->rRun =  sqlite3LogEstAdd(pNew->rRun,rLogSize>27 ? rLogSize-17 : 10);
    }
    /* Step cost for each output row */
    pNew->rRun = sqlite3LogEstAdd(pNew->rRun, pNew->nOut);
    whereLoopOutputAdjust(pBuilder->pWC, pNew);
    rc = whereLoopInsert(pBuilder, pNew);
    if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
     && pNew->u.btree.nEq<(pProbe->nKeyCol + (pProbe->zName!=0))
    ){
      whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn);
    }
    pNew->nOut = saved_nOut;
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    pBuilder->nRecValid = nRecValid;
#endif
  }
  pNew->prereq = saved_prereq;
  pNew->u.btree.nEq = saved_nEq;
  pNew->u.btree.nSkip = saved_nSkip;
  pNew->wsFlags = saved_wsFlags;
  pNew->nOut = saved_nOut;
  pNew->nLTerm = saved_nLTerm;
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movw %cx, %ax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movw %ax, -0x22(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0xf8(%rbp)
movq $0x0, -0x108(%rbp)
movq $0x0, -0x110(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x80c21
movl $0x7, -0x4(%rbp)
jmp 0x8141d
movq -0x48(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x80c39
movl $0x18, -0x54(%rbp)
jmp 0x80c65
movq -0x20(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jle 0x80c53
movq -0x18(%rbp), %rax
movzbl 0x38(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x80c5c
movl $0x3f, -0x54(%rbp)
jmp 0x80c63
movl $0xbf, -0x54(%rbp)
jmp 0x80c65
movq -0x20(%rbp), %rax
movb 0x63(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x80c82
movl -0x54(%rbp), %eax
andl $-0x3d, %eax
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rax
movzwl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x80cfb
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
movswl (%rax,%rcx,2), %eax
movl %eax, -0xf4(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, %edi
callq 0x4b340
movw %ax, -0xfa(%rbp)
movswl -0xfa(%rbp), %eax
cmpl $0x0, %eax
jne 0x80cf9
movq -0x20(%rbp), %rax
movzbl 0x62(%rax), %eax
cmpl $0x0, %eax
jne 0x80cf9
movw $0x1, -0xfa(%rbp)
jmp 0x80d0e
movl $0xffffffff, -0xf4(%rbp) # imm = 0xFFFFFFFF
movw $0x0, -0xfa(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edx
movl -0xf4(%rbp), %ecx
movl -0x54(%rbp), %r8d
movq -0x20(%rbp), %r9
leaq -0xd8(%rbp), %rdi
callq 0x7e080
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movw 0x18(%rax), %ax
movw %ax, -0xe4(%rbp)
movq -0x48(%rbp), %rax
movw 0x1a(%rax), %ax
movw %ax, -0xe6(%rbp)
movq -0x48(%rbp), %rax
movw 0x2c(%rax), %ax
movw %ax, -0xe2(%rbp)
movq -0x48(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0xec(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x48(%rbp), %rax
movw 0x16(%rax), %ax
movw %ax, -0xee(%rbp)
movq -0x48(%rbp), %rax
movw $0x0, 0x12(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
movl %eax, %edi
callq 0x4b340
movswl %ax, %edi
callq 0x806a0
movw %ax, -0xfc(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x80eb8
movzwl -0xe4(%rbp), %eax
movzwl -0xe6(%rbp), %ecx
cmpl %ecx, %eax
jne 0x80eb8
movzwl -0xe4(%rbp), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x80eb8
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movzwl -0xe4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x12, (%rax,%rcx,4)
jb 0x80eb8
movq -0x48(%rbp), %rax
movw 0x18(%rax), %cx
addw $0x1, %cx
movw %cx, 0x18(%rax)
movq -0x48(%rbp), %rax
movw 0x1a(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1a(%rax)
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x48(%rbp), %rdx
movw 0x2c(%rdx), %cx
movw %cx, %si
addw $0x1, %si
movw %si, 0x2c(%rdx)
movzwl %cx, %ecx
movq $0x0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzwl -0xe4(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rsi
xorl %edx, %edx
divl (%rcx,%rsi,4)
movl %eax, %eax
movl %eax, %edi
callq 0x4b340
movw %ax, -0x112(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movswl -0x112(%rbp), %ecx
callq 0x80ba0
jmp 0x80eba
xorl %eax, %eax
cmpl $0x0, -0xf8(%rbp)
movb %al, -0x121(%rbp)
jne 0x80ed9
cmpq $0x0, -0x50(%rbp)
setne %al
movb %al, -0x121(%rbp)
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0x80ee8
jmp 0x813bd
movl $0x0, -0x118(%rbp)
movq -0x50(%rbp), %rax
movzwl 0x1a(%rax), %eax
cmpl $0x80, %eax
je 0x80f11
movq -0x50(%rbp), %rax
movzbl 0x1c(%rax), %eax
andl $0x0, %eax
cmpl $0x0, %eax
je 0x80f42
cmpl $0x0, -0xf4(%rbp)
jl 0x80f3d
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movslq -0xf4(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movzbl 0x28(%rax), %eax
cmpl $0x0, %eax
je 0x80f42
jmp 0x813a8
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x48(%rbp), %rcx
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
je 0x80f5d
jmp 0x813a8
movl -0xec(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x28(%rax)
movw -0xe4(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x18(%rax)
movw -0xe2(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x2c(%rax)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x48(%rbp), %rax
movzwl 0x2c(%rax), %edx
addl $0x1, %edx
callq 0x7fdb0
cmpl $0x0, %eax
je 0x80faa
jmp 0x813bd
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x48(%rbp), %rsi
movw 0x2c(%rsi), %cx
movw %cx, %di
addw $0x1, %di
movw %di, 0x2c(%rsi)
movzwl %cx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0xe0(%rbp), %rcx
movq -0x50(%rbp), %rax
orq 0x28(%rax), %rcx
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
xorq $-0x1, %rax
andq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movw -0xfc(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x14(%rax)
movq -0x50(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x810d4
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x28(%rax)
movq -0x120(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x81053
movl $0x2e, -0x118(%rbp)
jmp 0x8108d
movq -0x120(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x8108b
movq -0x120(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x0, (%rax)
je 0x8108b
movq -0x120(%rbp), %rax
movq 0x20(%rax), %rax
movslq (%rax), %rdi
callq 0x4b340
cwtl
movl %eax, -0x118(%rbp)
jmp 0x8108d
movl -0x118(%rbp), %edx
movq -0x48(%rbp), %rax
movswl 0x14(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x14(%rax)
movq -0x48(%rbp), %rax
movw 0x18(%rax), %cx
addw $0x1, %cx
movw %cx, 0x18(%rax)
movswl -0xfa(%rbp), %eax
movswl -0x22(%rbp), %ecx
addl %ecx, %eax
addl -0x118(%rbp), %eax
movw %ax, %cx
movq -0x48(%rbp), %rax
movw %cx, 0x16(%rax)
jmp 0x81262
movq -0x50(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x81168
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x28(%rax)
cmpl $0x0, -0xf4(%rbp)
jl 0x8112b
movq -0x20(%rbp), %rax
movzbl 0x62(%rax), %eax
cmpl $0x0, %eax
je 0x8113b
movswl -0x22(%rbp), %eax
cmpl $0x0, %eax
jne 0x8113b
movq -0x48(%rbp), %rax
movzwl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x8113b
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %ecx, 0x28(%rax)
movq -0x48(%rbp), %rax
movw 0x18(%rax), %cx
addw $0x1, %cx
movw %cx, 0x18(%rax)
movswl -0xfa(%rbp), %eax
movswl -0x22(%rbp), %ecx
addl %ecx, %eax
movw %ax, %cx
movq -0x48(%rbp), %rax
movw %cx, 0x16(%rax)
jmp 0x81260
movq -0x50(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x811c4
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x28(%rax)
movq -0x48(%rbp), %rax
movw 0x18(%rax), %cx
addw $0x1, %cx
movw %cx, 0x18(%rax)
movl $0xa, -0x118(%rbp)
movswl -0xfa(%rbp), %eax
movswl -0x22(%rbp), %ecx
addl %ecx, %eax
addl -0x118(%rbp), %eax
movw %ax, %cx
movq -0x48(%rbp), %rax
movw %cx, 0x16(%rax)
jmp 0x8125e
movq -0x50(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x24, %eax
cmpl $0x0, %eax
je 0x811f9
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x22, %ecx
movl %ecx, 0x28(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x110(%rbp)
movq $0x0, -0x108(%rbp)
jmp 0x8125c
movq -0x48(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x12, %ecx
movl %ecx, 0x28(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x48(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x81243
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x48(%rbp), %rcx
movzwl 0x2c(%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x130(%rbp)
jmp 0x8124e
xorl %eax, %eax
movq %rax, -0x130(%rbp)
jmp 0x8124e
movq -0x130(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x8125e
jmp 0x81260
jmp 0x81262
movq -0x48(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x81290
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x110(%rbp), %rdx
movq -0x108(%rbp), %rcx
movq -0x48(%rbp), %r8
callq 0x81510
movq -0x48(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x140, %eax            # imm = 0x140
cmpl $0x0, %eax
jne 0x812fe
movq -0x48(%rbp), %rax
movw 0x14(%rax), %ax
movw %ax, -0x132(%rbp)
movswl -0xfc(%rbp), %eax
cmpl $0x1b, %eax
jle 0x812ce
movswl -0xfc(%rbp), %eax
subl $0x11, %eax
movl %eax, -0x138(%rbp)
jmp 0x812db
movl $0xa, %eax
movl %eax, -0x138(%rbp)
jmp 0x812db
movw -0x132(%rbp), %cx
movl -0x138(%rbp), %eax
movswl %cx, %edi
movswl %ax, %esi
callq 0x807c0
movw %ax, %cx
movq -0x48(%rbp), %rax
movw %cx, 0x14(%rax)
movq -0x48(%rbp), %rax
movw 0x14(%rax), %cx
movq -0x48(%rbp), %rax
movswl %cx, %edi
movswl 0x16(%rax), %esi
callq 0x807c0
movw %ax, %cx
movq -0x48(%rbp), %rax
movw %cx, 0x14(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x80a40
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x80060
movl %eax, -0xf8(%rbp)
movq -0x48(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x81399
movq -0x48(%rbp), %rax
movzwl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
movq -0x20(%rbp), %rdx
cmpq $0x0, (%rdx)
setne %dl
andb $0x1, %dl
movzbl %dl, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x81399
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movswl -0x22(%rbp), %eax
addl -0x118(%rbp), %eax
movswl %ax, %ecx
callq 0x80ba0
movw -0xee(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x16(%rax)
leaq -0xd8(%rbp), %rdi
callq 0x7e1b0
movq %rax, -0x50(%rbp)
jmp 0x80eba
movq -0xe0(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movw -0xe4(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x18(%rax)
movw -0xe6(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x1a(%rax)
movl -0xec(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x28(%rax)
movw -0xee(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x16(%rax)
movw -0xe2(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x2c(%rax)
movl -0xf8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax)