// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: resolveP2Values
static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
  int nMaxArgs = *pMaxFuncArgs;
  Op *pOp;
  Parse *pParse = p->pParse;
  int *aLabel = pParse->aLabel;
  p->readOnly = 1;
  p->bIsReader = 0;
  pOp = &p->aOp[p->nOp-1];
  while(1){

    /* Only JUMP opcodes and the short list of special opcodes in the switch
    ** below need to be considered.  The mkopcodeh.tcl generator script groups
    ** all these opcodes together near the front of the opcode list.  Skip
    ** any opcode that does not need processing by virtual of the fact that
    ** it is larger than SQLITE_MX_JUMP_OPCODE, as a performance optimization.
    */
    if( pOp->opcode<=SQLITE_MX_JUMP_OPCODE ){
      /* NOTE: Be sure to update mkopcodeh.tcl when adding or removing
      ** cases from this switch! */
      switch( pOp->opcode ){
        case OP_Transaction: {
          if( pOp->p2!=0 ) p->readOnly = 0;
          /* no break */ deliberate_fall_through
        }
        case OP_AutoCommit:
        case OP_Savepoint: {
          p->bIsReader = 1;
          break;
        }
#ifndef SQLITE_OMIT_WAL
        case OP_Checkpoint:
#endif
        case OP_Vacuum:
        case OP_JournalMode: {
          p->readOnly = 0;
          p->bIsReader = 1;
          break;
        }
        case OP_Next:
        case OP_SorterNext: {
          pOp->p4.xAdvance = sqlite3BtreeNext;
          pOp->p4type = P4_ADVANCE;
          /* The code generator never codes any of these opcodes as a jump
          ** to a label.  They are always coded as a jump backwards to a
          ** known address */
          assert( pOp->p2>=0 );
          break;
        }
        case OP_Prev: {
          pOp->p4.xAdvance = sqlite3BtreePrevious;
          pOp->p4type = P4_ADVANCE;
          /* The code generator never codes any of these opcodes as a jump
          ** to a label.  They are always coded as a jump backwards to a
          ** known address */
          assert( pOp->p2>=0 );
          break;
        }
#ifndef SQLITE_OMIT_VIRTUALTABLE
        case OP_VUpdate: {
          if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2;
          break;
        }
        case OP_VFilter: {
          int n;
          assert( (pOp - p->aOp) >= 3 );
          assert( pOp[-1].opcode==OP_Integer );
          n = pOp[-1].p1;
          if( n>nMaxArgs ) nMaxArgs = n;
          /* Fall through into the default case */
          /* no break */ deliberate_fall_through
        }
#endif
        default: {
          if( pOp->p2<0 ){
            /* The mkopcodeh.tcl script has so arranged things that the only
            ** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to
            ** have non-negative values for P2. */
            assert( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)!=0 );
            assert( ADDR(pOp->p2)<-pParse->nLabel );
            pOp->p2 = aLabel[ADDR(pOp->p2)];
          }
          break;
        }
      }
      /* The mkopcodeh.tcl script has so arranged things that the only
      ** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to
      ** have non-negative values for P2. */
      assert( (sqlite3OpcodeProperty[pOp->opcode]&OPFLG_JUMP)==0 || pOp->p2>=0);
    }
    if( pOp==p->aOp ) break;
    pOp--;
  }
  sqlite3DbFree(p->db, pParse->aLabel);
  pParse->aLabel = 0;
  pParse->nLabel = 0;
  *pMaxFuncArgs = nMaxArgs;
  assert( p->bIsReader!=0 || DbMaskAllZero(p->btreeMask) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movw 0xc6(%rax), %cx
andw $0xff7f, %cx            # imm = 0xFF7F
orw $0x80, %cx
movw %cx, 0xc6(%rax)
movq -0x8(%rbp), %rax
movw 0xc6(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x0, %cx
movw %cx, 0xc6(%rax)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x90(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3e, %eax
jg 0x410648
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movq %rax, -0x40(%rbp)
subq $0xa, %rax
ja 0x41061f
movq -0x40(%rbp), %rax
leaq 0x194956(%rip), %rcx    # 0x5a4e84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x41055c
movq -0x8(%rbp), %rax
movw 0xc6(%rax), %cx
andw $0xff7f, %cx            # imm = 0xFF7F
orw $0x0, %cx
movw %cx, 0xc6(%rax)
jmp 0x41055e
movq -0x8(%rbp), %rax
movw 0xc6(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x100, %cx             # imm = 0x100
movw %cx, 0xc6(%rax)
jmp 0x410646
movq -0x8(%rbp), %rax
movw 0xc6(%rax), %cx
andw $0xff7f, %cx            # imm = 0xFF7F
orw $0x0, %cx
movw %cx, 0xc6(%rax)
movq -0x8(%rbp), %rax
movw 0xc6(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x100, %cx             # imm = 0x100
movw %cx, 0xc6(%rax)
jmp 0x410646
movq -0x20(%rbp), %rax
leaq -0x14866(%rip), %rcx    # 0x3fbd60
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movb $-0x5, 0x1(%rax)
jmp 0x410646
movq -0x20(%rbp), %rax
leaq -0x147bf(%rip), %rcx    # 0x3fbe20
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movb $-0x5, 0x1(%rax)
jmp 0x410646
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x14(%rbp), %eax
jle 0x410603
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x410646
movq -0x20(%rbp), %rax
movl -0x14(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jle 0x41061d
movl -0x34(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x41061f
movq -0x20(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jge 0x410644
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %ecx
xorl $-0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x410646
jmp 0x410648
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x88(%rcx), %rax
jne 0x41065b
jmp 0x41066c
movq -0x20(%rbp), %rax
addq $-0x18, %rax
movq %rax, -0x20(%rbp)
jmp 0x4104fe
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x3c00a0
movq -0x28(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x44(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)