// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ExprAlloc
SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
  sqlite3 *db,            /* Handle for sqlite3DbMallocZero() (may be null) */
  int op,                 /* Expression opcode */
  const Token *pToken,    /* Token argument.  Might be NULL */
  int dequote             /* True to dequote */
){
  Expr *pNew;
  int nExtra = 0;
  int iValue = 0;

  if( pToken ){
    if( op!=TK_INTEGER || pToken->z==0
          || sqlite3GetInt32(pToken->z, &iValue)==0 ){
      nExtra = pToken->n+1;
      assert( iValue>=0 );
    }
  }
  pNew = sqlite3DbMallocZero(db, sizeof(Expr)+nExtra);
  if( pNew ){
    pNew->op = (u8)op;
    pNew->iAgg = -1;
    if( pToken ){
      if( nExtra==0 ){
        pNew->flags |= EP_IntValue;
        pNew->u.iValue = iValue;
      }else{
        int c;
        pNew->u.zToken = (char*)&pNew[1];
        assert( pToken->z!=0 || pToken->n==0 );
        if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
        pNew->u.zToken[pToken->n] = 0;
        if( dequote && nExtra>=3 
             && ((c = pToken->z[0])=='\'' || c=='"' || c=='[' || c=='`') ){
          sqlite3Dequote(pNew->u.zToken);
          if( c=='"' ) pNew->flags |= EP_DblQuoted;
        }
      }
    }
#if SQLITE_MAX_EXPR_DEPTH>0
    pNew->nHeight = 1;
#endif  
  }
  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x64e02
cmpl $0x81, -0xc(%rbp)
jne 0x64df3
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x64df3
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x466d0
cmpl $0x0, %eax
jne 0x64e00
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x64e02
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rax
addq $0x48, %rax
movl %eax, %esi
callq 0x11ca0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x64f18
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movq -0x28(%rbp), %rax
movw $0xffff, 0x32(%rax)     # imm = 0xFFFF
cmpq $0x0, -0x18(%rbp)
je 0x64f0d
cmpl $0x0, -0x2c(%rbp)
jne 0x64e6b
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
movw %cx, 0x2(%rax)
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x64f0b
movq -0x28(%rbp), %rcx
addq $0x48, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x64ea2
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
callq 0x82f0
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
movb $0x0, (%rax,%rcx)
cmpl $0x0, -0x1c(%rbp)
je 0x64f09
cmpl $0x3, -0x2c(%rbp)
jl 0x64f09
movq -0x18(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x27, %eax
je 0x64ee5
cmpl $0x22, -0x34(%rbp)
je 0x64ee5
cmpl $0x5b, -0x34(%rbp)
je 0x64ee5
cmpl $0x60, -0x34(%rbp)
jne 0x64f09
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5e890
cmpl $0x22, -0x34(%rbp)
jne 0x64f07
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %ecx
orl $0x40, %ecx
movw %cx, 0x2(%rax)
jmp 0x64f09
jmp 0x64f0b
jmp 0x64f0d
movq -0x28(%rbp), %rax
movl $0x1, 0x28(%rax)
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)