LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtCoder.c
// Function: MtCoder_Free
static void MtCoder_Free(CMtCoder *p)
{
  unsigned i;

  /*
  p->stopReading = True;
  if (Event_IsCreated(&p->readEvent))
    Event_Set(&p->readEvent);
  */

  for (i = 0; i < MTCODER_THREADS_MAX; i++)
    MtCoderThread_Destruct(&p->threads[i]);

  Event_Close(&p->readEvent);
  Semaphore_Close(&p->blocksSemaphore);

  #ifdef MTCODER_USE_WRITE_THREAD
    for (i = 0; i < MTCODER_BLOCKS_MAX; i++)
      Event_Close(&p->writeEvents[i]);
  #else
    Event_Close(&p->finishedEvent);
  #endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x758(%rdi), %r15
leaq 0x7c0(%rdi), %r12
xorl %r13d, %r13d
cmpl $0x0, 0x7c8(%rbx,%r13)
je 0x3b6ff
leaq (%r12,%r13), %r14
movl $0x1, 0x74c(%rbx,%r13)
leaq (%r15,%r13), %rdi
callq 0x3d7a5
movq %r14, %rdi
callq 0x3d6fb
leaq (%r15,%r13), %rdi
callq 0x3d875
movq 0x750(%rbx,%r13), %rsi
testq %rsi, %rsi
je 0x3b730
movq 0x740(%rbx,%r13), %rax
movq 0x38(%rax), %rdi
callq *0x8(%rdi)
movq $0x0, 0x750(%rbx,%r13)
addq $0x90, %r13
cmpq $0x2400, %r13           # imm = 0x2400
jne 0x3b6d3
leaq 0x58(%rbx), %rdi
callq 0x3d875
leaq 0xc0(%rbx), %rdi
callq 0x3d9eb
addq $0x130, %rbx            # imm = 0x130
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3d875
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtCoder.c
// Function: MtCoderThread_CreateAndStart
static SRes MtCoderThread_CreateAndStart(CMtCoderThread *t)
{
  WRes wres = AutoResetEvent_OptCreate_And_Reset(&t->startEvent);
  if (wres == 0)
  {
    t->stop = False;
    if (!Thread_WasCreated(&t->thread))
      wres = Thread_Create(&t->thread, ThreadFunc, t);
    if (wres == 0)
      wres = Event_Set(&t->startEvent);
  }
  if (wres == 0)
    return SZ_OK;
  return MY_SRes_HRESULT_FROM_WRes(wres);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
movq %rbx, %rdi
callq 0x3da6a
testl %eax, %eax
jne 0x3ba22
movl $0x0, 0xc(%r14)
cmpl $0x0, 0x88(%r14)
je 0x3ba08
movq %rbx, %rdi
callq 0x3d7a5
jmp 0x3ba22
leaq 0x80(%r14), %rdi
leaq 0x24(%rip), %rsi        # 0x3ba3a
movq %r14, %rdx
callq 0x3d63b
testl %eax, %eax
je 0x3b9fe
movzwl %ax, %ecx
orl $0x88000000, %ecx       # imm = 0x88000000
testl %eax, %eax
cmovlel %eax, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtProgress_Progress_ST
SRes MtProgress_Progress_ST(CMtProgress *p)
{
  if (p->res == SZ_OK && p->progress)
    if (ICompressProgress_Progress(p->progress, p->totalInSize, p->totalOutSize) != SZ_OK)
      p->res = SZ_ERROR_PROGRESS;
  return p->res;
}

// Assembly:
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x3bfe2
retq
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3c00a
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
callq *(%rdi)
testl %eax, %eax
je 0x3c00e
movl $0xa, 0x8(%rbx)
movl $0xa, %eax
jmp 0x3c011
xorl %eax, %eax
jmp 0x3c011
movl 0x8(%rbx), %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtProgress_ProgressAdd
SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize)
{
  SRes res;
  CriticalSection_Enter(&p->cs);
  
  p->totalInSize += inSize;
  p->totalOutSize += outSize;
  if (p->res == SZ_OK && p->progress)
    if (ICompressProgress_Progress(p->progress, p->totalInSize, p->totalOutSize) != SZ_OK)
      p->res = SZ_ERROR_PROGRESS;
  res = p->res;
  
  CriticalSection_Leave(&p->cs);
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3da34
addq 0x10(%r14), %r12
movq %r12, 0x10(%r14)
addq 0x18(%r14), %r15
movq %r15, 0x18(%r14)
movl 0x8(%r14), %ebp
testl %ebp, %ebp
je 0x3c05b
movq %rbx, %rdi
callq 0x3da3e
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3c07e
movq %r12, %rsi
movq %r15, %rdx
callq *(%rdi)
testl %eax, %eax
je 0x3c082
movl $0xa, 0x8(%r14)
movl $0xa, %ebp
jmp 0x3c048
xorl %ebp, %ebp
jmp 0x3c048
movl 0x8(%r14), %ebp
jmp 0x3c048
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtProgress_GetError
SRes MtProgress_GetError(CMtProgress *p)
{
  SRes res;
  CriticalSection_Enter(&p->cs);
  res = p->res;
  CriticalSection_Leave(&p->cs);
  return res;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x3da34
movl 0x8(%rbx), %ebx
movq %r14, %rdi
callq 0x3da3e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtProgress_SetError
void MtProgress_SetError(CMtProgress *p, SRes res)
{
  CriticalSection_Enter(&p->cs);
  if (p->res == SZ_OK)
    p->res = res;
  CriticalSection_Leave(&p->cs);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3da34
cmpl $0x0, 0x8(%r14)
jne 0x3c0d0
movl %ebp, 0x8(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3da3e
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDecThread_FreeInBufs
void MtDecThread_FreeInBufs(CMtDecThread *t)
{
  if (t->inBuf)
  {
    void *link = t->inBuf;
    t->inBuf = NULL;
    do
    {
      void *next = ((CMtDecBufLink *)link)->next;
      ISzAlloc_Free(t->mtDec->alloc, link);
      link = next;
    }
    while (link);
  }
}

// Assembly:
movq 0x10(%rdi), %rsi
testq %rsi, %rsi
je 0x3c110
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, 0x10(%rdi)
movq (%rsi), %r14
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq *0x8(%rdi)
movq %r14, %rsi
testq %r14, %r14
jne 0x3c0f4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDec_GetCrossBuff
Byte *MtDec_GetCrossBuff(CMtDec *p)
{
  Byte *cr = p->crossBlock;
  if (!cr)
  {
    cr = (Byte *)ISzAlloc_Alloc(p->alloc, MTDEC__LINK_DATA_OFFSET + p->inBufSize);
    if (!cr)
      return NULL;
    p->crossBlock = cr;
  }
  return MTDEC__DATA_PTR_FROM_LINK(cr);
}

// Assembly:
pushq %rbx
movq 0x78(%rdi), %rax
testq %rax, %rax
jne 0x3c134
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x20(%rdi), %rdi
addq $0x20, %rsi
callq *(%rdi)
testq %rax, %rax
je 0x3c13a
movq %rax, 0x78(%rbx)
addq $0x20, %rax
popq %rbx
retq
xorl %eax, %eax
jmp 0x3c138
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDec_PrepareRead
int MtDec_PrepareRead(CMtDec *p)
{
  if (p->crossBlock && p->crossStart == p->crossEnd)
  {
    ISzAlloc_Free(p->alloc, p->crossBlock);
    p->crossBlock = NULL;
  }
    
  {
    unsigned i;
    for (i = 0; i < MTDEC_THREADS_MAX; i++)
      if (i > p->numStartedThreads
          || p->numFilledThreads <=
            (i >= p->filledThreadStart ?
              i - p->filledThreadStart :
              i + p->numStartedThreads - p->filledThreadStart))
        MtDecThread_FreeInBufs(&p->threads[i]);
  }

  return (p->numFilledThreads != 0) || (p->crossStart != p->crossEnd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x78(%rdi), %rsi
testq %rsi, %rsi
je 0x3c174
movq 0x80(%rbx), %rax
cmpq 0x88(%rbx), %rax
jne 0x3c174
movq 0x20(%rbx), %rdi
callq *0x8(%rdi)
movq $0x0, 0x78(%rbx)
leaq 0x108(%rbx), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movl 0x70(%rbx), %eax
cmpq %rax, %r12
ja 0x3c1a5
movl 0xa8(%rbx), %ecx
cmpq %rcx, %r12
cmovael %r15d, %eax
movl %r12d, %edx
subl %ecx, %edx
addl %eax, %edx
cmpl %edx, 0xac(%rbx)
ja 0x3c1d7
imulq $0x110, %r12, %r13      # imm = 0x110
movq 0x10(%r14,%r13), %rsi
testq %rsi, %rsi
je 0x3c1d7
addq %r14, %r13
movq $0x0, 0x10(%r13)
movq (%rsi), %rbp
movq (%r13), %rax
movq 0x20(%rax), %rdi
callq *0x8(%rdi)
movq %rbp, %rsi
testq %rbp, %rbp
jne 0x3c1c1
incq %r12
cmpq $0x20, %r12
jne 0x3c181
movl $0x1, %eax
cmpl $0x0, 0xac(%rbx)
jne 0x3c201
movq 0x80(%rbx), %rcx
xorl %eax, %eax
cmpq 0x88(%rbx), %rcx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDec_Read
const Byte *MtDec_Read(CMtDec *p, size_t *inLim)
{
  while (p->numFilledThreads != 0)
  {
    CMtDecThread *t = &p->threads[p->filledThreadStart];
    
    if (*inLim != 0)
    {
      {
        void *link = t->inBuf;
        void *next = ((CMtDecBufLink *)link)->next;
        ISzAlloc_Free(p->alloc, link);
        t->inBuf = next;
      }
      
      if (t->inDataSize == 0)
      {
        MtDecThread_FreeInBufs(t);
        if (--p->numFilledThreads == 0)
          break;
        if (++p->filledThreadStart == p->numStartedThreads)
          p->filledThreadStart = 0;
        t = &p->threads[p->filledThreadStart];
      }
    }
    
    {
      size_t lim = t->inDataSize_Start;
      if (lim != 0)
        t->inDataSize_Start = 0;
      else
      {
        UInt64 rem = t->inDataSize;
        lim = p->inBufSize;
        if (lim > rem)
          lim = (size_t)rem;
      }
      t->inDataSize -= lim;
      *inLim = lim;
      return (const Byte *)MTDEC__DATA_PTR_FROM_LINK(t->inBuf);
    }
  }

  {
    size_t crossSize = p->crossEnd - p->crossStart;
    if (crossSize != 0)
    {
      const Byte *data = MTDEC__DATA_PTR_FROM_LINK(p->crossBlock) + p->crossStart;
      *inLim = crossSize;
      p->crossStart = 0;
      p->crossEnd = 0;
      return data;
    }
    *inLim = 0;
    if (p->crossBlock)
    {
      ISzAlloc_Free(p->alloc, p->crossBlock);
      p->crossBlock = NULL;
    }
    return NULL;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0xac(%rdi)
je 0x3c2db
movl 0xa8(%r14), %eax
imulq $0x110, %rax, %rax      # imm = 0x110
leaq (%r14,%rax), %r12
addq $0x108, %r12            # imm = 0x108
cmpq $0x0, (%rbx)
je 0x3c2c1
movq 0x10(%r12), %rsi
movq (%rsi), %r15
movq 0x20(%r14), %rdi
callq *0x8(%rdi)
movq %r15, 0x10(%r12)
cmpq $0x0, 0x20(%r12)
jne 0x3c2c1
testq %r15, %r15
je 0x3c28e
movq $0x0, 0x10(%r12)
movq (%r15), %r13
movq (%r12), %rax
movq 0x20(%rax), %rdi
movq %r15, %rsi
callq *0x8(%rdi)
movq %r13, %r15
testq %r13, %r13
jne 0x3c275
decl 0xac(%r14)
je 0x3c2db
movl 0xa8(%r14), %eax
incl %eax
xorl %ecx, %ecx
cmpl 0x70(%r14), %eax
cmovnel %eax, %ecx
leaq 0x108(%r14), %rax
movl %ecx, 0xa8(%r14)
imulq $0x110, %rcx, %r12      # imm = 0x110
addq %rax, %r12
movq 0x18(%r12), %rax
testq %rax, %rax
je 0x3c32c
movq $0x0, 0x18(%r12)
movq 0x20(%r12), %rcx
jmp 0x3c33b
movq 0x80(%r14), %rax
movq 0x88(%r14), %rcx
subq %rax, %rcx
jne 0x3c311
movq $0x0, (%rbx)
movq 0x78(%r14), %rsi
testq %rsi, %rsi
je 0x3c30d
movq 0x20(%r14), %rdi
callq *0x8(%rdi)
movq $0x0, 0x78(%r14)
xorl %eax, %eax
jmp 0x3c34f
movq 0x78(%r14), %rdx
subq $-0x80, %r14
addq %rdx, %rax
addq $0x20, %rax
movq %rcx, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0x3c34f
movq 0x20(%r12), %rcx
movq (%r14), %rax
cmpq %rcx, %rax
cmovaeq %rcx, %rax
subq %rax, %rcx
movq %rcx, 0x20(%r12)
movq %rax, (%rbx)
movq 0x10(%r12), %rax
addq $0x20, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDecThread_CloseThread
static void MtDecThread_CloseThread(CMtDecThread *t)
{
  if (Thread_WasCreated(&t->thread))
  {
    Event_Set(&t->canWrite); /* we can disable it. There are no threads waiting canWrite in normal cases */
    Event_Set(&t->canRead);
    Thread_Wait_Close(&t->thread);
  }

  Event_Close(&t->canRead);
  Event_Close(&t->canWrite);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x30(%rdi)
je 0x3d48b
leaq 0x28(%rbx), %r14
leaq 0xa0(%rbx), %rdi
callq 0x3d7a5
leaq 0x38(%rbx), %rdi
callq 0x3d7a5
movq %r14, %rdi
callq 0x3d6fb
leaq 0x38(%rbx), %rdi
callq 0x3d875
addq $0xa0, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3d875
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDec_Progress_GetError_Spec
static SRes MtDec_Progress_GetError_Spec(CMtDec *p, UInt64 inSize, UInt64 outSize, UInt64 interruptIndex, BoolInt *wasInterrupted)
{
  SRes res;
  CriticalSection_Enter(&p->mtProgress.cs);

  p->mtProgress.totalInSize += inSize;
  p->mtProgress.totalOutSize += outSize;
  if (p->mtProgress.res == SZ_OK && p->mtProgress.progress)
    if (ICompressProgress_Progress(p->mtProgress.progress, p->mtProgress.totalInSize, p->mtProgress.totalOutSize) != SZ_OK)
      p->mtProgress.res = SZ_ERROR_PROGRESS;

  *wasInterrupted = (p->needInterrupt && interruptIndex > p->interruptIndex);
  res = p->mtProgress.res;
  
  CriticalSection_Leave(&p->mtProgress.cs);

  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r15
leaq 0xe0(%rdi), %r14
movq %r14, %rdi
callq 0x3da34
addq 0xd0(%r15), %rbp
movq %rbp, 0xd0(%r15)
addq 0xd8(%r15), %r13
movq %r13, 0xd8(%r15)
cmpl $0x0, 0xc8(%r15)
je 0x3d511
cmpl $0x0, 0xb0(%r15)
je 0x3d536
xorl %eax, %eax
cmpq %r12, 0xb8(%r15)
setb %al
jmp 0x3d538
movq 0xc0(%r15), %rdi
testq %rdi, %rdi
je 0x3d4f9
movq %rbp, %rsi
movq %r13, %rdx
callq *(%rdi)
testl %eax, %eax
je 0x3d4f9
movl $0xa, 0xc8(%r15)
jmp 0x3d4f9
xorl %eax, %eax
movl %eax, (%rbx)
movl 0xc8(%r15), %ebx
movq %r14, %rdi
callq 0x3da3e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/MtDec.c
// Function: MtDec_Interrupt
static void MtDec_Interrupt(CMtDec *p, UInt64 interruptIndex)
{
  CriticalSection_Enter(&p->mtProgress.cs);
  if (!p->needInterrupt || interruptIndex < p->interruptIndex)
  {
    p->interruptIndex = interruptIndex;
    p->needInterrupt = True;
  }
  CriticalSection_Leave(&p->mtProgress.cs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0xe0(%rdi), %rbx
movq %rbx, %rdi
callq 0x3da34
cmpl $0x0, 0xb0(%r14)
je 0x3d587
cmpq %r15, 0xb8(%r14)
jbe 0x3d599
movq %r15, 0xb8(%r14)
movl $0x1, 0xb0(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3da3e
nop
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/lzma/C/Threads.c
// Function: Thread_Create_With_Affinity
WRes Thread_Create_With_Affinity(CThread *p, THREAD_FUNC_TYPE func, LPVOID param, CAffinityMask affinity)
{
  Print("Thread_Create_WithAffinity")
  CCpuSet cs;
  unsigned i;
  CpuSet_Zero(&cs);
  for (i = 0; i < sizeof(affinity) * 8; i++)
  {
    if (affinity == 0)
      break;
    if (affinity & 1)
    {
      CpuSet_Set(&cs, i);
    }
    affinity >>= 1;
  }
  return Thread_Create_With_CpuSet(p, func, param, &cs);
}

// Assembly:
subq $0x88, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rsp)
movups %xmm0, 0x60(%rsp)
movups %xmm0, 0x50(%rsp)
movups %xmm0, 0x40(%rsp)
movups %xmm0, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq $0x0, 0x80(%rsp)
testq %rcx, %rcx
je 0x3d6be
movq %rcx, %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r8, %r9
movl %eax, %r10d
andl $0x1, %r10d
movl $0x1, %r8d
shlq %cl, %r8
negq %r10
andq %r10, %r8
orq %r9, %r8
cmpq $0x3e, %rcx
ja 0x3d6c1
movq %rax, %r9
shrq %r9
incq %rcx
cmpq $0x1, %rax
movq %r9, %rax
ja 0x3d688
jmp 0x3d6c1
xorl %r8d, %r8d
leaq 0x8(%rsp), %rcx
movq %r8, (%rcx)
callq 0x3d5a8
addq $0x88, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
cmpl $0x0, 0x8(%rdi)
je 0x3d6f8
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x4250
movq $0x0, (%rbx)
movl $0x0, 0x8(%rbx)
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
cmpl $0x0, 0x8(%rdi)
je 0x3d72a
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x8(%rsp), %rsi
callq 0x42b0
movl $0x0, 0x8(%rbx)
movq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
retq
movl $0x16, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
addq $0x10, %rdi
xorl %esi, %esi
callq 0x4490
testl %eax, %eax
jne 0x3d769
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x43c0
testl %eax, %eax
je 0x3d77a
movl %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, 0x4(%rbx)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movl %eax, 0x8(%rbx)
movl $0x1, (%rbx)
jmp 0x3d76c
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x4480
testl %eax, %eax
je 0x3d83c
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x0, 0x8(%r14)
jne 0x3d859
leaq 0x38(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x44c0
cmpl $0x0, 0x8(%r14)
je 0x3d847
cmpl $0x0, 0x4(%r14)
jne 0x3d868
movl $0x0, 0x8(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4270
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl %edx, %esi
seta %al
testl %edx, %edx
sete %cl
orb %al, %cl
movl $0x16, %r15d
jne 0x3d8f2
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
addq $0x10, %rdi
xorl %esi, %esi
callq 0x4490
testl %eax, %eax
jne 0x3d8ef
leaq 0x38(%r14), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x43c0
testl %eax, %eax
je 0x3d900
movl %eax, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x4(%r14)
movl %ebx, 0x8(%r14)
movl $0x1, (%r14)
jmp 0x3d8f2
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x3d989
movl %esi, %r15d
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x4480
movl %eax, %ebp
testl %eax, %eax
jne 0x3d98e
addl 0x4(%r14), %r15d
movl $0x8007012a, %ebp       # imm = 0x8007012A
cmpl 0x8(%r14), %r15d
ja 0x3d97a
movl %r15d, 0x4(%r14)
addq $0x38, %r14
movq %r14, %rdi
callq 0x40e0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x4270
testl %eax, %eax
cmovnel %eax, %ebp
jmp 0x3d98e
movl $0x16, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x4480
testl %eax, %eax
je 0x3d9b9
popq %rbx
popq %r14
popq %r15
retq
movl 0x4(%r14), %eax
testl %eax, %eax
jne 0x3d9d8
leaq 0x38(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x44c0
movl 0x4(%r14), %eax
testl %eax, %eax
je 0x3d9c5
decl %eax
movl %eax, 0x4(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4270
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdx, %rdx
je 0x3dab9
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %r15d, %r15d
xorl %r13d, %r13d
movl (%r14,%r13,4), %esi
movq %r12, %rdi
callq 0x3fadd
movzbl %al, %eax
addl %eax, %r15d
incq %r13
cmpq %r13, %rbx
jne 0x3da9d
jmp 0x3dabc
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x3db11
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %r15d, %r15d
xorl %r13d, %r13d
movl (%r14,%r13,4), %ebp
movq %r12, %rdi
movl %ebp, %esi
callq 0x3fadd
testb %al, %al
je 0x3db07
movq %r12, %rdi
movl %ebp, %esi
callq 0x40520
addl %eax, %r15d
incq %r13
cmpq %r13, %rbx
jne 0x3dae8
jmp 0x3db14
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, (%rsp)
movq %rsi, 0x10(%rsp)
testq %rdx, %rdx
je 0x3dbb2
movq %rdi, %r12
movq %rdx, 0x8(%rsp)
movq %rdx, %r14
negq %r14
movl $0x1, %r15d
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x10(%rsp), %rax
movl -0x4(%rax,%r15,4), %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x3fadd
testb %al, %al
je 0x3db97
movq %r12, %rdi
movl %ebx, %esi
movq (%rsp), %rdx
movq %r13, %rcx
callq 0x40983
testb %al, %al
je 0x3dbb5
movq %r12, %rdi
movl %ebx, %esi
callq 0x40520
movl %eax, %eax
addq %rax, %r13
cmpq 0x8(%rsp), %r15
setae %bpl
leaq (%r14,%r15), %rax
incq %rax
incq %r15
cmpq $0x1, %rax
jne 0x3db5b
jmp 0x3dbb5
movb $0x1, %bpl
andb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x50(%rdi), %rsi
movl 0xa0(%rdi), %edx
addl 0xa8(%rdi), %edx
subl %esi, %edx
xorl %edi, %edi
callq 0x49d47
movq %rax, %r12
testq %rbx, %rbx
je 0x3dc31
xorl %ebp, %ebp
leaq 0x4(%rsp), %r13
movl (%r14,%rbp,4), %esi
movq %r15, %rdi
callq 0x4053e
movl %eax, 0x4(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movl $0x4, %edx
callq 0x49d47
movq %rax, %r12
incq %rbp
cmpq %rbp, %rbx
jne 0x3dc06
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
cmpq $0x0, (%rdi)
jne 0x3df77
movq %rdi, %rbx
movq 0x10(%rsp), %rax
movq %rsi, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
movq %r9, %r8
callq 0x3dc82
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x3dfa2
movq 0x38(%rbx), %rcx
movl -0x4(%rcx,%rax,4), %eax
leaq 0x18(%rbx), %rcx
movq %rbx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
leaq 0x55(%rip), %rax        # 0x3dfc1
movq %rax, 0x28(%rbx)
movq %rcx, (%rbx)
movb $0x1, %al
popq %rbx
retq
leaq 0x21cc2(%rip), %rdi     # 0x5fc40
callq 0x44e0
leaq 0x1c0c6(%rip), %rdi     # 0x5a050
leaq 0x21acd(%rip), %rsi     # 0x5fa5e
leaq 0x21b8c(%rip), %rcx     # 0x5fb24
movl $0x127, %edx            # imm = 0x127
callq 0x4200
leaq 0x21bf9(%rip), %rdi     # 0x5fba2
leaq 0x21aae(%rip), %rsi     # 0x5fa5e
leaq 0x21b6d(%rip), %rcx     # 0x5fb24
movl $0x131, %edx            # imm = 0x131
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O3/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 %rax
movq %rsi, %rax
movslq %r8d, %r8
movq 0x38(%rdi), %rsi
movq 0x40(%rdi), %r9
movl -0x4(%rsi,%r8,4), %esi
subq %rsi, %rax
movl (%r9,%r8,4), %esi
addq %rax, %rsi
testl %r8d, %r8d
je 0x3e150
movq 0x48(%rdi), %rax
cmpb $0x0, (%rax,%r8)
je 0x3e16a
movq 0x10(%rdi), %rdi
callq *0x10(%rdi)
testl %eax, %eax
setne %al
jmp 0x3e168
movq 0x8(%rdi), %rax
addq 0x50(%rax), %rsi
subq %rdx, %rcx
movq %rdx, %rdi
movq %rcx, %rdx
callq 0x4290
movb $0x1, %al
popq %rcx
retq
movq 0x8(%rdi), %rdi
popq %rax
jmp 0x4008d
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %ebp
movl %ebp, %r14d
testl %ebp, %ebp
jle 0x3f5d2
leal -0x1(%r14), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3f5dd
testb %al, %al
je 0x3f5b9
testl %r14d, %r14d
setg %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rcx
movslq %esi, %rdx
movl (%rcx,%rdx,4), %ecx
cmpw $0x9, 0x1c(%rax,%rcx)
jae 0x3f5f6
xorl %eax, %eax
retq
movabsq $0x464e492d4154454d, %rdx # imm = 0x464E492D4154454D
movq 0x2e(%rax,%rcx), %rsi
xorq %rdx, %rsi
movzbl 0x36(%rax,%rcx), %edi
xorq $0x2f, %rdi
orq %rsi, %rdi
je 0x3f62b
xorq 0x2e(%rax,%rcx), %rdx
movzbl 0x36(%rax,%rcx), %eax
xorq $0x5c, %rax
orq %rdx, %rax
sete %al
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %ebp
movl %ebp, %r14d
testl %ebp, %ebp
jle 0x3f656
leal -0x1(%r14), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3f661
testb %al, %al
je 0x3f63d
testl %r14d, %r14d
setg %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r15
callq 0x3f5dd
testb %al, %al
je 0x3f6e7
movq 0x50(%r15), %r14
movq 0x58(%r15), %r15
leaq 0x216f5(%rip), %rcx     # 0x60d7a
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x3fa0d
movb $0x1, %bpl
testb %al, %al
jne 0x3f6e9
leaq 0x20ce1(%rip), %rcx     # 0x60381
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x3fa0d
testb %al, %al
jne 0x3f6e9
leaq 0x20cce(%rip), %rcx     # 0x60386
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x3fa64
testb %al, %al
jne 0x3f6e9
leaq 0x20ccb(%rip), %rcx     # 0x6039b
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3fa64
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq 0x50(%rdi), %r15
movq 0x58(%rdi), %rax
movslq %esi, %rcx
movl (%rax,%rcx,4), %eax
movzwl 0x1c(%r15,%rax), %ebp
cmpl %ebx, %ebp
jl 0x3f775
addq %rax, %r15
movl %ebp, %eax
leaq (%r15,%rax), %rdi
addq $0x2e, %rdi
movslq %ebx, %r14
subq %r14, %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x4310
testl %eax, %eax
je 0x3f782
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
cmpl %ebx, %ebp
je 0x3f777
addq $0x2e, %r15
notl %ebp
movslq %ebp, %rax
addq %r15, %rax
movb (%r14,%rax), %al
cmpb $0x5c, %al
sete %cl
cmpb $0x2f, %al
sete %al
orb %cl, %al
jmp 0x3f777
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %r12d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x3f84f
movl %edx, %ebp
movq 0x50(%rdi), %r13
movq 0x58(%rdi), %rbx
movl %edx, %r15d
xorl %r14d, %r14d
movl (%rbx,%r14,4), %edi
movzwl 0x1c(%r13,%rdi), %eax
cmpl %ebp, %eax
jne 0x3f83d
addq %r13, %rdi
addq $0x2e, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x4310
testl %eax, %eax
je 0x3f84c
incq %r14
cmpq %r14, %r12
jne 0x3f818
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3f84f
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq %rcx, %rdi
callq 0x4140
movslq %ebp, %rcx
movl (%r15,%rcx,4), %ecx
movzwl 0x1c(%r14,%rcx), %edi
cmpl %eax, %edi
jge 0x3fa3c
xorl %eax, %eax
jmp 0x3fa59
addq %rcx, %r14
addq %r14, %rdi
subq %rax, %rdi
addq $0x2e, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4310
testl %eax, %eax
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
movq $0x0, (%rdi)
movq 0x90(%rdi), %rdi
testq %rdi, %rdi
je 0x3fb3f
callq 0x43b0
movq $0x0, 0x90(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x3fb65
callq 0x43b0
movq $0x0, 0xa0(%rbx)
movl $0x0, 0xa8(%rbx)
cmpq $0x0, 0x28(%rbx)
je 0x3fb7c
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x47fd6
testl %eax, %eax
je 0x3fb80
movb $0x1, %al
popq %rbx
retq
leaq 0x1a4c9(%rip), %rdi     # 0x5a050
leaq 0x20753(%rip), %rsi     # 0x602e1
leaq 0x2081b(%rip), %rcx     # 0x603b0
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
cmpq $0x0, 0x90(%rdi)
jne 0x3fe50
movq %rdi, %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x4400
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x3fe6f
movb $0x0, 0x89(%rbx)
popq %rbx
retq
leaq 0x1fbf9(%rip), %rdi     # 0x5fa50
leaq 0x20483(%rip), %rsi     # 0x602e1
leaq 0x20f19(%rip), %rcx     # 0x60d7e
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x4200
leaq 0x1a1da(%rip), %rdi     # 0x5a050
leaq 0x20464(%rip), %rsi     # 0x602e1
leaq 0x20efa(%rip), %rcx     # 0x60d7e
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rax
movl 0x8(%rax), %eax
movl $0x10016, %r13d         # imm = 0x10016
cmpl %r13d, %eax
cmovbl %eax, %r13d
xorl %ebp, %ebp
testl %eax, %eax
je 0x3ff73
movq %rsi, 0x10(%rsp)
movq 0x90(%rdi), %r15
movl $0x4000, %edx           # imm = 0x4000
xorl %ebx, %ebx
movl %eax, 0x8(%rsp)
movl %r13d, 0xc(%rsp)
subl %ebx, %r13d
cmpl %edx, %r13d
movl $0x4000, %ecx           # imm = 0x4000
cmovbl %r13d, %ecx
leal (%rcx,%rbx), %r14d
movq %rdi, %r12
movq (%rdi), %rdi
movl %eax, %esi
subl %r14d, %esi
addq %r15, %rcx
movq %r15, %rdx
callq *0x10(%rdi)
testl %eax, %eax
je 0x3ff84
movl $0x4000, %eax           # imm = 0x4000
cmpl %eax, %r13d
movl $0x4000, %ecx           # imm = 0x4000
cmovbl %r13d, %ecx
movq %rcx, %rax
movq %r12, %rdi
movl $0x4000, %edx           # imm = 0x4000
subq $0x1, %rax
jb 0x3ff3e
shll $0x8, %ebp
movzbl -0x1(%r15,%rcx), %ecx
orl %ecx, %ebp
movq %rax, %rcx
cmpl $0x6054b50, %ebp        # imm = 0x6054B50
jne 0x3ff20
jmp 0x3ff53
movl %r14d, %ebx
movl 0xc(%rsp), %r13d
cmpl %r13d, %r14d
movl 0x8(%rsp), %eax
jb 0x3fed5
xorl %ebp, %ebp
jmp 0x3ff73
movl $0x4000, %ecx           # imm = 0x4000
cmpl %ecx, %r13d
cmovbl %r13d, %ecx
addl %ecx, %ebx
movl 0x8(%rsp), %ecx
subl %ebx, %ecx
addl %ecx, %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a0c5(%rip), %rdi     # 0x5a050
leaq 0x2034f(%rip), %rsi     # 0x602e1
leaq 0x20e0b(%rip), %rcx     # 0x60da4
movl $0x77, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_open_fvce(UnZipper*, unsigned int, int)
static bool _UnZipper_open_fvce(UnZipper* self,ZipFilePos_t fvceSize,int fileCount){
    assert(self->_cache_fvce==0);
    self->_fvce_size=fvceSize;
    size_t memSize=self->_fvce_size+1*fileCount+sizeof(ZipFilePos_t)*(fileCount+1)+sizeof(ZipFilePos_t)*fileCount*2;
    if (self->_isSaved_fileEntryOffsets) memSize+=sizeof(ZipFilePos_t)*fileCount;
    self->_cache_fvce=(TByte*)malloc(memSize);
    check(self->_cache_fvce!=0);
    self->_dataDescriptors=self->_cache_fvce+self->_fvce_size;
    size_t curBuf=_hpatch_align_upper((self->_dataDescriptors+1*fileCount),sizeof(ZipFilePos_t));
    self->_fileDataOffsets=(ZipFilePos_t*)curBuf; curBuf+=sizeof(ZipFilePos_t)*fileCount;
    self->_fileEntryOffsets=0;
    if (self->_isSaved_fileEntryOffsets){
        self->_fileEntryOffsets=(ZipFilePos_t*)curBuf; curBuf+=sizeof(ZipFilePos_t)*fileCount; }
    self->_fileHeaderOffsets=(ZipFilePos_t*)curBuf; curBuf+=sizeof(ZipFilePos_t)*fileCount;
    self->_fileCompressedSizes=(ZipFilePos_t*)curBuf;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x0, 0xa0(%rdi)
jne 0x4004f
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, 0xa8(%rdi)
leal (%rdx,%r14), %eax
movslq %edx, %r12
leaq (%rax,%r12,8), %rax
leaq (%rax,%r12,4), %rax
leaq (,%r12,4), %r15
movb 0x88(%rdi), %bpl
xorl %ecx, %ecx
testb %bpl, %bpl
cmovneq %r15, %rcx
leaq (%rcx,%rax), %rdi
addq $0x4, %rdi
callq 0x4400
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x4006e
movl %r14d, %ecx
addq %rcx, %rax
movq %rax, 0x68(%rbx)
addq %r12, %rax
addq $0x3, %rax
andq $-0x4, %rax
movq %rax, 0x78(%rbx)
addq %r15, %rax
movq $0x0, 0x80(%rbx)
testb %bpl, %bpl
je 0x4003b
movq %rax, 0x80(%rbx)
addq %r15, %rax
movq %rax, 0x58(%rbx)
addq %rax, %r15
movq %r15, 0x60(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x203ce(%rip), %rdi     # 0x60424
leaq 0x20284(%rip), %rsi     # 0x602e1
leaq 0x20de1(%rip), %rcx     # 0x60e45
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x4200
leaq 0x19fdb(%rip), %rdi     # 0x5a050
leaq 0x20265(%rip), %rsi     # 0x602e1
leaq 0x20dc2(%rip), %rcx     # 0x60e45
movl $0x1d4, %edx            # imm = 0x1D4
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x3fe23
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x3ffa3
leaq 0x8(%r14), %rbx
movq 0xa0(%r14), %rsi
movl 0xa8(%r14), %edx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x433a9
movq %rbx, (%r14)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq