// File: /workspace/github_c_makefile_star2_O1/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 0x14aa5
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 $0x3e9, %esi            # imm = 0x3E9
jne 0x14adf
movl -0x20(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x14b18
movq %rcx, %rax
addq -0x10(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x14b24
xorl %ecx, %ecx
leaq 0x648f8(%rip), %rdx     # 0x793e0
cmpl %esi, (%rdx,%rcx,8)
je 0x14b00
incq %rcx
cmpq $0x1, %rcx
je 0x14ae8
movl $0x1, %eax
jmp 0x14be3
movl -0x20(%rbp), %esi
cmpq $0x28, %rsi
ja 0x14b7a
movq %rsi, %rax
addq -0x10(%rbp), %rax
addl $0x8, %esi
movl %esi, -0x20(%rbp)
jmp 0x14b86
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq (%rax), %rsi
movl -0x20(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x14b3f
movq %rcx, %rax
addq -0x10(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x14b4b
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movl (%rax), %edx
movl -0x20(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x14b65
movq %rcx, %rax
addq -0x10(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x14b71
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movl (%rax), %ecx
callq 0x14c0d
jmp 0x14be3
movq -0x18(%rbp), %rax
leaq 0x8(%rax), %rsi
movq %rsi, -0x18(%rbp)
movl (%rax), %eax
movl -0x20(%rbp), %r8d
cmpq $0x28, %r8
ja 0x14ba3
movq %r8, %rsi
addq -0x10(%rbp), %rsi
addl $0x8, %r8d
movl %r8d, -0x20(%rbp)
jmp 0x14baf
movq -0x18(%rbp), %rsi
leaq 0x8(%rsi), %r8
movq %r8, -0x18(%rbp)
movq (%rsi), %rsi
movl 0x2c(%rdi), %r8d
testl %eax, %eax
jle 0x14bc6
movl 0x4(%rdx,%rcx,8), %eax
orl %r8d, %eax
movl %eax, 0x2c(%rdi)
jmp 0x14bc8
je 0x14c02
cmpl 0x2c(%rdi), %r8d
jne 0x14bec
xorl %eax, %eax
testq %rsi, %rsi
je 0x14be3
movl 0x4(%rdx,%rcx,8), %ecx
xorl %edx, %edx
testl %ecx, 0x2c(%rdi)
setne %dl
movl %edx, (%rsi)
addq $0xd0, %rsp
popq %rbp
retq
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14bce
orb $0x20, 0x9a(%rax)
movq 0x68(%rax), %rax
jmp 0x14bf0
movl 0x4(%rdx,%rcx,8), %eax
notl %eax
andl %r8d, %eax
jmp 0x14bc1