// File: /workspace/github_c_makefile_star2_O0/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
subq $0x120, %rsp            # imm = 0x120
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x64(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x7ff63
cmpl $0x0, 0x10(%rbp)
je 0x7ff63
movl -0x24(%rbp), %eax
movl %eax, -0xf4(%rbp)
jmp 0x7ff6c
movl -0x18(%rbp), %eax
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5e000
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movswl 0x42(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x80141
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x40(%rcx), %ecx
cmpl %ecx, %eax
jne 0x7ffc8
jmp 0x80133
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movzbl 0x28(%rax), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x7ffed
jmp 0x80133
cmpl $0x63, 0x18(%rbp)
je 0x7fffb
movl 0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x8000a
cmpl $0x63, -0x38(%rbp)
jne 0x80008
movl $0x2, -0x38(%rbp)
jmp 0x8000a
cmpl $0x5, -0x38(%rbp)
jne 0x80031
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
jne 0x80031
movl $0x2, -0x38(%rbp)
movl -0x38(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x100(%rbp)
subl $0x3, %eax
ja 0x800e8
movq -0x100(%rbp), %rax
leaq 0x2a662(%rip), %rcx     # 0xaa6b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
callq 0x6a6f0
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %ecx
movl -0x48(%rbp), %r8d
addl -0x28(%rbp), %r8d
movl $0x12, %esi
movl $0x513, %edx            # imm = 0x513
callq 0x5e0f0
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq 0x30848(%rip), %rsi     # 0xb08f6
movb $0x0, %al
callq 0x137f0
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %esi
callq 0x13c20
jmp 0x80131
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %edx
addl -0x28(%rbp), %edx
movl 0x20(%rbp), %ecx
movl $0x49, %esi
callq 0x5e0c0
jmp 0x80131
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %edx
addl -0x28(%rbp), %edx
movl $0x4a, %esi
callq 0x5ecf0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
movl -0x48(%rbp), %edx
addl -0x28(%rbp), %edx
callq 0x69c70
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x5e090
jmp 0x80133
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x7ffa8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x802a5
movq -0x60(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x802a5
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x78(%rbp)
movl -0x48(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x64(%rax)
cmpl $0x63, 0x18(%rbp)
je 0x8018c
movl 0x18(%rbp), %eax
movl %eax, -0x104(%rbp)
jmp 0x80199
movl $0x2, %eax
movl %eax, -0x104(%rbp)
jmp 0x80199
movl -0x104(%rbp), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x802a3
movq -0x30(%rbp), %rdi
callq 0x67890
movl %eax, -0x7c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x7c(%rbp), %edx
movl $0x8, %ecx
callq 0x67f00
cmpl $0x4, -0x38(%rbp)
jne 0x80209
movq -0x30(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
jmp 0x80289
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
cmpl $0x5, -0x38(%rbp)
jne 0x80234
movl $0x2, -0x38(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x80260
movq -0x60(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x306bc(%rip), %rsi     # 0xb090c
movb $0x0, %al
callq 0x137f0
movq %rax, -0x88(%rbp)
jmp 0x8026b
movq $0x0, -0x88(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %edx
movq -0x88(%rbp), %rcx
movl $0x113, %esi            # imm = 0x113
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x67830
movq -0x30(%rbp), %rdi
movl -0x7c(%rbp), %esi
callq 0x677f0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x801a9
jmp 0x802a5
cmpl $0x0, -0x24(%rbp)
je 0x8045f
movq -0x10(%rbp), %rax
movzbl 0x47(%rax), %eax
movl %eax, -0x38(%rbp)
cmpl $0x63, 0x18(%rbp)
je 0x802c8
movl 0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x802d7
cmpl $0x63, -0x38(%rbp)
jne 0x802d5
movl $0x2, -0x38(%rbp)
jmp 0x802d7
cmpl $0x0, 0x10(%rbp)
je 0x802f7
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %r8d
movl $0x4c, %esi
xorl %ecx, %ecx
callq 0x5e0f0
movl %eax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %r8d
movl $0x3f, %esi
xorl %ecx, %ecx
callq 0x5e0f0
movl %eax, -0x44(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x108(%rbp)
decl %eax
subl $0x3, %eax
jb 0x80348
jmp 0x80323
movl -0x108(%rbp), %eax
subl $0x4, %eax
je 0x8042c
jmp 0x80334
movl -0x108(%rbp), %eax
subl $0x5, %eax
je 0x8036b
jmp 0x80341
movl $0x2, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %edx
movl $0x613, %esi            # imm = 0x613
leaq 0x305c6(%rip), %rcx     # 0xb0921
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x67830
jmp 0x8043f
movq $0x0, -0x90(%rbp)
movq -0x60(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x803a8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x6a, %edx
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rcx
callq 0x7c4e0
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x803ca
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x7c850
cmpl $0x0, %eax
je 0x803f9
movq -0x8(%rbp), %rdi
callq 0x80b70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movq -0x90(%rbp), %r9
xorl %r8d, %r8d
movl $0x5, (%rsp)
callq 0x7cca0
jmp 0x80423
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x80421
movq -0x8(%rbp), %rdi
callq 0x80b70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x7da60
jmp 0x80423
movl $0x1, -0x64(%rbp)
jmp 0x8043f
movq -0x30(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x5e090
cmpl $0x0, 0x10(%rbp)
je 0x8045d
movq -0x30(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x5e090
jmp 0x8045f
movl $0x0, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x8096d
movl $0x0, -0x9c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x8049a
jmp 0x80953
movq -0x58(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x80500
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl $0x18, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x30(%rbp), %rdi
callq 0x67890
movl %eax, -0x9c(%rbp)
movl -0x48(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x64(%rax)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movq 0x48(%rax), %rsi
movl -0x9c(%rbp), %edx
movl $0x8, %ecx
callq 0x67920
movq -0x8(%rbp), %rax
movl $0x0, 0x64(%rax)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %esi
addl $0x1, %esi
callq 0x67c30
movl %eax, -0x94(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x58(%rbp), %rcx
movzwl 0x54(%rcx), %ecx
cmpl %ecx, %eax
jge 0x805a0
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x40(%rcx), %ecx
cmpl %ecx, %eax
jne 0x80573
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %edx
movl -0x94(%rbp), %ecx
addl -0x28(%rbp), %ecx
movl $0x1d, %esi
callq 0x5e0c0
jmp 0x80593
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %edx
addl -0xa0(%rbp), %edx
movl -0x94(%rbp), %ecx
addl -0x28(%rbp), %ecx
movl $0x1d, %esi
callq 0x5e0c0
jmp 0x80595
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x80521
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %edx
movl -0x94(%rbp), %ecx
addl -0x28(%rbp), %ecx
movl $0x1d, %esi
callq 0x5e0c0
movq -0x30(%rbp), %rdi
movl -0x94(%rbp), %edx
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rsi
movl (%rax,%rsi,4), %r8d
movl $0x2b, %esi
callq 0x5e0f0
movq -0x30(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x30(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x67d80
movq -0x110(%rbp), %rdi
movq %rax, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x13c20
movq -0x8(%rbp), %rdi
movl -0x94(%rbp), %esi
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %edx
addl $0x1, %edx
callq 0x69c40
movq -0x58(%rbp), %rax
movzbl 0x56(%rax), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x8066c
movq -0x8(%rbp), %rdi
movl -0x94(%rbp), %esi
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %edx
addl $0x1, %edx
callq 0x67e90
movq -0x30(%rbp), %rdi
movl -0x9c(%rbp), %esi
callq 0x677f0
jmp 0x80953
cmpl $0x63, 0x18(%rbp)
je 0x8067a
movl 0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x80689
cmpl $0x63, -0x38(%rbp)
jne 0x80687
movl $0x2, -0x38(%rbp)
jmp 0x80689
cmpl $0x0, -0x64(%rbp)
je 0x806af
cmpl $0x4, -0x38(%rbp)
jne 0x8069e
movl $0x5, -0x38(%rbp)
jmp 0x806ad
cmpl $0x3, -0x38(%rbp)
jne 0x806ab
movl $0x2, -0x38(%rbp)
jmp 0x806ad
jmp 0x806af
movq -0x8(%rbp), %rdi
callq 0x66a70
movl %eax, -0x98(%rbp)
movq -0x30(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x98(%rbp), %ecx
movl $0x1d, %esi
callq 0x5e0c0
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x4c(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal 0x1(%rax,%rcx), %edx
movl -0x98(%rbp), %r8d
movslq -0x94(%rbp), %r9
movq %rsp, %rax
movl $0xfffffff2, (%rax)     # imm = 0xFFFFFFF2
movl $0x3e, %esi
xorl %ecx, %ecx
callq 0x5e1b0
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movl -0x94(%rbp), %esi
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %edx
incl %edx
callq 0x67e90
movl -0x38(%rbp), %eax
movl %eax, -0x114(%rbp)
decl %eax
subl $0x3, %eax
jb 0x8074c
jmp 0x80738
movl -0x114(%rbp), %eax
subl $0x4, %eax
je 0x808a0
jmp 0x808b5
leaq -0xd0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
movl $0xc8, %ecx
callq 0xa720
movq -0x60(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %edx
leaq 0x301c8(%rip), %rax     # 0xb0945
leaq 0x301b8(%rip), %rcx     # 0xb093c
cmpl $0x1, %edx
cmovgq %rcx, %rax
movq %rax, -0xd8(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movq -0x58(%rbp), %rcx
movzwl 0x54(%rcx), %ecx
cmpl %ecx, %eax
jge 0x8082c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xa4(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0xd8(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1bb70
leaq 0x30154(%rip), %rax     # 0xb094d
movq %rax, -0xd8(%rbp)
movq -0xe8(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1bb70
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x8079c
movq -0x58(%rbp), %rax
movzwl 0x54(%rax), %ecx
leaq 0x30115(%rip), %rsi     # 0xb0950
leaq 0x2f8cd(%rip), %rax     # 0xb010f
cmpl $0x1, %ecx
cmovgq %rax, %rsi
leaq -0xd0(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1bb70
leaq -0xd0(%rbp), %rdi
callq 0xc310
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %edx
movq -0xe0(%rbp), %rcx
movl $0x813, %esi            # imm = 0x813
xorl %r8d, %r8d
callq 0x67830
movq -0xd0(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x9cd0
jmp 0x80929
movq -0x30(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0xe, %esi
xorl %edx, %edx
callq 0x5e0c0
jmp 0x80929
movq $0x0, -0xf0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x80b70
movq -0x60(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x808fb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x6a, %edx
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rcx
callq 0x7c4e0
movq %rax, -0xf0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x98(%rbp), %ecx
movq -0xf0(%rbp), %r9
xorl %r8d, %r8d
movl $0x5, (%rsp)
callq 0x7cca0
movl $0x1, -0x64(%rbp)
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x5e090
movq -0x30(%rbp), %rdi
movl -0x9c(%rbp), %esi
callq 0x677f0
movq -0x8(%rbp), %rdi
movl -0x98(%rbp), %esi
callq 0x66ac0
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x80472
cmpq $0x0, 0x28(%rbp)
je 0x8097d
movl -0x64(%rbp), %ecx
movq 0x28(%rbp), %rax
movl %ecx, (%rax)
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)