LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Thread_Close
WRes Thread_Close(CThread *p)
{
  // Print("Thread_Close")
  int ret;
  if (!p->_created)
    return 0;
    
  ret = pthread_detach(p->_tid);
  p->_tid = 0;
  p->_created = 0;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x7b41f
movl $0x0, -0x4(%rbp)
jmp 0x7b44a
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x42d0
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Thread_Wait_Close
WRes Thread_Wait_Close(CThread *p)
{
  // Print("Thread_Wait_Close")
  void *thread_return;
  int ret;
  if (!p->_created)
    return EINVAL;

  ret = pthread_join(p->_tid, &thread_return);
  // probably we can't use that (_tid) after pthread_join(), so we close thread here
  p->_created = 0;
  p->_tid = 0;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x7b47f
movl $0x16, -0x4(%rbp)
jmp 0x7b4ae
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4350
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Event_Create
static WRes Event_Create(CEvent *p, int manualReset, int signaled)
{
  RINOK(pthread_mutex_init(&p->_mutex, NULL))
  RINOK(pthread_cond_init(&p->_cond, NULL))
  p->_manual_reset = manualReset;
  p->_state = (signaled ? True : False);
  p->_created = 1;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4560
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x7b524
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b578
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4470
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x7b546
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b578
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x18(%rbp), %edx
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Event_Set
WRes Event_Set(CEvent *p)
{
  RINOK(pthread_mutex_lock(&p->_mutex))
  p->_state = True;
  {
    const int res1 = pthread_cond_broadcast(&p->_cond);
    const int res2 = pthread_mutex_unlock(&p->_mutex);
    return (res2 ? res2 : res1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x4550
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x7b62a
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b66f
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x4110
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x42f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x7b663
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x7b669
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Event_Wait
WRes Event_Wait(CEvent *p)
{
  RINOK(pthread_mutex_lock(&p->_mutex))
  while (p->_state == False)
  {
    // ETIMEDOUT
    // ret =
    pthread_cond_wait(&p->_cond, &p->_mutex);
    // if (ret != 0) break;
  }
  if (p->_manual_reset == False)
  {
    p->_state = False;
  }
  return pthread_mutex_unlock(&p->_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x4550
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x7b6fa
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b742
jmp 0x7b6fc
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x7b71d
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x4590
jmp 0x7b6fc
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x7b732
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x42f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Event_Close
WRes Event_Close(CEvent *p)
{
  if (!p->_created)
    return 0;
  p->_created = 0;
  {
    const int res1 = pthread_mutex_destroy(&p->_mutex);
    const int res2 = pthread_cond_destroy(&p->_cond);
    return (res1 ? res1 : res2);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x7b76e
movl $0x0, -0x4(%rbp)
jmp 0x7b7b2
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x4440
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x4710
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x7b7a6
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x7b7ac
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Semaphore_Create
WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount)
{
  if (initCount > maxCount || maxCount < 1)
    return EINVAL;
  RINOK(pthread_mutex_init(&p->_mutex, NULL))
  RINOK(pthread_cond_init(&p->_cond, NULL))
  p->_count = initCount;
  p->_maxCount = maxCount;
  p->_created = 1;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
ja 0x7b7e0
cmpl $0x1, -0x18(%rbp)
jae 0x7b7e9
movl $0x16, -0x4(%rbp)
jmp 0x7b852
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4560
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x7b80b
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b852
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4470
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x7b82d
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b852
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Semaphore_OptCreateInit
WRes Semaphore_OptCreateInit(CSemaphore *p, UInt32 initCount, UInt32 maxCount)
{
  if (Semaphore_IsCreated(p))
  {
    /*
    WRes wres = Semaphore_Close(p);
    if (wres != 0)
      return wres;
    */
    if (initCount > maxCount || maxCount < 1)
      return EINVAL;
    // return EINVAL; // for debug
    p->_count = initCount;
    p->_maxCount = maxCount;
    return 0;
  }
  return Semaphore_Create(p, initCount, maxCount);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7b8af
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
ja 0x7b889
cmpl $0x1, -0x18(%rbp)
jae 0x7b892
movl $0x16, -0x4(%rbp)
jmp 0x7b8c1
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7b8c1
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x7b7c0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Semaphore_ReleaseN
WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 releaseCount)
{
  UInt32 newCount;
  int ret;

  if (releaseCount < 1)
    return EINVAL;

  RINOK(pthread_mutex_lock(&p->_mutex))

  newCount = p->_count + releaseCount;
  if (newCount > p->_maxCount)
    ret = ERROR_TOO_MANY_POSTS; // EINVAL;
  else
  {
    p->_count = newCount;
    ret = pthread_cond_broadcast(&p->_cond);
  }
  RINOK(pthread_mutex_unlock(&p->_mutex))
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jae 0x7b8ee
movl $0x16, -0x4(%rbp)
jmp 0x7b96c
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x4550
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x7b90c
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b96c
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jbe 0x7b92e
movl $0x8007012a, -0x1c(%rbp) # imm = 0x8007012A
jmp 0x7b948
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x4110
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x42f0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x7b966
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b96c
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Semaphore_Wait
WRes Semaphore_Wait(CSemaphore *p)
{
  RINOK(pthread_mutex_lock(&p->_mutex))
  while (p->_count < 1)
  {
    pthread_cond_wait(&p->_cond, &p->_mutex);
  }
  p->_count--;
  return pthread_mutex_unlock(&p->_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x4550
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x7b9aa
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7b9ea
jmp 0x7b9ac
movq -0x10(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jae 0x7b9cd
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x4590
jmp 0x7b9ac
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x42f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_getDecompressFileCount(UnZipper const*, unsigned int const*, unsigned long)
int OldStream_getDecompressFileCount(const UnZipper* oldZip,const uint32_t* refList,
                                     size_t refCount _VIRTUAL_IN_D(virtual_in)){
    int result=0;
    for (size_t i=0; i<refCount; ++i){
        int fileIndex=(int)refList[i];
#if (_IS_NEED_VIRTUAL_ZIP)
        if ((virtual_in)&&(virtual_in->entryDatas[fileIndex])) {
            if (virtual_in->entryDatas[fileIndex]->isCompressed)
                ++result;
        } else
#endif
        if (UnZipper_file_isCompressed(oldZip,fileIndex))
            ++result;
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x7bc26
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x7f2e0
testb $0x1, %al
jne 0x7bc0d
jmp 0x7bc16
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7bc18
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7bbe3
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_getDecompressSumSize(UnZipper const*, unsigned int const*, unsigned long)
ZipFilePos_t OldStream_getDecompressSumSize(const UnZipper* oldZip,const uint32_t* refList,
                                            size_t refCount _VIRTUAL_IN_D(virtual_in)){
    ZipFilePos_t decompressSumSize=0;
    for (size_t i=0; i<refCount; ++i) {
        int fileIndex=(int)refList[i];
#if (_IS_NEED_VIRTUAL_ZIP)
        if ((virtual_in)&&(virtual_in->entryDatas[fileIndex])) {
            if (virtual_in->entryDatas[fileIndex]->isCompressed)
                decompressSumSize+=virtual_in->entryDatas[fileIndex]->uncompressedSize;
        } else
#endif
            if (UnZipper_file_isCompressed(oldZip,fileIndex))
                decompressSumSize+=UnZipper_file_uncompressedSize(oldZip,fileIndex);
    }
    return decompressSumSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x7bc9f
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x7f2e0
testb $0x1, %al
jne 0x7bc7d
jmp 0x7bc8f
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x80480
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x7bc91
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7bc53
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_getDecompressData(UnZipper*, unsigned int const*, unsigned long, hpatch_TStreamOutput*)
bool OldStream_getDecompressData(UnZipper* oldZip,const uint32_t* refList,size_t refCount,
                                 hpatch_TStreamOutput* output_refStream _VIRTUAL_IN_D(virtual_in)){
    hpatch_StreamPos_t writeToPos=0;
    for (size_t i=0;i<refCount;++i){
        int fileIndex=(int)refList[i];
#if (_IS_NEED_VIRTUAL_ZIP)
        if ((virtual_in)&&(virtual_in->entryDatas[fileIndex])) {
            TZipEntryData* entryData=virtual_in->entryDatas[fileIndex];
            if (entryData->isCompressed){
                if (!UnZipper_compressedData_decompressTo(oldZip,entryData->dataStream, 0,
                                                          entryData->dataStream->streamSize,
                                                          entryData->uncompressedSize,
                                                          output_refStream,writeToPos)) return false;
                writeToPos+=entryData->uncompressedSize;
            }
        } else
#endif
        if (UnZipper_file_isCompressed(oldZip,fileIndex)){
            if (!UnZipper_fileData_decompressTo(oldZip,fileIndex,output_refStream,writeToPos))
                return false;
            writeToPos+=UnZipper_file_uncompressedSize(oldZip,fileIndex);
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x7bd46
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x7f2e0
testb $0x1, %al
jne 0x7bd02
jmp 0x7bd36
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x80d50
testb $0x1, %al
jne 0x7bd20
movb $0x0, -0x1(%rbp)
jmp 0x7bd4a
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x80480
movl %eax, %eax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x7bd38
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7bcd8
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_getOldCrc(UnZipper const*, unsigned int const*, unsigned long)
uint32_t OldStream_getOldCrc(const UnZipper* oldZip,const uint32_t* refList,
                             size_t refCount _VIRTUAL_IN_D(virtual_in)){
    unsigned char buf4[4];
    uLong crc=0;
    const unsigned char* CE;
#if (_IS_NEED_VIRTUAL_ZIP)
    if (virtual_in)
        CE=UnZipper_CEData(&virtual_in->virtualZip);
    else
#endif
        CE=UnZipper_CEData(oldZip);
    crc=crc32(crc,CE,(uInt)UnZipper_CESize(oldZip));
    for (size_t i=0;i<refCount;++i){
        int fileIndex=(int)refList[i];
        uint32_t fileCrc;
#if (_IS_NEED_VIRTUAL_ZIP)
        if ((virtual_in)&&(virtual_in->entryDatas[fileIndex]))
            fileCrc=UnZipper_file_crc32(&virtual_in->virtualZip,fileIndex);
        else
#endif
            fileCrc=UnZipper_file_crc32(oldZip,fileIndex);
        writeUInt32_to(buf4,fileCrc);
        crc=crc32(crc,buf4,4);
    }
    return (uint32_t)crc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7be20
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7be40
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl %eax, %edx
callq 0x92a10
movq %rax, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x7be14
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x80540
movl %eax, -0x40(%rbp)
leaq -0x1c(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x7be70
movq -0x28(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
movl $0x4, %edx
callq 0x92a10
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7bdbd
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_open(OldStream*, UnZipper*, unsigned int const*, unsigned long, unsigned int const*, unsigned long, hpatch_TStreamInput const*)
bool OldStream_open(OldStream* self,UnZipper* oldZip,const uint32_t* refList,size_t refCount,
                    const uint32_t* refNotDecompressList,size_t refNotDecompressCount,
                    const hpatch_TStreamInput* input_decompressedStream _VIRTUAL_IN_D(virtual_in)){
    bool result=true;
    uint32_t oldDataSize;
    check(self->stream==0);
    
    self->_oldZip=oldZip;
    self->_input_decompressedStream=input_decompressedStream;
#if (_IS_NEED_VIRTUAL_ZIP)
    self->_vin=virtual_in;
    if (virtual_in!=0)
        check(refNotDecompressCount==0);
#endif
    check(_createRange(self,refList,refCount,refNotDecompressList,refNotDecompressCount));
    assert(self->_rangeCount>0);
    oldDataSize=self->_rangeEndList[self->_rangeCount-1];
    
    self->_stream.streamImport=self;
    self->_stream.streamSize=oldDataSize;
    self->_stream.read=_OldStream_read;
    self->stream=&self->_stream;
clear:
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x1, -0x31(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x7c353
leaq 0x36e21(%rip), %rdi     # 0xb314a
movb $0x0, %al
callq 0x4060
movb $0x0, -0x31(%rbp)
leaq 0x30f35(%rip), %rdi     # 0xad270
leaq 0x36d2c(%rip), %rsi     # 0xb306e
movl $0x127, %edx            # imm = 0x127
leaq 0x36e14(%rip), %rcx     # 0xb3162
callq 0x4270
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x7bf30
testb $0x1, %al
jne 0x7c3b9
leaq 0x36e51(%rip), %rdi     # 0xb31e0
movb $0x0, %al
callq 0x4060
movb $0x0, -0x31(%rbp)
leaq 0x30ecf(%rip), %rdi     # 0xad270
leaq 0x36cc6(%rip), %rsi     # 0xb306e
movl $0x130, %edx            # imm = 0x130
leaq 0x36dae(%rip), %rcx     # 0xb3162
callq 0x4270
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jbe 0x7c3c6
jmp 0x7c3e5
leaq 0x36e6a(%rip), %rdi     # 0xb3237
leaq 0x36c9a(%rip), %rsi     # 0xb306e
movl $0x131, %edx            # imm = 0x131
leaq 0x36d82(%rip), %rcx     # 0xb3162
callq 0x4270
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x38(%rbp), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
leaq 0x2d(%rip), %rcx        # 0x7c450
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rcx
addq $0x18, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movb -0x31(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_read_do(OldStream*, unsigned long long, unsigned char*, unsigned char*, int)
static bool _OldStream_read_do(OldStream* self,hpatch_StreamPos_t readFromPos,
                                 unsigned char* out_data,unsigned char* out_data_end,int curRangeIndex){
    hpatch_StreamPos_t readPos=readFromPos - self->_rangeEndList[curRangeIndex-1];
#if (_IS_NEED_VIRTUAL_ZIP)
    if ((self->_vin)&&(self->_rangIsInVirtualBuf[curRangeIndex])){
        int fileIndex=self->_rangeFileOffsets[curRangeIndex];
        TZipEntryData* entryData=self->_vin->entryDatas[fileIndex];
        return hpatch_FALSE!=entryData->dataStream->read(entryData->dataStream,
                                                         readPos,out_data,out_data_end);
    }
#endif
    readPos+=self->_rangeFileOffsets[curRangeIndex];
    if (curRangeIndex==0){
        const unsigned char* src;
#if (_IS_NEED_VIRTUAL_ZIP)
        if (self->_vin)
            src=UnZipper_CEData(&self->_vin->virtualZip);
        else
#endif
            src=UnZipper_CEData(self->_oldZip);
        memcpy(out_data,src+readPos,out_data_end-out_data);
        return true;
    }else if (self->_rangIsInDecBuf[curRangeIndex]){
        return hpatch_FALSE!=self->_input_decompressedStream->read(self->_input_decompressedStream,
                                                                   readPos,out_data,out_data_end);
    }else{
        return UnZipper_fileData_read(self->_oldZip,(ZipFilePos_t)readPos,out_data,out_data_end);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
movl -0x2c(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
subq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x7c6eb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7be20
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
callq 0x4320
movb $0x1, -0x1(%rbp)
jmp 0x7c74f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x2c(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x7c72f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq *%rax
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x7c74f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x7fcb0
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: findRangeIndex(unsigned int const*, unsigned long, unsigned int)
static int findRangeIndex(const uint32_t* ranges,size_t rangeCount,uint32_t pos){
    //optimize, binary search?
    for (size_t i=0; i<rangeCount; ++i) {
        if (pos>=ranges[i]) continue;
        return (int)i;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x7c7aa
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jb 0x7c793
jmp 0x7c79c
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x7c7b1
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7c777
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_isHaveApkV1_or_jarSign
bool UnZipper_isHaveApkV1_or_jarSign(const UnZipper* self){
    int fCount=UnZipper_fileCount(self);
    for (int i=fCount-1; i>=0; --i) {
        if (UnZipper_file_isApkV1_or_jarSign(self,i))
            return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x7ebcc
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x7ebe0
testb $0x1, %al
jne 0x7ebb9
jmp 0x7ebbf
movb $0x1, -0x1(%rbp)
jmp 0x7ebd0
jmp 0x7ebc1
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7eba1
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_isApkV1_or_jarSign
bool UnZipper_file_isApkV1_or_jarSign(const UnZipper* self,int fileIndex){
    const char* kJarSignPath0="META-INF/";
    const char* kJarSignPath1="META-INF\\";
    const size_t kJarSignPathLen=8+1;
    if (UnZipper_file_nameLen(self,fileIndex)<(int)kJarSignPathLen) return false;
    const char* fn=UnZipper_file_nameBegin(self,fileIndex);
    return (0==memcmp(fn,kJarSignPath0,kJarSignPathLen))
         ||(0==memcmp(fn,kJarSignPath1,kJarSignPathLen));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
leaq 0x34e20(%rip), %rax     # 0xb3a16
movq %rax, -0x20(%rbp)
leaq 0x34e1f(%rip), %rax     # 0xb3a20
movq %rax, -0x28(%rbp)
movq $0x9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eae0
cmpl $0x9, %eax
jge 0x7ec24
movb $0x0, -0x1(%rbp)
jmp 0x7ec79
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eb50
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x9, %edx
callq 0x4190
movl %eax, %edx
movb $0x1, %al
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x39(%rbp)
je 0x7ec71
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x9, %edx
callq 0x4190
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
sete %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_isHaveApkV1Sign
bool UnZipper_isHaveApkV1Sign(const UnZipper* self){
    int fCount=UnZipper_fileCount(self);
    for (int i=fCount-1; i>=0; --i) {
        if (UnZipper_file_isApkV1Sign(self,i))
            return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x7ecdc
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x7ecf0
testb $0x1, %al
jne 0x7ecc9
jmp 0x7eccf
movb $0x1, -0x1(%rbp)
jmp 0x7ece0
jmp 0x7ecd1
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7ecb1
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_isApkV1Sign
bool UnZipper_file_isApkV1Sign(const UnZipper* self,int fileIndex){
    if (!UnZipper_file_isApkV1_or_jarSign(self,fileIndex)) return false;
    if (_fileName_isEndWith(self,fileIndex,kJarSignSF)) return true;
    if (_fileName_isEndWith(self,fileIndex,".RSA")) return true;
    if (_fileName_is(self,fileIndex,"META-INF/MANIFEST.MF")) return true;
    if (_fileName_is(self,fileIndex,"META-INF\\MANIFEST.MF")) return true;
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7ebe0
testb $0x1, %al
jne 0x7ed18
movb $0x0, -0x1(%rbp)
jmp 0x7ed98
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq 0x67882(%rip), %rdx     # 0xe65a8
callq 0x7f160
testb $0x1, %al
jne 0x7ed31
jmp 0x7ed37
movb $0x1, -0x1(%rbp)
jmp 0x7ed98
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x34ce5(%rip), %rdx     # 0xb3a2a
callq 0x7f160
testb $0x1, %al
jne 0x7ed50
jmp 0x7ed56
movb $0x1, -0x1(%rbp)
jmp 0x7ed98
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x34ccb(%rip), %rdx     # 0xb3a2f
callq 0x7f1f0
testb $0x1, %al
jne 0x7ed6f
jmp 0x7ed75
movb $0x1, -0x1(%rbp)
jmp 0x7ed98
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x34cc1(%rip), %rdx     # 0xb3a44
callq 0x7f1f0
testb $0x1, %al
jne 0x7ed8e
jmp 0x7ed94
movb $0x1, -0x1(%rbp)
jmp 0x7ed98
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_is_lastNameWith
bool UnZipper_file_is_lastNameWith(const UnZipper* self,int fileIndex,const char* lastName,int lastNameLen){
         if (!UnZipper_file_is_nameEndWith(self,fileIndex,lastName,lastNameLen)) return false;
        size_t nameL=UnZipper_file_nameLen(self,fileIndex);
        if (lastNameLen==nameL) return true;
        size_t s1=lastNameLen-nameL-1;
        const char* fn=UnZipper_file_nameBegin(self,fileIndex);
        return _isDirTag(fn[s1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x7eec0
testb $0x1, %al
jne 0x7ee53
movb $0x0, -0x1(%rbp)
jmp 0x7eeab
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eae0
cltq
movq %rax, -0x30(%rbp)
movslq -0x24(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x7ee75
movb $0x1, -0x1(%rbp)
jmp 0x7eeab
movslq -0x24(%rbp), %rax
subq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eb50
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x7ef40
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_is_nameEndWith
bool UnZipper_file_is_nameEndWith(const UnZipper* self,int fileIndex,const char* nameSuffix,int nameSuffixLen){
    int fnLen=UnZipper_file_nameLen(self,fileIndex);
    if (fnLen<nameSuffixLen) return false;
    const char* fn=UnZipper_file_nameBegin(self,fileIndex);
    return (0==memcmp(fn+fnLen-nameSuffixLen,nameSuffix,nameSuffixLen));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eae0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7eef3
movb $0x0, -0x1(%rbp)
jmp 0x7ef35
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eb50
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x28(%rbp), %rax
addq %rax, %rdi
movslq -0x24(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movslq -0x24(%rbp), %rdx
callq 0x4190
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_searchFileIndexByName
int UnZipper_searchFileIndexByName(const UnZipper* self,const char* fileName,int fileNameLen){
    int fCount=UnZipper_fileCount(self);
    for (int i=0; i<fCount; ++i) {
        if (UnZipper_file_is_sameName(self,i,fileName,fileNameLen))
            return i;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x7efdc
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x7edb0
testb $0x1, %al
jne 0x7efc7
jmp 0x7efcf
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7efe3
jmp 0x7efd1
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7efa6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_isHaveApkV2orV3SignTag_in_ApkV1SignFile
bool UnZipper_isHaveApkV2orV3SignTag_in_ApkV1SignFile(UnZipper* self){
    int fCount=UnZipper_fileCount(self);
    for (int i=fCount-1; i>=0; --i) {
        if (_UnZipper_file_isHaveApkV2orV3SignTag_in_ApkV1SignFile(self,i))
            return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x7f03c
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x7f050
testb $0x1, %al
jne 0x7f029
jmp 0x7f02f
movb $0x1, -0x1(%rbp)
jmp 0x7f040
jmp 0x7f031
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7f011
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_isHaveApkV2orV3SignTag_in_ApkV1SignFile(UnZipper*, int)
static bool _UnZipper_file_isHaveApkV2orV3SignTag_in_ApkV1SignFile(UnZipper* self,int fileIndex){
        if (!UnZipper_file_isApkV1Sign(self,fileIndex)) return false;
        
        //match fileType
        if (!_fileName_isEndWith(self,fileIndex,kJarSignSF)) return false;
        //match V2 tag in txt file
        size_t fsize=UnZipper_file_uncompressedSize(self,fileIndex);
        TByte* data=(TByte*)malloc(fsize+1); //+1 for '\0'
        check(data!=0);
        hpatch_TStreamOutput stream;
        mem_as_hStreamOutput(&stream,data,data+fsize);
        if(!UnZipper_fileData_decompressTo(self,fileIndex,&stream,0)) {
            free(data); return false; }
        data[fsize]='\0';
        bool result=_find_ApkV2orV3SignTag_in_c_string((char*)data);
        free(data);
        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7ecf0
testb $0x1, %al
jne 0x7f078
movb $0x0, -0x1(%rbp)
jmp 0x7f148
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq 0x67522(%rip), %rdx     # 0xe65a8
callq 0x7f160
testb $0x1, %al
jne 0x7f098
movb $0x0, -0x1(%rbp)
jmp 0x7f148
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x80480
movl %eax, %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x44d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x7f0e1
leaq 0x2e1a7(%rip), %rdi     # 0xad270
leaq 0x348ba(%rip), %rsi     # 0xb398a
movl $0x135, %edx            # imm = 0x135
leaq 0x35354(%rip), %rcx     # 0xb4430
callq 0x4270
movq -0x28(%rbp), %rsi
movq -0x28(%rbp), %rdx
addq -0x20(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x85c10
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x80d50
testb $0x1, %al
jne 0x7f11d
movq -0x28(%rbp), %rdi
callq 0x4460
movb $0x0, -0x1(%rbp)
jmp 0x7f148
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rdi
callq 0x83fc0
andb $0x1, %al
movb %al, -0x49(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4460
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: fileName_isEndWith(UnZipper const*, int, char const*)
static bool _fileName_isEndWith(const UnZipper* self,int fileIndex,const char* tag){
        const size_t tagLen=strlen(tag);
        int fnameLen=UnZipper_file_nameLen(self,fileIndex);
        if (fnameLen<(int)tagLen) return false;
        const char* fnameBegin=UnZipper_file_nameBegin(self,fileIndex);
        return (0==memcmp(fnameBegin+fnameLen-tagLen,tag,tagLen));
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4180
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eae0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl %ecx, %eax
jge 0x7f1a0
movb $0x0, -0x1(%rbp)
jmp 0x7f1df
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eb50
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x2c(%rbp), %rax
addq %rax, %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x4190
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_close
bool UnZipper_close(UnZipper* self){
    self->stream=0;
    if (self->_buf) { free(self->_buf); self->_buf=0; }
    _UnZipper_close_fvce(self);
    if (self->_fileStream.m_file!=0) { check(hpatch_TFileStreamInput_close(&self->_fileStream)); }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
je 0x7f3d4
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdi
callq 0x4460
movq -0x8(%rbp), %rax
movq $0x0, 0x90(%rax)
movq -0x8(%rbp), %rdi
callq 0x7f430
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x7f41b
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x8e030
cmpl $0x0, %eax
jne 0x7f419
leaq 0x2de6f(%rip), %rdi     # 0xad270
leaq 0x34582(%rip), %rsi     # 0xb398a
movl $0x1c2, %edx            # imm = 0x1C2
leaq 0x34645(%rip), %rcx     # 0xb3a59
callq 0x4270
jmp 0x7f41b
movb $0x1, %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_open_begin(UnZipper*)
static bool _UnZipper_open_begin(UnZipper* self){
    assert(self->_buf==0);
    self->_buf=(unsigned char*)malloc(kBufSize);
    check(self->_buf!=0);
    self->_isDataNormalized=false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jne 0x7f89c
jmp 0x7f8bb
leaq 0x337bd(%rip), %rdi     # 0xb3060
leaq 0x340e0(%rip), %rsi     # 0xb398a
movl $0x1c7, %edx            # imm = 0x1C7
leaq 0x34be0(%rip), %rcx     # 0xb4496
callq 0x4270
movl $0x4000, %edi           # imm = 0x4000
callq 0x44d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jne 0x7f900
leaq 0x2d988(%rip), %rdi     # 0xad270
leaq 0x3409b(%rip), %rsi     # 0xb398a
movl $0x1c9, %edx            # imm = 0x1C9
leaq 0x34b9b(%rip), %rcx     # 0xb4496
callq 0x4270
movq -0x8(%rbp), %rax
movb $0x0, 0x89(%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_searchEndCentralDirectory(UnZipper*, unsigned int*)
static bool _UnZipper_searchEndCentralDirectory(UnZipper* self,ZipFilePos_t* out_endCentralDirectory_pos){
    TByte*       buf=self->_buf;
    ZipFilePos_t max_back_pos = kMaxEndGlobalComment+kMinEndCentralDirectorySize;
    ZipFilePos_t fileLength=(ZipFilePos_t)self->stream->streamSize;
    if (max_back_pos>fileLength)
        max_back_pos=fileLength;
    ZipFilePos_t readed_pos=0;
    uint32_t     cur_value=0;
    while (readed_pos<max_back_pos) {
        ZipFilePos_t readLen=max_back_pos-readed_pos;
        if (readLen>kBufSize) readLen=kBufSize;
        readed_pos+=readLen;
        check(self->stream->read(self->stream,fileLength-readed_pos,buf,buf+readLen));
        for (int i=(int)readLen-1; i>=0; --i) {
            cur_value=(cur_value<<8)|buf[i];
            if (cur_value==kENDHEADERMAGIC){
                *out_endCentralDirectory_pos=(fileLength-readed_pos)+i;
                return true;//ok
            }
        }
    }
    return false;//not found
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x10016, -0x24(%rbp)   # imm = 0x10016
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jbe 0x7f962
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x7fa45
movl -0x24(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x4000, -0x34(%rbp)    # imm = 0x4000
jbe 0x7f995
movl $0x4000, -0x34(%rbp)    # imm = 0x4000
movl -0x34(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
movl -0x28(%rbp), %ecx
subl -0x2c(%rbp), %ecx
movl %ecx, %ecx
movl %ecx, %esi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x34(%rbp), %r8d
addq %r8, %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x7f9ef
leaq 0x2d899(%rip), %rdi     # 0xad270
leaq 0x33fac(%rip), %rsi     # 0xb398a
movl $0x77, %edx
leaq 0x34ad2(%rip), %rcx     # 0xb44bc
callq 0x4270
movl -0x34(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jl 0x7fa40
movl -0x30(%rbp), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movslq -0x38(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x30(%rbp)
cmpl $0x6054b50, -0x30(%rbp) # imm = 0x6054B50
jne 0x7fa33
movl -0x28(%rbp), %ecx
subl -0x2c(%rbp), %ecx
addl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x7fa49
jmp 0x7fa35
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7f9f8
jmp 0x7f970
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_searchCentralDirectory(UnZipper*, unsigned int, unsigned int*, unsigned int*)
static bool _UnZipper_searchCentralDirectory(UnZipper* self,ZipFilePos_t endCentralDirectory_pos,
                                             ZipFilePos_t* out_centralDirectory_pos,uint32_t* out_fileCount){
    const int readLen=20-8;
    TByte buf[readLen];
    check(self->stream->read(self->stream,endCentralDirectory_pos+8,buf,buf+readLen));
    *out_fileCount=readUInt16(buf+(8-8));
    *out_centralDirectory_pos=readUInt32(buf+(16-8));
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0xc, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rdi
movl -0xc(%rbp), %ecx
addl $0x8, %ecx
movl %ecx, %ecx
movl %ecx, %esi
leaq -0x30(%rbp), %rdx
leaq -0x30(%rbp), %rcx
addq $0xc, %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x7facc
leaq 0x2d7bc(%rip), %rdi     # 0xad270
leaq 0x33ecf(%rip), %rsi     # 0xb398a
movl $0x87, %edx
leaq 0x34a3a(%rip), %rcx     # 0xb4501
callq 0x4270
leaq -0x30(%rbp), %rdi
callq 0x7eac0
movzwl %ax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
leaq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x804b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_openVirtualVCE
bool UnZipper_openVirtualVCE(UnZipper* self,ZipFilePos_t fvce_size,int fileCount){
    check(_UnZipper_open_begin(self));
    check(_UnZipper_open_fvce(self,fvce_size,fileCount));
    mem_as_hStreamInput(&self->_fileStream.base,self->_cache_fvce,self->_cache_fvce+self->_fvce_size);
    self->stream=&self->_fileStream.base;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7f880
testb $0x1, %al
jne 0x8025e
leaq 0x2d02a(%rip), %rdi     # 0xad270
leaq 0x3373d(%rip), %rsi     # 0xb398a
movl $0x217, %edx            # imm = 0x217
leaq 0x338cc(%rip), %rcx     # 0xb3b25
callq 0x4270
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x7fb00
testb $0x1, %al
jne 0x80290
leaq 0x2cff8(%rip), %rdi     # 0xad270
leaq 0x3370b(%rip), %rsi     # 0xb398a
movl $0x218, %edx            # imm = 0x218
leaq 0x3389a(%rip), %rcx     # 0xb3b25
callq 0x4270
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
addq %rax, %rdx
callq 0x85b30
movq -0x8(%rbp), %rcx
addq $0x8, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)