// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: exprCodeInlineFunction
static int exprCodeInlineFunction(
  Parse *pParse,        /* Parsing context */
  ExprList *pFarg,      /* List of function arguments */
  int iFuncId,          /* Function ID.  One of the INTFUNC_... values */
  int target            /* Store function result in this register */
){
  int nFarg;
  Vdbe *v = pParse->pVdbe;
  assert( v!=0 );
  assert( pFarg!=0 );
  nFarg = pFarg->nExpr;
  assert( nFarg>0 );  /* All in-line functions have at least one argument */
  switch( iFuncId ){
    case INLINEFUNC_coalesce: {
      /* Attempt a direct implementation of the built-in COALESCE() and
      ** IFNULL() functions.  This avoids unnecessary evaluation of
      ** arguments past the first non-NULL argument.
      */
      int endCoalesce = sqlite3VdbeMakeLabel(pParse);
      int i;
      assert( nFarg>=2 );
      sqlite3ExprCode(pParse, pFarg->a[0].pExpr, target);
      for(i=1; i<nFarg; i++){
        sqlite3VdbeAddOp2(v, OP_NotNull, target, endCoalesce);
        VdbeCoverage(v);
        sqlite3ExprCode(pParse, pFarg->a[i].pExpr, target);
      }
      setDoNotMergeFlagOnCopy(v);
      sqlite3VdbeResolveLabel(v, endCoalesce);
      break;
    }
    case INLINEFUNC_iif: {
      Expr caseExpr;
      memset(&caseExpr, 0, sizeof(caseExpr));
      caseExpr.op = TK_CASE;
      caseExpr.x.pList = pFarg;
      return sqlite3ExprCodeTarget(pParse, &caseExpr, target);
    }

    default: {
      /* The UNLIKELY() function is a no-op.  The result is the value
      ** of the first argument.
      */
      assert( nFarg==1 || nFarg==2 );
      target = sqlite3ExprCodeTarget(pParse, pFarg->a[0].pExpr, target);
      break;
    }

  /***********************************************************************
  ** Test-only SQL functions that are only usable if enabled
  ** via SQLITE_TESTCTRL_INTERNAL_FUNCTIONS
  */
    case INLINEFUNC_expr_compare: {
      /* Compare two expressions using sqlite3ExprCompare() */
      assert( nFarg==2 );
      sqlite3VdbeAddOp2(v, OP_Integer,
         sqlite3ExprCompare(0,pFarg->a[0].pExpr, pFarg->a[1].pExpr,-1),
         target);
      break;
    }

    case INLINEFUNC_expr_implies_expr: {
      /* Compare two expressions using sqlite3ExprImpliesExpr() */
      assert( nFarg==2 );
      sqlite3VdbeAddOp2(v, OP_Integer,
         sqlite3ExprImpliesExpr(pParse,pFarg->a[0].pExpr, pFarg->a[1].pExpr,-1),
         target);
      break;
    }

    case INLINEFUNC_implies_nonnull_row: {
      /* REsult of sqlite3ExprImpliesNonNullRow() */
      Expr *pA1;
      assert( nFarg==2 );
      pA1 = pFarg->a[1].pExpr;
      if( pA1->op==TK_COLUMN ){
        sqlite3VdbeAddOp2(v, OP_Integer,
           sqlite3ExprImpliesNonNullRow(pFarg->a[0].pExpr,pA1->iTable),
           target);
      }else{
        sqlite3VdbeAddOp2(v, OP_Null, 0, target);
      }
      break;
    }

#ifdef SQLITE_DEBUG
    case INLINEFUNC_affinity: {
      /* The AFFINITY() function evaluates to a string that describes
      ** the type affinity of the argument.  This is used for testing of
      ** the SQLite type logic.
      */
      const char *azAff[] = { "blob", "text", "numeric", "integer", "real" };
      char aff;
      assert( nFarg==1 );
      aff = sqlite3ExprAffinity(pFarg->a[0].pExpr);
      sqlite3VdbeLoadString(v, target,
              (aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]);
      break;
    }
#endif
  }
  return target;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, %r13d
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x5, %edx
ja 0x2be9ee
movq 0x10(%r12), %r14
movl %edx, %eax
leaq 0x112638(%rip), %rcx    # 0x3d0f90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, 0x8(%rsp)
movl (%r15), %r14d
movl 0x44(%r12), %ebx
decl %ebx
movl %ebx, 0x44(%r12)
movq 0x8(%r15), %rsi
movq %r12, %rdi
movl %r13d, %edx
callq 0x2bc7e9
cmpl $0x2, %r14d
jl 0x2be9c9
leaq (%r14,%r14,2), %rax
leaq -0x18(,%rax,8), %rbp
xorl %r14d, %r14d
movq 0x8(%rsp), %rdi
movl $0x33, %esi
movl %r13d, %edx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq 0x20(%r15,%r14), %rsi
movq %r12, %rdi
movl %r13d, %edx
callq 0x2bc7e9
addq $0x18, %r14
cmpq %r14, %rbp
jne 0x2be999
movq 0x8(%rsp), %rdi
movslq 0x90(%rdi), %rax
movq (%rdi), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2beaa6
leaq 0x20049f(%rip), %rcx    # 0x4bee88
jmp 0x2beab9
movq 0x8(%r15), %rsi
movq %r12, %rdi
movl %r13d, %edx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2bcc6c
movq 0x8(%r15), %rsi
movq 0x20(%r15), %rdx
movq %r12, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2c1375
jmp 0x2bea4d
movq 0x20(%r15), %rax
cmpb $-0x5c, (%rax)
jne 0x2bea9a
movq 0x8(%r15), %rdi
movl 0x2c(%rax), %esi
callq 0x2c13f8
jmp 0x2bea4d
movq 0x8(%r15), %rsi
movq 0x20(%r15), %rdx
xorl %edi, %edi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2c0d98
movq %r14, %rdi
movl $0x45, %esi
movl %eax, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
jmp 0x2beadb
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x10(%rsi)
movq $0x0, 0x40(%rsi)
movb $-0x66, (%rsi)
movq %r15, 0x20(%rsi)
movq %r12, %rdi
movl %r13d, %edx
callq 0x2bcc6c
movl %eax, %r13d
jmp 0x2beadb
movq %r14, %rdi
movl $0x48, %esi
xorl %edx, %edx
jmp 0x2bea57
movq 0x88(%rdi), %rcx
leaq (%rax,%rax,2), %rdx
leaq (%rcx,%rdx,8), %rcx
addq $-0x18, %rcx
cmpb $0x4d, (%rcx)
jne 0x2bead4
testl %eax, %eax
jle 0x2bead4
movq 0x88(%rdi), %rcx
leaq (%rax,%rax,2), %rax
movw $0x1, -0x16(%rcx,%rax,8)
movl %ebx, %esi
callq 0x2bfa39
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq