// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/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_MAINDBNAME: {
      /* IMP: R-06824-28531 */
      /* IMP: R-36257-52125 */
      db->aDb[0].zDbSName = va_arg(ap,char*);
      rc = SQLITE_OK;
      break;
    }
    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  },
        { SQLITE_DBCONFIG_ENABLE_VIEW,           SQLITE_EnableView     },
        { SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, SQLITE_Fts3Tokenizer  },
        { SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, SQLITE_LoadExtension  },
        { SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,      SQLITE_NoCkptOnClose  },
        { SQLITE_DBCONFIG_ENABLE_QPSG,           SQLITE_EnableQPSG     },
        { SQLITE_DBCONFIG_TRIGGER_EQP,           SQLITE_TriggerEQP     },
        { SQLITE_DBCONFIG_RESET_DATABASE,        SQLITE_ResetDatabase  },
        { SQLITE_DBCONFIG_DEFENSIVE,             SQLITE_Defensive      },
        { SQLITE_DBCONFIG_WRITABLE_SCHEMA,       SQLITE_WriteSchema|
                                                 SQLITE_NoSchemaError  },
        { SQLITE_DBCONFIG_LEGACY_ALTER_TABLE,    SQLITE_LegacyAlter    },
        { SQLITE_DBCONFIG_DQS_DDL,               SQLITE_DqsDDL         },
        { SQLITE_DBCONFIG_DQS_DML,               SQLITE_DqsDML         },
        { SQLITE_DBCONFIG_LEGACY_FILE_FORMAT,    SQLITE_LegacyFileFmt  },
        { SQLITE_DBCONFIG_TRUSTED_SCHEMA,        SQLITE_TrustedSchema  },
      };
      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*);
          u64 oldFlags = db->flags;
          if( onoff>0 ){
            db->flags |= aFlagOp[i].mask;
          }else if( onoff==0 ){
            db->flags &= ~(u64)aFlagOp[i].mask;
          }
          if( oldFlags!=db->flags ){
            sqlite3ExpirePreparedStatements(db, 0);
          }
          if( pRes ){
            *pRes = (db->flags & aFlagOp[i].mask)!=0;
          }
          rc = SQLITE_OK;
          break;
        }
      }
      break;
    }
  }
  va_end(ap);
  return rc;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x288c95
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %r10, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
cmpl $0x3e8, %esi            # imm = 0x3E8
je 0x288cde
cmpl $0x3e9, %esi            # imm = 0x3E9
jne 0x288cfe
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x288d3f
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x288d4d
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x288dac
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x288dba
xorl %ecx, %ecx
leaq 0x152469(%rip), %rdx    # 0x3db170
cmpl %esi, (%rdx,%rcx,8)
je 0x288d1f
incq %rcx
cmpq $0x10, %rcx
jne 0x288d07
movl $0x1, %eax
jmp 0x288e3a
movl (%rsp), %esi
cmpq $0x28, %rsi
ja 0x288dc8
movq %rsi, %rax
addq 0x10(%rsp), %rax
addl $0x8, %esi
movl %esi, (%rsp)
jmp 0x288dd6
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x288d69
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x288d77
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %edx
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x288d92
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x288da0
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %ecx
callq 0x288e75
jmp 0x288e3a
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rax
movq 0x20(%rdi), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
jmp 0x288e3a
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movl (%rax), %r8d
movl (%rsp), %esi
cmpq $0x28, %rsi
ja 0x288df2
movq %rsi, %rax
addq 0x10(%rsp), %rax
addl $0x8, %esi
movl %esi, (%rsp)
jmp 0x288e00
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rsi
movq 0x30(%rdi), %rax
testl %r8d, %r8d
jle 0x288e1a
movl 0x4(%rdx,%rcx,8), %r8d
orq %rax, %r8
movq %r8, 0x30(%rdi)
jmp 0x288e1c
je 0x288e68
cmpq 0x30(%rdi), %rax
jne 0x288e42
xorl %eax, %eax
testq %rsi, %rsi
je 0x288e3a
movl 0x30(%rdi), %edi
xorl %r8d, %r8d
testl %edi, 0x4(%rdx,%rcx,8)
setne %r8b
movl %r8d, (%rsi)
addq $0xd8, %rsp
retq
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x288e22
movzwl 0xc6(%rax), %r8d
andl $-0x4, %r8d
incl %r8d
movw %r8w, 0xc6(%rax)
movq 0x10(%rax), %rax
jmp 0x288e46
movl 0x4(%rdx,%rcx,8), %r8d
notq %r8
andq %rax, %r8
jmp 0x288e14