// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3GenerateConstraintChecks
SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
  Parse *pParse,      /* The parser context */
  Table *pTab,        /* the table into which we are inserting */
  int baseCur,        /* Index of a read/write cursor pointing at pTab */
  int regRowid,       /* Index of the range of input registers */
  int *aRegIdx,       /* Register used by each index.  0 for unused indices */
  int rowidChng,      /* True if the rowid might collide with existing entry */
  int isUpdate,       /* True for UPDATE, False for INSERT */
  int overrideError,  /* Override onError to this if not OE_Default */
  int ignoreDest,     /* Jump to this label on an OE_Ignore resolution */
  int *pbMayReplace   /* OUT: Set to true if constraint may cause a replace */
){
  int i;              /* loop counter */
  Vdbe *v;            /* VDBE under constrution */
  int nCol;           /* Number of columns */
  int onError;        /* Conflict resolution strategy */
  int j1;             /* Addresss of jump instruction */
  int j2 = 0, j3;     /* Addresses of jump instructions */
  int regData;        /* Register containing first data column */
  int iCur;           /* Table cursor number */
  Index *pIdx;         /* Pointer to one of the indices */
  sqlite3 *db;         /* Database connection */
  int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */
  int regOldRowid = (rowidChng && isUpdate) ? rowidChng : regRowid;

  db = pParse->db;
  v = sqlite3GetVdbe(pParse);
  assert( v!=0 );
  assert( pTab->pSelect==0 );  /* This table is not a VIEW */
  nCol = pTab->nCol;
  regData = regRowid + 1;

  /* Test all NOT NULL constraints.
  */
  for(i=0; i<nCol; i++){
    if( i==pTab->iPKey ){
      continue;
    }
    onError = pTab->aCol[i].notNull;
    if( onError==OE_None ) continue;
    if( overrideError!=OE_Default ){
      onError = overrideError;
    }else if( onError==OE_Default ){
      onError = OE_Abort;
    }
    if( onError==OE_Replace && pTab->aCol[i].pDflt==0 ){
      onError = OE_Abort;
    }
    assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail
        || onError==OE_Ignore || onError==OE_Replace );
    switch( onError ){
      case OE_Abort:
        sqlite3MayAbort(pParse);
      case OE_Rollback:
      case OE_Fail: {
        char *zMsg;
        sqlite3VdbeAddOp3(v, OP_HaltIfNull,
                          SQLITE_CONSTRAINT_NOTNULL, onError, regData+i);
        zMsg = sqlite3MPrintf(db, "%s.%s may not be NULL",
                              pTab->zName, pTab->aCol[i].zName);
        sqlite3VdbeChangeP4(v, -1, zMsg, P4_DYNAMIC);
        break;
      }
      case OE_Ignore: {
        sqlite3VdbeAddOp2(v, OP_IsNull, regData+i, ignoreDest);
        break;
      }
      default: {
        assert( onError==OE_Replace );
        j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regData+i);
        sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regData+i);
        sqlite3VdbeJumpHere(v, j1);
        break;
      }
    }
  }

  /* Test all CHECK constraints
  */
#ifndef SQLITE_OMIT_CHECK
  if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
    ExprList *pCheck = pTab->pCheck;
    pParse->ckBase = regData;
    onError = overrideError!=OE_Default ? overrideError : OE_Abort;
    for(i=0; i<pCheck->nExpr; i++){
      int allOk = sqlite3VdbeMakeLabel(v);
      sqlite3ExprIfTrue(pParse, pCheck->a[i].pExpr, allOk, SQLITE_JUMPIFNULL);
      if( onError==OE_Ignore ){
        sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest);
      }else{
        char *zConsName = pCheck->a[i].zName;
        if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */
        if( zConsName ){
          zConsName = sqlite3MPrintf(db, "constraint %s failed", zConsName);
        }else{
          zConsName = 0;
        }
        sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
                              onError, zConsName, P4_DYNAMIC);
      }
      sqlite3VdbeResolveLabel(v, allOk);
    }
  }
#endif /* !defined(SQLITE_OMIT_CHECK) */

  /* If we have an INTEGER PRIMARY KEY, make sure the primary key
  ** of the new record does not previously exist.  Except, if this
  ** is an UPDATE and the primary key is not changing, that is OK.
  */
  if( rowidChng ){
    onError = pTab->keyConf;
    if( overrideError!=OE_Default ){
      onError = overrideError;
    }else if( onError==OE_Default ){
      onError = OE_Abort;
    }
    
    if( isUpdate ){
      j2 = sqlite3VdbeAddOp3(v, OP_Eq, regRowid, 0, rowidChng);
    }
    j3 = sqlite3VdbeAddOp3(v, OP_NotExists, baseCur, 0, regRowid);
    switch( onError ){
      default: {
        onError = OE_Abort;
        /* Fall thru into the next case */
      }
      case OE_Rollback:
      case OE_Abort:
      case OE_Fail: {
        sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_PRIMARYKEY,
           onError, "PRIMARY KEY must be unique", P4_STATIC);
        break;
      }
      case OE_Replace: {
        /* If there are DELETE triggers on this table and the
        ** recursive-triggers flag is set, call GenerateRowDelete() to
        ** remove the conflicting row from the table. This will fire
        ** the triggers and remove both the table and index b-tree entries.
        **
        ** Otherwise, if there are no triggers or the recursive-triggers
        ** flag is not set, but the table has one or more indexes, call 
        ** GenerateRowIndexDelete(). This removes the index b-tree entries 
        ** only. The table b-tree entry will be replaced by the new entry 
        ** when it is inserted.  
        **
        ** If either GenerateRowDelete() or GenerateRowIndexDelete() is called,
        ** also invoke MultiWrite() to indicate that this VDBE may require
        ** statement rollback (if the statement is aborted after the delete
        ** takes place). Earlier versions called sqlite3MultiWrite() regardless,
        ** but being more selective here allows statements like:
        **
        **   REPLACE INTO t(rowid) VALUES($newrowid)
        **
        ** to run without a statement journal if there are no indexes on the
        ** table.
        */
        Trigger *pTrigger = 0;
        if( db->flags&SQLITE_RecTriggers ){
          pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
        }
        if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){
          sqlite3MultiWrite(pParse);
          sqlite3GenerateRowDelete(
              pParse, pTab, baseCur, regRowid, 0, pTrigger, OE_Replace
          );
        }else if( pTab->pIndex ){
          sqlite3MultiWrite(pParse);
          sqlite3GenerateRowIndexDelete(pParse, pTab, baseCur, 0);
        }
        seenReplace = 1;
        break;
      }
      case OE_Ignore: {
        assert( seenReplace==0 );
        sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest);
        break;
      }
    }
    sqlite3VdbeJumpHere(v, j3);
    if( isUpdate ){
      sqlite3VdbeJumpHere(v, j2);
    }
  }

  /* Test all UNIQUE constraints by creating entries for each UNIQUE
  ** index and making sure that duplicate entries do not already exist.
  ** Add the new records to the indices as we go.
  */
  for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){
    int regIdx;
    int regR;
    int addrSkipRow = 0;

    if( aRegIdx[iCur]==0 ) continue;  /* Skip unused indices */

    if( pIdx->pPartIdxWhere ){
      sqlite3VdbeAddOp2(v, OP_Null, 0, aRegIdx[iCur]);
      addrSkipRow = sqlite3VdbeMakeLabel(v);
      pParse->ckBase = regData;
      sqlite3ExprIfFalse(pParse, pIdx->pPartIdxWhere, addrSkipRow,
                         SQLITE_JUMPIFNULL);
      pParse->ckBase = 0;
    }

    /* Create a key for accessing the index entry */
    regIdx = sqlite3GetTempRange(pParse, pIdx->nColumn+1);
    for(i=0; i<pIdx->nColumn; i++){
      int idx = pIdx->aiColumn[i];
      if( idx==pTab->iPKey ){
        sqlite3VdbeAddOp2(v, OP_SCopy, regRowid, regIdx+i);
      }else{
        sqlite3VdbeAddOp2(v, OP_SCopy, regData+idx, regIdx+i);
      }
    }
    sqlite3VdbeAddOp2(v, OP_SCopy, regRowid, regIdx+i);
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn+1, aRegIdx[iCur]);
    sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v, pIdx), P4_TRANSIENT);
    sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn+1);

    /* Find out what action to take in case there is an indexing conflict */
    onError = pIdx->onError;
    if( onError==OE_None ){ 
      sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
      sqlite3VdbeResolveLabel(v, addrSkipRow);
      continue;  /* pIdx is not a UNIQUE index */
    }
    if( overrideError!=OE_Default ){
      onError = overrideError;
    }else if( onError==OE_Default ){
      onError = OE_Abort;
    }
    if( seenReplace ){
      if( onError==OE_Ignore ) onError = OE_Replace;
      else if( onError==OE_Fail ) onError = OE_Abort;
    }
    
    /* Check to see if the new index entry will be unique */
    regR = sqlite3GetTempReg(pParse);
    sqlite3VdbeAddOp2(v, OP_SCopy, regOldRowid, regR);
    j3 = sqlite3VdbeAddOp4(v, OP_IsUnique, baseCur+iCur+1, 0,
                           regR, SQLITE_INT_TO_PTR(regIdx),
                           P4_INT32);
    sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);

    /* Generate code that executes if the new index entry is not unique */
    assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail
        || onError==OE_Ignore || onError==OE_Replace );
    switch( onError ){
      case OE_Rollback:
      case OE_Abort:
      case OE_Fail: {
        int j;
        StrAccum errMsg;
        const char *zSep;
        char *zErr;

        sqlite3StrAccumInit(&errMsg, 0, 0, 200);
        errMsg.db = db;
        zSep = pIdx->nColumn>1 ? "columns " : "column ";
        for(j=0; j<pIdx->nColumn; j++){
          char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
          sqlite3StrAccumAppend(&errMsg, zSep, -1);
          zSep = ", ";
          sqlite3StrAccumAppend(&errMsg, zCol, -1);
        }
        sqlite3StrAccumAppend(&errMsg,
            pIdx->nColumn>1 ? " are not unique" : " is not unique", -1);
        zErr = sqlite3StrAccumFinish(&errMsg);
        sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_UNIQUE,
                              onError, zErr, 0);
        sqlite3DbFree(errMsg.db, zErr);
        break;
      }
      case OE_Ignore: {
        assert( seenReplace==0 );
        sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest);
        break;
      }
      default: {
        Trigger *pTrigger = 0;
        assert( onError==OE_Replace );
        sqlite3MultiWrite(pParse);
        if( db->flags&SQLITE_RecTriggers ){
          pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
        }
        sqlite3GenerateRowDelete(
            pParse, pTab, baseCur, regR, 0, pTrigger, OE_Replace
        );
        seenReplace = 1;
        break;
      }
    }
    sqlite3VdbeJumpHere(v, j3);
    sqlite3VdbeResolveLabel(v, addrSkipRow);
    sqlite3ReleaseTempReg(pParse, regR);
  }
  
  if( pbMayReplace ){
    *pbMayReplace = seenReplace;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, -0x98(%rbp)
movl %ecx, %ebx
movq %rdx, -0x70(%rbp)
movq %rsi, %r12
movq %rdi, %r13
movl %r9d, -0x38(%rbp)
testl %r9d, %r9d
setne %al
cmpl $0x0, 0x10(%rbp)
setne %cl
andb %al, %cl
movb %cl, -0x48(%rbp)
movq (%rdi), %rax
movq %rax, -0x58(%rbp)
callq 0x41ef4
movq %rax, -0x30(%rbp)
movzwl 0x42(%r12), %eax
movq %rbx, -0x60(%rbp)
leal 0x1(%rbx), %ecx
movq %rcx, -0x68(%rbp)
xorl %ecx, %ecx
testw %ax, %ax
cmovlel %ecx, %eax
movzwl %ax, %r14d
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %r13, -0x40(%rbp)
cmpq %r15, %r14
je 0x554e2
movswq 0x40(%r12), %rax
movl %eax, %eax
cmpq %rax, %r15
je 0x554d6
movq 0x8(%r12), %rax
movb 0x28(%rax,%rbx), %cl
testb %cl, %cl
je 0x554d6
cmpb $0x63, %cl
movzbl %cl, %ecx
pushq $0x2
popq %rdx
cmovel %edx, %ecx
movl 0x18(%rbp), %edx
cmpl $0x63, %edx
movzbl %cl, %ecx
cmovnel %edx, %ecx
leal -0x1(%rcx), %edx
cmpl $0x4, %edx
ja 0x55416
leaq 0x12aef(%rip), %rsi     # 0x67ed8
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movq -0x68(%rbp), %rax
leal (%rax,%r15), %edx
movq -0x30(%rbp), %rdi
pushq $0x49
popq %rsi
movl 0x20(%rbp), %ecx
callq 0x41f42
jmp 0x554d6
cmpq $0x0, 0x8(%rax,%rbx)
je 0x55470
movq -0x68(%rbp), %rax
leal (%rax,%r15), %r13d
movq -0x30(%rbp), %rdi
pushq $0x4a
popq %rsi
movl %r13d, %edx
callq 0x42436
movl %eax, -0x50(%rbp)
movq 0x8(%r12), %rax
movq 0x8(%rax,%rbx), %rsi
movq -0x40(%rbp), %rdi
movl %r13d, %edx
callq 0x494eb
movl -0x50(%rbp), %edx
testl %edx, %edx
js 0x554d6
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl %edx, %eax
jbe 0x554d6
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %edx, %edx
imulq $0x18, %rdx, %rdx
movl %eax, 0x8(%rcx,%rdx)
jmp 0x554d6
movq -0x40(%rbp), %rcx
movq 0x1d8(%rcx), %rax
testq %rax, %rax
cmoveq %rcx, %rax
movb $0x1, 0x24(%rax)
pushq $0x2
popq %rax
movl %eax, %ecx
movq -0x68(%rbp), %rax
leal (%rax,%r15), %r8d
movq -0x30(%rbp), %r13
movq %r13, %rdi
pushq $0x12
popq %rsi
movl $0x513, %edx            # imm = 0x513
callq 0x41f4c
movq (%r12), %rdx
movq 0x8(%r12), %rax
movq (%rax,%rbx), %rcx
movq -0x58(%rbp), %rdi
leaq 0x1895b(%rip), %rsi     # 0x6de1a
xorl %eax, %eax
callq 0x10594
movq %r13, %rdi
pushq $-0x1
popq %rcx
movl %ecx, %esi
movq %rax, %rdx
callq 0x1074b
incq %r15
addq $0x30, %rbx
jmp 0x55397
cmpb $0x0, -0x48(%rbp)
movq -0x60(%rbp), %rax
cmovnel -0x38(%rbp), %eax
movl %eax, -0x84(%rbp)
movq %r12, -0x50(%rbp)
movq 0x30(%r12), %r15
testq %r15, %r15
movq -0x30(%rbp), %r14
je 0x55604
movq -0x58(%rbp), %rax
testb $0x20, 0x2d(%rax)
jne 0x55604
movl 0x18(%rbp), %r13d
cmpl $0x63, %r13d
pushq $0x2
popq %rax
cmovel %eax, %r13d
movq -0x40(%rbp), %rax
movq -0x68(%rbp), %rcx
movl %ecx, 0x64(%rax)
xorl %ebx, %ebx
xorl %esi, %esi
movslq (%r15), %rax
cmpq %rax, %rsi
jge 0x55604
movq %rsi, -0x48(%rbp)
movq %r14, %rdi
callq 0x47934
movq %r14, %r12
movl %eax, %r14d
movq 0x8(%r15), %rax
movq (%rax,%rbx), %rsi
movq -0x40(%rbp), %rdi
movl %r14d, %edx
pushq $0x8
popq %rcx
callq 0x47d9c
cmpl $0x4, %r13d
jne 0x55587
movq %r12, %rdi
pushq $0xe
popq %rsi
xorl %edx, %edx
movl 0x20(%rbp), %ecx
callq 0x41f42
pushq $0x4
popq %r13
jmp 0x555ce
movq 0x8(%r15), %rax
movq 0x8(%rax,%rbx), %rdx
cmpl $0x5, %r13d
pushq $0x2
popq %rax
cmovel %eax, %r13d
testq %rdx, %rdx
je 0x555b7
movq -0x58(%rbp), %rdi
leaq 0x18885(%rip), %rsi     # 0x6de30
xorl %eax, %eax
callq 0x10594
movq %rax, %rcx
jmp 0x555b9
xorl %ecx, %ecx
movq -0x40(%rbp), %rdi
movl $0x113, %esi            # imm = 0x113
movl %r13d, %edx
pushq $-0x1
popq %r8
callq 0x478d0
testl %r14d, %r14d
movq -0x48(%rbp), %rsi
jns 0x555f4
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
je 0x555f4
notl %r14d
movq -0x30(%rbp), %rcx
movl 0x34(%rcx), %ecx
movl %r14d, %edx
movl %ecx, (%rax,%rdx,4)
incq %rsi
addq $0x20, %rbx
movq -0x30(%rbp), %r14
jmp 0x55536
cmpl $0x0, -0x38(%rbp)
je 0x55654
movl 0x18(%rbp), %eax
movl %eax, %r13d
cmpl $0x63, %eax
movq -0x50(%rbp), %r12
jne 0x5562b
movzbl 0x47(%r12), %eax
cmpb $0x63, %al
pushq $0x2
popq %rcx
cmovnel %eax, %ecx
movzbl %cl, %r13d
cmpl $0x0, 0x10(%rbp)
je 0x55668
pushq $0x4c
popq %rsi
movq %r14, %rdi
movq -0x60(%rbp), %r14
movl %r14d, %edx
xorl %ecx, %ecx
movl -0x38(%rbp), %r8d
callq 0x41f4c
movl %eax, %ebx
movq %r14, %r8
movq -0x30(%rbp), %r14
jmp 0x5566e
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %r13
movq -0x50(%rbp), %r12
jmp 0x557bc
xorl %ebx, %ebx
movq -0x60(%rbp), %r8
pushq $0x3f
popq %rsi
movl $0x0, -0x34(%rbp)
movq %r14, %rdi
movq -0x70(%rbp), %rdx
xorl %ecx, %ecx
callq 0x41f4c
movl %eax, %r14d
leal -0x1(%r13), %eax
cmpl $0x3, %eax
jb 0x55745
cmpl $0x4, %r13d
je 0x55727
cmpl $0x5, %r13d
jne 0x55741
movq -0x58(%rbp), %rax
testb $0x4, 0x2e(%rax)
movq -0x40(%rbp), %r13
je 0x556d3
pushq $0x6a
popq %rdx
movq %r13, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x52d34
movq %rax, %r15
testq %rax, %rax
jne 0x556ed
xorl %r15d, %r15d
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x52f34
testl %eax, %eax
je 0x55c0b
movq 0x1d8(%r13), %rax
testq %rax, %rax
cmoveq %r13, %rax
movb $0x1, 0x23(%rax)
movl $0x5, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq -0x70(%rbp), %rdx
movq -0x60(%rbp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5322b
pushq $0x1
popq %rax
movl %eax, -0x34(%rbp)
jmp 0x55761
pushq $0xe
popq %rsi
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rdi
xorl %edx, %edx
movl 0x20(%rbp), %ecx
callq 0x41f42
jmp 0x55761
pushq $0x2
popq %r13
leaq 0x186f9(%rip), %rcx     # 0x6de45
pushq $-0x2
popq %r8
movq -0x40(%rbp), %rdi
movl $0x613, %esi            # imm = 0x613
movl %r13d, %edx
callq 0x478d0
testl %r14d, %r14d
js 0x55785
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl %r14d, %eax
jbe 0x55785
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %r14d, %edx
imulq $0x18, %rdx, %rdx
movl %eax, 0x8(%rcx,%rdx)
cmpl $0x0, 0x10(%rbp)
setne %al
testl %ebx, %ebx
setns %cl
andb %al, %cl
cmpb $0x1, %cl
movq -0x40(%rbp), %r13
jne 0x557b8
movq -0x30(%rbp), %r14
movl 0x34(%r14), %eax
cmpl %ebx, %eax
jbe 0x557bc
movq 0x8(%r14), %rcx
movl %ebx, %edx
imulq $0x18, %rdx, %rdx
movl %eax, 0x8(%rcx,%rdx)
jmp 0x557bc
movq -0x30(%rbp), %r14
leaq 0x10(%r12), %rbx
movq -0x70(%rbp), %rax
incl %eax
movq %rax, -0xa0(%rbp)
xorl %edx, %edx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x55beb
movq -0x98(%rbp), %rax
movl (%rax,%rdx,4), %ecx
testl %ecx, %ecx
je 0x55bdf
movq %rdx, -0x48(%rbp)
cmpq $0x0, 0x48(%rbx)
je 0x55831
movq %r14, %rdi
pushq $0x18
popq %rsi
xorl %edx, %edx
callq 0x41f42
movq %r14, %rdi
callq 0x47934
movl %eax, %edx
movq -0x68(%rbp), %rax
movl %eax, 0x64(%r13)
movq 0x48(%rbx), %rsi
movq %r13, %rdi
movl %edx, -0x38(%rbp)
pushq $0x8
popq %rcx
callq 0x4797e
andl $0x0, 0x64(%r13)
jmp 0x55838
movl $0x0, -0x38(%rbp)
movzwl 0x54(%rbx), %esi
incl %esi
movq %r13, %rdi
callq 0x47c2c
movl %eax, %r13d
movl %eax, %r14d
cltq
movq %rax, -0x80(%rbp)
xorl %r15d, %r15d
movzwl 0x54(%rbx), %eax
cmpq %rax, %r15
jae 0x5588d
movq 0x8(%rbx), %rax
movl (%rax,%r15,4), %eax
movswl 0x40(%r12), %ecx
movq -0x68(%rbp), %rdx
addl %eax, %edx
cmpl %ecx, %eax
cmovel -0x60(%rbp), %edx
leal (%r14,%r15), %ecx
movq -0x30(%rbp), %rdi
pushq $0x1d
popq %rsi
callq 0x41f42
incq %r15
jmp 0x55855
addl %r14d, %r15d
movq -0x30(%rbp), %r12
movq %r12, %rdi
pushq $0x1d
popq %rsi
movq -0x60(%rbp), %rdx
movl %r15d, %ecx
callq 0x41f42
movzwl 0x54(%rbx), %ecx
incl %ecx
movq -0x98(%rbp), %rax
movq -0x48(%rbp), %rdx
movl (%rax,%rdx,4), %r8d
movq %r12, %rdi
pushq $0x2b
popq %rsi
movl %r13d, %edx
callq 0x41f4c
movq %r12, %rdi
movq %rbx, %rsi
callq 0x47ce5
movq %r12, %rdi
pushq $-0x1
popq %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x1074b
movzwl 0x54(%rbx), %edx
incl %edx
movq -0x40(%rbp), %r13
movq %r13, %rdi
movl %r14d, %esi
callq 0x49537
movb 0x56(%rbx), %al
movl -0x38(%rbp), %r15d
movl %r15d, %r12d
notl %r12d
testb %al, %al
je 0x55acf
cmpb $0x63, %al
movzbl %al, %eax
pushq $0x2
popq %rcx
cmovel %ecx, %eax
movl 0x18(%rbp), %ecx
cmpl $0x63, %ecx
movzbl %al, %eax
cmovnel %ecx, %eax
cmpl $0x0, -0x34(%rbp)
je 0x5593b
pushq $0x5
popq %rcx
cmpl $0x4, %eax
je 0x5593d
cmpl $0x3, %eax
jne 0x5593b
pushq $0x2
popq %rax
movl %eax, %ecx
movq %rcx, -0x90(%rbp)
movl %r12d, -0x88(%rbp)
movq %r13, %rdi
callq 0x46ff9
movl %eax, %r15d
movq -0x30(%rbp), %r12
movq %r12, %rdi
pushq $0x1d
popq %rsi
movl -0x84(%rbp), %edx
movl %eax, %ecx
callq 0x41f42
movq -0xa0(%rbp), %rax
movq -0x48(%rbp), %rcx
leal (%rax,%rcx), %edx
movl $0xfffffff2, (%rsp)     # imm = 0xFFFFFFF2
movq %r12, %rdi
pushq $0x3e
popq %rsi
xorl %ecx, %ecx
movl %r15d, -0x74(%rbp)
movl %r15d, %r8d
movq -0x80(%rbp), %r9
callq 0x41fd2
movl %eax, -0x80(%rbp)
movzwl 0x54(%rbx), %edx
incl %edx
movq %r13, %rdi
movl %r14d, %esi
callq 0x47d6c
movq -0x90(%rbp), %rcx
leal -0x1(%rcx), %eax
cmpl $0x3, %eax
jae 0x55af2
leaq -0xc0(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movl $0xc8, -0xa8(%rbp)
movw $0x1, -0xa4(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xc8(%rbp)
movzwl 0x54(%rbx), %eax
cmpw $0x2, %ax
leaq 0x18469(%rip), %rsi     # 0x6de69
leaq 0x18459(%rip), %rcx     # 0x6de60
cmovaeq %rcx, %rsi
xorl %r13d, %r13d
movzwl %ax, %ecx
cmpq %rcx, %r13
jae 0x55a62
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rbx), %rcx
movslq (%rcx,%r13,4), %rcx
imulq $0x30, %rcx, %rcx
movq (%rax,%rcx), %r14
leaq -0xc8(%rbp), %r12
movq %r12, %rdi
pushq $-0x1
popq %r15
movl %r15d, %edx
callq 0x155e3
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x155e3
incq %r13
movzwl 0x54(%rbx), %eax
leaq 0x18411(%rip), %rsi     # 0x6de71
jmp 0x55a0e
cmpw $0x2, %ax
leaq 0x18407(%rip), %rsi     # 0x6de74
leaq 0x17bbf(%rip), %rax     # 0x6d633
cmovaeq %rax, %rsi
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
pushq $-0x1
popq %rdx
callq 0x155e3
movq %r14, %rdi
callq 0xadc3
movq %rax, %r14
movq -0x40(%rbp), %r13
movq %r13, %rdi
movl $0x813, %esi            # imm = 0x813
movq -0x90(%rbp), %rdx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x478d0
movq -0xc8(%rbp), %rdi
movq %r14, %rsi
callq 0x968b
movq -0x30(%rbp), %r14
movq -0x50(%rbp), %r12
jmp 0x55b97
movzwl 0x54(%rbx), %edx
incl %edx
movq %r13, %rdi
movl %r14d, %esi
callq 0x47d6c
testl %r15d, %r15d
js 0x55b14
movq -0x30(%rbp), %r14
movq -0x50(%rbp), %r12
jmp 0x55bdb
cmpl $0x4, %ecx
movq -0x50(%rbp), %r12
jne 0x55b3a
movq -0x30(%rbp), %r14
movq %r14, %rdi
pushq $0xe
popq %rsi
xorl %edx, %edx
movl 0x20(%rbp), %ecx
callq 0x41f42
jmp 0x55b97
movl %r12d, %edx
movq -0x30(%rbp), %r14
movq 0x40(%r14), %rax
testq %rax, %rax
movq -0x50(%rbp), %r12
je 0x55bdb
movl 0x34(%r14), %ecx
movl %edx, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x55bdb
movq 0x1d8(%r13), %rax
testq %rax, %rax
cmoveq %r13, %rax
movb $0x1, 0x23(%rax)
movq -0x58(%rbp), %rax
testb $0x4, 0x2e(%rax)
movq -0x30(%rbp), %r14
jne 0x55b5f
xorl %r9d, %r9d
jmp 0x55b75
movq %r13, %rdi
movq %r12, %rsi
pushq $0x6a
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x52d34
movq %rax, %r9
movl $0x5, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq -0x70(%rbp), %rdx
movl -0x74(%rbp), %ecx
xorl %r8d, %r8d
callq 0x5322b
pushq $0x1
popq %rax
movl %eax, -0x34(%rbp)
movl -0x80(%rbp), %edx
testl %edx, %edx
js 0x55bb4
movl 0x34(%r14), %eax
cmpl %edx, %eax
jbe 0x55bb4
movq 0x8(%r14), %rcx
movl %edx, %edx
imulq $0x18, %rdx, %rdx
movl %eax, 0x8(%rcx,%rdx)
cmpl $0x0, -0x38(%rbp)
jns 0x55bd0
movq 0x40(%r14), %rax
testq %rax, %rax
je 0x55bd0
movl 0x34(%r14), %ecx
movl -0x88(%rbp), %edx
movl %ecx, (%rax,%rdx,4)
movq %r13, %rdi
movl -0x74(%rbp), %esi
callq 0x4701c
movq -0x48(%rbp), %rdx
addq $0x28, %rbx
incq %rdx
jmp 0x557d0
movq 0x28(%rbp), %rax
testq %rax, %rax
je 0x55bf9
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
movl %eax, -0x34(%rbp)
cmpq $0x0, 0x10(%r12)
je 0x55761
movq 0x1d8(%r13), %rax
testq %rax, %rax
cmoveq %r13, %rax
movb $0x1, 0x23(%rax)
movq %r13, %rdi
movq %r12, %rsi
movq -0x70(%rbp), %rdx
xorl %ecx, %ecx
callq 0x53c86
jmp 0x55761