// File: /workspace/github_c_makefile_star2_O0/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 $0x190, %rsp            # imm = 0x190
testb %al, %al
je 0x17fa1
movaps %xmm0, -0xe0(%rbp)
movaps %xmm1, -0xd0(%rbp)
movaps %xmm2, -0xc0(%rbp)
movaps %xmm3, -0xb0(%rbp)
movaps %xmm4, -0xa0(%rbp)
movaps %xmm5, -0x90(%rbp)
movaps %xmm6, -0x80(%rbp)
movaps %xmm7, -0x70(%rbp)
movq %r9, -0xe8(%rbp)
movq %r8, -0xf0(%rbp)
movq %rcx, -0xf8(%rbp)
movq %rdx, -0x100(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x10, -0x30(%rbp)
movl -0xc(%rbp), %eax
subl $0x3e9, %eax            # imm = 0x3E9
jne 0x1813e
jmp 0x17ff5
leaq -0x30(%rbp), %rax
movq %rax, -0x120(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x114(%rbp)
cmpl $0x28, %eax
ja 0x18030
movq -0x120(%rbp), %rcx
movl -0x114(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x128(%rbp)
jmp 0x1804d
movq -0x120(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x138(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x12c(%rbp)
cmpl $0x28, %eax
ja 0x18096
movq -0x138(%rbp), %rcx
movl -0x12c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x140(%rbp)
jmp 0x180b3
movq -0x138(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x150(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x144(%rbp)
cmpl $0x28, %eax
ja 0x180fa
movq -0x150(%rbp), %rcx
movl -0x144(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x158(%rbp)
jmp 0x18117
movq -0x150(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
callq 0x18300
movl %eax, -0x34(%rbp)
jmp 0x182e8
movl $0x1, -0x34(%rbp)
movl $0x0, -0x4c(%rbp)
cmpl $0x2, -0x4c(%rbp)
jae 0x182e6
movl -0x4c(%rbp), %eax
movl %eax, %ecx
leaq 0x92b5e(%rip), %rax     # 0xaacc0
movl (%rax,%rcx,8), %eax
cmpl -0xc(%rbp), %eax
jne 0x182d6
leaq -0x30(%rbp), %rax
movq %rax, -0x168(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x15c(%rbp)
cmpl $0x28, %eax
ja 0x181a9
movq -0x168(%rbp), %rcx
movl -0x15c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x170(%rbp)
jmp 0x181c6
movq -0x168(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x50(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x180(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x174(%rbp)
cmpl $0x28, %eax
ja 0x1820d
movq -0x180(%rbp), %rcx
movl -0x174(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x188(%rbp)
jmp 0x1822a
movq -0x180(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x50(%rbp)
jle 0x18264
movl -0x4c(%rbp), %eax
movl %eax, %ecx
leaq 0x92a6c(%rip), %rax     # 0xaacc0
movl 0x4(%rax,%rcx,8), %ecx
movq -0x8(%rbp), %rax
orl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
jmp 0x18289
cmpl $0x0, -0x50(%rbp)
jne 0x18287
movl -0x4c(%rbp), %eax
movl %eax, %ecx
leaq 0x92a4a(%rip), %rax     # 0xaacc0
movl 0x4(%rax,%rcx,8), %ecx
xorl $-0x1, %ecx
movq -0x8(%rbp), %rax
andl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
jmp 0x18289
movl -0x5c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
je 0x1829e
movq -0x8(%rbp), %rdi
callq 0x14a20
cmpq $0x0, -0x58(%rbp)
je 0x182cd
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
leaq 0x92a08(%rip), %rcx     # 0xaacc0
andl 0x4(%rcx,%rdx,8), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x34(%rbp)
jmp 0x182e6
jmp 0x182d8
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1814c
jmp 0x182e8
movl -0x34(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw %cs:(%rax,%rax)