// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3GenerateConstraintChecks
SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
  Parse *pParse,       /* The parser context */
  Table *pTab,         /* The table being inserted or updated */
  int *aRegIdx,        /* Use register aRegIdx[i] for index i.  0 for unused */
  int iDataCur,        /* Canonical data cursor (main table or PK index) */
  int iIdxCur,         /* First index cursor */
  int regNewData,      /* First register in a range holding values to insert */
  int regOldData,      /* Previous content.  0 for INSERTs */
  u8 pkChng,           /* Non-zero if the rowid or PRIMARY KEY changed */
  u8 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 */
){
  Vdbe *v;             /* VDBE under constrution */
  Index *pIdx;         /* Pointer to one of the indices */
  Index *pPk = 0;      /* The PRIMARY KEY index */
  sqlite3 *db;         /* Database connection */
  int i;               /* loop counter */
  int ix;              /* Index loop counter */
  int nCol;            /* Number of columns */
  int onError;         /* Conflict resolution strategy */
  int j1;              /* Addresss of jump instruction */
  int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */
  int nPkField;        /* Number of fields in PRIMARY KEY. 1 for ROWID tables */
  int ipkTop = 0;      /* Top of the rowid change constraint check */
  int ipkBottom = 0;   /* Bottom of the rowid change constraint check */
  u8 isUpdate;         /* True if this is an UPDATE operation */

  isUpdate = regOldData!=0;
  db = pParse->db;
  v = sqlite3GetVdbe(pParse);
  assert( v!=0 );
  assert( pTab->pSelect==0 );  /* This table is not a VIEW */
  nCol = pTab->nCol;
  
  /* pPk is the PRIMARY KEY index for WITHOUT ROWID tables and NULL for
  ** normal rowid tables.  nPkField is the number of key fields in the 
  ** pPk index or 1 for a rowid table.  In other words, nPkField is the
  ** number of fields in the true primary key of the table. */
  if( HasRowid(pTab) ){
    pPk = 0;
    nPkField = 1;
  }else{
    pPk = sqlite3PrimaryKeyIndex(pTab);
    nPkField = pPk->nKeyCol;
  }

  /* Record that this module has started */
  VdbeModuleComment((v, "BEGIN: GenCnstCks(%d,%d,%d,%d,%d)",
                     iDataCur, iIdxCur, regNewData, regOldData, pkChng));

  /* 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);
        /* Fall through */
      case OE_Rollback:
      case OE_Fail: {
        char *zMsg = sqlite3MPrintf(db, "%s.%s", pTab->zName,
                                    pTab->aCol[i].zName);
        sqlite3VdbeAddOp4(v, OP_HaltIfNull, SQLITE_CONSTRAINT_NOTNULL, onError,
                          regNewData+1+i, zMsg, P4_DYNAMIC);
        sqlite3VdbeChangeP5(v, P5_ConstraintNotNull);
        break;
      }
      case OE_Ignore: {
        sqlite3VdbeAddOp2(v, OP_IsNull, regNewData+1+i, ignoreDest);
        break;
      }
      default: {
        assert( onError==OE_Replace );
        j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regNewData+1+i);
        sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+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 = regNewData+1;
    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 *zName = pCheck->a[i].zName;
        if( zName==0 ) zName = pTab->zName;
        if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */
        sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
                              onError, zName, P4_TRANSIENT,
                              P5_ConstraintCheck);
      }
      sqlite3VdbeResolveLabel(v, allOk);
    }
  }
#endif /* !defined(SQLITE_OMIT_CHECK) */

  /* If rowid is changing, make sure the new rowid does not previously
  ** exist in the table.
  */
  if( pkChng && pPk==0 ){
    int addrRowidOk = sqlite3VdbeMakeLabel(v);

    /* Figure out what action to take in case of a rowid collision */
    onError = pTab->keyConf;
    if( overrideError!=OE_Default ){
      onError = overrideError;
    }else if( onError==OE_Default ){
      onError = OE_Abort;
    }

    if( isUpdate ){
      /* pkChng!=0 does not mean that the rowid has change, only that
      ** it might have changed.  Skip the conflict logic below if the rowid
      ** is unchanged. */
      sqlite3VdbeAddOp3(v, OP_Eq, regNewData, addrRowidOk, regOldData);
    }

    /* If the response to a rowid conflict is REPLACE but the response
    ** to some other UNIQUE constraint is FAIL or IGNORE, then we need
    ** to defer the running of the rowid conflict checking until after
    ** the UNIQUE constraints have run.
    */
    if( onError==OE_Replace && overrideError!=OE_Replace ){
      for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
        if( pIdx->onError==OE_Ignore || pIdx->onError==OE_Fail ){
          ipkTop = sqlite3VdbeAddOp0(v, OP_Goto);
          break;
        }
      }
    }

    /* Check to see if the new rowid already exists in the table.  Skip
    ** the following conflict logic if it does not. */
    sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, addrRowidOk, regNewData);

    /* Generate code that deals with a rowid collision */
    switch( onError ){
      default: {
        onError = OE_Abort;
        /* Fall thru into the next case */
      }
      case OE_Rollback:
      case OE_Abort:
      case OE_Fail: {
        sqlite3RowidConstraint(pParse, onError, pTab);
        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, pTrigger, iDataCur, iIdxCur,
                                   regNewData, 1, 0, OE_Replace, 1);
        }else if( pTab->pIndex ){
          sqlite3MultiWrite(pParse);
          sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, 0);
        }
        seenReplace = 1;
        break;
      }
      case OE_Ignore: {
        /*assert( seenReplace==0 );*/
        sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest);
        break;
      }
    }
    sqlite3VdbeResolveLabel(v, addrRowidOk);
    if( ipkTop ){
      ipkBottom = sqlite3VdbeAddOp0(v, OP_Goto);
      sqlite3VdbeJumpHere(v, ipkTop);
    }
  }

  /* Test all UNIQUE constraints by creating entries for each UNIQUE
  ** index and making sure that duplicate entries do not already exist.
  ** Compute the revised record entries for indices as we go.
  **
  ** This loop also handles the case of the PRIMARY KEY index for a
  ** WITHOUT ROWID table.
  */
  for(ix=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, ix++){
    int regIdx;          /* Range of registers hold conent for pIdx */
    int regR;            /* Range of registers holding conflicting PK */
    int iThisCur;        /* Cursor for this UNIQUE index */
    int addrUniqueOk;    /* Jump here if the UNIQUE constraint is satisfied */

    if( aRegIdx[ix]==0 ) continue;  /* Skip indices that do not change */
    iThisCur = iIdxCur+ix;
    addrUniqueOk = sqlite3VdbeMakeLabel(v);

    /* Skip partial indices for which the WHERE clause is not true */
    if( pIdx->pPartIdxWhere ){
      sqlite3VdbeAddOp2(v, OP_Null, 0, aRegIdx[ix]);
      pParse->ckBase = regNewData+1;
      sqlite3ExprIfFalse(pParse, pIdx->pPartIdxWhere, addrUniqueOk,
                         SQLITE_JUMPIFNULL);
      pParse->ckBase = 0;
    }

    /* Create a record for this index entry as it should appear after
    ** the insert or update.  Store that record in the aRegIdx[ix] register
    */
    regIdx = sqlite3GetTempRange(pParse, pIdx->nColumn);
    for(i=0; i<pIdx->nColumn; i++){
      int iField = pIdx->aiColumn[i];
      int x;
      if( iField<0 || iField==pTab->iPKey ){
        x = regNewData;
      }else{
        x = iField + regNewData + 1;
      }
      sqlite3VdbeAddOp2(v, OP_SCopy, x, regIdx+i);
      VdbeComment((v, "%s", iField<0 ? "rowid" : pTab->aCol[iField].zName));
    }
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn, aRegIdx[ix]);
    sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v, pIdx), P4_TRANSIENT);
    VdbeComment((v, "for %s", pIdx->zName));
    sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn);

    /* In an UPDATE operation, if this index is the PRIMARY KEY index 
    ** of a WITHOUT ROWID table and there has been no change the
    ** primary key, then no collision is possible.  The collision detection
    ** logic below can all be skipped. */
    if( isUpdate && pPk==pIdx && pkChng==0 ){
      sqlite3VdbeResolveLabel(v, addrUniqueOk);
      continue;
    }

    /* Find out what action to take in case there is a uniqueness conflict */
    onError = pIdx->onError;
    if( onError==OE_None ){ 
      sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn);
      sqlite3VdbeResolveLabel(v, addrUniqueOk);
      continue;  /* pIdx is not a UNIQUE index */
    }
    if( overrideError!=OE_Default ){
      onError = overrideError;
    }else if( onError==OE_Default ){
      onError = OE_Abort;
    }
    
    /* Check to see if the new index entry will be unique */
    sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk,
                         regIdx, pIdx->nKeyCol);

    /* Generate code to handle collisions */
    regR = (pIdx==pPk) ? regIdx : sqlite3GetTempRange(pParse, nPkField);
    if( HasRowid(pTab) ){
      sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR);
      /* Conflict only if the rowid of the existing index entry
      ** is different from old-rowid */
      if( isUpdate ){
        sqlite3VdbeAddOp3(v, OP_Eq, regR, addrUniqueOk, regOldData);
      }
    }else{
      int x;
      /* Extract the PRIMARY KEY from the end of the index entry and
      ** store it in registers regR..regR+nPk-1 */
      if( (isUpdate || onError==OE_Replace) && pIdx!=pPk ){
        for(i=0; i<pPk->nKeyCol; i++){
          x = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[i]);
          sqlite3VdbeAddOp3(v, OP_Column, iThisCur, x, regR+i);
          VdbeComment((v, "%s.%s", pTab->zName,
                       pTab->aCol[pPk->aiColumn[i]].zName));
        }
      }
      if( isUpdate ){
        /* If currently processing the PRIMARY KEY of a WITHOUT ROWID 
        ** table, only conflict if the new PRIMARY KEY values are actually
        ** different from the old.
        **
        ** For a UNIQUE index, only conflict if the PRIMARY KEY values
        ** of the matched index row are different from the original PRIMARY
        ** KEY values of this row before the update.  */
        int addrJump = sqlite3VdbeCurrentAddr(v)+pPk->nKeyCol;
        int op = OP_Ne;
        int regCmp = (pIdx->autoIndex==2 ? regIdx : regR);

        for(i=0; i<pPk->nKeyCol; i++){
          char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]);
          x = pPk->aiColumn[i];
          if( i==(pPk->nKeyCol-1) ){
            addrJump = addrUniqueOk;
            op = OP_Eq;
          }
          sqlite3VdbeAddOp4(v, op, 
              regOldData+1+x, addrJump, regCmp+i, p4, P4_COLLSEQ
          );
        }
      }
    }

    /* 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: {
        sqlite3UniqueConstraint(pParse, onError, pIdx);
        break;
      }
      case OE_Ignore: {
        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, pTrigger, iDataCur, iIdxCur,
                                 regR, nPkField, 0, OE_Replace, pIdx==pPk);
        seenReplace = 1;
        break;
      }
    }
    sqlite3VdbeResolveLabel(v, addrUniqueOk);
    sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn);
    if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField);
  }
  if( ipkTop ){
    sqlite3VdbeAddOp2(v, OP_Goto, 0, ipkTop+1);
    sqlite3VdbeJumpHere(v, ipkBottom);
  }
  
  *pbMayReplace = seenReplace;
  VdbeModuleComment((v, "END: GenCnstCks(%d)", seenReplace));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %r14d
movq %r8, 0x70(%rsp)
movl %ecx, 0x30(%rsp)
movq %rdx, 0x80(%rsp)
movq %rsi, %r15
movq (%rdi), %rax
movq %rax, 0x78(%rsp)
movq %rdi, 0x18(%rsp)
callq 0x43f1b
movq %rax, 0x8(%rsp)
movzwl 0x42(%r15), %ebx
testb $0x20, 0x48(%r15)
movq %r15, 0x10(%rsp)
jne 0x57e2c
pushq $0x1
popq %rax
movl %eax, 0x34(%rsp)
xorl %esi, %esi
jmp 0x57e3f
movq %r15, %rdi
callq 0x30033
movq %rax, %rsi
movzwl 0x5e(%rax), %eax
movl %eax, 0x34(%rsp)
leal 0x1(%r14), %eax
movq %rax, 0x60(%rsp)
testw %bx, %bx
movl $0x0, %eax
cmovgl %ebx, %eax
movzwl %ax, %r12d
movzbl 0xf0(%rsp), %eax
movl %eax, 0x4c(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %rsi, 0x20(%rsp)
cmpq %r13, %r12
je 0x5800c
movq 0x10(%rsp), %rax
movswq 0x40(%rax), %rax
movl %eax, %eax
cmpq %rax, %r13
je 0x58000
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movb 0x28(%rax,%rbp), %cl
testb %cl, %cl
je 0x58000
cmpb $0xa, %cl
movzbl %cl, %ecx
pushq $0x2
popq %rdx
cmovel %edx, %ecx
movl 0x4c(%rsp), %edx
cmpb $0xa, %dl
cmovnel %edx, %ecx
cmpb $0x5, %cl
jne 0x57ed0
xorl %ecx, %ecx
cmpq $0x0, 0x8(%rax,%rbp)
setne %cl
leal (%rcx,%rcx,2), %r15d
addl $0x2, %r15d
jmp 0x57ed4
movzbl %cl, %r15d
leal -0x1(%r15), %ecx
cmpl $0x3, %ecx
ja 0x57fa2
leaq 0x8314(%rip), %rdx      # 0x601fc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x18(%rsp), %rdx
movq 0x1e0(%rdx), %rcx
testq %rcx, %rcx
cmoveq %rdx, %rcx
movb $0x1, 0x24(%rcx)
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
movq (%rax,%rbp), %rcx
movq 0x78(%rsp), %rdi
leaq 0xc8e5(%rip), %rsi      # 0x64805
xorl %eax, %eax
callq 0x10c1b
movq 0x60(%rsp), %rcx
leal (%rcx,%r13), %r8d
subq $0x8, %rsp
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
pushq $0x15
popq %rsi
movl $0x513, %edx            # imm = 0x513
movl %r15d, %ecx
movq %rax, %r9
pushq $-0x1
callq 0x43fe6
addq $0x10, %rsp
movq 0x8(%rbx), %rax
testq %rax, %rax
movq 0x20(%rsp), %rsi
je 0x58000
movq 0x8(%rsp), %rcx
movslq 0x34(%rcx), %rcx
imulq $0x18, %rcx, %rcx
movb $0x1, -0x15(%rax,%rcx)
jmp 0x58000
movq 0x60(%rsp), %rax
leal (%rax,%r13), %edx
movq 0x8(%rsp), %rdi
pushq $0x4a
popq %rsi
movl 0xf8(%rsp), %ecx
callq 0x43f64
movq 0x20(%rsp), %rsi
jmp 0x58000
movq 0x60(%rsp), %rax
leal (%rax,%r13), %r15d
movq 0x8(%rsp), %rdi
pushq $0x4b
popq %rsi
movl %r15d, %edx
callq 0x457e7
movl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax,%rbp), %rsi
movq 0x18(%rsp), %rdi
movl %r15d, %edx
callq 0x4401c
movq 0x20(%rsp), %rsi
testl %ebx, %ebx
js 0x58000
movq 0x8(%rsp), %rax
movl 0x34(%rax), %eax
cmpl %ebx, %eax
jbe 0x58000
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %ebx, %edx
imulq $0x18, %rdx, %rdx
movl %eax, 0x8(%rcx,%rdx)
incq %r13
addq $0x30, %rbp
jmp 0x57e6d
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rbx
testq %rbx, %rbx
je 0x5811b
movq 0x78(%rsp), %rax
testb $0x20, 0x2d(%rax)
jne 0x5811b
movl 0x4c(%rsp), %eax
cmpb $0xa, %al
pushq $0x2
popq %rcx
cmovel %ecx, %eax
movq 0x18(%rsp), %rcx
movq 0x60(%rsp), %rdx
movl %edx, 0x64(%rcx)
movzbl %al, %r12d
xorl %ebp, %ebp
xorl %edi, %edi
movq 0x8(%rsp), %r13
movslq (%rbx), %rax
cmpq %rax, %rdi
jge 0x5811b
movq %rdi, 0x58(%rsp)
movq %r13, %rdi
callq 0x4595f
movl %eax, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%rbp), %rsi
movq 0x18(%rsp), %rdi
movl %r15d, %edx
pushq $0x8
popq %rcx
callq 0x47dc2
cmpl $0x4, %r12d
jne 0x580a7
movq %r13, %rdi
pushq $0x10
popq %rsi
xorl %edx, %edx
movl 0xf8(%rsp), %ecx
callq 0x43f64
pushq $0x4
popq %r12
jmp 0x580e1
movq 0x8(%rbx), %rax
movq 0x8(%rax,%rbp), %rcx
testq %rcx, %rcx
jne 0x580bd
movq 0x10(%rsp), %rax
movq (%rax), %rcx
cmpl $0x5, %r12d
pushq $0x2
popq %rax
cmovel %eax, %r12d
movq 0x18(%rsp), %rdi
movl $0x113, %esi            # imm = 0x113
movl %r12d, %edx
xorl %r8d, %r8d
pushq $0x3
popq %r9
callq 0x465e2
testl %r15d, %r15d
movq 0x20(%rsp), %rsi
movq 0x58(%rsp), %rdi
jns 0x5810f
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
je 0x5810f
notl %r15d
movq 0x8(%rsp), %rcx
movl 0x34(%rcx), %ecx
movl %r15d, %edx
movl %ecx, (%rax,%rdx,4)
incq %rdi
addq $0x20, %rbp
jmp 0x58053
cmpb $0x0, 0xe8(%rsp)
sete %al
testq %rsi, %rsi
setne %cl
orb %al, %cl
jne 0x5828c
movq 0x8(%rsp), %rdi
callq 0x4595f
movl %eax, %ebp
movb 0xf0(%rsp), %al
movl %eax, %r15d
cmpb $0xa, %al
jne 0x58163
movq 0x10(%rsp), %rax
movzbl 0x49(%rax), %r15d
cmpb $0xa, %r15b
pushq $0x2
popq %rax
cmovel %eax, %r15d
movl 0xe0(%rsp), %r8d
testl %r8d, %r8d
je 0x58182
pushq $0x4d
popq %rsi
movq 0x8(%rsp), %rdi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x43f69
xorl %ebx, %ebx
cmpb $0x5, 0xf0(%rsp)
je 0x581c3
cmpb $0x5, %r15b
jne 0x581c3
movq 0x10(%rsp), %rax
addq $0x10, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x581c3
movb 0x62(%rax), %cl
addb $-0x3, %cl
addq $0x28, %rax
cmpb $0x1, %cl
ja 0x5819d
pushq $0x10
popq %rsi
movq 0x8(%rsp), %rdi
callq 0x43f5b
movl %eax, %ebx
pushq $0x41
popq %rsi
movq 0x8(%rsp), %rdi
movl 0x30(%rsp), %edx
movl %ebp, %ecx
movl %r14d, %r8d
callq 0x43f69
movzbl %r15b, %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
jb 0x582ce
cmpl $0x4, %eax
je 0x582aa
cmpl $0x5, %eax
jne 0x582cb
movl %ebx, %r13d
movq 0x78(%rsp), %rax
testb $0x4, 0x2e(%rax)
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r12
je 0x5822e
pushq $0x6b
popq %rdx
movq %r12, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x55469
movq %rax, %r15
testq %rax, %rax
jne 0x58248
xorl %r15d, %r15d
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x55658
testl %eax, %eax
je 0x588ba
movq 0x1e0(%r12), %rax
testq %rax, %rax
cmoveq %r12, %rax
movb $0x1, 0x23(%rax)
pushq $0x1
popq %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl 0x30(%rsp), %ecx
movq 0x70(%rsp), %r8
movl %r14d, %r9d
pushq %rax
pushq $0x5
pushq $0x0
movq %rax, 0x68(%rsp)
pushq %rax
callq 0x558d6
addq $0x20, %rsp
movl %r13d, %ebx
jmp 0x582ea
movl $0x0, 0x44(%rsp)
movl $0x0, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
jmp 0x58358
pushq $0x10
popq %rsi
movq $0x0, 0x50(%rsp)
movq 0x8(%rsp), %rdi
xorl %edx, %edx
movl 0xf8(%rsp), %ecx
callq 0x43f64
jmp 0x582ea
movb $0x2, %r15b
movzbl %r15b, %esi
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
callq 0x58ac4
movq $0x0, 0x50(%rsp)
testl %ebp, %ebp
jns 0x5830b
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
je 0x5830b
notl %ebp
movq 0x8(%rsp), %rcx
movl 0x34(%rcx), %ecx
movl %ebp, %edx
movl %ecx, (%rax,%rdx,4)
testl %ebx, %ebx
je 0x58348
pushq $0x10
popq %rsi
movq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x43f5b
testl %ebx, %ebx
movq 0x10(%rsp), %rbp
movl %ebx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
js 0x58362
movl 0x34(%r13), %esi
cmpl %ebx, %esi
jbe 0x58362
movq 0x8(%r13), %rcx
movl %ebx, %edx
imulq $0x18, %rdx, %rdx
movl %esi, 0x8(%rcx,%rdx)
jmp 0x58362
movl $0x0, 0x44(%rsp)
movl $0x0, 0x48(%rsp)
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rbp
leaq 0x10(%rbp), %r12
movl 0xe0(%rsp), %eax
incl %eax
movl %eax, 0x8c(%rsp)
xorl %ebx, %ebx
movswl 0x34(%rsp), %eax
movq %rax, 0x90(%rsp)
movq %r14, 0xa0(%rsp)
movq (%r12), %r12
testq %r12, %r12
je 0x58864
movq 0x80(%rsp), %rax
cmpl $0x0, (%rax,%rbx,4)
je 0x58858
movq %r13, %rdi
callq 0x4595f
movl %eax, %r15d
cmpq $0x0, 0x48(%r12)
movq %rbx, %r14
movq 0x18(%rsp), %rbx
je 0x583ff
movq 0x80(%rsp), %rax
movl (%rax,%r14,4), %ecx
movq %r13, %rdi
pushq $0x1a
popq %rsi
xorl %edx, %edx
callq 0x43f64
movq 0x60(%rsp), %rax
movl %eax, 0x64(%rbx)
movq 0x48(%r12), %rsi
movq %rbx, %rdi
movl %r15d, %edx
pushq $0x8
popq %rcx
callq 0x4636b
andl $0x0, 0x64(%rbx)
movl %r15d, 0x58(%rsp)
movq %r14, 0x38(%rsp)
movzwl 0x60(%r12), %esi
movq %rbx, %rdi
callq 0x45b5d
movl %eax, 0x2c(%rsp)
movl %eax, %r15d
xorl %ebx, %ebx
movq 0xa0(%rsp), %r14
movzwl 0x60(%r12), %ecx
cmpq %rcx, %rbx
jae 0x58466
movq 0x8(%r12), %rax
movswl (%rax,%rbx,2), %eax
movl %r14d, %edx
testl %eax, %eax
js 0x58452
movl %r14d, %edx
cmpw 0x40(%rbp), %ax
je 0x58452
addl 0x60(%rsp), %eax
movl %eax, %edx
leal (%r15,%rbx), %ecx
movq %r13, %rdi
pushq $0x1f
popq %rsi
callq 0x43f64
incq %rbx
jmp 0x58428
cmpb $0x0, 0xe8(%rsp)
setne %bl
movl 0xe0(%rsp), %eax
testl %eax, %eax
sete %bpl
movq 0x80(%rsp), %rax
movq 0x38(%rsp), %rdx
movl (%rax,%rdx,4), %r8d
movq %r13, %rdi
pushq $0x2d
popq %rsi
movl 0x2c(%rsp), %edx
callq 0x43f69
movq %r13, %rdi
movq %r12, %rsi
callq 0x4c5f6
movq %r13, %rdi
pushq $-0x1
popq %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x10de3
movzwl 0x60(%r12), %edx
movq 0x18(%rsp), %rdi
movl %r15d, %esi
callq 0x459a9
cmpq %r12, 0x20(%rsp)
setne %al
orb %bl, %al
orb %bpl, %al
movl 0x58(%rsp), %r13d
movl %r13d, %r15d
notl %r15d
je 0x585d1
movb 0x62(%r12), %al
testb %al, %al
je 0x585dd
movl %r15d, 0x6c(%rsp)
cmpb $0xa, %al
movzbl %al, %ebx
pushq $0x2
popq %rax
cmovel %eax, %ebx
cmpb $0xa, 0xf0(%rsp)
cmovnel 0x4c(%rsp), %ebx
movzwl 0x5e(%r12), %r9d
movq 0x70(%rsp), %rax
movq 0x38(%rsp), %rcx
leal (%rcx,%rax), %r15d
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
pushq $0x3e
popq %rsi
movl %r15d, %edx
movl %r13d, %ecx
movl 0x2c(%rsp), %r13d
movl %r13d, %r8d
callq 0x441d6
movq 0x20(%rsp), %rdi
cmpq %rdi, %r12
je 0x58566
movq 0x18(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x45b5d
movq 0x20(%rsp), %rdi
movl %eax, %r13d
movzbl %bl, %ecx
movq 0x10(%rsp), %rax
testb $0x20, 0x48(%rax)
movl 0xe0(%rsp), %ebx
movl %r13d, 0x28(%rsp)
movq %rcx, 0x98(%rsp)
jne 0x58630
movq %rbp, %rdi
pushq $0x6b
popq %rsi
movl %r15d, %edx
movl %r13d, %ecx
callq 0x43f64
movq 0x20(%rsp), %rdi
testl %ebx, %ebx
je 0x58737
movq 0x8(%rsp), %rdi
pushq $0x4d
popq %rsi
movl 0x28(%rsp), %edx
movl 0x58(%rsp), %ecx
movl 0xe0(%rsp), %r8d
callq 0x43f69
movq 0x20(%rsp), %rdi
jmp 0x58737
testl %r13d, %r13d
js 0x58605
movq 0x8(%rsp), %r13
jmp 0x585fb
movzwl 0x60(%r12), %edx
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x45c24
testl %r13d, %r13d
movq 0x8(%rsp), %r13
js 0x5860a
movq 0x10(%rsp), %rbp
jmp 0x58853
movq 0x8(%rsp), %r13
movq 0x40(%r13), %rax
testq %rax, %rax
movq 0x10(%rsp), %rbp
movq 0x38(%rsp), %rbx
je 0x58858
movl 0x34(%r13), %ecx
movl %r15d, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x58858
testl %ebx, %ebx
sete %al
cmpl $0x5, %ecx
setne %cl
cmpq %rdi, %r12
je 0x58684
andb %cl, %al
jne 0x58684
movl 0x28(%rsp), %ebx
xorl %r13d, %r13d
movzwl 0x5e(%rdi), %eax
cmpq %rax, %r13
jae 0x58684
movq 0x8(%rdi), %rax
movswl (%rax,%r13,2), %esi
movq %r12, %rdi
callq 0x467ab
movswl %ax, %ecx
leal (%rbx,%r13), %r8d
movq %rbp, %rdi
pushq $0x2b
popq %rsi
movl %r15d, %edx
callq 0x43f69
movq 0x20(%rsp), %rdi
incq %r13
jmp 0x5864b
movl 0xe0(%rsp), %eax
testl %eax, %eax
je 0x58737
movzwl 0x5e(%rdi), %eax
movl %eax, %r15d
movq 0x8(%rsp), %rcx
addl 0x34(%rcx), %r15d
movb 0x63(%r12), %cl
andb $0x3, %cl
cmpb $0x2, %cl
movl 0x28(%rsp), %ecx
movl %ecx, %ebp
cmovel 0x2c(%rsp), %ebp
xorl %ebx, %ebx
pushq $0x4c
popq %r13
movzwl %ax, %eax
cmpq %rax, %rbx
jae 0x58737
movq 0x40(%rdi), %rax
movq (%rax,%rbx,8), %rsi
movq 0x18(%rsp), %rdi
callq 0x4436b
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
movswl (%rcx,%rbx,2), %edx
movq 0x20(%rsp), %rcx
movzwl 0x5e(%rcx), %ecx
decl %ecx
cmpq %rcx, %rbx
cmovel 0x58(%rsp), %r15d
pushq $0x4d
popq %rcx
cmovel %ecx, %r13d
addl 0x8c(%rsp), %edx
leal (%rbx,%rbp), %r8d
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
movl %r13d, %esi
movl %r15d, %ecx
movq %rax, %r9
pushq $-0x4
callq 0x43fe6
movq 0x30(%rsp), %rdi
addq $0x10, %rsp
incq %rbx
movzwl 0x5e(%rdi), %eax
jmp 0x586bf
movq 0x98(%rsp), %rsi
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
jae 0x58767
movq 0x18(%rsp), %rdi
movq %r12, %rdx
callq 0x4c4f5
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rbp
movl 0x6c(%rsp), %ebx
jmp 0x5880a
cmpl $0x4, %esi
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r15
movl 0x6c(%rsp), %ebx
jne 0x58795
movq %r13, %rdi
pushq $0x10
popq %rsi
xorl %edx, %edx
movl 0xf8(%rsp), %ecx
callq 0x43f64
jmp 0x5880a
movq 0x1e0(%r15), %rax
testq %rax, %rax
cmoveq %r15, %rax
movb $0x1, 0x23(%rax)
movq 0x78(%rsp), %rax
testb $0x4, 0x2e(%rax)
jne 0x587b6
xorl %edx, %edx
jmp 0x587d1
movq %r15, %rdi
movq %rbp, %rsi
pushq $0x6b
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x55469
movq 0x20(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdi, %r12
sete %al
movq %r15, %rdi
movq %rbp, %rsi
movl 0x30(%rsp), %ecx
movq 0x70(%rsp), %r8
movl 0x28(%rsp), %r9d
pushq %rax
pushq $0x5
pushq $0x0
pushq 0xa8(%rsp)
callq 0x558d6
addq $0x20, %rsp
pushq $0x1
popq %rax
movq %rax, 0x50(%rsp)
cmpl $0x0, 0x58(%rsp)
jns 0x58823
movq 0x40(%r13), %rax
testq %rax, %rax
je 0x58823
movl 0x34(%r13), %ecx
movl %ebx, %edx
movl %ecx, (%rax,%rdx,4)
movzwl 0x60(%r12), %edx
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl 0x2c(%rsp), %r15d
movl %r15d, %esi
callq 0x45c24
movl 0x28(%rsp), %esi
cmpl %r15d, %esi
je 0x58853
movq %rbx, %rdi
movl 0x34(%rsp), %edx
callq 0x45c24
movq 0x38(%rsp), %rbx
addq $0x28, %r12
incq %rbx
jmp 0x5838d
movl 0x48(%rsp), %ecx
testl %ecx, %ecx
movl 0x44(%rsp), %ebx
je 0x58899
incl %ecx
pushq $0x10
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x43f64
testl %ebx, %ebx
js 0x58899
movl 0x34(%r13), %eax
cmpl %ebx, %eax
jbe 0x58899
movq 0x8(%r13), %rcx
movl %ebx, %edx
imulq $0x18, %rdx, %rdx
movl %eax, 0x8(%rcx,%rdx)
movq 0x100(%rsp), %rax
movq 0x50(%rsp), %rcx
movl %ecx, (%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x10(%rbx)
je 0x58287
movq 0x18(%rsp), %r12
movq 0x1e0(%r12), %rax
testq %rax, %rax
cmoveq %r12, %rax
movb $0x1, 0x23(%rax)
movq %r12, %rdi
movq %rbx, %rsi
movl 0x30(%rsp), %edx
movq 0x70(%rsp), %rcx
xorl %r8d, %r8d
callq 0x56533
jmp 0x58287