// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: allocateBtreePage
static int allocateBtreePage(
  BtShared *pBt,         /* The btree */
  MemPage **ppPage,      /* Store pointer to the allocated page here */
  Pgno *pPgno,           /* Store the page number here */
  Pgno nearby,           /* Search for a page near this one */
  u8 eMode               /* BTALLOC_EXACT, BTALLOC_LT, or BTALLOC_ANY */
){
  MemPage *pPage1;
  int rc;
  u32 n;     /* Number of pages on the freelist */
  u32 k;     /* Number of leaves on the trunk of the freelist */
  MemPage *pTrunk = 0;
  MemPage *pPrevTrunk = 0;
  Pgno mxPage;     /* Total size of the database file */

  assert( sqlite3_mutex_held(pBt->mutex) );
  assert( eMode==BTALLOC_ANY || (nearby>0 && IfNotOmitAV(pBt->autoVacuum)) );
  pPage1 = pBt->pPage1;
  mxPage = btreePagecount(pBt);
  /* EVIDENCE-OF: R-05119-02637 The 4-byte big-endian integer at offset 36
  ** stores stores the total number of pages on the freelist. */
  n = get4byte(&pPage1->aData[36]);
  testcase( n==mxPage-1 );
  if( n>=mxPage ){
    return SQLITE_CORRUPT_BKPT;
  }
  if( n>0 ){
    /* There are pages on the freelist.  Reuse one of those pages. */
    Pgno iTrunk;
    u8 searchList = 0; /* If the free-list must be searched for 'nearby' */
    u32 nSearch = 0;   /* Count of the number of search attempts */

    /* If eMode==BTALLOC_EXACT and a query of the pointer-map
    ** shows that the page 'nearby' is somewhere on the free-list, then
    ** the entire-list will be searched for that page.
    */
#ifndef SQLITE_OMIT_AUTOVACUUM
    if( eMode==BTALLOC_EXACT ){
      if( nearby<=mxPage ){
        u8 eType;
        assert( nearby>0 );
        assert( pBt->autoVacuum );
        rc = ptrmapGet(pBt, nearby, &eType, 0);
        if( rc ) return rc;
        if( eType==PTRMAP_FREEPAGE ){
          searchList = 1;
        }
      }
    }else if( eMode==BTALLOC_LE ){
      searchList = 1;
    }
#endif

    /* Decrement the free-list count by 1. Set iTrunk to the index of the
    ** first free-list trunk page. iPrevTrunk is initially 1.
    */
    rc = sqlite3PagerWrite(pPage1->pDbPage);
    if( rc ) return rc;
    put4byte(&pPage1->aData[36], n-1);

    /* The code within this loop is run only once if the 'searchList' variable
    ** is not true. Otherwise, it runs once for each trunk-page on the
    ** free-list until the page 'nearby' is located (eMode==BTALLOC_EXACT)
    ** or until a page less than 'nearby' is located (eMode==BTALLOC_LT)
    */
    do {
      pPrevTrunk = pTrunk;
      if( pPrevTrunk ){
        /* EVIDENCE-OF: R-01506-11053 The first integer on a freelist trunk page
        ** is the page number of the next freelist trunk page in the list or
        ** zero if this is the last freelist trunk page. */
        iTrunk = get4byte(&pPrevTrunk->aData[0]);
      }else{
        /* EVIDENCE-OF: R-59841-13798 The 4-byte big-endian integer at offset 32
        ** stores the page number of the first page of the freelist, or zero if
        ** the freelist is empty. */
        iTrunk = get4byte(&pPage1->aData[32]);
      }
      testcase( iTrunk==mxPage );
      if( iTrunk>mxPage || nSearch++ > n ){
        rc = SQLITE_CORRUPT_PGNO(pPrevTrunk ? pPrevTrunk->pgno : 1);
      }else{
        rc = btreeGetUnusedPage(pBt, iTrunk, &pTrunk, 0);
      }
      if( rc ){
        pTrunk = 0;
        goto end_allocate_page;
      }
      assert( pTrunk!=0 );
      assert( pTrunk->aData!=0 );
      /* EVIDENCE-OF: R-13523-04394 The second integer on a freelist trunk page
      ** is the number of leaf page pointers to follow. */
      k = get4byte(&pTrunk->aData[4]);
      if( k==0 && !searchList ){
        /* The trunk has no leaves and the list is not being searched.
        ** So extract the trunk page itself and use it as the newly
        ** allocated page */
        assert( pPrevTrunk==0 );
        rc = sqlite3PagerWrite(pTrunk->pDbPage);
        if( rc ){
          goto end_allocate_page;
        }
        *pPgno = iTrunk;
        memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4);
        *ppPage = pTrunk;
        pTrunk = 0;
        TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1));
      }else if( k>(u32)(pBt->usableSize/4 - 2) ){
        /* Value of k is out of range.  Database corruption */
        rc = SQLITE_CORRUPT_PGNO(iTrunk);
        goto end_allocate_page;
#ifndef SQLITE_OMIT_AUTOVACUUM
      }else if( searchList
            && (nearby==iTrunk || (iTrunk<nearby && eMode==BTALLOC_LE))
      ){
        /* The list is being searched and this trunk page is the page
        ** to allocate, regardless of whether it has leaves.
        */
        *pPgno = iTrunk;
        *ppPage = pTrunk;
        searchList = 0;
        rc = sqlite3PagerWrite(pTrunk->pDbPage);
        if( rc ){
          goto end_allocate_page;
        }
        if( k==0 ){
          if( !pPrevTrunk ){
            memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4);
          }else{
            rc = sqlite3PagerWrite(pPrevTrunk->pDbPage);
            if( rc!=SQLITE_OK ){
              goto end_allocate_page;
            }
            memcpy(&pPrevTrunk->aData[0], &pTrunk->aData[0], 4);
          }
        }else{
          /* The trunk page is required by the caller but it contains
          ** pointers to free-list leaves. The first leaf becomes a trunk
          ** page in this case.
          */
          MemPage *pNewTrunk;
          Pgno iNewTrunk = get4byte(&pTrunk->aData[8]);
          if( iNewTrunk>mxPage ){
            rc = SQLITE_CORRUPT_PGNO(iTrunk);
            goto end_allocate_page;
          }
          testcase( iNewTrunk==mxPage );
          rc = btreeGetUnusedPage(pBt, iNewTrunk, &pNewTrunk, 0);
          if( rc!=SQLITE_OK ){
            goto end_allocate_page;
          }
          rc = sqlite3PagerWrite(pNewTrunk->pDbPage);
          if( rc!=SQLITE_OK ){
            releasePage(pNewTrunk);
            goto end_allocate_page;
          }
          memcpy(&pNewTrunk->aData[0], &pTrunk->aData[0], 4);
          put4byte(&pNewTrunk->aData[4], k-1);
          memcpy(&pNewTrunk->aData[8], &pTrunk->aData[12], (k-1)*4);
          releasePage(pNewTrunk);
          if( !pPrevTrunk ){
            assert( sqlite3PagerIswriteable(pPage1->pDbPage) );
            put4byte(&pPage1->aData[32], iNewTrunk);
          }else{
            rc = sqlite3PagerWrite(pPrevTrunk->pDbPage);
            if( rc ){
              goto end_allocate_page;
            }
            put4byte(&pPrevTrunk->aData[0], iNewTrunk);
          }
        }
        pTrunk = 0;
        TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1));
#endif
      }else if( k>0 ){
        /* Extract a leaf from the trunk */
        u32 closest;
        Pgno iPage;
        unsigned char *aData = pTrunk->aData;
        if( nearby>0 ){
          u32 i;
          closest = 0;
          if( eMode==BTALLOC_LE ){
            for(i=0; i<k; i++){
              iPage = get4byte(&aData[8+i*4]);
              if( iPage<=nearby ){
                closest = i;
                break;
              }
            }
          }else{
            int dist;
            dist = sqlite3AbsInt32(get4byte(&aData[8]) - nearby);
            for(i=1; i<k; i++){
              int d2 = sqlite3AbsInt32(get4byte(&aData[8+i*4]) - nearby);
              if( d2<dist ){
                closest = i;
                dist = d2;
              }
            }
          }
        }else{
          closest = 0;
        }

        iPage = get4byte(&aData[8+closest*4]);
        testcase( iPage==mxPage );
        if( iPage>mxPage ){
          rc = SQLITE_CORRUPT_PGNO(iTrunk);
          goto end_allocate_page;
        }
        testcase( iPage==mxPage );
        if( !searchList
         || (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
        ){
          int noContent;
          *pPgno = iPage;
          TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d"
                 ": %d more free pages\n",
                 *pPgno, closest+1, k, pTrunk->pgno, n-1));
          rc = sqlite3PagerWrite(pTrunk->pDbPage);
          if( rc ) goto end_allocate_page;
          if( closest<k-1 ){
            memcpy(&aData[8+closest*4], &aData[4+k*4], 4);
          }
          put4byte(&aData[4], k-1);
          noContent = !btreeGetHasContent(pBt, *pPgno)? PAGER_GET_NOCONTENT : 0;
          rc = btreeGetUnusedPage(pBt, *pPgno, ppPage, noContent);
          if( rc==SQLITE_OK ){
            rc = sqlite3PagerWrite((*ppPage)->pDbPage);
            if( rc!=SQLITE_OK ){
              releasePage(*ppPage);
              *ppPage = 0;
            }
          }
          searchList = 0;
        }
      }
      releasePage(pPrevTrunk);
      pPrevTrunk = 0;
    }while( searchList );
  }else{
    /* There are no pages on the freelist, so append a new page to the
    ** database image.
    **
    ** Normally, new pages allocated by this block can be requested from the
    ** pager layer with the 'no-content' flag set. This prevents the pager
    ** from trying to read the pages content from disk. However, if the
    ** current transaction has already run one or more incremental-vacuum
    ** steps, then the page we are about to allocate may contain content
    ** that is required in the event of a rollback. In this case, do
    ** not set the no-content flag. This causes the pager to load and journal
    ** the current page content before overwriting it.
    **
    ** Note that the pager will not actually attempt to load or journal
    ** content for any page that really does lie past the end of the database
    ** file on disk. So the effects of disabling the no-content optimization
    ** here are confined to those pages that lie between the end of the
    ** database image and the end of the database file.
    */
    int bNoContent = (0==IfNotOmitAV(pBt->bDoTruncate))? PAGER_GET_NOCONTENT:0;

    rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
    if( rc ) return rc;
    pBt->nPage++;
    if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ) pBt->nPage++;

#ifndef SQLITE_OMIT_AUTOVACUUM
    if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){
      /* If *pPgno refers to a pointer-map page, allocate two new pages
      ** at the end of the file instead of one. The first allocated page
      ** becomes a new pointer-map page, the second is used by the caller.
      */
      MemPage *pPg = 0;
      TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", pBt->nPage));
      assert( pBt->nPage!=PENDING_BYTE_PAGE(pBt) );
      rc = btreeGetUnusedPage(pBt, pBt->nPage, &pPg, bNoContent);
      if( rc==SQLITE_OK ){
        rc = sqlite3PagerWrite(pPg->pDbPage);
        releasePage(pPg);
      }
      if( rc ) return rc;
      pBt->nPage++;
      if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ){ pBt->nPage++; }
    }
#endif
    put4byte(28 + (u8*)pBt->pPage1->aData, pBt->nPage);
    *pPgno = pBt->nPage;

    assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
    rc = btreeGetUnusedPage(pBt, *pPgno, ppPage, bNoContent);
    if( rc ) return rc;
    rc = sqlite3PagerWrite((*ppPage)->pDbPage);
    if( rc!=SQLITE_OK ){
      releasePage(*ppPage);
      *ppPage = 0;
    }
    TRACE(("ALLOCATE: %d from end of file\n", *pPgno));
  }

  assert( CORRUPT_DB || *pPgno!=PENDING_BYTE_PAGE(pBt) );

end_allocate_page:
  releasePage(pTrunk);
  releasePage(pPrevTrunk);
  assert( rc!=SQLITE_OK || sqlite3PagerPageRefcount((*ppPage)->pDbPage)<=1 );
  assert( rc!=SQLITE_OK || (*ppPage)->isInit==0 );
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq $0x0, 0x28(%rsp)
movq 0x18(%rdi), %rbx
movl 0x40(%rdi), %esi
movq 0x50(%rbx), %rax
movl 0x24(%rax), %r12d
bswapl %r12d
cmpl %esi, %r12d
jae 0x28e80e
movq %rdi, %r14
testl %r12d, %r12d
je 0x28e83f
movl %r8d, %ebp
cmpb $0x2, %bpl
movq %r15, 0x48(%rsp)
movl %ecx, 0x54(%rsp)
movq %rbx, 0x10(%rsp)
movl %esi, 0x20(%rsp)
movq %rdx, 0x38(%rsp)
je 0x28e990
movzbl %bpl, %eax
cmpl $0x1, %eax
jne 0x28e806
cmpl %ecx, %esi
jae 0x28eee1
xorl %r15d, %r15d
jmp 0x28e993
leaq 0x1473b6(%rip), %rsi    # 0x3d5bcb
leaq 0x1474c0(%rip), %rdx    # 0x3d5cdc
leaq 0x14720e(%rip), %r8     # 0x3d5a31
movl $0xb, %r13d
movl $0xb, %edi
movl $0x11313, %ecx          # imm = 0x11313
xorl %eax, %eax
callq 0x274d08
jmp 0x28e9a3
movq %rdx, %r12
movq %rbx, %rax
xorl %ebx, %ebx
cmpb $0x0, 0x23(%r14)
sete %bpl
movq 0x70(%rax), %rdi
callq 0x2774a1
testl %eax, %eax
jne 0x28e9a0
movl 0x40(%r14), %edi
leal 0x1(%rdi), %esi
movl %esi, 0x40(%r14)
movl 0x22d24e(%rip), %eax    # 0x4bbac0
xorl %edx, %edx
divl 0x34(%r14)
movl %eax, %ecx
cmpl %eax, %edi
jne 0x28e887
addl $0x2, %edi
movl %edi, 0x40(%r14)
movl %edi, %esi
movb %bpl, %bl
cmpb $0x0, 0x21(%r14)
je 0x28e939
xorl %eax, %eax
cmpl $0x2, %esi
jb 0x28e8cd
movl 0x38(%r14), %eax
movl $0xcccccccd, %r8d       # imm = 0xCCCCCCCD
imulq %rax, %r8
shrq $0x22, %r8
incl %r8d
leal -0x2(%rsi), %edi
movl %edi, %eax
xorl %edx, %edx
divl %r8d
subl %edx, %edi
leal 0x1(%rdi), %eax
xorl %edx, %edx
cmpl %ecx, %eax
sete %dl
leal (%rdi,%rdx), %eax
addl $0x2, %eax
cmpl %esi, %eax
jne 0x28e939
leaq 0x40(%rsp), %rdx
movq $0x0, (%rdx)
movq %r14, %rdi
movl %ebx, %ecx
callq 0x28f303
testl %eax, %eax
jne 0x28e9a0
movq %r14, %rbp
movq 0x40(%rsp), %r14
movq 0x70(%r14), %rdi
callq 0x2774a1
movl %eax, %r13d
movq 0x70(%r14), %rdi
callq 0x28ab87
testl %r13d, %r13d
jne 0x28e9a3
movq %rbp, %r14
movl 0x40(%rbp), %ecx
leal 0x1(%rcx), %esi
movl %esi, 0x40(%rbp)
movl 0x22d199(%rip), %eax    # 0x4bbac0
xorl %edx, %edx
divl 0x34(%rbp)
cmpl %eax, %ecx
jne 0x28e939
addl $0x2, %ecx
movl %ecx, 0x40(%r14)
movl %ecx, %esi
movq 0x18(%r14), %rax
movq 0x50(%rax), %rax
bswapl %esi
movl %esi, 0x1c(%rax)
movl 0x40(%r14), %esi
movl %esi, (%r12)
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x28f303
testl %eax, %eax
jne 0x28e9a0
movq (%r15), %rax
movq 0x70(%rax), %rdi
callq 0x2774a1
testl %eax, %eax
je 0x28ef94
movl %eax, %r13d
movq (%r15), %rax
testq %rax, %rax
je 0x28e987
movq 0x70(%rax), %rdi
callq 0x28ab87
movq $0x0, (%r15)
jmp 0x28e9a3
movb $0x1, %r15b
movq 0x70(%rbx), %rdi
callq 0x2774a1
testl %eax, %eax
je 0x28e9b5
movl %eax, %r13d
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x24(%rsp)
movq 0x50(%rbx), %rax
leal -0x1(%r12), %ecx
bswapl %ecx
movl %ecx, 0x24(%rax)
xorl %ebp, %ebp
movl $0x0, 0x34(%rsp)
movq %r14, (%rsp)
testq %rbp, %rbp
je 0x28e9fc
movq 0x50(%rbp), %rax
movzbl (%rax), %ecx
shll $0x18, %ecx
movzbl 0x1(%rax), %edx
shll $0x10, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %ecx
shll $0x8, %ecx
orl %edx, %ecx
addq $0x3, %rax
jmp 0x28ea1d
movq 0x50(%rbx), %rax
movzbl 0x20(%rax), %ecx
shll $0x18, %ecx
movzbl 0x21(%rax), %edx
shll $0x10, %edx
orl %ecx, %edx
movzbl 0x22(%rax), %ecx
shll $0x8, %ecx
orl %edx, %ecx
addq $0x23, %rax
movl 0x20(%rsp), %edx
movzbl (%rax), %ebx
orl %ecx, %ebx
cmpl %edx, %ebx
ja 0x28ef0e
cmpl %r12d, 0x34(%rsp)
ja 0x28ef0e
movq %r14, %rdi
movl %ebx, %esi
leaq 0x28(%rsp), %rdx
xorl %ecx, %ecx
callq 0x28f303
testl %eax, %eax
jne 0x28ef3c
movq %rbp, 0x18(%rsp)
movq 0x28(%rsp), %r11
movq 0x50(%r11), %rbp
movl 0x4(%rbp), %r14d
bswapl %r14d
testb %r15b, %r15b
jne 0x28eac6
testl %r14d, %r14d
jne 0x28eac6
movq 0x70(%r11), %rdi
movq %r11, %r14
callq 0x2774a1
testl %eax, %eax
movq 0x18(%rsp), %rbp
jne 0x28ef4d
movq 0x38(%rsp), %rax
movl %ebx, (%rax)
movq 0x10(%rsp), %rbx
movq 0x50(%rbx), %rax
movq 0x50(%r14), %rcx
movl (%rcx), %ecx
movl %ecx, 0x20(%rax)
movq 0x48(%rsp), %rax
movq %r14, (%rax)
movq $0x0, 0x28(%rsp)
xorl %r11d, %r11d
xorl %r15d, %r15d
xorl %r13d, %r13d
movq (%rsp), %r14
jmp 0x28eeaa
movq (%rsp), %rax
movl 0x38(%rax), %eax
shrl $0x2, %eax
addl $-0x2, %eax
cmpl %eax, %r14d
ja 0x28ef58
testb %r15b, %r15b
movl 0x54(%rsp), %r9d
je 0x28eafa
cmpb $0x2, 0x24(%rsp)
sete %al
cmpl %r9d, %ebx
setb %cl
je 0x28eb53
andb %cl, %al
jne 0x28eb53
testl %r14d, %r14d
je 0x28ec77
xorl %ebx, %ebx
testl %r9d, %r9d
je 0x28ec7f
cmpb $0x2, 0x24(%rsp)
movl 0x20(%rsp), %r10d
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
jne 0x28ec89
movl %r14d, %eax
movl $0x8, %ecx
xorl %edx, %edx
movl %ecx, %esi
andl $-0x4, %esi
movl (%rbp,%rsi), %esi
bswapl %esi
cmpl %r9d, %esi
jbe 0x28ed26
incq %rdx
addq $0x4, %rcx
cmpq %rdx, %rax
jne 0x28eb2e
jmp 0x28ed28
movq 0x38(%rsp), %rax
movl %ebx, (%rax)
movq 0x48(%rsp), %rax
movq %r11, (%rax)
movq %r11, 0x8(%rsp)
movq 0x70(%r11), %rdi
callq 0x2774a1
testl %eax, %eax
movq 0x18(%rsp), %rbp
jne 0x28ef9c
testl %r14d, %r14d
je 0x28eced
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movzbl 0x8(%rax), %edi
movl %edi, %ecx
shll $0x18, %ecx
movzbl 0x9(%rax), %r15d
movl %r15d, %edx
shll $0x10, %edx
orl %ecx, %edx
movzbl 0xa(%rax), %ebx
movl %ebx, %esi
shll $0x8, %esi
orl %edx, %esi
movzbl 0xb(%rax), %eax
orl %eax, %esi
cmpl 0x20(%rsp), %esi
ja 0x28efe5
movl %edi, 0x30(%rsp)
movl %eax, 0x50(%rsp)
movq (%rsp), %rdi
leaq 0x40(%rsp), %rdx
xorl %ecx, %ecx
callq 0x28f303
testl %eax, %eax
jne 0x28ef9c
movq 0x40(%rsp), %rbp
movq 0x70(%rbp), %rdi
callq 0x2774a1
testl %eax, %eax
jne 0x28f013
movq 0x50(%rbp), %rax
movq 0x8(%rsp), %rdx
movq 0x50(%rdx), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq 0x50(%rbp), %rax
leal -0x1(%r14), %ecx
bswapl %ecx
movl %ecx, 0x4(%rax)
movq 0x50(%rbp), %rdi
addq $0x8, %rdi
movq 0x50(%rdx), %rsi
addq $0xc, %rsi
leal -0x4(,%r14,4), %edx
callq 0x17660
movq 0x70(%rbp), %rdi
callq 0x28ab87
movq 0x18(%rsp), %rbp
testq %rbp, %rbp
je 0x28ee3e
movq 0x70(%rbp), %rdi
callq 0x2774a1
testl %eax, %eax
movq (%rsp), %r14
jne 0x28ef9c
movq 0x50(%rbp), %rax
movl 0x30(%rsp), %ecx
movb %cl, (%rax)
movb %r15b, 0x1(%rax)
movb %bl, 0x2(%rax)
addq $0x3, %rax
jmp 0x28ee5d
xorl %r13d, %r13d
jmp 0x28ed5d
movl 0x20(%rsp), %r10d
jmp 0x28ed28
cmpl $0x1, %r14d
je 0x28ed28
movl 0x8(%rbp), %ecx
bswapl %ecx
subl %r9d, %ecx
movl %ecx, %eax
negl %eax
cmovol %r13d, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
movl %r14d, %ecx
xorl %ebx, %ebx
movl $0x1, %edx
movl $0xc, %esi
movl %esi, %edi
andl $-0x4, %edi
movl (%rbp,%rdi), %edi
bswapl %edi
subl %r9d, %edi
movl %edi, %r8d
negl %r8d
cmovol %r13d, %r8d
testl %edi, %edi
cmovnsl %edi, %r8d
cmpl %eax, %r8d
cmovll %edx, %ebx
cmovll %r8d, %eax
incq %rdx
addq $0x4, %rsi
cmpq %rdx, %rcx
jne 0x28ecb7
jmp 0x28ed28
testq %rbp, %rbp
je 0x28ee6a
movq 0x70(%rbp), %rdi
callq 0x2774a1
testl %eax, %eax
movq (%rsp), %r14
movq 0x10(%rsp), %rbx
jne 0x28ef9c
movq 0x50(%rbp), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
jmp 0x28ee85
movl %edx, %ebx
leal 0x8(,%rbx,4), %esi
movl (%rbp,%rsi), %eax
bswapl %eax
cmpl %r10d, %eax
ja 0x28efa4
cmpb $0x2, 0x24(%rsp)
setne %cl
cmpl %r9d, %eax
setae %dl
je 0x28ed70
orb %dl, %cl
je 0x28ed70
testb %r15b, %r15b
je 0x28ed70
xorl %r13d, %r13d
movb $0x1, %r15b
movq (%rsp), %r14
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %rbx
jmp 0x28eeaa
movq %rsi, %r15
movq 0x38(%rsp), %rcx
movl %eax, (%rcx)
movq %r11, 0x8(%rsp)
movq 0x70(%r11), %rdi
callq 0x2774a1
testl %eax, %eax
jne 0x28efe0
leal -0x1(%r14), %eax
cmpl %eax, %ebx
jae 0x28eda9
leal 0x4(,%r14,4), %ecx
movl (%rbp,%rcx), %ecx
movl %ecx, (%rbp,%r15)
bswapl %eax
movl %eax, 0x4(%rbp)
movq 0x38(%rsp), %rax
movl (%rax), %ebx
movq (%rsp), %rax
movq 0x60(%rax), %rdi
testq %rdi, %rdi
movq 0x48(%rsp), %r14
je 0x28ede2
xorl %ecx, %ecx
cmpl %ebx, (%rdi)
movq 0x18(%rsp), %rbp
jb 0x28edec
movl %ebx, %esi
callq 0x286b64
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
jmp 0x28edec
movl $0x1, %ecx
movq 0x18(%rsp), %rbp
movq (%rsp), %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0x28f303
xorl %r13d, %r13d
testl %eax, %eax
je 0x28ee0c
xorl %r15d, %r15d
movl %eax, %r13d
jmp 0x28ee9c
movq (%r14), %rax
movq 0x70(%rax), %rdi
callq 0x2774a1
testl %eax, %eax
je 0x28ee99
movl %eax, %ebx
movq (%r14), %rax
testq %rax, %rax
je 0x28ee2f
movq 0x70(%rax), %rdi
callq 0x28ab87
movq $0x0, (%r14)
xorl %r15d, %r15d
movl %ebx, %r13d
jmp 0x28ee9c
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x30(%rsp), %ecx
movb %cl, 0x20(%rax)
movb %r15b, 0x21(%rax)
movb %bl, 0x22(%rax)
addq $0x23, %rax
movq (%rsp), %r14
movl 0x50(%rsp), %ecx
movb %cl, (%rax)
movq 0x10(%rsp), %rbx
jmp 0x28ee85
movq 0x10(%rsp), %rbx
movq 0x50(%rbx), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rcx
movl (%rcx), %ecx
movl %ecx, 0x20(%rax)
movq (%rsp), %r14
movq $0x0, 0x28(%rsp)
xorl %r11d, %r11d
xorl %r15d, %r15d
xorl %r13d, %r13d
jmp 0x28eeaa
xorl %r15d, %r15d
movq (%rsp), %r14
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r11
testq %rbp, %rbp
je 0x28eebe
movq 0x70(%rbp), %rdi
movq %r11, %rbp
callq 0x28ab87
movq %rbp, %r11
incl 0x34(%rsp)
movq %r11, %rbp
testb %r15b, %r15b
movb $0x1, %r15b
jne 0x28e9d5
xorl %ebp, %ebp
testq %r11, %r11
jne 0x28f029
jmp 0x28f032
leaq 0x40(%rsp), %rbx
movq %r14, %rdi
movl %ecx, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x28e6a5
cmpb $0x2, (%rbx)
movq 0x10(%rsp), %rbx
sete %r15b
testl %eax, %eax
jne 0x28e9a0
jmp 0x28e993
leaq 0x146cb6(%rip), %rsi    # 0x3d5bcb
leaq 0x146dc0(%rip), %rdx    # 0x3d5cdc
leaq 0x146b0e(%rip), %r8     # 0x3d5a31
movl $0xb, %r13d
movl $0xb, %edi
movl $0x1134b, %ecx          # imm = 0x1134B
xorl %eax, %eax
callq 0x274d08
jmp 0x28ef3f
movl %eax, %r13d
movq $0x0, 0x28(%rsp)
jmp 0x28f032
movl %eax, %r13d
movq %r14, %r11
jmp 0x28f029
leaq 0x146c6c(%rip), %rsi    # 0x3d5bcb
leaq 0x146d76(%rip), %rdx    # 0x3d5cdc
leaq 0x146ac4(%rip), %r8     # 0x3d5a31
movl $0xb, %r13d
movl $0xb, %edi
movl $0x11368, %ecx          # imm = 0x11368
xorl %eax, %eax
movq %r11, %rbx
callq 0x274d08
movq %rbx, %r11
movq 0x18(%rsp), %rbp
jmp 0x28f029
xorl %r13d, %r13d
jmp 0x28e9a3
movl %eax, %r13d
jmp 0x28f024
leaq 0x146c20(%rip), %rsi    # 0x3d5bcb
leaq 0x146d2a(%rip), %rdx    # 0x3d5cdc
leaq 0x146a78(%rip), %r8     # 0x3d5a31
movl $0xb, %r13d
movl $0xb, %edi
movl $0x113cb, %ecx          # imm = 0x113CB
xorl %eax, %eax
movq %r11, %rbx
callq 0x274d08
movq %rbx, %r11
movq 0x18(%rsp), %rbp
jmp 0x28eed3
movl %eax, %r13d
jmp 0x28f01f
leaq 0x146bdf(%rip), %rsi    # 0x3d5bcb
leaq 0x146ce9(%rip), %rdx    # 0x3d5cdc
leaq 0x146a37(%rip), %r8     # 0x3d5a31
movl $0xb, %r13d
movl $0xb, %edi
movl $0x1138a, %ecx          # imm = 0x1138A
xorl %eax, %eax
callq 0x274d08
jmp 0x28f024
movl %eax, %r13d
movq 0x70(%rbp), %rdi
callq 0x28ab87
movq 0x18(%rsp), %rbp
movq 0x8(%rsp), %r11
movq 0x70(%r11), %rdi
callq 0x28ab87
testq %rbp, %rbp
je 0x28e9a3
movq 0x70(%rbp), %rdi
callq 0x28ab87
jmp 0x28e9a3