LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt_CreateVTable
void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable)
{
  vTable->Init = MatchFinderMt_Init;
  vTable->GetNumAvailableBytes = MatchFinderMt_GetNumAvailableBytes;
  vTable->GetPointerToCurrentPos = MatchFinderMt_GetPointerToCurrentPos;
  vTable->GetMatches = MatchFinderMt_GetMatches;
  
  switch (MF(p)->numHashBytes)
  {
    case 2:
      p->GetHeadsFunc = GetHeads2;
      p->MixMatchesFunc = NULL;
      vTable->Skip = MatchFinderMt0_Skip;
      vTable->GetMatches = MatchFinderMt2_GetMatches;
      break;
    case 3:
      p->GetHeadsFunc = MF(p)->bigHash ? GetHeads3b : GetHeads3;
      p->MixMatchesFunc = MixMatches2;
      vTable->Skip = MatchFinderMt2_Skip;
      break;
    case 4:
      p->GetHeadsFunc = MF(p)->bigHash ? GetHeads4b : GetHeads4;

      // it's fast inline version of GetMatches()
      // vTable->GetMatches = MatchFinderMt_GetMatches_Bt4;

      p->MixMatchesFunc = MixMatches3;
      vTable->Skip = MatchFinderMt3_Skip;
      break;
    default:
      p->GetHeadsFunc = MF(p)->bigHash ? GetHeads5b : GetHeads5;
      p->MixMatchesFunc = MixMatches4;
      vTable->Skip =
          MatchFinderMt3_Skip;
          // MatchFinderMt4_Skip;
      break;
  }
}

// Assembly:
leaq 0xf6(%rip), %rax        # 0x31f9f
movq %rax, (%rsi)
leaq 0x193(%rip), %rax       # 0x32046
movq %rax, 0x8(%rsi)
leaq 0x19a(%rip), %rax       # 0x32058
movq %rax, 0x10(%rsi)
leaq 0x193(%rip), %rax       # 0x3205c
movq %rax, 0x18(%rsi)
movq 0x520(%rdi), %rax
movl 0x5c(%rax), %ecx
cmpl $0x4, %ecx
je 0x31f45
cmpl $0x3, %ecx
je 0x31f14
cmpl $0x2, %ecx
jne 0x31f6b
leaq 0x1ee(%rip), %rax       # 0x320df
movq %rax, 0x518(%rdi)
andq $0x0, 0x40(%rdi)
leaq 0x205(%rip), %rax       # 0x32109
movq %rax, 0x20(%rsi)
leaq 0x256(%rip), %rax       # 0x32165
movq %rax, 0x18(%rsi)
retq
cmpb $0x0, 0x22(%rax)
leaq 0x2c9(%rip), %rax       # 0x321e8
leaq 0x28a(%rip), %rcx       # 0x321b0
cmoveq %rax, %rcx
movq %rcx, 0x518(%rdi)
leaq 0x2f3(%rip), %rax       # 0x3222b
movq %rax, 0x40(%rdi)
leaq 0x33c(%rip), %rax       # 0x3227f
jmp 0x31f9a
cmpb $0x0, 0x22(%rax)
leaq 0x412(%rip), %rax       # 0x32362
leaq 0x3a1(%rip), %rcx       # 0x322f8
cmoveq %rax, %rcx
movq %rcx, 0x518(%rdi)
leaq 0x485(%rip), %rax       # 0x323ee
jmp 0x31f8f
cmpb $0x0, 0x22(%rax)
leaq 0x656(%rip), %rax       # 0x325cc
leaq 0x5c1(%rip), %rcx       # 0x3253e
cmoveq %rax, %rcx
movq %rcx, 0x518(%rdi)
leaq 0x6e7(%rip), %rax       # 0x32676
movq %rax, 0x40(%rdi)
leaq 0x505(%rip), %rax       # 0x3249f
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt_GetMatches
static UInt32 * MatchFinderMt_GetMatches(void *_p, UInt32 *d)
{
  CMatchFinderMt *p = (CMatchFinderMt *)_p;
  const UInt32 *bt = p->btBufPos;
  UInt32 len = *bt++;
  const UInt32 avail = p->btNumAvailBytes - 1;
  p->btNumAvailBytes = avail;
  p->btBufPos = bt + len;
  if (len == 0)
  {
    #define BT_HASH_BYTES_MAX 5
    if (avail >= (BT_HASH_BYTES_MAX - 1) - 1)
    {
      UInt32 m = p->lzPos;
      if (m > p->historySize)
        m -= p->historySize;
      else
        m = 1;
      d = p->MixMatchesFunc(p, m, d);
    }
  }
  else
  {
    /*
      first match pair from BinTree: (match_len, match_dist),
      (match_len >= numHashBytes).
      MixMatchesFunc() inserts only hash matches that are nearer than (match_dist)
    */
    d = p->MixMatchesFunc(p, p->lzPos - bt[1], d);
    // if (d) // check for failure
    do
    {
      const UInt32 v0 = bt[0];
      const UInt32 v1 = bt[1];
      bt += 2;
      d[0] = v0;
      d[1] = v1;
      d += 2;
    }
    while (len -= 2);
  }
  INCREASE_LZ_POS
  return d;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movl (%r14), %r15d
movl 0x24(%rdi), %ecx
decl %ecx
movl %ecx, 0x24(%rdi)
leaq (%r14,%r15,4), %rdx
addq $0x4, %rdx
movq %rdx, 0x10(%rdi)
testq %r15, %r15
je 0x320b9
movl 0x20(%rbx), %esi
subl 0x8(%r14), %esi
addq $0x4, %r14
movq %rbx, %rdi
movq %rax, %rdx
callq *0x40(%rbx)
xorl %ecx, %ecx
xorl %edx, %edx
movq (%r14,%rdx,4), %rsi
movq %rsi, (%rax,%rdx,4)
addq $0x2, %rdx
addq $-0x8, %rcx
cmpl %edx, %r15d
jne 0x3209f
subq %rcx, %rax
jmp 0x320d3
cmpl $0x3, %ecx
jb 0x320d3
movl 0x20(%rbx), %ecx
subl 0x34(%rbx), %ecx
pushq $0x1
popq %rsi
cmoval %ecx, %esi
movq %rbx, %rdi
movq %rax, %rdx
callq *0x40(%rbx)
incl 0x20(%rbx)
incq (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt2_GetMatches
static UInt32 * MatchFinderMt2_GetMatches(void *_p, UInt32 *d)
{
  CMatchFinderMt *p = (CMatchFinderMt *)_p;
  const UInt32 *bt = p->btBufPos;
  const UInt32 len = *bt++;
  const UInt32 *btLim = bt + len;
  p->btBufPos = btLim;
  p->btNumAvailBytes--;
  INCREASE_LZ_POS
  {
    while (bt != btLim)
    {
      const UInt32 v0 = bt[0];
      const UInt32 v1 = bt[1];
      bt += 2;
      d[0] = v0;
      d[1] = v1;
      d += 2;
    }
  }
  return d;
}

// Assembly:
movq 0x10(%rdi), %rdx
movl (%rdx), %ecx
leaq (%rdx,%rcx,4), %rax
addq $0x4, %rax
movq %rax, 0x10(%rdi)
movq 0x20(%rdi), %xmm0
paddd 0x2294c(%rip), %xmm0    # 0x54ad0
movq %xmm0, 0x20(%rdi)
incq (%rdi)
movq %rsi, %rax
addq $0x4, %rdx
shlq $0x2, %rcx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x321ac
movq (%rdx,%rsi), %rdi
movq %rdi, (%rax,%rsi)
addq $0x8, %rsi
jmp 0x32199
addq %rsi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MixMatches2
static UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *d)
{
  UInt32 h2, c2;
  UInt32 *hash = p->hash;
  const Byte *cur = p->pointerToCurPos;
  const UInt32 m = p->lzPos;
  MT_HASH2_CALC
      
  c2 = hash[h2];
  hash[h2] = m;

  if (c2 >= matchMinPos)
  {
    CHECK_FAILURE_LZ(c2, m)
    if (cur[(ptrdiff_t)c2 - (ptrdiff_t)m] == cur[0])
    {
      *d++ = 2;
      *d++ = m - c2 - 1;
    }
  }
  
  return d;
}

// Assembly:
movq %rdx, %rax
movq 0x28(%rdi), %r8
movq (%rdi), %rdx
movl 0x20(%rdi), %ecx
movq 0x38(%rdi), %rdi
movzbl (%rdx), %r9d
movzbl 0x1(%rdx), %r10d
movl $0x3ff, %r11d           # imm = 0x3FF
andl (%rdi,%r9,4), %r11d
xorl %r10d, %r11d
movl (%r8,%r11,4), %edi
movl %ecx, (%r8,%r11,4)
cmpl %esi, %edi
jb 0x3227e
movq %rdi, %rsi
subq %rcx, %rsi
movb (%rdx,%rsi), %sil
cmpb (%rdx), %sil
jne 0x3227e
movl $0x2, (%rax)
notl %edi
addl %ecx, %edi
movl %edi, 0x4(%rax)
addq $0x8, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt2_Skip
static void MatchFinderMt2_Skip(void *_p, UInt32 num)
{
  CMatchFinderMt *p = (CMatchFinderMt *)_p;
  SKIP_HEADER_MT(2)
      UInt32 h2;
      MT_HASH2_CALC
      hash[h2] = p->lzPos;
  SKIP_FOOTER_MT
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x10(%rdi), %rax
movl $0x3ff, %ebp            # imm = 0x3FF
cmpq 0x18(%r14), %rax
jne 0x3229f
movq %r14, %rdi
callq 0x32b2a
movl 0x24(%r14), %edx
leal -0x1(%rdx), %eax
movl %eax, 0x24(%r14)
movl 0x20(%r14), %ecx
movq (%r14), %rax
cmpl $0x2, %edx
jb 0x322d1
movq 0x28(%r14), %rdx
movq 0x38(%r14), %rsi
movzbl (%rax), %edi
movzbl 0x1(%rax), %r8d
movl (%rsi,%rdi,4), %esi
andl %ebp, %esi
xorl %r8d, %esi
movl %ecx, (%rdx,%rsi,4)
incl %ecx
movl %ecx, 0x20(%r14)
incq %rax
movq %rax, (%r14)
movq 0x10(%r14), %rax
movl (%rax), %ecx
leaq (%rax,%rcx,4), %rax
addq $0x4, %rax
movq %rax, 0x10(%r14)
decl %ebx
jne 0x32291
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MixMatches3
static UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *d)
{
  UInt32 h2, h3, c2, c3;
  UInt32 *hash = p->hash;
  const Byte *cur = p->pointerToCurPos;
  const UInt32 m = p->lzPos;
  MT_HASH3_CALC

  c2 = hash[h2];
  c3 = (hash + kFix3HashSize)[h3];
  
  hash[h2] = m;
  (hash + kFix3HashSize)[h3] = m;

  if (c2 >= matchMinPos)
  {
    CHECK_FAILURE_LZ(c2, m)
    if (cur[(ptrdiff_t)c2 - (ptrdiff_t)m] == cur[0])
    {
      d[1] = m - c2 - 1;
      if (cur[(ptrdiff_t)c2 - (ptrdiff_t)m + 2] == cur[2])
      {
        d[0] = 3;
        return d + 2;
      }
      d[0] = 2;
      d += 2;
    }
  }
  
  if (c3 >= matchMinPos)
  {
    CHECK_FAILURE_LZ(c3, m)
    if (cur[(ptrdiff_t)c3 - (ptrdiff_t)m] == cur[0])
    {
      *d++ = 3;
      *d++ = m - c3 - 1;
    }
  }
  
  return d;
}

// Assembly:
movq 0x28(%rdi), %rax
movq (%rdi), %r8
movl 0x20(%rdi), %ecx
movq 0x38(%rdi), %rdi
movzbl (%r8), %r9d
movzbl 0x1(%r8), %r10d
xorl (%rdi,%r9,4), %r10d
movzwl %r10w, %edi
andl $0x3ff, %r10d           # imm = 0x3FF
movzbl 0x2(%r8), %r11d
movl (%rax,%r10,4), %r9d
shll $0x2, %edi
shll $0xa, %r11d
xorl %edi, %r11d
movl 0x1000(%rax,%r11), %edi
movl %ecx, (%rax,%r10,4)
movl %ecx, 0x1000(%rax,%r11)
cmpl %esi, %r9d
jb 0x3246f
movq %r9, %rax
subq %rcx, %rax
movb (%r8,%rax), %r10b
cmpb (%r8), %r10b
jne 0x3246f
notl %r9d
addl %ecx, %r9d
movl %r9d, 0x4(%rdx)
movb 0x2(%r8,%rax), %r9b
leaq 0x8(%rdx), %rax
cmpb 0x2(%r8), %r9b
jne 0x32497
movl $0x3, (%rdx)
retq
movq %rdx, %rax
cmpl %esi, %edi
jb 0x32496
movq %rdi, %rdx
subq %rcx, %rdx
movb (%r8,%rdx), %dl
cmpb (%r8), %dl
jne 0x32496
movl $0x3, (%rax)
notl %edi
addl %ecx, %edi
movl %edi, 0x4(%rax)
addq $0x8, %rax
retq
movl $0x2, (%rdx)
jmp 0x32472
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt3_Skip
static void MatchFinderMt3_Skip(void *_p, UInt32 num)
{
  CMatchFinderMt *p = (CMatchFinderMt *)_p;
  SKIP_HEADER_MT(3)
      UInt32 h2, h3;
      MT_HASH3_CALC
      (hash + kFix3HashSize)[h3] =
      hash[                h2] =
        p->lzPos;
  SKIP_FOOTER_MT
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x10(%rdi), %rax
cmpq 0x18(%r14), %rax
jne 0x324ba
movq %r14, %rdi
callq 0x32b2a
movl 0x24(%r14), %edx
leal -0x1(%rdx), %eax
movl %eax, 0x24(%r14)
movl 0x20(%r14), %ecx
movq (%r14), %rax
cmpl $0x3, %edx
jb 0x32510
movq 0x28(%r14), %rdx
movq 0x38(%r14), %rsi
movzbl (%rax), %edi
movzbl 0x1(%rax), %r8d
xorl (%rsi,%rdi,4), %r8d
movzwl %r8w, %esi
movl %r8d, %edi
andl $0x3ff, %edi            # imm = 0x3FF
movzbl 0x2(%rax), %r8d
movl %ecx, (%rdx,%rdi,4)
shll $0x2, %esi
shll $0xa, %r8d
xorl %esi, %r8d
movl %ecx, 0x1000(%rdx,%r8)
movl 0x20(%r14), %ecx
incl %ecx
movl %ecx, 0x20(%r14)
incq %rax
movq %rax, (%r14)
movq 0x10(%r14), %rax
movl (%rax), %ecx
leaq (%rax,%rcx,4), %rax
addq $0x4, %rax
movq %rax, 0x10(%r14)
decl %ebx
jne 0x324ac
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MtSync_GetNextBlock
Z7_NO_INLINE
static UInt32 MtSync_GetNextBlock(CMtSync *p)
{
  UInt32 numBlocks = 0;
  if (p->needStart)
  {
    BUFFER_MUST_BE_UNLOCKED(p)
    p->numProcessedBlocks = 1;
    p->needStart = False;
    p->stopWriting = False;
    p->exit = False;
    Event_Reset(&p->wasStopped);
    Event_Set(&p->canStart);
  }
  else
  {
    UNLOCK_BUFFER(p)
    // we free current block
    numBlocks = p->numProcessedBlocks++;
    Semaphore_Release1(&p->freeSemaphore);
  }

  // buffer is UNLOCKED here
  Semaphore_Wait(&p->filledSemaphore);
  LOCK_BUFFER(p)
  return numBlocks;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x24(%rdi)
je 0x32ad8
movl $0x1, (%rbx)
andl $0x0, 0x24(%rbx)
andq $0x0, 0x30(%rbx)
leaq 0xa0(%rbx), %rdi
callq 0x34fce
leaq 0x38(%rbx), %rdi
callq 0x34f8b
xorl %r14d, %r14d
jmp 0x32b00
leaq 0x1d8(%rbx), %rdi
callq 0x35208
andl $0x0, 0x2c(%rbx)
movl (%rbx), %r14d
leal 0x1(%r14), %eax
movl %eax, (%rbx)
leaq 0x108(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x3510d
leaq 0x170(%rbx), %rdi
callq 0x35170
leaq 0x1d8(%rbx), %rdi
callq 0x351fe
movl $0x1, 0x2c(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt_GetNextBlock_Bt
Z7_NO_INLINE
static UInt32 MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p)
{
  if (p->failure_LZ_BT)
    p->btBufPos = p->failureBuf;
  else
  {
    const UInt32 bi = MtSync_GetNextBlock(&p->btSync);
    const UInt32 *bt = p->btBuf + GET_BT_BLOCK_OFFSET(bi);
    {
      const UInt32 numItems = bt[0];
      p->btBufPosLimit = bt + numItems;
      p->btNumAvailBytes = bt[1];
      p->btBufPos = bt + 2;
      if (numItems < 2 || numItems > kMtBtBlockSize)
      {
        p->failureBuf[0] = 0;
        p->btBufPos = p->failureBuf;
        p->btBufPosLimit = p->failureBuf + 1;
        p->failure_LZ_BT = True;
        // p->btNumAvailBytes = 0;
        /* we don't want to decrease AvailBytes, that was load before.
            that can be unxepected for the code that have loaded anopther value before */
      }
    }
  
    if (p->lzPos >= (UInt32)kMtMaxValForNormalize - (UInt32)kMtBtBlockSize)
    {
      /* we don't check (lzPos) over exact avail bytes in (btBuf).
         (fixedHashSize) is small, so normalization is fast */
      const UInt32 subValue = (p->lzPos - p->historySize - 1); // & ~(UInt32)(kNormalizeAlign - 1);
      p->lzPos -= subValue;
      MatchFinder_Normalize3(subValue, p->hash, p->fixedHashSize);
    }
  }
  return p->btNumAvailBytes;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x48(%rdi)
je 0x32b41
leaq 0x4c(%rbx), %rax
movq %rax, 0x10(%rbx)
jmp 0x32bbc
leaq 0x50(%rbx), %r14
movq %r14, %rdi
callq 0x32aa2
movq 0x8(%rbx), %rcx
andl $0xf, %eax
shll $0x12, %eax
leaq (%rcx,%rax), %rdx
addq %rcx, %rax
addq $0x8, %rax
movl -0x8(%rax), %ecx
leaq (%rdx,%rcx,4), %rdx
movq %rdx, 0x18(%rbx)
movl -0x4(%rax), %edx
movl %edx, 0x24(%rbx)
movq %rax, 0x10(%rbx)
leal -0x10001(%rcx), %eax
cmpl $0xffff0000, %eax       # imm = 0xFFFF0000
ja 0x32b98
leaq 0x4c(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movq $0x1, 0x48(%rbx)
movl 0x20(%rbx), %edi
cmpl $0xfffeffff, %edi       # imm = 0xFFFEFFFF
jb 0x32bbc
movl 0x34(%rbx), %eax
leal 0x1(%rax), %ecx
notl %eax
addl %eax, %edi
movl %ecx, 0x20(%rbx)
movq 0x28(%rbx), %rsi
movl 0x30(%rbx), %edx
callq 0x2f8e9
movl 0x24(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/CpuArch.c
// Function: CPU_IsSupported_SHA
BoolInt CPU_IsSupported_SHA(void)
{
  CHECK_SYS_SSE_SUPPORT

  if (z7_x86_cpuid_GetMaxFunc() < 7)
    return False;
  {
    UInt32 d[4];
    z7_x86_cpuid(d, 7);
    return (BoolInt)(d[1] >> 29) & 1;
  }
}

// Assembly:
pushq %rax
callq 0x33014
xorl %esi, %esi
cmpl $0x7, %eax
jb 0x33083
pushq $0x7
popq %rax
xorl %ecx, %ecx
movq %rbx, %rsi
cpuid
xchgq %rbx, %rsi
shrl $0x1d, %esi
andl $0x1, %esi
movl %esi, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/CpuArch.c
// Function: CPU_IsSupported_SHA512
BoolInt CPU_IsSupported_SHA512(void)
{
  if (!CPU_IsSupported_AVX2()) return False; // maybe CPU_IsSupported_AVX() is enough here

  if (z7_x86_cpuid_GetMaxFunc() < 7)
    return False;
  {
    UInt32 d[4];
    z7_x86_cpuid_subFunc(d, 7, 0);
    if (d[0] < 1) // d[0] - is max supported subleaf value
      return False;
    z7_x86_cpuid_subFunc(d, 7, 1);
    return (BoolInt)(d[0]) & 1;
  }
}

// Assembly:
pushq %rbx
callq 0x330c8
xorl %ebx, %ebx
testl %eax, %eax
je 0x330c4
callq 0x33014
cmpl $0x7, %eax
jb 0x330c4
pushq $0x7
popq %rsi
xorl %ebx, %ebx
movl %esi, %eax
xorl %ecx, %ecx
movq %rbx, %rdi
cpuid
xchgq %rbx, %rdi
testl %eax, %eax
je 0x330c4
pushq $0x1
popq %rcx
movl %esi, %eax
movq %rbx, %rsi
cpuid
xchgq %rbx, %rsi
movl %eax, %ebx
andl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/CpuArch.c
// Function: CPU_IsSupported_AVX2
BoolInt CPU_IsSupported_AVX2(void)
{
  if (!CPU_IsSupported_AVX())
    return False;
  if (z7_x86_cpuid_GetMaxFunc() < 7)
    return False;
  {
    UInt32 d[4];
    z7_x86_cpuid(d, 7);
    // printf("\ncpuid(7): ebx=%8x ecx=%8x\n", d[1], d[2]);
    return 1
      & (BoolInt)(d[1] >> 5); // avx2
  }
}

// Assembly:
pushq %rbx
callq 0x330f5
xorl %ebx, %ebx
testl %eax, %eax
je 0x330f1
callq 0x33014
cmpl $0x7, %eax
jb 0x330f1
pushq $0x7
popq %rax
xorl %ecx, %ecx
movq %rbx, %rbx
cpuid
xchgq %rbx, %rbx
shrl $0x5, %ebx
andl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/CpuArch.c
// Function: CPU_IsSupported_VAES_AVX2
BoolInt CPU_IsSupported_VAES_AVX2(void)
{
  if (!CPU_IsSupported_AVX())
    return False;
  if (z7_x86_cpuid_GetMaxFunc() < 7)
    return False;
  {
    UInt32 d[4];
    z7_x86_cpuid(d, 7);
    // printf("\ncpuid(7): ebx=%8x ecx=%8x\n", d[1], d[2]);
    return 1
      & (BoolInt)(d[1] >> 5) // avx2
      // & (d[1] >> 31) // avx512vl
      & (BoolInt)(d[2] >> 9); // vaes // VEX-256/EVEX
  }
}

// Assembly:
pushq %rbx
callq 0x330f5
xorl %ebx, %ebx
testl %eax, %eax
je 0x33150
callq 0x33014
cmpl $0x7, %eax
jb 0x33150
pushq $0x7
popq %rax
xorl %ecx, %ecx
movq %rbx, %rsi
cpuid
xchgq %rbx, %rsi
movl %ecx, %ebx
shrl $0x5, %esi
shrl $0x9, %ebx
andl %esi, %ebx
andl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/CpuArch.c
// Function: CPU_IsSupported_PageGB
BoolInt CPU_IsSupported_PageGB(void)
{
  CHECK_CPUID_IS_SUPPORTED
  {
    UInt32 d[4];
    z7_x86_cpuid(d, 0x80000000);
    if (d[0] < 0x80000001)
      return False;
    z7_x86_cpuid(d, 0x80000001);
    return (BoolInt)(d[3] >> 26) & 1;
  }
}

// Assembly:
xorl %esi, %esi
xorl %ecx, %ecx
movl $0x80000000, %eax       # imm = 0x80000000
movq %rbx, %rdi
cpuid
xchgq %rbx, %rdi
cmpl $0x80000001, %eax       # imm = 0x80000001
jb 0x33183
xorl %ecx, %ecx
movl $0x80000001, %eax       # imm = 0x80000001
movq %rbx, %rsi
cpuid
xchgq %rbx, %rsi
movl %edx, %esi
shrl $0x1a, %esi
andl $0x1, %esi
movl %esi, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/MtCoder.c
// Function: MtProgressThunk_Progress
static SRes MtProgressThunk_Progress(ICompressProgressPtr pp, UInt64 inSize, UInt64 outSize)
{
  Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CMtProgressThunk)
  UInt64 inSize2 = 0;
  UInt64 outSize2 = 0;
  if (inSize != (UInt64)(Int64)-1)
  {
    inSize2 = inSize - p->inSize;
    p->inSize = inSize;
  }
  if (outSize != (UInt64)(Int64)-1)
  {
    outSize2 = outSize - p->outSize;
    p->outSize = outSize;
  }
  return MtProgress_ProgressAdd(p->mtProgress, inSize2, outSize2);
}

// Assembly:
cmpq $-0x1, %rsi
je 0x331a6
movq %rsi, %rax
subq 0x10(%rdi), %rsi
movq %rax, 0x10(%rdi)
jmp 0x331a8
xorl %esi, %esi
cmpq $-0x1, %rdx
je 0x331bb
movq %rdx, %rax
subq 0x18(%rdi), %rax
movq %rdx, 0x18(%rdi)
jmp 0x331bd
xorl %eax, %eax
movq 0x8(%rdi), %rdi
movq %rax, %rdx
jmp 0x33ad2
// File: /workspace/github_cpp_makefile_star2_O2/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
cmpq $0x2400, %r13           # imm = 0x2400
je 0x332fc
cmpl $0x0, 0x7c8(%rbx,%r13)
je 0x332c5
leaq (%r12,%r13), %r14
movl $0x1, 0x74c(%rbx,%r13)
leaq (%r15,%r13), %rdi
callq 0x34f8b
movq %r14, %rdi
callq 0x34eec
leaq (%r15,%r13), %rdi
callq 0x35050
movq 0x750(%rbx,%r13), %rsi
testq %rsi, %rsi
je 0x332f3
movq 0x740(%rbx,%r13), %rax
movq 0x38(%rax), %rdi
callq *0x8(%rdi)
andq $0x0, 0x750(%rbx,%r13)
addq $0x90, %r13
jmp 0x33290
leaq 0x58(%rbx), %rdi
callq 0x35050
leaq 0xc0(%rbx), %rdi
callq 0x351ba
addq $0x130, %rbx            # imm = 0x130
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x35050
// File: /workspace/github_cpp_makefile_star2_O2/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 0x35230
testl %eax, %eax
jne 0x3354a
andl $0x0, 0xc(%r14)
cmpl $0x0, 0x88(%r14)
je 0x33530
movq %rbx, %rdi
callq 0x34f8b
jmp 0x3354a
leaq 0x80(%r14), %rdi
leaq 0x24(%rip), %rsi        # 0x33562
movq %r14, %rdx
callq 0x34e4c
testl %eax, %eax
je 0x33526
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_O2/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 0x33aa3
retq
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x33ac9
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
callq *(%rdi)
testl %eax, %eax
je 0x33acd
movl $0xa, 0x8(%rbx)
pushq $0xa
popq %rax
jmp 0x33ad0
xorl %eax, %eax
jmp 0x33ad0
movl 0x8(%rbx), %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x351fe
addq 0x10(%r14), %r12
movq %r12, 0x10(%r14)
addq 0x18(%r14), %r15
movq %r15, 0x18(%r14)
movl 0x8(%r14), %ebp
testl %ebp, %ebp
je 0x33b1a
movq %rbx, %rdi
callq 0x35208
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
testq %rdi, %rdi
je 0x33b3b
movq %r12, %rsi
movq %r15, %rdx
callq *(%rdi)
testl %eax, %eax
je 0x33b3f
movl $0xa, 0x8(%r14)
pushq $0xa
popq %rbp
jmp 0x33b07
xorl %ebp, %ebp
jmp 0x33b07
movl 0x8(%r14), %ebp
jmp 0x33b07
// File: /workspace/github_cpp_makefile_star2_O2/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 0x351fe
movl 0x8(%rbx), %ebx
movq %r14, %rdi
callq 0x35208
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x351fe
cmpl $0x0, 0x8(%r14)
jne 0x33b8d
movl %ebp, 0x8(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x35208
// File: /workspace/github_cpp_makefile_star2_O2/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 0x33bca
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
movq (%rsi), %r14
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq *0x8(%rdi)
movq %r14, %rsi
testq %r14, %r14
jne 0x33bae
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x33bee
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x20(%rdi), %rdi
addq $0x20, %rsi
callq *(%rdi)
testq %rax, %rax
je 0x33bf4
movq %rax, 0x78(%rbx)
addq $0x20, %rax
popq %rbx
retq
xorl %eax, %eax
jmp 0x33bf2
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x78(%rdi), %rsi
testq %rsi, %rsi
je 0x33c28
movq 0x80(%rbx), %rax
cmpq 0x88(%rbx), %rax
jne 0x33c28
movq 0x20(%rbx), %rdi
callq *0x8(%rdi)
andq $0x0, 0x78(%rbx)
leaq 0x108(%rbx), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq $0x20, %r12
je 0x33c71
movl 0x70(%rbx), %eax
cmpq %rax, %r12
ja 0x33c5d
movl 0xa8(%rbx), %ecx
cmpq %rcx, %r12
cmovael %r15d, %eax
subl %ecx, %eax
addl %r12d, %eax
cmpl %eax, 0xac(%rbx)
ja 0x33c65
movq %r14, %rdi
callq 0x33b99
incq %r12
addq $0x110, %r14            # imm = 0x110
jmp 0x33c35
cmpl $0x0, 0xac(%rbx)
je 0x33c7f
pushq $0x1
popq %rax
jmp 0x33c92
movq 0x80(%rbx), %rcx
xorl %eax, %eax
cmpq 0x88(%rbx), %rcx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0xac(%rdi)
je 0x33d40
movl 0xa8(%r14), %eax
imulq $0x110, %rax, %rax      # imm = 0x110
leaq (%r14,%rax), %r15
addq $0x108, %r15            # imm = 0x108
cmpq $0x0, (%rbx)
je 0x33d2c
movq 0x10(%r15), %rsi
movq (%rsi), %r12
movq 0x20(%r14), %rdi
callq *0x8(%rdi)
movq %r12, 0x10(%r15)
cmpq $0x0, 0x20(%r15)
jne 0x33d2c
movq %r15, %rdi
callq 0x33b99
decl 0xac(%r14)
je 0x33d40
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, %r15      # imm = 0x110
addq %rax, %r15
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x33d8b
andq $0x0, 0x18(%r15)
movq 0x20(%r15), %rcx
jmp 0x33d99
movq 0x80(%r14), %rax
movq 0x88(%r14), %rcx
subq %rax, %rcx
jne 0x33d70
andq $0x0, (%rbx)
movq 0x78(%r14), %rsi
testq %rsi, %rsi
je 0x33d6c
movq 0x20(%r14), %rdi
callq *0x8(%rdi)
andq $0x0, 0x78(%r14)
xorl %eax, %eax
jmp 0x33dab
movq 0x78(%r14), %rdx
subq $-0x80, %r14
addq %rdx, %rax
addq $0x20, %rax
movq %rcx, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0x33dab
movq 0x20(%r15), %rcx
movq (%r14), %rax
cmpq %rcx, %rax
cmovaeq %rcx, %rax
subq %rax, %rcx
movq %rcx, 0x20(%r15)
movq %rax, (%rbx)
movq 0x10(%r15), %rax
addq $0x20, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x34ca1
leaq 0x28(%rbx), %r14
leaq 0xa0(%rbx), %rdi
callq 0x34f8b
leaq 0x38(%rbx), %rdi
callq 0x34f8b
movq %r14, %rdi
callq 0x34eec
leaq 0x38(%rbx), %rdi
callq 0x35050
addq $0xa0, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x35050
// File: /workspace/github_cpp_makefile_star2_O2/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 0x351fe
addq 0xd0(%r15), %rbp
movq %rbp, 0xd0(%r15)
addq 0xd8(%r15), %r13
movq %r13, 0xd8(%r15)
cmpl $0x0, 0xc8(%r15)
je 0x34d27
cmpl $0x0, 0xb0(%r15)
je 0x34d4c
xorl %eax, %eax
cmpq %r12, 0xb8(%r15)
setb %al
jmp 0x34d4e
movq 0xc0(%r15), %rdi
testq %rdi, %rdi
je 0x34d0f
movq %rbp, %rsi
movq %r13, %rdx
callq *(%rdi)
testl %eax, %eax
je 0x34d0f
movl $0xa, 0xc8(%r15)
jmp 0x34d0f
xorl %eax, %eax
movl %eax, (%rbx)
movl 0xc8(%r15), %ebx
movq %r14, %rdi
callq 0x35208
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_O2/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 0x351fe
cmpl $0x0, 0xb0(%r14)
je 0x34d9d
cmpq %r15, 0xb8(%r14)
jbe 0x34daf
movq %r15, 0xb8(%r14)
movl $0x1, 0xb0(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x35208
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rcx, %rax
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)
andq $0x0, 0x80(%rsp)
movups %xmm0, 0x10(%rsp)
xorl %ecx, %ecx
pushq $0x1
popq %r9
xorl %r8d, %r8d
testq %rax, %rax
je 0x34eb8
movl %eax, %r10d
andl $0x1, %r10d
negq %r10
movq %r9, %r11
shlq %cl, %r11
andq %r10, %r11
orq %r11, %r8
shrq %rax
incq %rcx
jmp 0x34e95
leaq 0x8(%rsp), %rcx
movq %r8, (%rcx)
callq 0x34dbc
addq $0x88, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x34ee9
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x4280
andq $0x0, (%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x34f15
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x8(%rsp), %rsi
callq 0x42e0
andl $0x0, 0x8(%rbx)
andq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
retq
pushq $0x16
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x44c0
testl %eax, %eax
jne 0x34f50
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x43e0
testl %eax, %eax
je 0x34f61
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 0x34f53
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x44b0
movl %eax, %ebp
testl %eax, %eax
jne 0x34fc7
movl $0x1, 0x8(%r14)
addq $0x38, %r14
movq %r14, %rdi
callq 0x40f0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
cmovnel %eax, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x44b0
testl %eax, %eax
je 0x3501f
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38(%r14), %r15
cmpl $0x0, 0x8(%r14)
jne 0x35037
movq %r15, %rdi
movq %rbx, %rsi
callq 0x44f0
jmp 0x35023
cmpl $0x0, 0x4(%r14)
jne 0x35043
andl $0x0, 0x8(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x42a0
// File: /workspace/github_cpp_makefile_star2_O2/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:
cmpl $0x0, (%rdi)
je 0x35081
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x0, (%rdi)
addq $0x10, %rdi
callq 0x43b0
movl %eax, %ebp
addq $0x38, %rbx
movq %rbx, %rdi
callq 0x4670
testl %ebp, %ebp
cmovnel %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
je 0x3509f
pushq $0x16
popq %r15
jmp 0x350ca
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
addq $0x10, %rdi
xorl %esi, %esi
callq 0x44c0
testl %eax, %eax
jne 0x350c7
leaq 0x38(%r14), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x43e0
testl %eax, %eax
je 0x350d8
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 0x350ca
// File: /workspace/github_cpp_makefile_star2_O2/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 0x35160
movl %esi, %r15d
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x44b0
movl %eax, %ebp
testl %eax, %eax
jne 0x35163
addl 0x4(%r14), %r15d
movl $0x8007012a, %ebp       # imm = 0x8007012A
cmpl 0x8(%r14), %r15d
ja 0x35151
movl %r15d, 0x4(%r14)
addq $0x38, %r14
movq %r14, %rdi
callq 0x40f0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
cmovnel %eax, %ebp
jmp 0x35163
pushq $0x16
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x44b0
testl %eax, %eax
je 0x3518e
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38(%r14), %r15
movl 0x4(%r14), %eax
testl %eax, %eax
jne 0x351a7
movq %r15, %rdi
movq %rbx, %rsi
callq 0x44f0
jmp 0x35192
decl %eax
movl %eax, 0x4(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x42a0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpq %r12, %rbx
je 0x35271
movl (%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x370d6
movzbl %al, %eax
addl %eax, %ebp
incq %r12
jmp 0x35256
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq %r13, %rbx
je 0x352bf
movl (%r14,%r13,4), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x370d6
testb %al, %al
je 0x352ba
movq %r15, %rdi
movl %r12d, %esi
callq 0x37b03
addl %eax, %ebp
incq %r13
jmp 0x35295
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x3532e
movl (%r15,%r14,4), %ebp
movq %r12, %rdi
movl %ebp, %esi
callq 0x370d6
testb %al, %al
je 0x35329
movq %r12, %rdi
movl %ebp, %esi
movq (%rsp), %rdx
movq %r13, %rcx
callq 0x37f48
testb %al, %al
je 0x3532e
movq %r12, %rdi
movl %ebp, %esi
callq 0x37b03
movl %eax, %eax
addq %rax, %r13
incq %r14
jmp 0x352ee
cmpq %rbx, %r14
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12d, %r12d
xorl %edi, %edi
callq 0x405c1
movq %rax, %r13
pushq $0x4
popq %rbp
cmpq %r12, %rbx
je 0x353a5
movl (%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x37b21
movl %eax, 0x4(%rsp)
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
movl %ebp, %edx
callq 0x405c1
movq %rax, %r13
incq %r12
jmp 0x35379
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq