// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x13182
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %rdi, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x30(%rbp)
cmpl $0x3eb, %esi            # imm = 0x3EB
je 0x1320f
cmpl $0x3ea, %esi            # imm = 0x3EA
je 0x13206
cmpl $0x3e9, %esi            # imm = 0x3E9
jne 0x1327c
movl -0x30(%rbp), %eax
cmpq $0x29, %rax
jae 0x1329b
movq -0x20(%rbp), %rcx
leal 0x8(%rax), %edx
movl %edx, -0x30(%rbp)
movq (%rcx,%rax), %rsi
cmpl $0x21, %eax
jae 0x132aa
movq -0x20(%rbp), %rdx
movq %rax, %rcx
addq $0x10, %rcx
movl %ecx, -0x30(%rbp)
movl 0x8(%rdx,%rax), %edx
cmpl $0x18, %eax
ja 0x132b8
addq -0x20(%rbp), %rcx
addl $0x18, %eax
movl %eax, -0x30(%rbp)
jmp 0x132c4
leaq 0x581f3(%rip), %r14     # 0x6b400
jmp 0x13216
leaq 0x581f2(%rip), %r14     # 0x6b408
movl -0x30(%rbp), %edx
cmpq $0x29, %rdx
jae 0x13241
movq -0x20(%rbp), %rax
movq %rdx, %rcx
addq $0x8, %rcx
movl %ecx, -0x30(%rbp)
movl (%rax,%rdx), %eax
cmpl $0x20, %edx
ja 0x1324f
addq -0x20(%rbp), %rcx
addl $0x10, %edx
movl %edx, -0x30(%rbp)
jmp 0x1325b
movq -0x28(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movl (%rax), %eax
movq -0x28(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x28(%rbp)
movq (%rcx), %r15
movl 0x2c(%rbx), %ecx
testl %eax, %eax
jle 0x13281
movl 0x4(%r14), %eax
orl %ecx, %eax
movl %eax, 0x2c(%rbx)
cmpl %eax, %ecx
je 0x13283
movq %rbx, %rdi
callq 0x1108b
jmp 0x13283
pushq $0x1
popq %rax
jmp 0x132ce
je 0x132dc
xorl %eax, %eax
testq %r15, %r15
je 0x132ce
movl 0x4(%r14), %ecx
xorl %edx, %edx
testl %ecx, 0x2c(%rbx)
setne %dl
movl %edx, (%r15)
jmp 0x132ce
movq -0x28(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq (%rax), %rsi
movq -0x28(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movl (%rax), %edx
movq -0x28(%rbp), %rcx
leaq 0x8(%rcx), %rax
movq %rax, -0x28(%rbp)
movl (%rcx), %ecx
movq %rbx, %rdi
callq 0x132e6
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%r14), %eax
notl %eax
andl %ecx, %eax
jmp 0x1326b