LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: xferCompatibleIndex
static int xferCompatibleIndex(Index *pDest, Index *pSrc){
  int i;
  assert( pDest && pSrc );
  assert( pDest->pTable!=pSrc->pTable );
  if( pDest->nColumn!=pSrc->nColumn ){
    return 0;   /* Different number of columns */
  }
  if( pDest->onError!=pSrc->onError ){
    return 0;   /* Different conflict resolution strategies */
  }
  for(i=0; i<pSrc->nColumn; i++){
    if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
      return 0;   /* Different columns indexed */
    }
    if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
      return 0;   /* Different sort orders */
    }
    if( !xferCompatibleCollation(pSrc->azColl[i],pDest->azColl[i]) ){
      return 0;   /* Different collating sequences */
    }
  }
  if( sqlite3ExprCompare(pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){
    return 0;     /* Different WHERE clauses */
  }

  /* If no test above fails then the indices must be compatible */
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movzwl 0x54(%rdi), %r12d
xorl %r15d, %r15d
cmpw 0x54(%rsi), %r12w
jne 0x55f2a
movq %rsi, %r14
movq %rdi, %rbx
movb 0x56(%rdi), %al
cmpb 0x56(%rsi), %al
jne 0x55f2a
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r13, %r12
je 0x55f11
movq 0x8(%r14), %rax
movl (%rax,%r13,4), %eax
movq 0x8(%rbx), %rcx
cmpl (%rcx,%r13,4), %eax
jne 0x55f2a
movq 0x38(%r14), %rax
movb (%rax,%r13), %al
movq 0x38(%rbx), %rcx
cmpb (%rcx,%r13), %al
jne 0x55f2a
movq 0x40(%r14), %rax
movq (%rax,%r13,8), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%r13,8), %rsi
callq 0x55e6b
incq %r13
testl %eax, %eax
jne 0x55eca
jmp 0x55f2a
movq 0x48(%r14), %rdi
movq 0x48(%rbx), %rsi
pushq $-0x1
popq %rdx
callq 0x46bdc
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: returnSingleInt
static void returnSingleInt(Parse *pParse, const char *zLabel, i64 value){
  Vdbe *v = sqlite3GetVdbe(pParse);
  int mem = ++pParse->nMem;
  i64 *pI64 = sqlite3DbMallocRaw(pParse->db, sizeof(value));
  if( pI64 ){
    memcpy(pI64, &value, sizeof(value));
  }
  sqlite3VdbeAddOp4(v, OP_Int64, 0, mem, 0, (char*)pI64, P4_INT64);
  sqlite3VdbeSetNumCols(v, 1);
  sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLabel, SQLITE_STATIC);
  sqlite3VdbeAddOp2(v, OP_ResultRow, mem, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
callq 0x41ef4
movq %rax, %r14
movl 0x58(%r13), %r15d
incl %r15d
movl %r15d, 0x58(%r13)
movq (%r13), %rdi
pushq $0x8
popq %rsi
callq 0x103b4
testq %rax, %rax
je 0x55f7a
movq %r12, (%rax)
movl $0xfffffff3, (%rsp)     # imm = 0xFFFFFFF3
pushq $0x16
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x41fd2
pushq $0x1
popq %r12
movq %r14, %rdi
movl %r12d, %esi
callq 0x31d90
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x31dfc
pushq $0x1e
popq %rsi
movq %r14, %rdi
movl %r15d, %edx
movl %r12d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41f42
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeSecureDelete
SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){
  int b;
  if( p==0 ) return 0;
  sqlite3BtreeEnter(p);
  if( newFlag>=0 ){
    p->pBt->btsFlags &= ~BTS_SECURE_DELETE;
    if( newFlag ) p->pBt->btsFlags |= BTS_SECURE_DELETE;
  } 
  b = (p->pBt->btsFlags & BTS_SECURE_DELETE)!=0;
  sqlite3BtreeLeave(p);
  return b;
}

// Assembly:
testq %rdi, %rdi
je 0x56013
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rax, 0x8(%rcx)
movzwl 0x26(%rcx), %edx
testl %esi, %esi
js 0x56009
movl %edx, %eax
andl $0xfffb, %eax           # imm = 0xFFFB
movw %ax, 0x26(%rcx)
testl %esi, %esi
je 0x5600b
orl $0x4, %edx
movw %dx, 0x26(%rcx)
movl %edx, %eax
shrl $0x2, %eax
andl $0x1, %eax
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PagerLockingMode
SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *pPager, int eMode){
  assert( eMode==PAGER_LOCKINGMODE_QUERY
            || eMode==PAGER_LOCKINGMODE_NORMAL
            || eMode==PAGER_LOCKINGMODE_EXCLUSIVE );
  assert( PAGER_LOCKINGMODE_QUERY<0 );
  assert( PAGER_LOCKINGMODE_NORMAL>=0 && PAGER_LOCKINGMODE_EXCLUSIVE>=0 );
  assert( pPager->exclusiveMode || 0==sqlite3WalHeapMemory(pPager->pWal) );
  if( eMode>=0 && !pPager->tempFile && !sqlite3WalHeapMemory(pPager->pWal) ){
    pPager->exclusiveMode = (u8)eMode;
  }
  return (int)pPager->exclusiveMode;
}

// Assembly:
testl %esi, %esi
js 0x5603b
cmpb $0x0, 0x10(%rdi)
jne 0x5603b
pushq %rbp
movq %rsp, %rbp
movq 0x118(%rdi), %rax
testq %rax, %rax
je 0x56036
cmpb $0x2, 0x3f(%rax)
je 0x5603a
movb %sil, 0x8(%rdi)
popq %rbp
movzbl 0x8(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: invalidateTempStorage
static int invalidateTempStorage(Parse *pParse){
  sqlite3 *db = pParse->db;
  if( db->aDb[1].pBt!=0 ){
    if( !db->autoCommit || sqlite3BtreeIsInReadTrans(db->aDb[1].pBt) ){
      sqlite3ErrorMsg(pParse, "temporary storage cannot be changed "
        "from within a transaction");
      return SQLITE_ERROR;
    }
    sqlite3BtreeClose(db->aDb[1].pBt);
    db->aDb[1].pBt = 0;
    sqlite3ResetAllSchemasOfConnection(db);
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %r14
movq 0x20(%r14), %rax
movq 0x28(%rax), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x56092
cmpb $0x0, 0x4e(%r14)
je 0x56066
cmpb $0x0, 0x10(%rax)
je 0x56079
leaq 0x182cd(%rip), %rsi     # 0x6e33a
xorl %eax, %eax
callq 0x104d6
pushq $0x1
popq %rbx
jmp 0x56092
movq %rax, %rdi
callq 0x20ae6
movq 0x20(%r14), %rax
andq $0x0, 0x28(%rax)
movq %r14, %rdi
callq 0xd023
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: getSafetyLevel
static u8 getSafetyLevel(const char *z, int omitFull, int dflt){
                             /* 123456789 123456789 */
  static const char zText[] = "onoffalseyestruefull";
  static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16};
  static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4};
  static const u8 iValue[] =  {1, 0, 0, 0, 1, 1, 2};
  int i, n;
  if( sqlite3Isdigit(*z) ){
    return (u8)sqlite3Atoi(z);
  }
  n = sqlite3Strlen30(z);
  for(i=0; i<ArraySize(iLength)-omitFull; i++){
    if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){
      return iValue[i];
    }
  }
  return dflt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movzbl (%rdi), %eax
addq $-0x3a, %rax
cmpq $-0xa, %rax
jae 0x56112
movl %esi, %r12d
movl %edx, -0x2c(%rbp)
movq %r14, %rdi
callq 0x8f8e
movl %eax, %r15d
pushq $0x7
popq %r13
subl %r12d, %r13d
xorl %r12d, %r12d
leaq 0x148f3(%rip), %rbx     # 0x6a9cc
cmpq %r12, %r13
je 0x5611c
movzbl (%r12,%rbx), %eax
cmpl %eax, %r15d
jne 0x5610d
leaq 0x148d6(%rip), %rax     # 0x6a9c5
movzbl (%r12,%rax), %edi
leaq 0x148b5(%rip), %rax     # 0x6a9b0
addq %rax, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x8f45
testl %eax, %eax
je 0x56121
incq %r12
jmp 0x560d9
movq %r14, %rdi
callq 0x2ecd6
jmp 0x5612c
movl -0x2c(%rbp), %eax
jmp 0x5612c
leaq 0x148ab(%rip), %rax     # 0x6a9d3
movb (%r12,%rax), %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: setAllPagerFlags
static void setAllPagerFlags(sqlite3 *db){
  if( db->autoCommit ){
    Db *pDb = db->aDb;
    int n = db->nDb;
    assert( SQLITE_FullFSync==PAGER_FULLFSYNC );
    assert( SQLITE_CkptFullFSync==PAGER_CKPT_FULLFSYNC );
    assert( SQLITE_CacheSpill==PAGER_CACHESPILL );
    assert( (PAGER_FULLFSYNC | PAGER_CKPT_FULLFSYNC | PAGER_CACHESPILL)
             ==  PAGER_FLAGS_MASK );
    assert( (pDb->safety_level & PAGER_SYNCHRONOUS_MASK)==pDb->safety_level );
    while( (n--) > 0 ){
      if( pDb->pBt ){
        sqlite3BtreeSetPagerFlags(pDb->pBt,
                 pDb->safety_level | (db->flags & PAGER_FLAGS_MASK) );
      }
      pDb++;
    }
  }
}

// Assembly:
cmpb $0x0, 0x4e(%rdi)
je 0x5618c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
movl 0x28(%rdi), %r15d
addq $0x10, %r14
testl %r15d, %r15d
jle 0x56182
movq -0x8(%r14), %rdi
testq %rdi, %rdi
je 0x56179
movzbl (%r14), %eax
movl 0x2c(%rbx), %esi
andl $0x1c, %esi
orl %eax, %esi
callq 0x561b8
addq $0x20, %r14
decl %r15d
jmp 0x5615a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeSetPagerFlags
SQLITE_PRIVATE int sqlite3BtreeSetPagerFlags(
  Btree *p,              /* The btree to set the safety level on */
  unsigned pgFlags       /* Various PAGER_* flags */
){
  BtShared *pBt = p->pBt;
  assert( sqlite3_mutex_held(p->db->mutex) );
  sqlite3BtreeEnter(p);
  sqlite3PagerSetFlags(pBt->pPager, pgFlags);
  sqlite3BtreeLeave(p);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rax, 0x8(%rcx)
movq (%rcx), %rax
movl %esi, %ecx
andl $0x3, %ecx
cmpl $0x1, %ecx
jne 0x561de
movw $0x1, 0xb(%rax)
xorl %ecx, %ecx
jmp 0x561fc
cmpl $0x3, %ecx
sete %dl
movb 0x10(%rax), %dil
testb %dil, %dil
sete %cl
andb %dl, %cl
testb %dil, %dil
setne 0xb(%rax)
movb %cl, 0xc(%rax)
je 0x5622a
xorl %edx, %edx
movb %dl, 0xf(%rax)
movb %dl, 0xd(%rax)
leal 0x20(%rdx), %edi
testb %cl, %cl
movzbl %dl, %ecx
movzbl %dil, %edx
cmovel %ecx, %edx
movb %dl, 0xe(%rax)
testb $0x10, %sil
sete %cl
movb 0x17(%rax), %dl
andb $-0x2, %dl
orb %cl, %dl
movb %dl, 0x17(%rax)
popq %rbp
retq
testb $0x4, %sil
jne 0x56240
movb $0x2, 0xf(%rax)
testb $0x8, %sil
jne 0x56244
movb $0x2, 0xd(%rax)
jmp 0x56248
movb $0x3, %dl
jmp 0x561fe
movb $0x3, 0xd(%rax)
movb $0x2, %dl
jmp 0x56204
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: likeFunc
static void likeFunc(
  sqlite3_context *context, 
  int argc, 
  sqlite3_value **argv
){
  const unsigned char *zA, *zB;
  u32 escape = 0;
  int nPat;
  sqlite3 *db = sqlite3_context_db_handle(context);

  zB = sqlite3_value_text(argv[0]);
  zA = sqlite3_value_text(argv[1]);

  /* Limit the length of the LIKE or GLOB pattern to avoid problems
  ** of deep recursion and N*N behavior in patternCompare().
  */
  nPat = sqlite3_value_bytes(argv[0]);
  testcase( nPat==db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] );
  testcase( nPat==db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]+1 );
  if( nPat > db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] ){
    sqlite3_result_error(context, "LIKE or GLOB pattern too complex", -1);
    return;
  }
  assert( zB==sqlite3_value_text(argv[0]) );  /* Encoding did not change */

  if( argc==3 ){
    /* The escape character string must consist of a single UTF-8 character.
    ** Otherwise, return an error.
    */
    const unsigned char *zEsc = sqlite3_value_text(argv[2]);
    if( zEsc==0 ) return;
    if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){
      sqlite3_result_error(context, 
          "ESCAPE expression must be a single character", -1);
      return;
    }
    escape = sqlite3Utf8Read(&zEsc);
  }
  if( zA && zB ){
    struct compareInfo *pInfo = sqlite3_user_data(context);
#ifdef SQLITE_TEST
    sqlite3_like_count++;
#endif
    
    sqlite3_result_int(context, patternCompare(zB, zA, pInfo, escape));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq (%rdx), %rdi
callq 0xdf1e
movq %rax, -0x30(%rbp)
movq 0x8(%r12), %rdi
callq 0xdf1e
movq %rax, %r15
movq (%r12), %rdi
callq 0xdf2d
cmpl 0x88(%r14), %eax
jle 0x562b5
leaq 0x18224(%rip), %rsi     # 0x6e4c0
pushq $-0x1
popq %rdx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe1ae
xorl %ecx, %ecx
cmpl $0x3, %r13d
jne 0x562eb
movq 0x10(%r12), %rdi
callq 0xdf1e
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x5633b
pushq $-0x1
popq %rsi
movq %rax, %rdi
callq 0x31e38
cmpl $0x1, %eax
jne 0x56329
leaq -0x38(%rbp), %rdi
callq 0x318c9
movl %eax, %ecx
testq %r15, %r15
setne %al
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x5633b
movq (%rbx), %rax
movq 0x8(%rax), %rdx
movq %r15, %rsi
callq 0x110c7
movq %rbx, %rdi
movl %eax, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe3f1
leaq 0x181b1(%rip), %rsi     # 0x6e4e1
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0xe1ae
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: setLikeOptFlag
static void setLikeOptFlag(sqlite3 *db, const char *zName, u8 flagVal){
  FuncDef *pDef;
  pDef = sqlite3FindFunction(db, zName, sqlite3Strlen30(zName),
                             2, SQLITE_UTF8, 0);
  if( ALWAYS(pDef) ){
    pDef->flags = flagVal;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x8f8e
pushq $0x2
popq %rcx
pushq $0x1
popq %r8
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %r9d, %r9d
callq 0x13a4e
testq %rax, %rax
je 0x56383
movb %bl, 0x3(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: triggerStepAllocate
static TriggerStep *triggerStepAllocate(
  sqlite3 *db,                /* Database connection */
  u8 op,                      /* Trigger opcode */
  Token *pName                /* The target name */
){
  TriggerStep *pTriggerStep;

  pTriggerStep = sqlite3DbMallocZero(db, sizeof(TriggerStep) + pName->n);
  if( pTriggerStep ){
    char *z = (char*)&pTriggerStep[1];
    memcpy(z, pName->z, pName->n);
    pTriggerStep->target.z = z;
    pTriggerStep->target.n = pName->n;
    pTriggerStep->op = op;
  }
  return pTriggerStep;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movl 0x8(%rdx), %esi
addl $0x50, %esi
callq 0xf4ae
movq %rax, %r15
testq %rax, %rax
je 0x563d6
movq %r15, %r12
addq $0x50, %r12
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %r12, %rdi
callq 0x82c0
movq %r12, 0x18(%r15)
movl 0x8(%r14), %eax
movl %eax, 0x20(%r15)
movb %bl, (%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SchemaGet
SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){
  Schema * p;
  if( pBt ){
    p = (Schema *)sqlite3BtreeSchema(pBt, sizeof(Schema), sqlite3SchemaClear);
  }else{
    p = (Schema *)sqlite3DbMallocZero(0, sizeof(Schema));
  }
  if( !p ){
    db->mallocFailed = 1;
  }else if ( 0==p->file_format ){
    sqlite3HashInit(&p->tblHash);
    sqlite3HashInit(&p->idxHash);
    sqlite3HashInit(&p->trigHash);
    sqlite3HashInit(&p->fkeyHash);
    p->enc = SQLITE_UTF8;
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x56ec7
movq (%rsi), %rax
movq 0x8(%rsi), %r14
movq %rax, 0x8(%r14)
movq 0x40(%r14), %rax
testq %rax, %rax
jne 0x56ed6
pushq $0x78
popq %rsi
xorl %edi, %edi
callq 0xf4ae
movq %rax, 0x40(%r14)
leaq -0x2b0f2(%rip), %rcx    # 0x2bdcf
movq %rcx, 0x48(%r14)
jmp 0x56ed1
pushq $0x78
popq %rsi
xorl %edi, %edi
callq 0xf4ae
testq %rax, %rax
je 0x56efd
cmpb $0x0, 0x70(%rax)
jne 0x56f03
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rax)
movups %xmm0, 0x48(%rax)
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movb $0x1, 0x71(%rax)
jmp 0x56f03
movb $0x1, 0x50(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: resolveAttachExpr
static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
{
  int rc = SQLITE_OK;
  if( pExpr ){
    if( pExpr->op!=TK_ID ){
      rc = sqlite3ResolveExprNames(pName, pExpr);
      if( rc==SQLITE_OK && !sqlite3ExprIsConstant(pExpr) ){
        sqlite3ErrorMsg(pName->pParse, "invalid name: \"%s\"", pExpr->u.zToken);
        return SQLITE_ERROR;
      }
    }else{
      pExpr->op = TK_STRING;
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x56f4c
movq %rsi, %r14
cmpb $0x1a, (%rsi)
jne 0x56f28
movb $0x5e, (%r14)
jmp 0x56f4c
movq %rdi, %r15
movq %r14, %rsi
callq 0x42880
pushq $0x1
popq %r12
testl %eax, %eax
je 0x56f40
movl %r12d, %ebx
jmp 0x56f4c
movq %r14, %rdi
callq 0x49607
testl %eax, %eax
je 0x56f57
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rdi
movq 0x8(%r14), %rdx
leaq 0x1784d(%rip), %rsi     # 0x6e7b2
xorl %eax, %eax
callq 0x104d6
jmp 0x56f3b
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: detachFunc
static void detachFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  const char *zName = (const char *)sqlite3_value_text(argv[0]);
  sqlite3 *db = sqlite3_context_db_handle(context);
  int i;
  Db *pDb = 0;
  char zErr[128];

  UNUSED_PARAMETER(NotUsed);

  if( zName==0 ) zName = "";
  for(i=0; i<db->nDb; i++){
    pDb = &db->aDb[i];
    if( pDb->pBt==0 ) continue;
    if( sqlite3StrICmp(pDb->zName, zName)==0 ) break;
  }

  if( i>=db->nDb ){
    sqlite3_snprintf(sizeof(zErr),zErr, "no such database: %s", zName);
    goto detach_error;
  }
  if( i<2 ){
    sqlite3_snprintf(sizeof(zErr),zErr, "cannot detach database %s", zName);
    goto detach_error;
  }
  if( !db->autoCommit ){
    sqlite3_snprintf(sizeof(zErr), zErr,
                     "cannot DETACH database within transaction");
    goto detach_error;
  }
  if( sqlite3BtreeIsInReadTrans(pDb->pBt) || sqlite3BtreeIsInBackup(pDb->pBt) ){
    sqlite3_snprintf(sizeof(zErr),zErr, "database %s is locked", zName);
    goto detach_error;
  }

  sqlite3BtreeClose(pDb->pBt);
  pDb->pBt = 0;
  pDb->pSchema = 0;
  sqlite3ResetAllSchemasOfConnection(db);
  return;

detach_error:
  sqlite3_result_error(context, zErr, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movq (%rdx), %rdi
callq 0xdf1e
movq %rbx, -0x40(%rbp)
movq 0x8(%rbx), %rdx
testq %rax, %rax
leaq 0x193a6(%rip), %rcx     # 0x70345
cmovneq %rax, %rcx
movq %rcx, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movl 0x28(%rdx), %ebx
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x56feb
movq -0x38(%rbp), %rax
movq 0x20(%rax), %r14
movq 0x8(%r14,%r13), %r12
testq %r12, %r12
je 0x56fe2
movq (%r14,%r13), %rdi
movq -0x30(%rbp), %rsi
callq 0xb1bf
testl %eax, %eax
je 0x56ff4
incq %r15
addq $0x20, %r13
jmp 0x56fba
leaq 0x177e1(%rip), %rdx     # 0x6e7d3
jmp 0x57024
cmpq $0x1, %r15
ja 0x57003
leaq 0x177e7(%rip), %rdx     # 0x6e7e8
jmp 0x57024
movq -0x38(%rbp), %rax
cmpb $0x0, 0x4e(%rax)
je 0x57060
cmpb $0x0, 0x10(%r12)
jne 0x5701d
cmpl $0x0, 0x18(%r12)
je 0x5707c
leaq 0x17808(%rip), %rdx     # 0x6e82c
leaq -0xc0(%rbp), %rsi
movl $0x80, %edi
movq -0x30(%rbp), %rcx
xorl %eax, %eax
callq 0xaf26
leaq -0xc0(%rbp), %rsi
pushq $-0x1
popq %rdx
movq -0x40(%rbp), %rdi
callq 0xe1ae
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1779b(%rip), %rdx     # 0x6e802
leaq -0xc0(%rbp), %rsi
movl $0x80, %edi
xorl %eax, %eax
callq 0xaf26
jmp 0x5703b
movq %r12, %rdi
callq 0x20ae6
andq $0x0, 0x8(%r14,%r13)
andq $0x0, 0x18(%r14,%r13)
movq -0x38(%rbp), %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd023
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: reindexDatabases
static void reindexDatabases(Parse *pParse, char const *zColl){
  Db *pDb;                    /* A single database */
  int iDb;                    /* The database index number */
  sqlite3 *db = pParse->db;   /* The database connection */
  HashElem *k;                /* For looping over tables in pDb */
  Table *pTab;                /* A table in the database */

  assert( sqlite3BtreeHoldsAllMutexes(db) );  /* Needed for schema access */
  for(iDb=0, pDb=db->aDb; iDb<db->nDb; iDb++, pDb++){
    assert( pDb!=0 );
    for(k=sqliteHashFirst(&pDb->pSchema->tblHash);  k; k=sqliteHashNext(k)){
      pTab = (Table*)sqliteHashData(k);
      reindexTable(pParse, pTab, zColl);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq %rax, -0x30(%rbp)
movq 0x20(%rax), %r12
xorl %r13d, %r13d
movq -0x30(%rbp), %rax
cmpl 0x28(%rax), %r13d
jge 0x57101
movq 0x18(%r12), %r15
addq $0x10, %r15
movq (%r15), %r15
testq %r15, %r15
je 0x570f8
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x57110
jmp 0x570df
incl %r13d
addq $0x20, %r12
jmp 0x570cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: reindexTable
static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
  Index *pIndex;              /* An index associated with pTab */

  for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
    if( zColl==0 || collationMatch(zColl, pIndex) ){
      int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
      sqlite3BeginWriteOperation(pParse, 0, iDb);
      sqlite3RefillIndex(pParse, pIndex, -1);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r15
movq %rsi, -0x30(%rbp)
leaq 0x10(%rsi), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x57190
testq %rbx, %rbx
je 0x57160
movzwl 0x54(%r12), %r13d
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x5718a
movq 0x40(%r12), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
callq 0xb1bf
incq %r14
testl %eax, %eax
jne 0x57143
movq (%r15), %rdi
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x1064e
movq %r15, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x423f5
movq %r15, %rdi
movq %r12, %rsi
pushq $-0x1
popq %rdx
callq 0x4727d
addq $0x28, %r12
jmp 0x5712c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: analyzeDatabase
static void analyzeDatabase(Parse *pParse, int iDb){
  sqlite3 *db = pParse->db;
  Schema *pSchema = db->aDb[iDb].pSchema;    /* Schema of database iDb */
  HashElem *k;
  int iStatCur;
  int iMem;

  sqlite3BeginWriteOperation(pParse, 0, iDb);
  iStatCur = pParse->nTab;
  pParse->nTab += 3;
  openStatTable(pParse, iDb, iStatCur, 0, 0);
  iMem = pParse->nMem+1;
  assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
  for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
    Table *pTab = (Table*)sqliteHashData(k);
    analyzeOneTable(pParse, pTab, 0, iStatCur, iMem);
  }
  loadAnalysis(pParse, iDb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x20(%rax), %rax
movslq %esi, %r12
movq %r12, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %r13
xorl %esi, %esi
movl %r12d, %edx
callq 0x423f5
movl 0x54(%r14), %r15d
leal 0x3(%r15), %eax
movl %eax, 0x54(%r14)
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x572ce
movl 0x58(%r14), %r12d
incl %r12d
addq $0x10, %r13
movq (%r13), %r13
testq %r13, %r13
je 0x5721b
movq 0x10(%r13), %rsi
movq %r14, %rdi
xorl %edx, %edx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x57419
jmp 0x571fc
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x57bb3
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: analyzeTable
static void analyzeTable(Parse *pParse, Table *pTab, Index *pOnlyIdx){
  int iDb;
  int iStatCur;

  assert( pTab!=0 );
  assert( sqlite3BtreeHoldsAllMutexes(pParse->db) );
  iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
  sqlite3BeginWriteOperation(pParse, 0, iDb);
  iStatCur = pParse->nTab;
  pParse->nTab += 3;
  if( pOnlyIdx ){
    openStatTable(pParse, iDb, iStatCur, pOnlyIdx->zName, "idx");
  }else{
    openStatTable(pParse, iDb, iStatCur, pTab->zName, "tbl");
  }
  analyzeOneTable(pParse, pTab, pOnlyIdx, iStatCur, pParse->nMem+1);
  loadAnalysis(pParse, iDb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x68(%rsi), %rsi
callq 0x1064e
movl %eax, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x423f5
movl 0x54(%rbx), %r13d
leal 0x3(%r13), %eax
movl %eax, 0x54(%rbx)
testq %r14, %r14
movq %r14, %rax
cmoveq %r15, %rax
leaq 0x1658d(%rip), %rcx     # 0x6d80e
leaq 0x16d44(%rip), %r8      # 0x6dfcc
cmoveq %rcx, %r8
movq (%rax), %rcx
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x572ce
movl 0x58(%rbx), %r8d
incl %r8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %r13d, %ecx
callq 0x57419
movq %rbx, %rdi
movl %r12d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x57bb3
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: isSystemTable
static int isSystemTable(Parse *pParse, const char *zName){
  if( sqlite3Strlen30(zName)>6 && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){
    sqlite3ErrorMsg(pParse, "table %s may not be altered", zName);
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x8f8e
xorl %r15d, %r15d
cmpl $0x7, %eax
jb 0x57c2d
leaq 0x15206(%rip), %rsi     # 0x6ce0c
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x8f45
testl %eax, %eax
jne 0x57c2d
leaq 0x16f2d(%rip), %rsi     # 0x6eb49
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x104d6
pushq $0x1
popq %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: whereTempTriggers
static char *whereTempTriggers(Parse *pParse, Table *pTab){
  Trigger *pTrig;
  char *zWhere = 0;
  const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */

  /* If the table is not located in the temp-db (in which case NULL is 
  ** returned, loop through the tables list of triggers. For each trigger
  ** that is not part of the temp-db schema, add a clause to the WHERE 
  ** expression being built up in zWhere.
  */
  if( pTab->pSchema!=pTempSchema ){
    sqlite3 *db = pParse->db;
    for(pTrig=sqlite3TriggerList(pParse, pTab); pTrig; pTrig=pTrig->pNext){
      if( pTrig->pSchema==pTempSchema ){
        zWhere = whereOrName(db, zWhere, pTrig->zName);
      }
    }
  }
  if( zWhere ){
    char *zNew = sqlite3MPrintf(pParse->db, "type='trigger' AND (%s)", zWhere);
    sqlite3DbFree(pParse->db, zWhere);
    zWhere = zNew;
  }
  return zWhere;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
movq 0x20(%r15), %rax
movq 0x38(%rax), %r13
cmpq %r13, 0x68(%rsi)
je 0x57cb9
movq %rdi, %rbx
callq 0x4a45f
movq %rax, %r12
xorl %r14d, %r14d
testq %r12, %r12
je 0x57c8d
cmpq %r13, 0x28(%r12)
jne 0x57c86
movq (%r12), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x57dce
movq %rax, %r14
movq 0x40(%r12), %r12
jmp 0x57c68
testq %r14, %r14
je 0x57cb9
movq (%rbx), %rdi
leaq 0x16ed7(%rip), %rsi     # 0x6eb73
movq %r14, %rdx
xorl %eax, %eax
callq 0x10594
movq %rax, %r15
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x968b
movq %r15, %rax
jmp 0x57cbb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: reloadTableSchema
static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
  Vdbe *v;
  char *zWhere;
  int iDb;                   /* Index of database containing pTab */
#ifndef SQLITE_OMIT_TRIGGER
  Trigger *pTrig;
#endif

  v = sqlite3GetVdbe(pParse);
  if( NEVER(v==0) ) return;
  assert( sqlite3BtreeHoldsAllMutexes(pParse->db) );
  iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
  assert( iDb>=0 );

#ifndef SQLITE_OMIT_TRIGGER
  /* Drop any table triggers from the internal schema. */
  for(pTrig=sqlite3TriggerList(pParse, pTab); pTrig; pTrig=pTrig->pNext){
    int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
    assert( iTrigDb==iDb || iTrigDb==1 );
    sqlite3VdbeAddOp4(v, OP_DropTrigger, iTrigDb, 0, 0, pTrig->zName, 0);
  }
#endif

  /* Drop the table and index from the internal schema.  */
  sqlite3VdbeAddOp4(v, OP_DropTable, iDb, 0, 0, pTab->zName, 0);

  /* Reload the table, index and permanent trigger schemas. */
  zWhere = sqlite3MPrintf(pParse->db, "tbl_name=%Q", zName);
  if( !zWhere ) return;
  sqlite3VdbeAddParseSchemaOp(v, iDb, zWhere);

#ifndef SQLITE_OMIT_TRIGGER
  /* Now, if the table is not stored in the temp database, reload any temp 
  ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. 
  */
  if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){
    sqlite3VdbeAddParseSchemaOp(v, 1, zWhere);
  }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
callq 0x41ef4
testq %rax, %rax
je 0x57dbf
movq %rax, %rbx
movq %r12, -0x38(%rbp)
movq (%r15), %rdi
movq 0x68(%r14), %rsi
callq 0x1064e
movl %eax, -0x2c(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4a45f
movq %rax, %r12
pushq $0x74
popq %r13
testq %r12, %r12
je 0x57d4d
movq (%r15), %rdi
movq 0x28(%r12), %rsi
callq 0x1064e
movq (%r12), %r9
andl $0x0, (%rsp)
movq %rbx, %rdi
movl %r13d, %esi
movl %eax, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x41fd2
movq 0x40(%r12), %r12
jmp 0x57d1a
movq (%r14), %r9
andl $0x0, (%rsp)
pushq $0x72
popq %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %r12d
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x41fd2
movq (%r15), %rdi
leaq 0x16e16(%rip), %rsi     # 0x6eb8b
movq -0x38(%rbp), %rdx
xorl %eax, %eax
callq 0x10594
testq %rax, %rax
je 0x57dbf
movq %rbx, %rdi
movl %r12d, %esi
movq %rax, %rdx
callq 0x42823
movq %r15, %rdi
movq %r14, %rsi
callq 0x57c3b
testq %rax, %rax
je 0x57dbf
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42823
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: whereOrName
static char *whereOrName(sqlite3 *db, char *zWhere, char *zConstant){
  char *zNew;
  if( !zWhere ){
    zNew = sqlite3MPrintf(db, "name=%Q", zConstant);
  }else{
    zNew = sqlite3MPrintf(db, "%s OR name=%Q", zWhere, zConstant);
    sqlite3DbFree(db, zWhere);
  }
  return zNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rcx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x57e16
movq %rsi, %r14
leaq 0x16d78(%rip), %rsi     # 0x6eb65
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10594
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x968b
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15a46(%rip), %rsi     # 0x6d863
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10594
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: addArgumentToVtab
static void addArgumentToVtab(Parse *pParse){
  if( pParse->sArg.z && pParse->pNewTable ){
    const char *z = (const char*)pParse->sArg.z;
    int n = pParse->sArg.n;
    sqlite3 *db = pParse->db;
    addModuleArgument(db, pParse->pNewTable, sqlite3DbStrNDup(db, z, n));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x270(%rdi), %rsi
testq %rsi, %rsi
je 0x57e73
movq 0x238(%rdi), %rbx
testq %rbx, %rbx
je 0x57e73
movl 0x278(%rdi), %edx
movq (%rdi), %r14
movq %r14, %rdi
callq 0x310c8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x57e78
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: addModuleArgument
static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
  int i = pTable->nModuleArg++;
  int nBytes = sizeof(char *)*(1+pTable->nModuleArg);
  char **azModuleArg;
  azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
  if( azModuleArg==0 ){
    int j;
    for(j=0; j<i; j++){
      sqlite3DbFree(db, pTable->azModuleArg[j]);
    }
    sqlite3DbFree(db, zArg);
    sqlite3DbFree(db, pTable->azModuleArg);
    pTable->nModuleArg = 0;
  }else{
    azModuleArg[i] = zArg;
    azModuleArg[i+1] = 0;
  }
  pTable->azModuleArg = azModuleArg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x4c(%rsi), %r13
leal 0x1(%r13), %eax
movl %eax, 0x4c(%rsi)
leal 0x10(,%r13,8), %edx
movq 0x50(%rsi), %rsi
callq 0x157c3
testq %rax, %rax
je 0x57ebf
movq %r15, (%rax,%r13,8)
andq $0x0, 0x8(%rax,%r13,8)
jmp 0x57f11
movq %rax, -0x30(%rbp)
movq %r15, -0x38(%rbp)
xorl %r15d, %r15d
testl %r13d, %r13d
movl $0x0, %r12d
cmovgl %r13d, %r12d
cmpq %r15, %r12
je 0x57ef1
movq 0x50(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x968b
incq %r15
jmp 0x57ed7
movq %r14, %rdi
movq -0x38(%rbp), %rsi
callq 0x968b
movq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0x968b
andl $0x0, 0x4c(%rbx)
movq -0x30(%rbp), %rax
movq %rax, 0x50(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: minmaxFunc
static void minmaxFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int i;
  int mask;    /* 0 for min() or 0xffffffff for max() */
  int iBest;
  CollSeq *pColl;

  assert( argc>1 );
  mask = sqlite3_user_data(context)==0 ? 0 : -1;
  pColl = sqlite3GetFuncCollSeq(context);
  assert( pColl );
  assert( mask==-1 || mask==0 );
  iBest = 0;
  if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
  for(i=1; i<argc; i++){
    if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return;
    if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){
      testcase( mask==0 );
      iBest = i;
    }
  }
  sqlite3_result_value(context, argv[iBest]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, -0x30(%rbp)
movq (%rdi), %rax
xorl %r15d, %r15d
cmpq 0x8(%rax), %r15
movl $0x0, %r13d
sbbl %r13d, %r13d
movq (%rdx), %rax
cmpb $0x5, 0x26(%rax)
jne 0x5818a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x38(%rbp)
movslq %esi, %rbx
pushq $0x1
popq %r12
movslq %r15d, %rax
cmpq %rbx, %r12
jge 0x581cc
movq (%r14,%r12,8), %rsi
cmpb $0x5, 0x26(%rsi)
je 0x5817b
movq (%r14,%rax,8), %rdi
movq -0x38(%rbp), %rdx
callq 0x29b5f
xorl %r13d, %eax
js 0x581c7
movl %r12d, %r15d
incq %r12
jmp 0x581a0
movq (%r14,%rax,8), %rsi
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe4e0
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: minmaxStep
static void minmaxStep(
  sqlite3_context *context, 
  int NotUsed, 
  sqlite3_value **argv
){
  Mem *pArg  = (Mem *)argv[0];
  Mem *pBest;
  UNUSED_PARAMETER(NotUsed);

  pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest));
  if( !pBest ) return;

  if( sqlite3_value_type(argv[0])==SQLITE_NULL ){
    if( pBest->flags ) sqlite3SkipAccumulatorLoad(context);
  }else if( pBest->flags ){
    int max;
    int cmp;
    CollSeq *pColl = sqlite3GetFuncCollSeq(context);
    /* This step function is used for both the min() and max() aggregates,
    ** the only difference between the two being that the sense of the
    ** comparison is inverted. For the max() aggregate, the
    ** sqlite3_user_data() function returns (void *)-1. For min() it
    ** returns (void *)db, where db is the sqlite3* database pointer.
    ** Therefore the next statement sets variable 'max' to 1 for the max()
    ** aggregate, or 0 for min().
    */
    max = sqlite3_user_data(context)!=0;
    cmp = sqlite3MemCompare(pBest, pArg, pColl);
    if( (max && cmp<0) || (!max && cmp>0) ){
      sqlite3VdbeMemCopy(pBest, pArg);
    }else{
      sqlite3SkipAccumulatorLoad(context);
    }
  }else{
    sqlite3VdbeMemCopy(pBest, pArg);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rdi, %rbx
movq (%rdx), %r14
pushq $0x38
popq %rsi
callq 0xf1e2
testq %rax, %rax
je 0x5825a
movq %rax, %r15
movq (%r12), %rax
cmpb $0x5, 0x26(%rax)
movzwl 0x24(%r15), %eax
jne 0x58225
testw %ax, %ax
jne 0x58256
jmp 0x5825a
testw %ax, %ax
je 0x58263
movq (%rbx), %rax
movq 0x48(%rbx), %rdx
movq 0x8(%rax), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x29b5f
xorl %ecx, %ecx
xorl %edx, %edx
testl %eax, %eax
setns %cl
setle %dl
testq %r12, %r12
cmovel %edx, %ecx
testb %cl, %cl
je 0x58263
movb $0x1, 0x60(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe4e0
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: minMaxFinalize
static void minMaxFinalize(sqlite3_context *context){
  sqlite3_value *pRes;
  pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0);
  if( pRes ){
    if( pRes->flags ){
      sqlite3_result_value(context, pRes);
    }
    sqlite3VdbeMemRelease(pRes);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0xf1e2
testq %rax, %rax
je 0x582b1
movq %rax, %r14
cmpw $0x0, 0x24(%rax)
je 0x582a5
addq $0x8, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe4e0
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xde44
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: typeofFunc
static void typeofFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  const char *z = 0;
  UNUSED_PARAMETER(NotUsed);
  switch( sqlite3_value_type(argv[0]) ){
    case SQLITE_INTEGER: z = "integer"; break;
    case SQLITE_TEXT:    z = "text";    break;
    case SQLITE_FLOAT:   z = "real";    break;
    case SQLITE_BLOB:    z = "blob";    break;
    default:             z = "null";    break;
  }
  sqlite3_result_text(context, z, -1, SQLITE_STATIC);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdx), %rax
movb 0x26(%rax), %al
decb %al
cmpb $0x3, %al
ja 0x582d9
movzbl %al, %eax
leaq 0x12fa0(%rip), %rcx     # 0x6b270
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x582e0
leaq 0x17f81(%rip), %rsi     # 0x70261
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
popq %rbp
jmp 0xe48d
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: lengthFunc
static void lengthFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int len;

  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  switch( sqlite3_value_type(argv[0]) ){
    case SQLITE_BLOB:
    case SQLITE_INTEGER:
    case SQLITE_FLOAT: {
      sqlite3_result_int(context, sqlite3_value_bytes(argv[0]));
      break;
    }
    case SQLITE_TEXT: {
      const unsigned char *z = sqlite3_value_text(argv[0]);
      if( z==0 ) return;
      len = 0;
      while( *z ){
        len++;
        SQLITE_SKIP_UTF8(z);
      }
      sqlite3_result_int(context, len);
      break;
    }
    default: {
      sqlite3_result_null(context);
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdx), %rdi
movzbl 0x26(%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x5830f
cmpl $0x3, %eax
je 0x58324
cmpl $0x4, %eax
jne 0x58354
callq 0xdf2d
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe3f1
callq 0xdf1e
testq %rax, %rax
je 0x5836b
xorl %esi, %esi
movb (%rax), %dl
testb %dl, %dl
je 0x58366
movq %rax, %rcx
incl %esi
incq %rax
cmpb $-0x40, %dl
jb 0x58330
movb 0x1(%rcx), %al
incq %rcx
andb $-0x40, %al
negb %al
jo 0x58343
movq %rcx, %rax
jmp 0x58330
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe43c
movq %rbx, %rdi
jmp 0x58319
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: instrFunc
static void instrFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  const unsigned char *zHaystack;
  const unsigned char *zNeedle;
  int nHaystack;
  int nNeedle;
  int typeHaystack, typeNeedle;
  int N = 1;
  int isText;

  UNUSED_PARAMETER(argc);
  typeHaystack = sqlite3_value_type(argv[0]);
  typeNeedle = sqlite3_value_type(argv[1]);
  if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return;
  nHaystack = sqlite3_value_bytes(argv[0]);
  nNeedle = sqlite3_value_bytes(argv[1]);
  if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){
    zHaystack = sqlite3_value_blob(argv[0]);
    zNeedle = sqlite3_value_blob(argv[1]);
    isText = 0;
  }else{
    zHaystack = sqlite3_value_text(argv[0]);
    zNeedle = sqlite3_value_text(argv[1]);
    isText = 1;
  }
  while( nNeedle<=nHaystack && memcmp(zHaystack, zNeedle, nNeedle)!=0 ){
    N++;
    do{
      nHaystack--;
      zHaystack++;
    }while( isText && (zHaystack[0]&0xc0)==0x80 );
  }
  if( nNeedle>nHaystack ) N = 0;
  sqlite3_result_int(context, N);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %rdx
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movb 0x26(%rdi), %r15b
movb 0x26(%rax), %r12b
cmpb $0x5, %r15b
sete %al
cmpb $0x5, %r12b
sete %cl
orb %al, %cl
je 0x583b9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, -0x40(%rbp)
callq 0xdf2d
movl %eax, %r14d
movq 0x8(%rbx), %rdi
callq 0xdf2d
movl %eax, -0x2c(%rbp)
xorb $0x4, %r15b
xorb $0x4, %r12b
orb %r15b, %r12b
sete %r13b
movq (%rbx), %rdi
jne 0x583f8
callq 0xde7e
movq %rax, %r12
movq 0x8(%rbx), %rdi
callq 0xde7e
jmp 0x58409
callq 0xdf1e
movq %rax, %r12
movq 0x8(%rbx), %rdi
callq 0xdf1e
movq %rax, -0x38(%rbp)
movslq -0x2c(%rbp), %r15
pushq $0x1
popq %rbx
cmpl %r14d, -0x2c(%rbp)
jg 0x5845c
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x83e0
testl %eax, %eax
je 0x5845e
incl %ebx
decl %r14d
incq %r12
movq %r12, %rax
movl %r14d, %ecx
movl %ecx, %r14d
movq %rax, %r12
testb %r13b, %r13b
jne 0x58414
movb (%r12), %dl
andb $-0x40, %dl
leal -0x1(%r14), %ecx
leaq 0x1(%r12), %rax
negb %dl
jo 0x5843b
jmp 0x58414
xorl %ebx, %ebx
movq -0x40(%rbp), %rdi
movl %ebx, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe3f1
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: charFunc
static void charFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  unsigned char *z, *zOut;
  int i;
  zOut = z = sqlite3_malloc( argc*4 );
  if( z==0 ){
    sqlite3_result_error_nomem(context);
    return;
  }
  for(i=0; i<argc; i++){
    sqlite3_int64 x;
    unsigned c;
    x = sqlite3_value_int64(argv[i]);
    if( x<0 || x>0x10ffff ) x = 0xfffd;
    c = (unsigned)(x & 0x1fffff);
    if( c<0x00080 ){
      *zOut++ = (u8)(c&0xFF);
    }else if( c<0x00800 ){
      *zOut++ = 0xC0 + (u8)((c>>6)&0x1F);
      *zOut++ = 0x80 + (u8)(c & 0x3F);
    }else if( c<0x10000 ){
      *zOut++ = 0xE0 + (u8)((c>>12)&0x0F);
      *zOut++ = 0x80 + (u8)((c>>6) & 0x3F);
      *zOut++ = 0x80 + (u8)(c & 0x3F);
    }else{
      *zOut++ = 0xF0 + (u8)((c>>18) & 0x07);
      *zOut++ = 0x80 + (u8)((c>>12) & 0x3F);
      *zOut++ = 0x80 + (u8)((c>>6) & 0x3F);
      *zOut++ = 0x80 + (u8)(c & 0x3F);
    }                                                    \
  }
  sqlite3_result_text(context, (char*)z, (int)(zOut-z), sqlite3_free);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
leal (,%r15,4), %edi
callq 0x9c1c
testq %rax, %rax
je 0x587f2
movq %rbx, -0x38(%rbp)
xorl %ebx, %ebx
testl %r15d, %r15d
cmovlel %ebx, %r15d
movl $0xfffd, %r12d          # imm = 0xFFFD
movq %rax, -0x30(%rbp)
movq %rax, %r13
cmpq %rbx, %r15
je 0x587ca
movq (%r14,%rbx,8), %rdi
callq 0xdfe0
movl %eax, %ecx
andl $0x1fffff, %ecx         # imm = 0x1FFFFF
cmpq $0x110000, %rax         # imm = 0x110000
cmovael %r12d, %ecx
cmpl $0x7f, %ecx
ja 0x58740
movb %cl, (%r13)
incq %r13
jmp 0x587c2
movl %ecx, %eax
cmpl $0x7ff, %ecx            # imm = 0x7FF
ja 0x58763
shrl $0x6, %eax
orb $-0x40, %al
movb %al, (%r13)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%r13)
addq $0x2, %r13
jmp 0x587c2
cmpl $0xffff, %ecx           # imm = 0xFFFF
ja 0x58791
shrl $0xc, %eax
orb $-0x20, %al
movb %al, (%r13)
movl %ecx, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%r13)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x2(%r13)
addq $0x3, %r13
jmp 0x587c2
shrl $0x12, %eax
orb $-0x10, %al
movb %al, (%r13)
movl %ecx, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%r13)
movl %ecx, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%r13)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x3(%r13)
addq $0x4, %r13
incq %rbx
jmp 0x5870b
movq -0x30(%rbp), %rsi
subl %esi, %r13d
leaq -0x4eb5d(%rip), %rcx    # 0x9c7b
movq -0x38(%rbp), %rdi
movl %r13d, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe48d
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe631