// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/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);
  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' */
    
    /* 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 ){
        iTrunk = get4byte(&pPrevTrunk->aData[0]);
      }else{
        iTrunk = get4byte(&pPage1->aData[32]);
      }
      testcase( iTrunk==mxPage );
      if( iTrunk>mxPage ){
        rc = SQLITE_CORRUPT_BKPT;
      }else{
        rc = btreeGetPage(pBt, iTrunk, &pTrunk, 0);
      }
      if( rc ){
        pTrunk = 0;
        goto end_allocate_page;
      }
      assert( pTrunk!=0 );
      assert( pTrunk->aData!=0 );

      k = get4byte(&pTrunk->aData[4]); /* # of leaves on this trunk page */
      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_BKPT;
        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_BKPT;
            goto end_allocate_page;
          }
          testcase( iNewTrunk==mxPage );
          rc = btreeGetPage(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_BKPT;
          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 = btreeGetPage(pBt, *pPgno, ppPage, noContent);
          if( rc==SQLITE_OK ){
            rc = sqlite3PagerWrite((*ppPage)->pDbPage);
            if( rc!=SQLITE_OK ){
              releasePage(*ppPage);
            }
          }
          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 = btreeGetPage(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 = btreeGetPage(pBt, *pPgno, ppPage, bNoContent);
    if( rc ) return rc;
    rc = sqlite3PagerWrite((*ppPage)->pDbPage);
    if( rc!=SQLITE_OK ){
      releasePage(*ppPage);
    }
    TRACE(("ALLOCATE: %d from end of file\n", *pPgno));
  }

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, %r15d
movl %ecx, -0x3c(%rbp)
movq %rdx, -0x68(%rbp)
movq %rsi, %r12
movq %rdi, %r13
andq $0x0, -0x78(%rbp)
movq 0x18(%rdi), %rax
movl 0x3c(%rdi), %r14d
movq %rax, -0x58(%rbp)
movq 0x50(%rax), %rdi
addq $0x24, %rdi
callq 0x180a3
cmpl %r14d, %eax
jae 0x1ecdb
movl %eax, %ebx
testl %eax, %eax
je 0x1ecee
cmpb $0x2, %r15b
movl %r15d, -0x60(%rbp)
movq %r12, -0x48(%rbp)
movl %r14d, -0x5c(%rbp)
je 0x1ee11
movzbl %r15b, %eax
cmpl $0x1, %eax
jne 0x1ecd3
movl -0x3c(%rbp), %esi
cmpl %esi, %r14d
jae 0x1f2c4
xorl %r12d, %r12d
jmp 0x1ee14
movl $0xd52e, %edi           # imm = 0xD52E
callq 0x1a1fc
pushq $0xb
popq %r15
jmp 0x1ee28
xorl %ebx, %ebx
cmpb $0x0, 0x23(%r13)
sete %r14b
movq -0x58(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0xd10b
testl %eax, %eax
jne 0x1ee25
movl 0x3c(%r13), %ecx
leal 0x1(%rcx), %r15d
movl %r15d, 0x3c(%r13)
movl 0x68b20(%rip), %eax     # 0x87840
xorl %edx, %edx
divl 0x30(%r13)
cmpl %eax, %ecx
jne 0x1ed34
addl $0x2, %ecx
movl %ecx, 0x3c(%r13)
movl %ecx, %r15d
movb %r14b, %bl
cmpb $0x0, 0x21(%r13)
je 0x1edbd
movq %r13, %rdi
movl %r15d, %esi
callq 0x1dfda
cmpl %r15d, %eax
movq -0x68(%rbp), %rcx
jne 0x1edc1
leaq -0x70(%rbp), %rdx
andq $0x0, (%rdx)
movq %r13, %rdi
movl %r15d, %esi
movl %ebx, %ecx
callq 0x1d84e
testl %eax, %eax
jne 0x1ee25
movq %r12, %r14
movq -0x70(%rbp), %r12
movq 0x68(%r12), %rdi
callq 0xd10b
movl %eax, %r15d
movq %r12, %rdi
callq 0x1d90e
testl %r15d, %r15d
jne 0x1ee28
movl 0x3c(%r13), %ecx
leal 0x1(%rcx), %r15d
movl %r15d, 0x3c(%r13)
movl 0x68a9a(%rip), %eax     # 0x87840
xorl %edx, %edx
divl 0x30(%r13)
cmpl %eax, %ecx
jne 0x1edba
addl $0x2, %ecx
movl %ecx, 0x3c(%r13)
movl %ecx, %r15d
movq %r14, %r12
movq -0x68(%rbp), %rcx
movq 0x18(%r13), %rax
movq 0x50(%rax), %rax
bswapl %r15d
movl %r15d, 0x1c(%rax)
movl 0x3c(%r13), %esi
movl %esi, (%rcx)
movq %r13, %rdi
movq %r12, %rdx
movl %ebx, %ecx
callq 0x1d84e
testl %eax, %eax
jne 0x1ee25
movq (%r12), %rax
movq 0x68(%rax), %rdi
callq 0xd10b
testl %eax, %eax
je 0x1f321
movl %eax, %r15d
movq (%r12), %rdi
callq 0x1d90e
xorl %edi, %edi
xorl %ebx, %ebx
jmp 0x1f37d
movb $0x1, %r12b
movq -0x58(%rbp), %r14
movq 0x68(%r14), %rdi
callq 0xd10b
testl %eax, %eax
je 0x1ee3a
movl %eax, %r15d
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%r14), %rax
decl %ebx
bswapl %ebx
movl %ebx, 0x24(%rax)
movq $0x0, -0x30(%rbp)
movl -0x5c(%rbp), %r14d
movq %r13, -0x80(%rbp)
movq %r12, -0x88(%rbp)
movq -0x30(%rbp), %rax
testq %rax, %rax
movq %rax, -0x38(%rbp)
je 0x1ee6f
movq 0x50(%rax), %rdi
jmp 0x1ee7b
movq -0x58(%rbp), %rax
movq 0x50(%rax), %rdi
addq $0x20, %rdi
callq 0x180a3
movl %eax, %ebx
movq -0x48(%rbp), %r12
cmpl %r14d, %eax
ja 0x1f2ee
movq %r13, %rdi
movl %ebx, %esi
leaq -0x78(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1d84e
testl %eax, %eax
jne 0x1f2fe
movq -0x78(%rbp), %r15
movq 0x50(%r15), %rax
movq %rax, -0x50(%rbp)
leaq 0x4(%rax), %rdi
callq 0x180a3
movq -0x88(%rbp), %rsi
testb %sil, %sil
jne 0x1ef35
testl %eax, %eax
jne 0x1ef35
movq 0x68(%r15), %rdi
callq 0xd10b
movq %r15, %rdi
testl %eax, %eax
jne 0x1f315
movl %r14d, %r13d
movq -0x68(%rbp), %rax
movl %ebx, (%rax)
movq -0x58(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x50(%rdi), %rcx
movl (%rcx), %ecx
movl %ecx, 0x20(%rax)
movq %rdi, (%r12)
andq $0x0, -0x78(%rbp)
movq $0x0, -0x30(%rbp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x1d90e
testb %r14b, %r14b
movb $0x1, %r12b
movl %r13d, %r14d
movq -0x80(%rbp), %r13
jne 0x1ee55
jmp 0x1f309
movq %r15, -0x30(%rbp)
movl 0x34(%r13), %ecx
shrl $0x2, %ecx
addl $-0x2, %ecx
cmpl %ecx, %eax
ja 0x1f31a
testb %sil, %sil
movl -0x60(%rbp), %r15d
movl -0x3c(%rbp), %edx
je 0x1ef6b
cmpb $0x2, %r15b
sete %dil
cmpl %edx, %ebx
setb %cl
je 0x1efc2
andb %cl, %dil
jne 0x1efc2
testl %eax, %eax
je 0x1f0ba
xorl %r13d, %r13d
testl %edx, %edx
movq %rax, -0x90(%rbp)
je 0x1f17f
movl %eax, %ebx
cmpb $0x2, %r15b
jne 0x1f0cc
pushq $0x8
popq %r15
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x1f177
movl %r15d, %edi
andl $-0x4, %edi
addq -0x50(%rbp), %rdi
callq 0x180a3
cmpl -0x3c(%rbp), %eax
jbe 0x1f174
incq %r14
addq $0x4, %r15
jmp 0x1ef98
movq %r12, %rcx
movq %rax, %r12
movq -0x68(%rbp), %rax
movl %ebx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, (%rcx)
movq 0x68(%rax), %rdi
callq 0xd10b
testl %eax, %eax
jne 0x1f33e
movq %r12, %rax
testl %eax, %eax
movq -0x38(%rbp), %rbx
je 0x1f13e
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
addq $0x8, %rdi
callq 0x180a3
cmpl %r14d, %eax
ja 0x1f34c
movq %r13, %rdi
movl %eax, -0x50(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1d84e
testl %eax, %eax
jne 0x1f35c
movq -0x70(%rbp), %rbx
movq 0x68(%rbx), %rdi
callq 0xd10b
testl %eax, %eax
jne 0x1f366
movq 0x50(%rbx), %rax
movq -0x30(%rbp), %rdx
movq 0x50(%rdx), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq 0x50(%rbx), %rax
leal -0x1(%r12), %ecx
bswapl %ecx
movl %ecx, 0x4(%rax)
movq 0x50(%rbx), %rdi
addq $0x8, %rdi
movq 0x50(%rdx), %rsi
addq $0xc, %rsi
leal -0x4(,%r12,4), %edx
callq 0x82c0
movq %rbx, %rdi
callq 0x1d90e
movl -0x50(%rbp), %ecx
bswapl %ecx
movq -0x38(%rbp), %rbx
testq %rbx, %rbx
je 0x1f27c
movl %ecx, -0x50(%rbp)
movq 0x68(%rbx), %rdi
callq 0xd10b
testl %eax, %eax
movq -0x48(%rbp), %r12
jne 0x1f361
movq 0x50(%rbx), %rax
movl -0x50(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x1f287
movl %r14d, %r13d
xorl %r15d, %r15d
movq -0x38(%rbp), %rbx
movq %rsi, %r14
jmp 0x1ef15
movq -0x50(%rbp), %rax
leaq 0x8(%rax), %rdi
callq 0x180a3
subl -0x3c(%rbp), %eax
movl %eax, %r15d
negl %r15d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmovol %ecx, %r15d
testl %eax, %eax
cmovnsl %eax, %r15d
xorl %r13d, %r13d
pushq $0xc
popq %r14
pushq $0x1
popq %r12
cmpq %r12, %rbx
je 0x1f138
movl %r14d, %edi
andl $-0x4, %edi
addq -0x50(%rbp), %rdi
callq 0x180a3
subl -0x3c(%rbp), %eax
movl %eax, %ecx
negl %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmovol %edx, %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
cmpl %r15d, %ecx
cmovll %r12d, %r13d
cmovll %ecx, %r15d
incq %r12
addq $0x4, %r14
jmp 0x1f0fc
movq -0x48(%rbp), %r12
jmp 0x1f177
testq %rbx, %rbx
movq -0x48(%rbp), %r12
je 0x1f28c
movq 0x68(%rbx), %rdi
callq 0xd10b
testl %eax, %eax
jne 0x1f361
movl %r14d, %r13d
movq 0x50(%rbx), %rax
movq -0x30(%rbp), %rcx
movq 0x50(%rcx), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
jmp 0x1f2a4
movl %r14d, %r13d
movl -0x60(%rbp), %r15d
movl -0x5c(%rbp), %r14d
leal 0x8(,%r13,4), %ebx
addq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0x180a3
cmpl %r14d, %eax
ja 0x1f32a
cmpb $0x2, %r15b
setne %cl
cmpl -0x3c(%rbp), %eax
setae %dl
je 0x1f1c6
orb %dl, %cl
je 0x1f1c6
cmpb $0x0, -0x88(%rbp)
je 0x1f1c6
movl %r14d, %r13d
xorl %r15d, %r15d
movb $0x1, %r14b
jmp 0x1ef11
movq -0x68(%rbp), %rcx
movl %eax, (%rcx)
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0xd10b
testl %eax, %eax
jne 0x1f347
movq -0x90(%rbp), %rcx
leal -0x1(%rcx), %eax
cmpl %eax, %r13d
jae 0x1f200
leal 0x4(,%rcx,4), %ecx
movq -0x50(%rbp), %rdx
movl (%rdx,%rcx), %ecx
movl %ecx, (%rbx)
bswapl %eax
movq -0x50(%rbp), %rcx
movl %eax, 0x4(%rcx)
movq -0x68(%rbp), %rax
movl (%rax), %ebx
movq -0x80(%rbp), %r15
movq 0x58(%r15), %rdi
pushq $0x1
popq %rcx
testq %rdi, %rdi
je 0x1f233
xorl %ecx, %ecx
cmpl %ebx, (%rdi)
jb 0x1f233
movl %ebx, %esi
callq 0x18dd4
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movq %r15, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x1d84e
xorl %r15d, %r15d
movl %r14d, %r13d
testl %eax, %eax
je 0x1f255
xorl %r14d, %r14d
movl %eax, %r15d
jmp 0x1ef11
movq (%r12), %rax
movq 0x68(%rax), %rdi
callq 0xd10b
testl %eax, %eax
je 0x1f2bc
movl %eax, %ebx
movq (%r12), %rdi
callq 0x1d90e
xorl %r14d, %r14d
movl %ebx, %r15d
jmp 0x1ef11
movq -0x58(%rbp), %rax
movq 0x50(%rax), %rax
movl %ecx, 0x20(%rax)
movl %r14d, %r13d
jmp 0x1f2a4
movl %r14d, %r13d
movq -0x58(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x50(%rcx), %rcx
movl (%rcx), %ecx
movl %ecx, 0x20(%rax)
andq $0x0, -0x78(%rbp)
movq $0x0, -0x30(%rbp)
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x1ef15
xorl %r14d, %r14d
jmp 0x1ef11
leaq -0x70(%rbp), %r14
movq %r13, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1ebb8
cmpb $0x2, (%r14)
sete %r12b
testl %eax, %eax
movq -0x58(%rbp), %r14
jne 0x1ee25
jmp 0x1ee18
movl $0xd55f, %edi           # imm = 0xD55F
callq 0x1a1fc
pushq $0xb
popq %r15
jmp 0x1f301
movl %eax, %r15d
xorl %edi, %edi
movq -0x38(%rbp), %rbx
jmp 0x1f37d
xorl %ebx, %ebx
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %r12
jmp 0x1f37d
movl %eax, %r15d
jmp 0x1f303
movl $0xd57b, %edi           # imm = 0xD57B
jmp 0x1f32f
xorl %edi, %edi
xorl %ebx, %ebx
xorl %r15d, %r15d
jmp 0x1f37d
movl $0xd5de, %edi           # imm = 0xD5DE
callq 0x1a1fc
pushq $0xb
popq %r15
movq -0x38(%rbp), %rbx
jmp 0x1f379
movl %eax, %r15d
movq -0x38(%rbp), %rbx
jmp 0x1f30b
movl %eax, %r15d
jmp 0x1f338
movl $0xd59d, %edi           # imm = 0xD59D
callq 0x1a1fc
pushq $0xb
popq %r15
jmp 0x1f375
movl %eax, %r15d
jmp 0x1f375
movl %eax, %r15d
jmp 0x1f379
movl %eax, %r15d
movq %rbx, %rdi
callq 0x1d90e
movq -0x38(%rbp), %rbx
movq -0x48(%rbp), %r12
movq -0x30(%rbp), %rdi
callq 0x1d90e
movq %rbx, %rdi
callq 0x1d90e
testl %r15d, %r15d
je 0x1f399
andq $0x0, (%r12)
jmp 0x1ee28
movq (%r12), %rdi
movq 0x68(%rdi), %rax
cmpw $0x2, 0x2e(%rax)
jl 0x1f3b7
callq 0x1d90e
movl $0xd640, %edi           # imm = 0xD640
jmp 0x1ece0
movb $0x0, (%rdi)
xorl %r15d, %r15d
jmp 0x1ee28