// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: exprDup
static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){
  Expr *pNew;           /* Value to return */
  u8 *zAlloc;           /* Memory space from which to build Expr object */
  u32 staticFlag;       /* EP_Static if space not obtained from malloc */

  assert( db!=0 );
  assert( p );
  assert( dupFlags==0 || dupFlags==EXPRDUP_REDUCE );
  assert( pzBuffer==0 || dupFlags==EXPRDUP_REDUCE );

  /* Figure out where to write the new Expr structure. */
  if( pzBuffer ){
    zAlloc = *pzBuffer;
    staticFlag = EP_Static;
  }else{
    zAlloc = sqlite3DbMallocRawNN(db, dupedExprSize(p, dupFlags));
    staticFlag = 0;
  }
  pNew = (Expr *)zAlloc;

  if( pNew ){
    /* Set nNewSize to the size allocated for the structure pointed to
    ** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or
    ** EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed
    ** by the copy of the p->u.zToken string (if any).
    */
    const unsigned nStructSize = dupedExprStructSize(p, dupFlags);
    const int nNewSize = nStructSize & 0xfff;
    int nToken;
    if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
      nToken = sqlite3Strlen30(p->u.zToken) + 1;
    }else{
      nToken = 0;
    }
    if( dupFlags ){
      assert( ExprHasProperty(p, EP_Reduced)==0 );
      memcpy(zAlloc, p, nNewSize);
    }else{
      u32 nSize = (u32)exprStructSize(p);
      memcpy(zAlloc, p, nSize);
      if( nSize<EXPR_FULLSIZE ){
        memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
      }
    }

    /* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */
    pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static|EP_MemToken);
    pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly);
    pNew->flags |= staticFlag;
    ExprClearVVAProperties(pNew);
    if( dupFlags ){
      ExprSetVVAProperty(pNew, EP_Immutable);
    }

    /* Copy the p->u.zToken string, if any. */
    if( nToken ){
      char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
      memcpy(zToken, p->u.zToken, nToken);
    }

    if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){
      /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
      if( ExprHasProperty(p, EP_xIsSelect) ){
        pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, dupFlags);
      }else{
        pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
      }
    }

    /* Fill in pNew->pLeft and pNew->pRight. */
    if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly|EP_WinFunc) ){
      zAlloc += dupedExprNodeSize(p, dupFlags);
      if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
        pNew->pLeft = p->pLeft ?
                      exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
        pNew->pRight = p->pRight ?
                       exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
      }
#ifndef SQLITE_OMIT_WINDOWFUNC
      if( ExprHasProperty(p, EP_WinFunc) ){
        pNew->y.pWin = sqlite3WindowDup(db, pNew, p->y.pWin);
        assert( ExprHasProperty(pNew, EP_WinFunc) );
      }
#endif /* SQLITE_OMIT_WINDOWFUNC */
      if( pzBuffer ){
        *pzBuffer = zAlloc;
      }
    }else{
      if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
        if( pNew->op==TK_SELECT_COLUMN ){
          pNew->pLeft = p->pLeft;
          assert( p->iColumn==0 || p->pRight==0 );
          assert( p->pRight==0  || p->pRight==p->pLeft );
        }else{
          pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
        }
        pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
      }
    }
  }
  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x432122
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x8000000, -0x34(%rbp) # imm = 0x8000000
jmp 0x43214d
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x432470
movq -0x58(%rbp), %rdi
movslq %eax, %rsi
callq 0x3d62a0
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x43245d
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x4324f0
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x4321ab
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x4321ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3c3400
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x4321b2
movl $0x0, -0x40(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4321cb
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x3c(%rbp), %rdx
callq 0x19610
jmp 0x432210
movq -0x10(%rbp), %rdi
callq 0x432560
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x44(%rbp), %eax
movl %eax, %edx
callq 0x19610
movl -0x44(%rbp), %eax
cmpq $0x48, %rax
jae 0x43220e
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %eax
addq %rax, %rdi
movl -0x44(%rbp), %eax
movl $0x48, %edx
subq %rax, %rdx
xorl %esi, %esi
callq 0x19360
jmp 0x432210
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0xf7fe9fff, %ecx       # imm = 0xF7FE9FFF
movl %ecx, 0x4(%rax)
movl -0x38(%rbp), %ecx
andl $0x6000, %ecx           # imm = 0x6000
movq -0x28(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
cmpl $0x0, -0x14(%rbp)
je 0x432248
jmp 0x432248
cmpl $0x0, -0x40(%rbp)
je 0x43227a
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movslq -0x40(%rbp), %rdx
callq 0x19610
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
orl 0x4(%rax), %ecx
andl $0x804000, %ecx         # imm = 0x804000
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x4322e7
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4322c6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movl -0x14(%rbp), %edx
callq 0x4325b0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4322e5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movl -0x14(%rbp), %edx
callq 0x432810
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4322e7
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1006000, %eax        # imm = 0x1006000
cmpl $0x0, %eax
je 0x4323ec
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x432a20
movl %eax, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x804000, %eax         # imm = 0x804000
cmpl $0x0, %eax
jne 0x4323a7
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x432354
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %edx
leaq -0x30(%rbp), %rcx
callq 0x4320f0
movq %rax, -0x60(%rbp)
jmp 0x43235c
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x43235c
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x432393
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl $0x1, %edx
leaq -0x30(%rbp), %rcx
callq 0x4320f0
movq %rax, -0x68(%rbp)
jmp 0x43239b
xorl %eax, %eax
movq %rax, -0x68(%rbp)
jmp 0x43239b
movq -0x68(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0x4323d8
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
callq 0x432aa0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x4323ea
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x43245b
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x804000, %eax         # imm = 0x804000
cmpl $0x0, %eax
jne 0x432459
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xaf, %eax
jne 0x43241d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x43243b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
xorl %edx, %edx
callq 0x42dee0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
callq 0x42dee0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x43245b
jmp 0x43245d
movq -0x28(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)