// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3ExprCodeRunJustOnce
SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(
  Parse *pParse,    /* Parsing context */
  Expr *pExpr,      /* The expression to code when the VDBE initializes */
  int regDest       /* Store the value in this register */
){
  ExprList *p;
  assert( ConstFactorOk(pParse) );
  p = pParse->pConstExpr;
  if( regDest<0 && p ){
    struct ExprList_item *pItem;
    int i;
    for(pItem=p->a, i=p->nExpr; i>0; pItem++, i--){
      if( pItem->reusable && sqlite3ExprCompare(0,pItem->pExpr,pExpr,-1)==0 ){
        return pItem->u.iConstExprReg;
      }
    }
  }
  pExpr = sqlite3ExprDup(pParse->db, pExpr, 0);
  if( pExpr!=0 && ExprHasProperty(pExpr, EP_HasFunc) ){
    Vdbe *v = pParse->pVdbe;
    int addr;
    assert( v );
    addr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
    pParse->okConstFactor = 0;
    if( !pParse->db->mallocFailed ){
      if( regDest<0 ) regDest = ++pParse->nMem;
      sqlite3ExprCode(pParse, pExpr, regDest);
    }
    pParse->okConstFactor = 1;
    sqlite3ExprDelete(pParse->db, pExpr);
    sqlite3VdbeJumpHere(v, addr);
  }else{
    p = sqlite3ExprListAppend(pParse, p, pExpr);
    if( p ){
       struct ExprList_item *pItem = &p->a[p->nExpr-1];
       pItem->reusable = regDest<0;
       if( regDest<0 ) regDest = ++pParse->nMem;
       pItem->u.iConstExprReg = regDest;
    }
    pParse->pConstExpr = p;
  }
  return regDest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r14
movq 0x58(%rdi), %r15
testl %edx, %edx
sets %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2be80a
movl (%r15), %ebp
testl %ebp, %ebp
jle 0x2be80a
incl %ebp
movq %r15, %r13
addq $0x1c, %r13
testb $0x8, -0x3(%r13)
je 0x2be7ff
movq -0x14(%r13), %rsi
xorl %edi, %edi
movq %r12, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2c0d98
testl %eax, %eax
je 0x2be8ff
decl %ebp
addq $0x18, %r13
cmpl $0x2, %ebp
jge 0x2be7dd
testq %r12, %r12
je 0x2be837
movq (%r14), %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2c2864
testq %rax, %rax
je 0x2be837
movq %rax, %r12
testb $0x4, 0x4(%rax)
jne 0x2be893
movq (%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
jmp 0x2be83f
movq (%r14), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2b1a3f
testq %rax, %rax
je 0x2be87e
movslq (%rax), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rcx
addq $-0x10, %rcx
movb 0x11(%rcx), %dl
movl %ebx, %esi
shrl $0x1c, %esi
andb $0x8, %sil
andb $-0x9, %dl
orb %sil, %dl
movb %dl, 0x11(%rcx)
testl %ebx, %ebx
jns 0x2be87b
movl 0x38(%r14), %ebx
incl %ebx
movl %ebx, 0x38(%r14)
movl %ebx, 0x14(%rcx)
movq %rax, 0x58(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %r15
movq %r15, %rdi
movl $0x11, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, %ebp
movb $0x0, 0x23(%r14)
movq (%r14), %rdi
cmpb $0x0, 0x61(%rdi)
jne 0x2be8d9
testl %ebx, %ebx
jns 0x2be8c9
movl 0x38(%r14), %ebx
incl %ebx
movl %ebx, 0x38(%r14)
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x2bc7e9
movq (%r14), %rdi
movb $0x1, 0x23(%r14)
movq %r12, %rsi
callq 0x2a6164
movl 0x90(%r15), %eax
movq (%r15), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2be908
leaq 0x20058b(%rip), %rcx    # 0x4bee88
jmp 0x2be922
movl (%r13), %ebx
jmp 0x2be882
leal -0x1(%rax), %ecx
testl %ebp, %ebp
cmovnsl %ebp, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%r15), %rcx
movl %eax, 0x8(%rcx)
jmp 0x2be882