// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x58(%rdi), %r12
testl %edx, %edx
sets %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2c7f76
movl %ebp, 0x4(%rsp)
movl (%r12), %r13d
testl %r13d, %r13d
setle %bpl
jle 0x2c7f63
incl %r13d
movq %r12, %r14
addq $0x1c, %r14
testb $0x8, -0x3(%r14)
je 0x2c7f50
movq -0x14(%r14), %rsi
xorl %edi, %edi
movq %r15, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2ca527
testl %eax, %eax
je 0x2c7f65
decl %r13d
addq $0x18, %r14
cmpl $0x2, %r13d
setl %bpl
jge 0x2c7f32
jmp 0x2c7f68
jmp 0x2c7f68
movl (%r14), %eax
testb $0x1, %bpl
movl 0x4(%rsp), %ebp
je 0x2c807b
testq %r15, %r15
je 0x2c7f8f
movq (%rbx), %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2cbf97
movq %rax, %r15
jmp 0x2c7f92
xorl %r15d, %r15d
testq %r15, %r15
je 0x2c7f9e
testb $0x4, 0x4(%r15)
jne 0x2c7ff1
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2bb1a3
testq %rax, %rax
je 0x2c7fe8
movslq (%rax), %rcx
leaq (%rcx,%rcx,2), %rdx
movb 0x1(%rax,%rdx,8), %sil
movl %ebp, %ecx
shrl $0x1c, %ecx
andb $0x8, %cl
andb $-0x9, %sil
orb %cl, %sil
leaq (%rax,%rdx,8), %rcx
addq $-0x10, %rcx
movb %sil, 0x1(%rax,%rdx,8)
testl %ebp, %ebp
jns 0x2c7fe5
movl 0x38(%rbx), %ebp
incl %ebp
movl %ebp, 0x38(%rbx)
movl %ebp, 0x14(%rcx)
movq %rax, 0x58(%rbx)
jmp 0x2c8079
movq 0x10(%rbx), %r14
movq %r14, %rdi
movl $0x11, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, %r13d
movb $0x0, 0x23(%rbx)
movq (%rbx), %rax
cmpb $0x0, 0x61(%rax)
jne 0x2c8032
testl %ebp, %ebp
jns 0x2c8025
movl 0x38(%rbx), %ebp
incl %ebp
movl %ebp, 0x38(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2c5f97
movb $0x1, 0x23(%rbx)
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x2afd54
movl 0x90(%r14), %eax
movq (%r14), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2c805a
leaq 0x201e30(%rip), %rcx    # 0x4c9e88
jmp 0x2c8076
leal -0x1(%rax), %ecx
testl %r13d, %r13d
cmovnsl %r13d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%r14), %rcx
movl %eax, 0x8(%rcx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq