// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3VdbeSorterReset
SQLITE_PRIVATE void sqlite3VdbeSorterReset(sqlite3 *db, VdbeSorter *pSorter){
  int i;
  (void)vdbeSorterJoinAll(pSorter, SQLITE_OK);
  assert( pSorter->bUseThreads || pSorter->pReader==0 );
#if SQLITE_MAX_WORKER_THREADS>0
  if( pSorter->pReader ){
    vdbePmaReaderClear(pSorter->pReader);
    sqlite3DbFree(db, pSorter->pReader);
    pSorter->pReader = 0;
  }
#endif
  vdbeMergeEngineFree(pSorter->pMerger);
  pSorter->pMerger = 0;
  for(i=0; i<pSorter->nTask; i++){
    SortSubtask *pTask = &pSorter->aTask[i];
    vdbeSortSubtaskCleanup(db, pTask);
    pTask->pSorter = pSorter;
  }
  if( pSorter->list.aMemory==0 ){
    vdbeSorterRecordFree(0, pSorter->list.pList);
  }
  pSorter->list.pList = 0;
  pSorter->list.szPMA = 0;
  pSorter->bUsePMA = 0;
  pSorter->iMemory = 0;
  pSorter->mxKeysize = 0;
  sqlite3DbFree(db, pSorter->pUnpacked);
  pSorter->pUnpacked = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, (%rsp)
movq 0x18(%rsi), %rdi
callq 0x2911da
movq $0x0, 0x18(%rbx)
cmpb $0x0, 0x5b(%rbx)
je 0x291179
leaq 0x60(%rbx), %r12
xorl %r13d, %r13d
imulq $0x68, %r13, %rbp
movq 0x18(%r12,%rbp), %rsi
testq %rsi, %rsi
je 0x29106d
movq (%rsp), %rdi
callq 0x282904
addq %r12, %rbp
movq 0x20(%rbp), %r15
testq %r15, %r15
je 0x2910b0
movq 0x8(%r15), %r14
cmpl $0x0, 0x22a5dc(%rip)    # 0x4bb660
je 0x29109f
movq %r15, %rdi
callq *0x22a609(%rip)         # 0x4bb698
cltq
subq %rax, 0x22da60(%rip)    # 0x4beaf8
decq 0x22daa1(%rip)          # 0x4beb40
movq %r15, %rdi
callq *0x22a5e0(%rip)         # 0x4bb688
movq %r14, %r15
testq %r14, %r14
jne 0x291079
movq 0x48(%rbp), %r15
testq %r15, %r15
je 0x2910f9
movq (%r15), %rax
testq %rax, %rax
je 0x2910ce
movq %r15, %rdi
callq *0x8(%rax)
movq $0x0, (%r15)
cmpl $0x0, 0x22a58b(%rip)    # 0x4bb660
je 0x2910f0
movq %r15, %rdi
callq *0x22a5b8(%rip)         # 0x4bb698
cltq
subq %rax, 0x22da0f(%rip)    # 0x4beaf8
decq 0x22da50(%rip)          # 0x4beb40
movq %r15, %rdi
callq *0x22a58f(%rip)         # 0x4bb688
movq 0x58(%rbp), %r15
testq %r15, %r15
je 0x291142
movq (%r15), %rax
testq %rax, %rax
je 0x291117
movq %r15, %rdi
callq *0x8(%rax)
movq $0x0, (%r15)
cmpl $0x0, 0x22a542(%rip)    # 0x4bb660
je 0x291139
movq %r15, %rdi
callq *0x22a56f(%rip)         # 0x4bb698
cltq
subq %rax, 0x22d9c6(%rip)    # 0x4beaf8
decq 0x22da07(%rip)          # 0x4beb40
movq %r15, %rdi
callq *0x22a546(%rip)         # 0x4bb688
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbp)
movups %xmm0, 0x50(%rbp)
movups %xmm0, 0x40(%rbp)
movups %xmm0, 0x30(%rbp)
movups %xmm0, 0x20(%rbp)
movups %xmm0, (%rbp)
movq $0x0, 0x60(%rbp)
movq %rbx, 0x10(%rbp)
incq %r13
movzbl 0x5b(%rbx), %eax
cmpq %rax, %r13
jb 0x291056
cmpq $0x0, 0x40(%rbx)
jne 0x29119a
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x29119a
movq 0x8(%rdi), %r14
callq 0x272c00
movq %r14, %rdi
testq %r14, %r14
jne 0x291189
movq $0x0, 0x38(%rbx)
xorl %eax, %eax
movl %eax, 0x48(%rbx)
movb $0x0, 0x58(%rbx)
movl %eax, 0x50(%rbx)
movl %eax, 0x8(%rbx)
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x2911c3
movq (%rsp), %rdi
callq 0x282904
movq $0x0, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq