// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3WalCheckpoint
SQLITE_PRIVATE int sqlite3WalCheckpoint(
  Wal *pWal,                      /* Wal connection */
  sqlite3 *db,                    /* Check this handle's interrupt flag */
  int eMode,                      /* PASSIVE, FULL, RESTART, or TRUNCATE */
  int (*xBusy)(void*),            /* Function to call when busy */
  void *pBusyArg,                 /* Context argument for xBusyHandler */
  int sync_flags,                 /* Flags to sync db file with (or 0) */
  int nBuf,                       /* Size of temporary buffer */
  u8 *zBuf,                       /* Temporary buffer to use */
  int *pnLog,                     /* OUT: Number of frames in WAL */
  int *pnCkpt                     /* OUT: Number of backfilled frames in WAL */
){
  int rc;                         /* Return code */
  int isChanged = 0;              /* True if a new wal-index header is loaded */
  int eMode2 = eMode;             /* Mode to pass to walCheckpoint() */
  int (*xBusy2)(void*) = xBusy;   /* Busy handler for eMode2 */

  assert( pWal->ckptLock==0 );
  assert( pWal->writeLock==0 );

  /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked
  ** in the SQLITE_CHECKPOINT_PASSIVE mode. */
  assert( eMode!=SQLITE_CHECKPOINT_PASSIVE || xBusy==0 );

  if( pWal->readOnly ) return SQLITE_READONLY;
  WALTRACE(("WAL%p: checkpoint begins\n", pWal));

  /* Enable blocking locks, if possible. If blocking locks are successfully
  ** enabled, set xBusy2=0 so that the busy-handler is never invoked. */
  sqlite3WalDb(pWal, db);
  (void)walEnableBlocking(pWal);

  /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive
  ** "checkpoint" lock on the database file.
  ** EVIDENCE-OF: R-10421-19736 If any other process is running a
  ** checkpoint operation at the same time, the lock cannot be obtained and
  ** SQLITE_BUSY is returned.
  ** EVIDENCE-OF: R-53820-33897 Even if there is a busy-handler configured,
  ** it will not be invoked in this case.
  */
  rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1);
  testcase( rc==SQLITE_BUSY );
  testcase( rc!=SQLITE_OK && xBusy2!=0 );
  if( rc==SQLITE_OK ){
    pWal->ckptLock = 1;

    /* IMPLEMENTATION-OF: R-59782-36818 The SQLITE_CHECKPOINT_FULL, RESTART and
    ** TRUNCATE modes also obtain the exclusive "writer" lock on the database
    ** file.
    **
    ** EVIDENCE-OF: R-60642-04082 If the writer lock cannot be obtained
    ** immediately, and a busy-handler is configured, it is invoked and the
    ** writer lock retried until either the busy-handler returns 0 or the
    ** lock is successfully obtained.
    */
    if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){
      rc = walBusyLock(pWal, xBusy2, pBusyArg, WAL_WRITE_LOCK, 1);
      if( rc==SQLITE_OK ){
        pWal->writeLock = 1;
      }else if( rc==SQLITE_BUSY ){
        eMode2 = SQLITE_CHECKPOINT_PASSIVE;
        xBusy2 = 0;
        rc = SQLITE_OK;
      }
    }
  }


  /* Read the wal-index header. */
  if( rc==SQLITE_OK ){
    walDisableBlocking(pWal);
    rc = walIndexReadHdr(pWal, &isChanged);
    (void)walEnableBlocking(pWal);
    if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){
      sqlite3OsUnfetch(pWal->pDbFd, 0, 0);
    }
  }

  /* Copy data from the log to the database file. */
  if( rc==SQLITE_OK ){

    if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){
      rc = SQLITE_CORRUPT_BKPT;
    }else{
      rc = walCheckpoint(pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf);
    }

    /* If no error occurred, set the output variables. */
    if( rc==SQLITE_OK || rc==SQLITE_BUSY ){
      if( pnLog ) *pnLog = (int)pWal->hdr.mxFrame;
      if( pnCkpt ) *pnCkpt = (int)(walCkptInfo(pWal)->nBackfill);
    }
  }

  if( isChanged ){
    /* If a new wal-index header was loaded before the checkpoint was
    ** performed, then the pager-cache associated with pWal is now
    ** out of date. So zero the cached wal-index header to ensure that
    ** next time the pager opens a snapshot on this database it knows that
    ** the cache needs to be reset.
    */
    memset(&pWal->hdr, 0, sizeof(WalIndexHdr));
  }

  walDisableBlocking(pWal);
  sqlite3WalDb(pWal, 0);

  /* Release the locks. */
  sqlite3WalEndWriteTransaction(pWal);
  if( pWal->ckptLock ){
    walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1);
    pWal->ckptLock = 0;
  }
  WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok"));
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
  if( rc==SQLITE_BUSY_TIMEOUT ) rc = SQLITE_BUSY;
#endif
  return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl $0x0, 0x4c(%rsp)
movl $0x8, %eax
cmpb $0x0, 0x42(%rdi)
jne 0x28be7a
movl %r9d, %ebx
movq %rcx, %r12
movl %edx, %r13d
movq %rdi, %r14
movq %rsi, 0xb8(%rsp)
movq %r8, 0x60(%rsp)
cmpb $0x0, 0x3f(%rdi)
je 0x28ba2f
movl %ebx, 0x8(%rsp)
movb $0x1, 0x41(%r14)
testl %r13d, %r13d
je 0x28ba71
movq 0x60(%rsp), %rbx
cmpb $0x0, 0x3f(%r14)
jne 0x28ba64
movq 0x8(%r14), %rdi
movq (%rdi), %rax
xorl %esi, %esi
movl $0x1, %edx
movl $0xa, %ecx
callq *0x70(%rax)
movl %eax, %ebp
testq %r12, %r12
je 0x28ba57
cmpl $0x5, %ebp
jne 0x28ba57
movq %rbx, %rdi
callq *%r12
testl %eax, %eax
jne 0x28b9fa
jmp 0x28ba6e
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x1, %esi
movl $0x1, %edx
movl $0xa, %ecx
callq *0x70(%rax)
movl %eax, %ebp
movl %r13d, %r15d
testl %eax, %eax
jne 0x28be19
jmp 0x28b9e7
cmpl $0x5, %ebp
je 0x28ba6e
testl %ebp, %ebp
jne 0x28bc45
movb $0x1, 0x40(%r14)
movl %r13d, %r15d
jmp 0x28ba74
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq 0x4c(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x287bea
movl %eax, %ebp
cmpl $0x0, (%rbx)
je 0x28baa1
movq 0x8(%r14), %rdi
movq (%rdi), %rax
cmpl $0x3, (%rax)
jl 0x28baa1
xorl %esi, %esi
xorl %edx, %edx
callq *0x90(%rax)
testl %ebp, %ebp
jne 0x28be19
movl 0x58(%r14), %edx
movzwl 0x56(%r14), %eax
movl %eax, %ecx
shll $0x10, %ecx
orl %eax, %ecx
andl $0x1fe00, %ecx          # imm = 0x1FE00
testl %edx, %edx
je 0x28bafc
cmpl 0x1d0(%rsp), %ecx
je 0x28bafc
leaq 0x14a0f8(%rip), %rsi    # 0x3d5bcb
leaq 0x14a202(%rip), %rdx    # 0x3d5cdc
leaq 0x149f50(%rip), %r8     # 0x3d5a31
movl $0xb, %ebp
movl $0xb, %edi
movl $0xf6f6, %ecx           # imm = 0xF6F6
xorl %eax, %eax
callq 0x274d08
jmp 0x28be19
movq 0x30(%r14), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x60(%rax), %eax
cmpl %edx, %eax
jae 0x28bc3a
movl %ecx, 0x38(%rsp)
movl %r15d, (%rsp)
movl %r13d, 0x4(%rsp)
movl 0x5c(%r14), %eax
movq %rax, 0x88(%rsp)
xorl %ebp, %ebp
movl $0x1, %r13d
movq 0x10(%rsp), %rax
movl 0x64(%rax,%r13,4), %r15d
cmpl %r15d, %edx
jbe 0x28bbea
movl %edx, 0xc(%rsp)
leal 0x3(%r13), %ebx
cmpb $0x0, 0x3f(%r14)
jne 0x28bb98
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl $0x1, %edx
movl $0xa, %ecx
callq *0x70(%rax)
movl %eax, %ebp
testq %r12, %r12
je 0x28bb8b
cmpl $0x5, %ebp
jne 0x28bb8b
movq 0x60(%rsp), %rdi
callq *%r12
testl %eax, %eax
jne 0x28bb4f
movl $0x5, %ebp
jmp 0x28bbbe
cmpl $0x5, %ebp
je 0x28bbbe
testl %ebp, %ebp
jne 0x28bd86
cmpq $0x1, %r13
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
movl %eax, 0x64(%rcx,%r13,4)
xorl %ebp, %ebp
cmpb $0x0, 0x3f(%r14)
je 0x28bbcb
movq %rcx, %rax
jmp 0x28bbe6
movl %r15d, %edx
xorl %r12d, %r12d
movq 0x10(%rsp), %rax
jmp 0x28bbea
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl $0x1, %edx
movl $0x9, %ecx
callq *0x70(%rax)
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %edx
incq %r13
cmpq $0x5, %r13
jne 0x28bb39
movq %rax, %rcx
movl 0x60(%rax), %eax
xorl %esi, %esi
cmpl %edx, %eax
movl 0x4(%rsp), %r13d
jae 0x28bc4d
movl %edx, 0xc(%rsp)
movl 0x60(%rcx), %eax
movq %rax, 0x18(%rsp)
movl 0x58(%r14), %ebp
callq 0x2725a7
testl %eax, %eax
je 0x28bcf2
xorl %edi, %edi
callq 0x272c00
movl $0x7, %ebp
movl (%rsp), %r15d
jmp 0x28be19
xorl %ebx, %ebx
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
jmp 0x28bc5e
movl %r13d, %r15d
jmp 0x28baa1
xorl %ebx, %ebx
movl (%rsp), %r15d
movq %rcx, %rax
cmpl $0x5, %ebp
cmovnel %ebp, %esi
movl %esi, %ebp
testl %r15d, %r15d
je 0x28bddc
testl %ebp, %ebp
jne 0x28bddc
movl 0x60(%rax), %eax
movl $0x5, %ebp
cmpl 0x58(%r14), %eax
jb 0x28bce5
xorl %ebp, %ebp
cmpl $0x2, %r15d
jl 0x28bce5
leaq 0xc0(%rsp), %rsi
movl $0x4, %edi
callq 0x274e7e
cmpb $0x0, 0x3f(%r14)
jne 0x28bd97
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x4, %esi
movl $0x4, %edx
movl $0xa, %ecx
callq *0x70(%rax)
movl %eax, %ebp
testq %r12, %r12
je 0x28bd93
cmpl $0x5, %ebp
jne 0x28bd93
movq 0x60(%rsp), %rdi
callq *%r12
testl %eax, %eax
jne 0x28bc97
movl $0x5, %ebp
jmp 0x28bddc
movq %rbx, %rdi
callq 0x272c00
jmp 0x28bded
movabsq $0xffffffff021, %rax    # imm = 0xFFFFFFFF021
leal 0x1000(%rbp), %r15d
addq %rax, %r15
shrq $0xc, %r15
movq %r15, %rax
shlq $0x20, %rax
movq %rax, 0x68(%rsp)
sarq $0x1b, %rax
leaq (%rax,%rbp,2), %rdi
addq $0x28, %rdi
movq %rdi, 0x30(%rsp)
callq 0x272ae6
testq %rax, %rax
je 0x28bc25
movq %rax, %rbx
movq %rbp, 0x78(%rsp)
leal 0x1(%r15), %ebp
movq %rax, %rdi
xorl %esi, %esi
movq 0x30(%rsp), %rdx
callq 0x173a0
movl %ebp, 0x4(%rbx)
callq 0x2725a7
movl $0x7, %ebp
testl %eax, %eax
movq %rbx, 0x20(%rsp)
je 0x28be8c
movl (%rsp), %r15d
movq 0x20(%rsp), %rdi
callq 0x272c00
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
xorl %esi, %esi
jmp 0x28bc56
xorl %ebx, %ebx
movl 0x4(%rsp), %r13d
movl (%rsp), %r15d
jmp 0x28bddc
testl %ebp, %ebp
jne 0x28bddc
xorl %ebp, %ebp
cmpl $0x3, %r15d
jne 0x28bdbc
movl 0xc0(%rsp), %esi
movq %r14, %rdi
callq 0x2875ae
movq 0x10(%r14), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x20(%rax)
movl %eax, %ebp
cmpb $0x0, 0x3f(%r14)
jne 0x28bddc
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x4, %esi
movl $0x4, %edx
movl $0x9, %ecx
callq *0x70(%rax)
movq %rbx, %rdi
callq 0x272c00
cmpl $0x5, %ebp
je 0x28bded
testl %ebp, %ebp
jne 0x28be19
movq 0x1e8(%rsp), %rax
movq 0x1e0(%rsp), %rcx
testq %rcx, %rcx
je 0x28be08
movl 0x58(%r14), %edx
movl %edx, (%rcx)
testq %rax, %rax
je 0x28be19
movq 0x30(%r14), %rcx
movq (%rcx), %rcx
movl 0x60(%rcx), %ecx
movl %ecx, (%rax)
cmpl $0x0, 0x4c(%rsp)
je 0x28be36
pxor %xmm0, %xmm0
movdqu %xmm0, 0x68(%r14)
movdqu %xmm0, 0x58(%r14)
movdqu %xmm0, 0x48(%r14)
movq %r14, %rdi
callq 0x2887e6
cmpb $0x0, 0x41(%r14)
je 0x28be6a
cmpb $0x0, 0x3f(%r14)
jne 0x28be65
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x1, %esi
movl $0x1, %edx
movl $0x9, %ecx
callq *0x70(%rax)
movb $0x0, 0x41(%r14)
testl %ebp, %ebp
movl $0x5, %eax
cmovnel %ebp, %eax
cmpl %r13d, %r15d
cmovel %ebp, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1000, %edi           # imm = 0x1000
movq 0x78(%rsp), %rax
cmpl %edi, %eax
cmovbl %eax, %edi
addl %edi, %edi
callq 0x272ae6
movq %rax, %r13
testq %rax, %rax
movq %r12, 0x28(%rsp)
movq 0x18(%rsp), %rcx
je 0x28c3e5
addl $0x1001, %ecx           # imm = 0x1001
movabsq $0xffffffff021, %rax    # imm = 0xFFFFFFFF021
addq %rax, %rcx
shrq $0xc, %rcx
cmpl %r15d, %ecx
jg 0x28c3e5
movq %r13, 0x18(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x80(%rsp)
movslq %ecx, %rsi
sarq $0x20, 0x68(%rsp)
leaq 0x16(%rbx), %rax
movq %rax, 0xa8(%rsp)
leaq 0x3c(%rsp), %r13
movq %r14, %rdi
leaq 0x90(%rsp), %rdx
movq %rsi, %rbx
callq 0x28881d
testl %eax, %eax
movl (%rsp), %r15d
jne 0x28c451
movq 0x98(%rsp), %rbp
addq $0x4, %rbp
movq %rbp, 0x98(%rsp)
movq %rbx, 0xb0(%rsp)
cmpq 0x68(%rsp), %rbx
jne 0x28bf57
movl 0xa0(%rsp), %esi
movq 0x78(%rsp), %rax
movl %eax, %edi
subl %esi, %edi
jmp 0x28bf6d
movq 0x90(%rsp), %rdi
subq %rbp, %rdi
shrq $0x2, %rdi
movl 0xa0(%rsp), %esi
movq 0x20(%rsp), %rax
movdqa 0xccab5(%rip), %xmm10   # 0x358a30
pcmpeqd %xmm11, %xmm11
movslq 0x4(%rax), %rcx
shlq $0x5, %rcx
movq 0x80(%rsp), %rax
addq %rcx, %rax
movl %esi, %edx
leaq (%rax,%rdx,2), %rax
movq %rax, 0x30(%rsp)
incl %esi
movl %esi, 0x74(%rsp)
movl %esi, 0xa0(%rsp)
testl %edi, %edi
movq %rdi, 0x50(%rsp)
jle 0x28c308
movl %edi, %esi
leal 0x7(%rdi), %eax
andl $-0x8, %eax
movq %rsi, 0x58(%rsp)
decq %rsi
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rcx,%rdx,2), %rcx
addq 0xa8(%rsp), %rcx
pxor %xmm10, %xmm0
xorl %edx, %edx
movdqa 0xcca33(%rip), %xmm1    # 0x358a20
movdqa 0x112a2b(%rip), %xmm2   # 0x39ea20
movdqa 0x112a13(%rip), %xmm3   # 0x39ea10
movdqa 0x1129fb(%rip), %xmm4   # 0x39ea00
movdqa %xmm1, %xmm5
pxor %xmm10, %xmm5
movdqa %xmm5, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0xa0, %xmm7, %xmm6     # xmm6 = xmm7[0,0,2,2]
pshuflw $0xe8, %xmm6, %xmm8     # xmm8 = xmm6[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pshuflw $0xe8, %xmm5, %xmm9     # xmm9 = xmm5[0,2,2,3,4,5,6,7]
pand %xmm8, %xmm9
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
pshuflw $0xe8, %xmm7, %xmm8     # xmm8 = xmm7[0,2,2,3,4,5,6,7]
por %xmm9, %xmm8
pxor %xmm11, %xmm8
packssdw %xmm8, %xmm8
movd %xmm8, %esi
testb $0x1, %sil
je 0x28c05f
movw %dx, -0xe(%rcx,%rdx,2)
pand %xmm6, %xmm5
por %xmm7, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm11, %xmm5
packssdw %xmm5, %xmm5
movd %xmm5, %esi
shrl $0x10, %esi
testb $0x1, %sil
je 0x28c089
leal 0x1(%rdx), %esi
movw %si, -0xc(%rcx,%rdx,2)
movdqa %xmm2, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0xa0, %xmm7, %xmm5     # xmm5 = xmm7[0,0,2,2]
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
movdqa %xmm6, %xmm8
pand %xmm5, %xmm8
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
por %xmm7, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm11, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x2, %xmm8, %esi
testb $0x1, %sil
je 0x28c0df
leal 0x2(%rdx), %esi
movw %si, -0xa(%rcx,%rdx,2)
pshufhw $0x84, %xmm5, %xmm5     # xmm5 = xmm5[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm6, %xmm6     # xmm6 = xmm6[0,1,2,3,4,5,4,6]
pand %xmm5, %xmm6
pshufhw $0x84, %xmm7, %xmm5     # xmm5 = xmm7[0,1,2,3,4,5,4,6]
por %xmm6, %xmm5
pxor %xmm11, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x3, %xmm5, %esi
testb $0x1, %sil
je 0x28c112
leal 0x3(%rdx), %esi
movw %si, -0x8(%rcx,%rdx,2)
movdqa %xmm3, %xmm5
pxor %xmm10, %xmm5
movdqa %xmm5, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0xa0, %xmm7, %xmm6     # xmm6 = xmm7[0,0,2,2]
pshuflw $0xe8, %xmm6, %xmm8     # xmm8 = xmm6[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pshuflw $0xe8, %xmm5, %xmm9     # xmm9 = xmm5[0,2,2,3,4,5,6,7]
pand %xmm8, %xmm9
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
pshuflw $0xe8, %xmm7, %xmm8     # xmm8 = xmm7[0,2,2,3,4,5,6,7]
por %xmm9, %xmm8
pxor %xmm11, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x4, %xmm8, %esi
testb $0x1, %sil
je 0x28c170
leal 0x4(%rdx), %esi
movw %si, -0x6(%rcx,%rdx,2)
pand %xmm6, %xmm5
por %xmm7, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm11, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x5, %xmm5, %esi
testb $0x1, %sil
je 0x28c198
leal 0x5(%rdx), %esi
movw %si, -0x4(%rcx,%rdx,2)
movdqa %xmm4, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0xa0, %xmm7, %xmm5     # xmm5 = xmm7[0,0,2,2]
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
movdqa %xmm6, %xmm8
pand %xmm5, %xmm8
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
por %xmm7, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm11, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x6, %xmm8, %esi
testb $0x1, %sil
je 0x28c1ee
leal 0x6(%rdx), %esi
movw %si, -0x2(%rcx,%rdx,2)
pshufhw $0x84, %xmm5, %xmm5     # xmm5 = xmm5[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm6, %xmm6     # xmm6 = xmm6[0,1,2,3,4,5,4,6]
pand %xmm5, %xmm6
pshufhw $0x84, %xmm7, %xmm5     # xmm5 = xmm7[0,1,2,3,4,5,4,6]
por %xmm6, %xmm5
pxor %xmm11, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x7, %xmm5, %esi
testb $0x1, %sil
je 0x28c220
leal 0x7(%rdx), %esi
movw %si, (%rcx,%rdx,2)
addq $0x8, %rdx
movdqa 0x142674(%rip), %xmm5   # 0x3ce8a0
paddq %xmm5, %xmm1
paddq %xmm5, %xmm2
paddq %xmm5, %xmm3
paddq %xmm5, %xmm4
cmpq %rdx, %rax
jne 0x28c005
movl $0xd0, %edx
leaq 0xc0(%rsp), %rdi
xorl %esi, %esi
callq 0x173a0
xorl %ebx, %ebx
leaq 0x40(%rsp), %rcx
movl $0x1, 0x3c(%rsp)
movq 0x30(%rsp), %rax
leaq (%rax,%rbx,2), %rsi
movq %rsi, 0x40(%rsp)
xorl %r15d, %r15d
testb $0x1, %bl
jne 0x28c285
movl $0x1, %eax
jmp 0x28c2d6
movq %rbp, %r12
movq %r13, %rbp
movq 0x18(%rsp), %r13
movl %r15d, %eax
shlq $0x4, %rax
movq 0xc8(%rsp,%rax), %rsi
movl 0xc0(%rsp,%rax), %edx
movq %r12, %rdi
movq %rbp, %r8
movq %r13, %r9
callq 0x28c7c7
leaq 0x40(%rsp), %rcx
incl %r15d
btl %r15d, %ebx
jb 0x28c290
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %eax
movq %rbp, %r13
movq %r12, %rbp
movq 0x28(%rsp), %r12
movl %r15d, %edx
shlq $0x4, %rdx
movq %rsi, 0xc8(%rsp,%rdx)
movl %eax, 0xc0(%rsp,%rdx)
incq %rbx
cmpq 0x58(%rsp), %rbx
jne 0x28c260
incl %r15d
cmpl $0xc, %r15d
jbe 0x28c338
jmp 0x28c388
movl $0x0, 0x3c(%rsp)
movq $0x0, 0x40(%rsp)
movl $0xd0, %edx
leaq 0xc0(%rsp), %rdi
xorl %esi, %esi
callq 0x173a0
movl $0x1, %r15d
leaq 0x40(%rsp), %rcx
movl %r15d, %ebx
movq %rbx, %r15
shlq $0x4, %r15
leaq 0xc8(%rsp), %rax
addq %rax, %r15
movq 0x50(%rsp), %rax
btl %ebx, %eax
jae 0x28c378
movq (%r15), %rsi
movl -0x8(%r15), %edx
movq %rbp, %rdi
movq %r13, %r8
movq 0x18(%rsp), %r9
callq 0x28c7c7
movq 0x50(%rsp), %rax
leaq 0x40(%rsp), %rcx
incq %rbx
addq $0x10, %r15
cmpl $0xd, %ebx
jne 0x28c352
movl 0x3c(%rsp), %eax
movq 0xb0(%rsp), %rsi
movq %rsi, %rdi
shlq $0x5, %rdi
movq 0x80(%rsp), %rdx
movl 0x74(%rsp), %ecx
movl %ecx, 0x1c(%rdx,%rdi)
movl %eax, 0x18(%rdx,%rdi)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rdx,%rdi)
movq %rbp, 0x10(%rdx,%rdi)
leaq 0x1(%rsi), %rax
cmpq 0x68(%rsp), %rsi
movq %rax, %rsi
movl 0x8(%rsp), %ebx
jl 0x28bf03
movq 0x18(%rsp), %rdi
callq 0x272c00
movl 0x4(%rsp), %r13d
movl (%rsp), %r15d
jmp 0x28c403
movq %r13, %rdi
callq 0x272c00
testq %r13, %r13
movl 0x4(%rsp), %r13d
movl (%rsp), %r15d
movl 0x8(%rsp), %ebx
je 0x28bd6e
movq 0x10(%rsp), %rax
cmpb $0x0, 0x3f(%r14)
jne 0x28c474
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x3, %esi
movl $0x1, %edx
movl $0xa, %ecx
callq *0x70(%rax)
movl %eax, %ebp
testq %r12, %r12
je 0x28c467
cmpl $0x5, %ebp
jne 0x28c467
movq 0x60(%rsp), %rdi
callq *%r12
xorl %ebp, %ebp
testl %eax, %eax
movq 0x10(%rsp), %rax
jne 0x28c408
movq 0x20(%rsp), %rbx
jmp 0x28bc5e
movl %eax, %ebp
movq 0x18(%rsp), %rdi
callq 0x272c00
movl 0x4(%rsp), %r13d
jmp 0x28bd6e
testl %ebp, %ebp
movq 0x10(%rsp), %rax
jne 0x28c7a0
movl 0x60(%rax), %ecx
movl %ecx, 0x58(%rsp)
movl 0xc(%rsp), %ecx
movl %ecx, 0x80(%rax)
shrl $0x2, %ebx
andl $0x3, %ebx
je 0x28c4ad
movq 0x10(%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
callq *0x28(%rax)
testl %eax, %eax
je 0x28c4ad
movl %eax, %ebp
movl 0x38(%rsp), %eax
movq %rax, 0x30(%rsp)
jmp 0x28c6f0
movl 0x38(%rsp), %ecx
movq 0x88(%rsp), %rax
movq %rcx, 0x30(%rsp)
imulq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x27, %esi
xorl %edx, %edx
callq *0x50(%rax)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
leaq 0x90(%rsp), %rsi
callq *0x30(%rax)
movl %eax, %ebp
testl %eax, %eax
jne 0x28c6f0
movl %ebx, 0x8(%rsp)
movq 0x90(%rsp), %rax
movq 0xc0(%rsp), %rcx
cmpq %rcx, %rax
jge 0x28c574
movl 0x58(%r14), %edx
imulq 0x30(%rsp), %rdx
addq %rdx, %rax
addq $0x10000, %rax          # imm = 0x10000
cmpq %rcx, %rax
jge 0x28c558
leaq 0x14969c(%rip), %rsi    # 0x3d5bcb
leaq 0x1497a6(%rip), %rdx    # 0x3d5cdc
leaq 0x1494f4(%rip), %r8     # 0x3d5a31
movl $0xb, %ebp
movl $0xb, %edi
movl $0xefec, %ecx           # imm = 0xEFEC
xorl %eax, %eax
callq 0x274d08
jmp 0x28c6de
movq 0x8(%r14), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x28c574
leaq 0xc0(%rsp), %rdx
movl $0x5, %esi
callq *0x50(%rax)
movq 0x20(%rsp), %rax
movl 0x4(%rax), %ecx
testl %ecx, %ecx
movq 0xb8(%rsp), %r15
movl 0x58(%rsp), %r12d
jle 0x28c6d6
movq %rax, %rbx
addq $0x8, %rbx
movl 0x38(%rsp), %edx
orl $0x18, %edx
movq %rdx, 0x50(%rsp)
movq $0x0, 0x18(%rsp)
movl (%rax), %eax
movl %ecx, %ecx
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %rcx, %rdx
decq %rcx
movq %rcx, %rsi
shlq $0x5, %rsi
movl 0x18(%rbx,%rsi), %edi
movslq (%rbx,%rsi), %r8
cmpl %edi, %r8d
jge 0x28c61b
addq %rbx, %rsi
movq 0x10(%rsi), %r9
negl %edi
leal 0x1(%r8), %r10d
addq %r8, %r8
addq 0x8(%rsi), %r8
movzwl (%r8), %r11d
movl (%r9,%r11,4), %ebp
cmpl %eax, %ebp
ja 0x28c60a
movl %r10d, (%rsi)
leal (%rdi,%r10), %r11d
incl %r11d
incl %r10d
addq $0x2, %r8
cmpl $0x1, %r11d
jne 0x28c5e5
jmp 0x28c61b
cmpl %r13d, %ebp
jae 0x28c61b
addl 0x1c(%rsi), %r11d
movq %r11, 0x18(%rsp)
movl %ebp, %r13d
cmpq $0x1, %rdx
jg 0x28c5b7
movq 0x20(%rsp), %rax
movl %r13d, (%rax)
cmpl $-0x1, %r13d
je 0x28c6dc
movl 0x168(%r15), %eax
testl %eax, %eax
jne 0x28c7aa
cmpl %r12d, 0x18(%rsp)
jbe 0x28c6c6
movq 0x18(%rsp), %rax
cmpl 0xc(%rsp), %eax
ja 0x28c6c6
cmpl 0x88(%rsp), %r13d
ja 0x28c6c6
movq %r15, %r12
movq 0x18(%rsp), %rax
leal -0x1(%rax), %ecx
imulq 0x50(%rsp), %rcx
addq $0x38, %rcx
movq 0x10(%r14), %rdi
movq (%rdi), %rax
movq 0x1d8(%rsp), %rsi
movl 0x38(%rsp), %r15d
movl %r15d, %edx
callq *0x10(%rax)
testl %eax, %eax
jne 0x28c7c0
decl %r13d
imulq 0x30(%rsp), %r13
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq 0x1d8(%rsp), %rsi
movl %r15d, %edx
movq %r13, %rcx
callq *0x18(%rax)
testl %eax, %eax
movq %r12, %r15
movl 0x58(%rsp), %r12d
jne 0x28c7c0
movq 0x20(%rsp), %rax
movl 0x4(%rax), %ecx
testl %ecx, %ecx
jg 0x28c5ad
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
xorl %ebp, %ebp
movl 0x4(%rsp), %r13d
movl (%rsp), %r15d
movl 0x8(%rsp), %ebx
movq 0x28(%rsp), %r12
movq 0x8(%r14), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x28c706
movl $0x25, %esi
xorl %edx, %edx
callq *0x50(%rax)
testl %ebp, %ebp
jne 0x28c77b
movq 0x30(%r14), %rax
movq (%rax), %rax
movl 0xc(%rsp), %ecx
cmpl 0x10(%rax), %ecx
jne 0x28c76d
movl 0x5c(%r14), %eax
movq 0x30(%rsp), %rsi
imulq %rax, %rsi
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
testl %eax, %eax
je 0x28c747
movl %eax, %ebp
movl 0x4(%rsp), %r13d
movl (%rsp), %r15d
movq 0x28(%rsp), %r12
jmp 0x28c77b
testl %ebx, %ebx
movl 0x4(%rsp), %r13d
movl (%rsp), %r15d
movq 0x28(%rsp), %r12
je 0x28c76d
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
callq *0x28(%rax)
testl %eax, %eax
je 0x28c76d
movl %eax, %ebp
jmp 0x28c77b
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, 0x60(%rax)
xorl %ebp, %ebp
cmpb $0x0, 0x3f(%r14)
jne 0x28c79b
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x3, %esi
movl $0x1, %edx
movl $0x9, %ecx
callq *0x70(%rax)
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rbx
jmp 0x28bd7f
xorl %eax, %eax
cmpb $0x0, 0x61(%r15)
sete %al
leal 0x7(,%rax,2), %ebp
jmp 0x28c6de
movl %eax, %ebp
jmp 0x28c6de