// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_db_config
SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
  va_list ap;
  int rc;
  va_start(ap, op);
  switch( op ){
    case SQLITE_DBCONFIG_LOOKASIDE: {
      void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
      int sz = va_arg(ap, int);       /* IMP: R-47871-25994 */
      int cnt = va_arg(ap, int);      /* IMP: R-04460-53386 */
      rc = setupLookaside(db, pBuf, sz, cnt);
      break;
    }
    default: {
      static const struct {
        int op;      /* The opcode */
        u32 mask;    /* Mask of the bit in sqlite3.flags to set/clear */
      } aFlagOp[] = {
        { SQLITE_DBCONFIG_ENABLE_FKEY,    SQLITE_ForeignKeys    },
        { SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger  },
      };
      unsigned int i;
      rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
      for(i=0; i<ArraySize(aFlagOp); i++){
        if( aFlagOp[i].op==op ){
          int onoff = va_arg(ap, int);
          int *pRes = va_arg(ap, int*);
          int oldFlags = db->flags;
          if( onoff>0 ){
            db->flags |= aFlagOp[i].mask;
          }else if( onoff==0 ){
            db->flags &= ~aFlagOp[i].mask;
          }
          if( oldFlags!=db->flags ){
            sqlite3ExpirePreparedStatements(db);
          }
          if( pRes ){
            *pRes = (db->flags & aFlagOp[i].mask)!=0;
          }
          rc = SQLITE_OK;
          break;
        }
      }
      break;
    }
  }
  va_end(ap);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
leaq -0xd0(%rbp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x14a72
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r10, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x20(%rbp)
cmpl $0x3eb, %esi            # imm = 0x3EB
je 0x14b04
cmpl $0x3ea, %esi            # imm = 0x3EA
je 0x14afb
movl $0x1, %eax
cmpl $0x3e9, %esi            # imm = 0x3E9
jne 0x14bc5
movl -0x20(%rbp), %eax
cmpq $0x29, %rax
jae 0x14b95
movq -0x10(%rbp), %rcx
leal 0x8(%rax), %edx
movl %edx, -0x20(%rbp)
movq (%rcx,%rax), %rsi
cmpl $0x21, %eax
jae 0x14ba4
movq -0x10(%rbp), %rdx
movq %rax, %rcx
addq $0x10, %rcx
movl %ecx, -0x20(%rbp)
movl 0x8(%rdx,%rax), %edx
cmpl $0x18, %eax
ja 0x14bb2
addq -0x10(%rbp), %rcx
addl $0x18, %eax
movl %eax, -0x20(%rbp)
jmp 0x14bbe
leaq 0x648de(%rip), %rcx     # 0x793e0
jmp 0x14b0b
leaq 0x648dd(%rip), %rcx     # 0x793e8
movl -0x20(%rbp), %esi
cmpq $0x29, %rsi
jae 0x14b36
movq -0x10(%rbp), %rax
movq %rsi, %rdx
addq $0x8, %rdx
movl %edx, -0x20(%rbp)
movl (%rax,%rsi), %eax
cmpl $0x20, %esi
ja 0x14b44
addq -0x10(%rbp), %rdx
addl $0x10, %esi
movl %esi, -0x20(%rbp)
jmp 0x14b50
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rdx
movq %rdx, -0x18(%rbp)
movl (%rax), %eax
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, -0x18(%rbp)
movq (%rdx), %rdx
movl 0x2c(%rdi), %esi
testl %eax, %eax
jle 0x14b7c
movl 0x4(%rcx), %eax
orl %esi, %eax
movl %eax, 0x2c(%rdi)
cmpl %eax, %esi
je 0x14b7e
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14b7e
orb $0x20, 0x9a(%rax)
movq 0x68(%rax), %rax
jmp 0x14b6a
je 0x14bce
xorl %eax, %eax
testq %rdx, %rdx
je 0x14bc5
movl 0x4(%rcx), %ecx
xorl %esi, %esi
testl %ecx, 0x2c(%rdi)
setne %sil
movl %esi, (%rdx)
jmp 0x14bc5
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq (%rax), %rsi
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movl (%rax), %edx
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rax
movq %rax, -0x18(%rbp)
movl (%rcx), %ecx
callq 0x14bd7
addq $0xd0, %rsp
popq %rbp
retq
movl 0x4(%rcx), %eax
notl %eax
andl %esi, %eax
jmp 0x14b5f