LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/zlib1.3.1/trees.c
// Function: pqdownheap
local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
    int v = s->heap[k];
    int j = k << 1;  /* left son of k */
    while (j <= s->heap_len) {
        /* Set j to the smallest of the two sons: */
        if (j < s->heap_len &&
            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
            j++;
        }
        /* Exit if v is smaller than both sons */
        if (smaller(tree, v, s->heap[j], s->depth)) break;

        /* Exchange v with the smallest son */
        s->heap[k] = s->heap[j];  k = j;

        /* And continue down the tree, setting j to the left son of k */
        j <<= 1;
    }
    s->heap[k] = v;
}

// Assembly:
movl %edx, %eax
movl 0xbc0(%rdi,%rax,4), %eax
leal (%rdx,%rdx), %r9d
movl 0x14b4(%rdi), %r10d
cmpl %r10d, %r9d
jle 0x52aaa
movl %edx, %r8d
jmp 0x52b53
pushq %rbx
movslq %eax, %rcx
cmpl %r10d, %r9d
jge 0x52afa
movl %r9d, %r10d
orl $0x1, %r10d
movslq %r10d, %r8
movslq 0xbc0(%rdi,%r8,4), %r8
movslq %r9d, %r11
movslq 0xbc0(%rdi,%r11,4), %r11
movzwl (%rsi,%r11,4), %ebx
cmpw %bx, (%rsi,%r8,4)
jae 0x52ae1
movl %r10d, %r8d
jmp 0x52afd
jne 0x52afa
movb 0x14bc(%rdi,%r8), %bl
movl %r9d, %r8d
cmpb 0x14bc(%rdi,%r11), %bl
jbe 0x52adc
jmp 0x52afd
movl %r9d, %r8d
movslq %r8d, %r9
movl 0xbc0(%rdi,%r9,4), %r9d
movslq %r9d, %r10
movzwl (%rsi,%r10,4), %r11d
cmpw %r11w, (%rsi,%rcx,4)
jb 0x52b4f
jne 0x52b2b
movb 0x14bc(%rdi,%rcx), %r11b
cmpb 0x14bc(%rdi,%r10), %r11b
jbe 0x52b4f
movslq %edx, %rdx
movl %r9d, 0xbc0(%rdi,%rdx,4)
leal (%r8,%r8), %r9d
movl 0x14b4(%rdi), %r10d
movl %r8d, %edx
cmpl %r10d, %r9d
jle 0x52aae
jmp 0x52b52
movl %edx, %r8d
popq %rbx
movslq %r8d, %rcx
movl %eax, 0xbc0(%rdi,%rcx,4)
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/zlib1.3.1/trees.c
// Function: scan_tree
local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
    int n;                     /* iterates over all tree elements */
    int prevlen = -1;          /* last emitted length */
    int curlen;                /* length of current code */
    int nextlen = tree[0].Len; /* length of next code */
    int count = 0;             /* repeat count of the current code */
    int max_count = 7;         /* max repeat count */
    int min_count = 4;         /* min repeat count */

    if (nextlen == 0) max_count = 138, min_count = 3;
    tree[max_code + 1].Len = (ush)0xffff; /* guard */

    for (n = 0; n <= max_code; n++) {
        curlen = nextlen; nextlen = tree[n + 1].Len;
        if (++count < max_count && curlen == nextlen) {
            continue;
        } else if (count < min_count) {
            s->bl_tree[curlen].Freq += count;
        } else if (curlen != 0) {
            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
            s->bl_tree[REP_3_6].Freq++;
        } else if (count <= 10) {
            s->bl_tree[REPZ_3_10].Freq++;
        } else {
            s->bl_tree[REPZ_11_138].Freq++;
        }
        count = 0; prevlen = curlen;
        if (nextlen == 0) {
            max_count = 138, min_count = 3;
        } else if (curlen == nextlen) {
            max_count = 6, min_count = 3;
        } else {
            max_count = 7, min_count = 4;
        }
    }
}

// Assembly:
movzwl 0x2(%rsi), %eax
movslq %edx, %rcx
movw $0xffff, 0x6(%rsi,%rcx,4) # imm = 0xFFFF
testl %ecx, %ecx
js 0x52c43
pushq %r14
pushq %rbx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movl $0x8a, %ecx
movl $0x7, %r10d
cmovel %ecx, %r10d
addl $0x3, %r9d
incl %edx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r14d, %r14d
movl %eax, %r8d
movzwl 0x6(%rsi,%rcx,4), %eax
leal 0x1(%r14), %r11d
cmpl %r10d, %r11d
jge 0x52bba
cmpl %eax, %r8d
jne 0x52bba
movl %ebx, %r8d
jmp 0x52c2e
cmpl %r9d, %r11d
jge 0x52bcd
movl %r8d, %r9d
addw %r11w, 0xabc(%rdi,%r9,4)
jmp 0x52c02
testl %r8d, %r8d
je 0x52bec
cmpl %ebx, %r8d
je 0x52be3
movl %r8d, %r9d
incw 0xabc(%rdi,%r9,4)
incw 0xafc(%rdi)
jmp 0x52c02
cmpl $0x9, %r14d
jg 0x52bfb
incw 0xb00(%rdi)
jmp 0x52c02
incw 0xb04(%rdi)
xorl %r11d, %r11d
testl %eax, %eax
je 0x52c22
xorl %r10d, %r10d
cmpl %eax, %r8d
sete %r10b
movl $0x4, %r9d
subl %r10d, %r9d
xorl $0x7, %r10d
jmp 0x52c2e
movl $0x3, %r9d
movl $0x8a, %r10d
incq %rcx
movl %r11d, %r14d
movl %r8d, %ebx
cmpq %rcx, %rdx
jne 0x52b9f
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/LzmaDec.c
// Function: LzmaDec_DecodeToBuf
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
{
  SizeT outSize = *destLen;
  SizeT inSize = *srcLen;
  *srcLen = *destLen = 0;
  for (;;)
  {
    SizeT inSizeCur = inSize, outSizeCur, dicPos;
    ELzmaFinishMode curFinishMode;
    SRes res;
    if (p->dicPos == p->dicBufSize)
      p->dicPos = 0;
    dicPos = p->dicPos;
    if (outSize > p->dicBufSize - dicPos)
    {
      outSizeCur = p->dicBufSize;
      curFinishMode = LZMA_FINISH_ANY;
    }
    else
    {
      outSizeCur = dicPos + outSize;
      curFinishMode = finishMode;
    }

    res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);
    src += inSizeCur;
    inSize -= inSizeCur;
    *srcLen += inSizeCur;
    outSizeCur = p->dicPos - dicPos;
    memcpy(dest, p->dic + dicPos, outSizeCur);
    dest += outSizeCur;
    outSize -= outSizeCur;
    *destLen += outSizeCur;
    if (res != 0)
      return res;
    if (outSizeCur == 0 || outSize == 0)
      return SZ_OK;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, 0x10(%rsp)
movq %rcx, %r9
movq %rsi, %r12
movq %rdi, %r15
movq (%rdx), %rbp
movq (%r8), %rcx
xorl %eax, %eax
movq %rdx, 0x20(%rsp)
movq %rax, (%rdx)
movq %r8, 0x28(%rsp)
movq %rax, (%r8)
movq %r12, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x20(%r15), %rax
cmpq %rax, 0x28(%r15)
jne 0x5763d
movq $0x0, 0x28(%r15)
movq 0x28(%r15), %r12
movq %rax, %rcx
subq %r12, %rcx
leaq (%r12,%rbp), %rsi
cmpq %rcx, %rbp
cmovaq %rax, %rsi
movl 0x10(%rsp), %r8d
movl $0x0, %eax
cmoval %eax, %r8d
movq %r15, %rdi
movq %r9, %rdx
leaq 0x18(%rsp), %rcx
movq %r9, 0x40(%rsp)
movq 0x80(%rsp), %r9
callq 0x55226
movq 0x18(%rsp), %r13
movq 0x28(%rsp), %rcx
addq %r13, (%rcx)
movl %eax, 0x14(%rsp)
movq 0x28(%r15), %r14
movq 0x18(%r15), %rsi
addq %r12, %rsi
subq %r12, %r14
setne 0xf(%rsp)
movq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x4290
movq 0x40(%rsp), %r9
movq 0x20(%rsp), %rax
addq %r14, (%rax)
subq %r14, %rbp
setne %al
andb 0xf(%rsp), %al
movl $0x0, %ecx
cmovel %ecx, %ebx
movl 0x14(%rsp), %ecx
testl %ecx, %ecx
cmovnel %ecx, %ebx
movq 0x30(%rsp), %rcx
jne 0x576f1
addq %r13, %r9
subq %r13, %rcx
addq %r14, %r12
testb %al, %al
jne 0x5761c
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/LzmaDec.c
// Function: LzmaProps_Decode
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
{
  UInt32 dicSize;
  Byte d;
  
  if (size < LZMA_PROPS_SIZE)
    return SZ_ERROR_UNSUPPORTED;
  else
    dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
 
  if (dicSize < LZMA_DIC_MIN)
    dicSize = LZMA_DIC_MIN;
  p->dicSize = dicSize;

  d = data[0];
  if (d >= (9 * 5 * 5))
    return SZ_ERROR_UNSUPPORTED;

  p->lc = (Byte)(d % 9);
  d /= 9;
  p->pb = (Byte)(d / 5);
  p->lp = (Byte)(d % 5);

  return SZ_OK;
}

// Assembly:
movl $0x4, %eax
cmpl $0x5, %edx
jb 0x577a9
movl 0x1(%rsi), %ecx
cmpl $0x1001, %ecx           # imm = 0x1001
movl $0x1000, %edx           # imm = 0x1000
cmovael %ecx, %edx
movl %edx, 0x4(%rdi)
movb (%rsi), %cl
cmpb $-0x20, %cl
ja 0x577a9
movzbl %cl, %edx
imull $0x39, %edx, %eax
shrl $0x9, %eax
leal (%rax,%rax,8), %esi
movl %ecx, %r8d
subb %sil, %r8b
movb %r8b, (%rdi)
imull $0x6d, %edx, %edx
shrl $0x8, %edx
subb %dl, %cl
shrb %cl
addb %dl, %cl
shrb $0x5, %cl
movb %cl, 0x2(%rdi)
imull $0x34, %eax, %ecx
movzbl %ch, %ecx
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
movb %al, 0x1(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/LzmaDec.c
// Function: LzmaDec_AllocateProbs2
static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAllocPtr alloc)
{
  UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
  if (!p->probs || numProbs != p->numProbs)
  {
    LzmaDec_FreeProbs(p, alloc);
    p->probs = (CLzmaProb *)ISzAlloc_Alloc(alloc, numProbs * sizeof(CLzmaProb));
    if (!p->probs)
      return SZ_ERROR_MEM;
    p->probs_1664 = p->probs + 1664;
    p->numProbs = numProbs;
  }
  return SZ_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movzbl 0x1(%rsi), %ecx
addl (%rsi), %ecx
movl $0x300, %ebp            # imm = 0x300
shll %cl, %ebp
movq %rdi, %r14
addl $0x7c0, %ebp            # imm = 0x7C0
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x57822
xorl %eax, %eax
cmpl 0x60(%r14), %ebp
je 0x5785a
movq %rbx, %rdi
callq *0x8(%rbx)
movq $0x0, 0x8(%r14)
movl %ebp, %esi
addq %rsi, %rsi
movq %rbx, %rdi
callq *(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x57855
addq $0xd00, %rax            # imm = 0xD00
movq %rax, 0x10(%r14)
movl %ebp, 0x60(%r14)
xorl %eax, %eax
jmp 0x5785a
movl $0x2, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/LzmaDec.c
// Function: LzmaDec_Allocate
SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc)
{
  CLzmaProps propNew;
  SizeT dicBufSize;
  RINOK(LzmaProps_Decode(&propNew, props, propsSize))
  RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc))

  {
    UInt32 dictSize = propNew.dicSize;
    SizeT mask = ((UInt32)1 << 12) - 1;
         if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1;
    else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;
    dicBufSize = ((SizeT)dictSize + mask) & ~mask;
    if (dicBufSize < dictSize)
      dicBufSize = dictSize;
  }

  if (!p->dic || dicBufSize != p->dicBufSize)
  {
    LzmaDec_FreeDict(p, alloc);
    p->dic = (Byte *)ISzAlloc_Alloc(alloc, dicBufSize);
    if (!p->dic)
    {
      LzmaDec_FreeProbs(p, alloc);
      return SZ_ERROR_MEM;
    }
  }
  p->dicBufSize = dicBufSize;
  p->prop = propNew;
  return SZ_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x5774d
movl %eax, %ebp
testl %eax, %eax
jne 0x57927
movq %rsp, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x577f4
testl %eax, %eax
cmovnel %eax, %ebp
jne 0x57927
movl 0x4(%rsp), %eax
cmpq $0x400000, %rax         # imm = 0x400000
movl $0xfffff, %ecx          # imm = 0xFFFFF
movl $0xfff, %edx            # imm = 0xFFF
cmovaeq %rcx, %rdx
cmpq $0x40000000, %rax       # imm = 0x40000000
movl $0x3fffff, %r15d        # imm = 0x3FFFFF
cmovbq %rdx, %r15
leaq (%r15,%rax), %rcx
notq %r15
andq %rcx, %r15
cmpq %rax, %r15
cmovbeq %rax, %r15
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x578df
cmpq 0x20(%rbx), %r15
je 0x57900
movq %r14, %rdi
callq *0x8(%r14)
movq $0x0, 0x18(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq *(%r14)
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x5790f
movq %r15, 0x20(%rbx)
movq (%rsp), %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
jmp 0x57927
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq *0x8(%r14)
movq $0x0, 0x8(%rbx)
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/LzmaDec.c
// Function: LzmaDecode
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
    ELzmaStatus *status, ISzAllocPtr alloc)
{
  CLzmaDec p;
  SRes res;
  SizeT outSize = *destLen, inSize = *srcLen;
  *destLen = *srcLen = 0;
  *status = LZMA_STATUS_NOT_SPECIFIED;
  if (inSize < RC_INIT_SIZE)
    return SZ_ERROR_INPUT_EOF;
  LzmaDec_CONSTRUCT(&p)
  RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc))
  p.dic = dest;
  p.dicBufSize = outSize;
  LzmaDec_Init(&p);
  *srcLen = inSize;
  res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
  *destLen = p.dicPos;
  if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
    res = SZ_ERROR_INPUT_EOF;
  LzmaDec_FreeProbs(&p, alloc);
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %r12
movq 0xc8(%rsp), %rcx
movq (%rsi), %rbp
movq (%r12), %r13
xorl %eax, %eax
movq %rax, (%r12)
movq %rax, (%rsi)
movl $0x0, (%rcx)
movl $0x6, %ebx
cmpq $0x5, %r13
jb 0x57a2f
movq %rsi, %r15
movq %rdi, %r14
movq 0xd0(%rsp), %rcx
xorl %eax, %eax
leaq 0x8(%rsp), %rdi
movq %rax, 0x18(%rdi)
movq %rax, 0x8(%rdi)
movq %r8, %rsi
movq %rdx, %rbx
movl %r9d, %edx
callq 0x577aa
movq %rbx, %rdx
movl %eax, %ebx
testl %eax, %eax
jne 0x57a2f
movl 0xc0(%rsp), %r8d
leaq 0x8(%rsp), %rdi
movq %r14, 0x18(%rdi)
movq %rbp, 0x20(%rdi)
xorl %r14d, %r14d
movq %r14, 0x28(%rdi)
movl $0x0, 0x64(%rdi)
movq %r14, 0x40(%rdi)
movl $0x114, 0x5c(%rdi)      # imm = 0x114
movq %r13, (%r12)
movq %rdi, %r13
movq %rbp, %rsi
movq %r12, %rcx
movq 0xc8(%rsp), %r12
movq %r12, %r9
callq 0x55226
movl %eax, %ebx
movq 0x28(%r13), %rax
movq %rax, (%r15)
testl %ebx, %ebx
jne 0x57a16
cmpl $0x3, (%r12)
movl $0x6, %eax
cmovel %eax, %r14d
movl %r14d, %ebx
movq 0x10(%rsp), %rsi
movq 0xd0(%rsp), %rdi
callq *0x8(%rdi)
movq $0x0, 0x10(%rsp)
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/Lzma2Dec.c
// Function: Lzma2Dec_DecodeToBuf
SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
{
  SizeT outSize = *destLen, inSize = *srcLen;
  *srcLen = *destLen = 0;
  
  for (;;)
  {
    SizeT inCur = inSize, outCur, dicPos;
    ELzmaFinishMode curFinishMode;
    SRes res;
    
    if (p->decoder.dicPos == p->decoder.dicBufSize)
      p->decoder.dicPos = 0;
    dicPos = p->decoder.dicPos;
    curFinishMode = LZMA_FINISH_ANY;
    outCur = p->decoder.dicBufSize - dicPos;
    
    if (outCur >= outSize)
    {
      outCur = outSize;
      curFinishMode = finishMode;
    }

    res = Lzma2Dec_DecodeToDic(p, dicPos + outCur, src, &inCur, curFinishMode, status);
    
    src += inCur;
    inSize -= inCur;
    *srcLen += inCur;
    outCur = p->decoder.dicPos - dicPos;
    memcpy(dest, p->decoder.dic + dicPos, outCur);
    dest += outCur;
    outSize -= outCur;
    *destLen += outCur;
    if (res != 0)
      return res;
    if (outCur == 0 || outSize == 0)
      return SZ_OK;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r12
movq (%rdx), %rbp
movq (%r8), %r9
xorl %eax, %eax
movq %rdx, 0x20(%rsp)
movq %rax, (%rdx)
movq %r8, 0x28(%rsp)
movq %rax, (%r8)
movq %r15, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movq %r9, 0x18(%rsp)
movq 0x30(%r12), %rsi
cmpq %rsi, 0x38(%r12)
jne 0x58191
movq $0x0, 0x38(%r12)
movq 0x38(%r12), %r15
subq %r15, %rsi
cmpq %rbp, %rsi
cmovaeq %rbp, %rsi
movl 0x10(%rsp), %r8d
movl $0x0, %eax
cmovbl %eax, %r8d
addq %r15, %rsi
movq %r12, %rdi
movq %rcx, %rdx
movq %rcx, 0x40(%rsp)
leaq 0x18(%rsp), %rcx
movq 0x80(%rsp), %r9
callq 0x57b22
movq 0x18(%rsp), %r13
movq 0x28(%rsp), %rcx
addq %r13, (%rcx)
movl %eax, 0x14(%rsp)
movq 0x38(%r12), %r14
movq 0x28(%r12), %rsi
addq %r15, %rsi
subq %r15, %r14
setne 0xf(%rsp)
movq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x4290
movq 0x40(%rsp), %rcx
movq 0x20(%rsp), %rax
addq %r14, (%rax)
subq %r14, %rbp
setne %al
andb 0xf(%rsp), %al
movl $0x0, %edx
cmovel %edx, %ebx
movl 0x14(%rsp), %edx
testl %edx, %edx
cmovnel %edx, %ebx
movq 0x30(%rsp), %r9
jne 0x58244
addq %r13, %rcx
subq %r13, %r9
addq %r14, %r15
testb %al, %al
jne 0x5816d
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/lzma/C/Lzma2Dec.c
// Function: Lzma2Decode
SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
    Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAllocPtr alloc)
{
  CLzma2Dec p;
  SRes res;
  SizeT outSize = *destLen, inSize = *srcLen;
  *destLen = *srcLen = 0;
  *status = LZMA_STATUS_NOT_SPECIFIED;
  Lzma2Dec_CONSTRUCT(&p)
  RINOK(Lzma2Dec_AllocateProbs(&p, prop, alloc))
  p.decoder.dic = dest;
  p.decoder.dicBufSize = outSize;
  Lzma2Dec_Init(&p);
  *srcLen = inSize;
  res = Lzma2Dec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
  *destLen = p.decoder.dicPos;
  if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
    res = SZ_ERROR_INPUT_EOF;
  Lzma2Dec_FreeProbs(&p, alloc);
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, 0x4(%rsp)
movq %rcx, %r12
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %rbp
movq 0xe8(%rsp), %rdx
movq 0xe0(%rsp), %rax
movq (%rsi), %r14
movq (%rcx), %rcx
movq %rcx, 0x8(%rsp)
xorl %ebx, %ebx
movq %rbx, (%r12)
movq %rbx, (%rsi)
movl $0x0, (%rax)
leaq 0x18(%rsp), %rdi
movq %rbx, 0x28(%rdi)
movq %rbx, 0x18(%rdi)
movl %r8d, %esi
callq 0x57a44
movl %eax, %r13d
testl %eax, %eax
jne 0x58348
leaq 0x28(%rsp), %rax
movq %rbp, 0x18(%rax)
movq %rax, %rbp
movq %r14, 0x20(%rax)
movl %ebx, -0x10(%rax)
movw $0xe0, -0xb(%rax)
movl %ebx, -0x4(%rax)
movq %rax, %rdi
callq 0x5520d
movq 0x8(%rsp), %rax
movq %rax, (%r12)
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
movl 0x4(%rsp), %r8d
movq 0xe0(%rsp), %rbx
movq %rbx, %r9
callq 0x57b22
movq 0x38(%r13), %rcx
movq %rcx, (%r15)
movl $0x1, %r13d
testl %eax, %eax
jne 0x58338
xorl %eax, %eax
cmpl $0x3, (%rbx)
movl $0x6, %r13d
cmovnel %eax, %r13d
movq %rbp, %rdi
movq 0xe8(%rsp), %rsi
callq 0x57702
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: randomU64()
uint64_t randomU64 ()
{
    uint64_t val1, val2, val3, val4;
    val1 = uint64_t(rand() & 0xFFFF);
    val2 = uint64_t(rand() & 0xFFFF) << 16;
    val3 = uint64_t(rand() & 0xFFFF) << 32;
    val4 = uint64_t(rand() & 0xFFFF) << 48;
    
    
    return val1 | val2 | val3 | val4;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x2060
movl %eax, %ebx
movl $0xffff, %ebp           # imm = 0xFFFF
andl %ebp, %ebx
callq 0x2060
movl %eax, %r14d
shll $0x10, %r14d
orl %ebx, %r14d
callq 0x2060
movl %eax, %ebx
andl %ebp, %ebx
shlq $0x20, %rbx
callq 0x2060
shlq $0x30, %rax
orq %rbx, %r14
orq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: bitboards::init()
void bitboards::init(){

  // std::cout << "Generating Bitboard Masks... \n";
    for(int i=0; i<numOfSq; i++)
    {
          squareBitMask[i] = (1ULL << i);
    }
    
    //diagonal and antiDiagonal bit masks
    for(int i=0; i<numOfSq; i++)
    {
        
        
        diagonalBitMask[i]  = diagMasks(i, 0) ;//& clearEdges;
        
       
        antiDiagonalBitMask[i] = antidiagMasks(i, 0);// & clearEdges;
        
        
    }
    
    for( int i = 0; i < numOfFile; i++)
    {
        fileBitMask[i] = fileA << i;
        clearFile[i] = ~fileBitMask[i];
    }
    
    for( int i = 0; i < numOfRank; i++)
    {
        rankBitMask[i] = rank1 << (8*i);
        clearRank[i] = ~rankBitMask[i];
    }
    // std::cout << "Generating Piece Attacks... \n";
     allPawnAttacks();
     allKingAttacks();
     allKnightAttacks();
     allBishopAttacks();
     allRookAttacks();
     allQueenAttacks();
     //std::cout << "Generating Magic Bishop Boards... \n";
     initMagicBishop();
     //std::cout << "Generating Magic Rook Boards... \n";
     initMagicRook();
     inBetweenBitMask();
     //std::cout << "Generating Bitboards Complete... \n";
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x94f5(%rip), %rax      # 0xbde0
xorl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, (%rax)
incq %rcx
addq $0x8, %rax
cmpq $0x40, %rcx
jne 0x28ed
xorl %r12d, %r12d
leaq 0x9751(%rip), %r14      # 0xc060
leaq 0x994a(%rip), %r15      # 0xc260
xorl %ebx, %ebx
movl %ebx, %edi
xorl %esi, %esi
callq 0x2a41
movq %rax, (%r12,%r14)
movl %ebx, %edi
xorl %esi, %esi
callq 0x2aa8
movq %rax, (%r12,%r15)
incq %rbx
addq $0x8, %r12
cmpq $0x40, %rbx
jne 0x2918
xorl %eax, %eax
movabsq $0x101010101010101, %rdx # imm = 0x101010101010101
leaq 0x968e(%rip), %rsi      # 0xbfe0
leaq 0x9b07(%rip), %rdi      # 0xc460
xorl %ecx, %ecx
movq %rdx, %r8
shlq %cl, %r8
movq %r8, (%rax,%rsi)
notq %r8
movq %r8, (%rax,%rdi)
incq %rcx
addq $0x8, %rax
cmpq $0x8, %rcx
jne 0x295b
xorl %ecx, %ecx
leaq 0x969e(%rip), %rax      # 0xc020
leaq 0x9b17(%rip), %rdx      # 0xc4a0
movl $0xff, %esi
shlq %cl, %rsi
movq %rsi, (%rcx,%rax)
notq %rsi
movq %rsi, (%rcx,%rdx)
addq $0x8, %rcx
cmpq $0x40, %rcx
jne 0x2989
callq 0x2b0b
callq 0x2bc7
callq 0x2c65
xorl %eax, %eax
leaq 0x9422(%rip), %rcx      # 0xbde0
movabsq $0x7e7e7e7e7e7e00, %rdx # imm = 0x7E7E7E7E7E7E00
leaq 0xe3111(%rip), %rsi     # 0xe5ae0
leaq 0x9b0a(%rip), %rbx      # 0xc4e0
movq (%rax,%r15), %rdi
orq (%rax,%r14), %rdi
xorq (%rax,%rcx), %rdi
movq %rdi, 0x400(%rax,%rbx)
andq %rdx, %rdi
movq %rdi, (%rax,%rsi)
addq $0x8, %rax
cmpq $0x200, %rax            # imm = 0x200
jne 0x29d6
callq 0x2d8a
movq $-0x200, %rax           # imm = 0xFE00
movq 0x800(%rax,%rbx), %rcx
orq 0x600(%rax,%rbx), %rcx
movq %rcx, 0xa00(%rax,%rbx)
addq $0x8, %rax
jne 0x2a09
callq 0x2ec5
callq 0x3098
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x326b
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: diagMasks(int, unsigned long)
bitboard diagMasks (int sq, bitboard occupied){
    int iter = sq;
   bitboard bb = squareBitMask[sq];
    
    //Diagonal
    //north east
    bitboard diag = bb;
    while( (square_to_rank(square(iter)) < numOfRank-1) && (square_to_file(square(iter)) < numOfFile-1) )
    {
        
        iter += noEa;
        diag |= (diag << noEa);
        if( squareBitMask[iter] & occupied) break;
    }
    
    //south west
    iter = sq;
    while( (square_to_rank(square(iter)) >= 0) && (square_to_file(square(iter)) > 0) && iter >= 0 )
    {
        iter +=soWe;
        diag |= (diag >> -soWe);
        if( squareBitMask[iter] & occupied) break;
    }
    
    //diagonalBitMask[sq] = diag;
    
    return diag;
}

// Assembly:
movslq %edi, %rcx
leaq 0x9395(%rip), %rdx      # 0xbde0
movq (%rdx,%rcx,8), %rax
movq %rcx, %rdi
movl %edi, %r8d
notl %r8d
testb $0x38, %r8b
je 0x2a83
movl %edi, %r8d
andl $0x7, %r8d
cmpl $0x7, %r8d
je 0x2a83
leaq 0x9(%rdi), %r8
movq %rax, %r9
shlq $0x9, %r9
orq %r9, %rax
testq %rsi, 0x48(%rdx,%rdi,8)
movq %r8, %rdi
je 0x2a52
testq %rcx, %rcx
js 0x2aa7
movl %ecx, %edi
andl $0x7, %edi
je 0x2aa7
leaq -0x9(%rcx), %rdi
movq %rax, %r8
shrq $0x9, %r8
orq %r8, %rax
testq %rsi, -0x48(%rdx,%rcx,8)
movq %rdi, %rcx
je 0x2a83
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: antidiagMasks(int, unsigned long)
bitboard antidiagMasks (int sq, bitboard occupied){
    
    bitboard antiDiag = squareBitMask[sq];
    int iter = sq;
    while( (square_to_rank(square(iter)) < numOfRank-1) && (square_to_file(square(iter)) > 0) )
    {
        iter += noWe;
        antiDiag |= (antiDiag << noWe);
        if( squareBitMask[iter] & occupied) break;
    }
    
    //south east
    iter = sq;
    while( (square_to_rank(square(iter)) >= 0) && (square_to_file(square(iter)) < numOfFile-1) )
    {
        iter += soEa;
        antiDiag |= (antiDiag >> -soEa);
        if( squareBitMask[iter] & occupied) break;
        
    }
    
    return antiDiag;
}

// Assembly:
movslq %edi, %rdx
leaq 0x932e(%rip), %rcx      # 0xbde0
movq (%rcx,%rdx,8), %rax
movq %rdx, %rdi
movl %edi, %r8d
notl %r8d
testb $0x38, %r8b
je 0x2b00
movl %edi, %r8d
andl $0x7, %r8d
je 0x2b00
leaq 0x7(%rdi), %r8
movq %rax, %r9
shlq $0x7, %r9
orq %r9, %rax
testq %rsi, 0x38(%rcx,%rdi,8)
movq %r8, %rdi
je 0x2ab9
jmp 0x2b00
leaq -0x7(%rdx), %rdi
movq %rax, %r8
shrq $0x7, %r8
orq %r8, %rax
testq %rsi, -0x38(%rcx,%rdx,8)
movq %rdi, %rdx
jne 0x2b0a
movl %edx, %edi
notl %edi
testb $0x7, %dil
jne 0x2ae8
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: allPawnAttacks()
void allPawnAttacks(){
    bitboard pawnA = 0ULL, pawnH = 0ULL, pawnAttacks = 0ULL;
    square sq = a1;
    
    for(rank rk = rank_1; rk<numOfRank-1; rk++)
    {
        for(file f = file_a; f<numOfFile; f++)
        {
            sq = rankFile_to_sq(rk, f);
            pawnA = squareBitMask[sq] & clearFile[file_a];
            pawnH = squareBitMask[sq] & clearFile[file_h];
            
            pawnAttacks |= (pawnA << noWe);
            pawnAttacks |= (pawnH << noEa);
            
            //printBitboard(pawnAttacks);
            openBoardPawnAttacks[0][sq] = pawnAttacks;
            pawnAttacks = 0ULL;
        }
    }
    
    for(rank rk = rank_8; rk > rank_1; rk--)
    {
        for(file f = file_a; f<numOfFile; f++)
        {
            sq = rankFile_to_sq(rk, f);
            pawnA = squareBitMask[sq] & clearFile[file_a];
            pawnH = squareBitMask[sq] & clearFile[file_h];
            
            pawnAttacks |= (pawnA >> -soWe);
            pawnAttacks |= (pawnH >> -soEa);
            
            //printBitboard(pawnAttacks);
            openBoardPawnAttacks[1][sq] = pawnAttacks;
            pawnAttacks = 0ULL;
        }
    }
}

// Assembly:
pushq %rbx
movq 0x994d(%rip), %rax      # 0xc460
movq 0x997e(%rip), %rcx      # 0xc498
xorl %edx, %edx
leaq 0x92bd(%rip), %rsi      # 0xbde0
leaq 0xa5b6(%rip), %rdi      # 0xd0e0
xorl %r8d, %r8d
xorl %r9d, %r9d
leaq (%rdx,%r9), %r10
movq (%rsi,%r10), %r11
movq %rax, %rbx
andq %r11, %rbx
andq %rcx, %r11
shlq $0x7, %rbx
shlq $0x9, %r11
orq %rbx, %r11
movq %r11, (%rdi,%r10)
addq $0x8, %r9
cmpq $0x40, %r9
jne 0x2b30
incq %r8
addq $0x40, %rdx
cmpq $0x7, %r8
jne 0x2b2d
movq 0x98f2(%rip), %rax      # 0xc460
movl $0x7, %edi
leaq 0x9426(%rip), %rcx      # 0xbfa0
leaq 0xa91f(%rip), %rdx      # 0xd4a0
movq 0x9910(%rip), %rsi      # 0xc498
xorl %r8d, %r8d
movq (%rcx,%r8,8), %r9
movq %rax, %r10
andq %r9, %r10
andq %rsi, %r9
shrq $0x9, %r10
shrq $0x7, %r9
orq %r10, %r9
movq %r9, (%rdx,%r8,8)
incq %r8
cmpq $0x8, %r8
jne 0x2b8b
leaq -0x1(%rdi), %r8
addq $-0x40, %rcx
addq $-0x40, %rdx
cmpq $0x1, %rdi
movq %r8, %rdi
ja 0x2b88
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: allKingAttacks()
void allKingAttacks(){
    bitboard kingA = 0ULL, kingH = 0ULL, kingMoves = 0ULL, king = 0ULL;
    square sq = a1;
    for(rank rk = rank_1; rk<numOfRank; rk++)
    {
        for(file f = file_a; f<numOfFile; f++)
        {
            sq = rankFile_to_sq(rk, f);
            kingA = squareBitMask[sq] & clearFile[file_a];
            kingH = squareBitMask[sq] & clearFile[file_h];
            king  = squareBitMask[sq];
            
            kingMoves |= (kingA << noWe);
            kingMoves |= (king  << nort);
            kingMoves |= (kingH << noEa);
            kingMoves |= (kingH << east);
            kingMoves |= (kingH >> -soEa);
            kingMoves |= (king  >> -south);
            kingMoves |= (kingA >> -soWe);
            kingMoves |= (kingA >> -west);
            
           // printBitboard(kingMoves);
            openBoardAttacks[p_king][sq] = kingMoves;
            kingMoves = 0ULL;
        }
        
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x988b(%rip), %rax      # 0xc460
leaq 0x9204(%rip), %rcx      # 0xbde0
leaq 0xa2fd(%rip), %rdx      # 0xcee0
movq 0x98ae(%rip), %rsi      # 0xc498
xorl %edi, %edi
xorl %r8d, %r8d
movq (%rcx,%r8,8), %r10
movq %rax, %r9
andq %r10, %r9
movq %rsi, %r11
andq %r10, %r11
movq %r9, %rbx
shlq $0x7, %rbx
movq %r10, %r14
shlq $0x8, %r14
movq %r11, %r15
shlq $0x9, %r15
leaq (%r11,%r11), %r12
orq %r15, %r12
shrq $0x7, %r11
orq %r12, %r11
shrq $0x8, %r10
orq %r14, %r10
orq %rbx, %r10
movq %r9, %rbx
shrq $0x9, %rbx
shrq %r9
orq %rbx, %r9
orq %r10, %r9
orq %r11, %r9
movq %r9, (%rdx,%r8,8)
incq %r8
cmpq $0x8, %r8
jne 0x2bef
incq %rdi
addq $0x40, %rcx
addq $0x40, %rdx
cmpq $0x8, %rdi
jne 0x2bec
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: allKnightAttacks()
void allKnightAttacks(){
    bitboard knightA = 0ULL, knightB = 0ULL, knightG = 0ULL, knightH = 0ULL;
    bitboard knightMoves = 0ULL, knight = 0ULL;
    square sq = a1;
    for(rank rk = rank_1; rk<numOfRank; rk++)
    {
        for(file f = file_a; f<numOfFile; f++)
        {
            sq = rankFile_to_sq(rk, f);
            knightA = squareBitMask[sq] & clearFile[file_a];
            knightB = squareBitMask[sq] & clearFile[file_b];
            knightG = squareBitMask[sq] & clearFile[file_g];
            knightH = squareBitMask[sq] & clearFile[file_h];
            knight  = squareBitMask[sq];
            
            knightMoves |= ((knightA & knightB) << noWeWe);
            knightMoves |= (knightA  << noNoWe);
            knightMoves |= (knightH << noNoEa);
            knightMoves |= ((knightG & knightH) << noEaEa);
            knightMoves |= ((knightG & knightH) >> -soEaEa);
            knightMoves |= (knightH  >> -soSoEa);
            knightMoves |= (knightA >> -soSoWe);
            knightMoves |= ((knightA & knightB) >> -soWeWe);
            
           // printBitboard(knightMoves);
            openBoardAttacks[p_knight][sq] = knightMoves;
            knightMoves = 0ULL;
        }
        
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x97ea(%rip), %rax      # 0xc460
movq 0x97eb(%rip), %rcx      # 0xc468
movq 0x980c(%rip), %rdx      # 0xc490
leaq 0x9155(%rip), %rsi      # 0xbde0
leaq 0x9a4e(%rip), %rdi      # 0xc6e0
movq 0x97ff(%rip), %r8       # 0xc498
xorl %r9d, %r9d
movq %r9, -0x8(%rsp)
xorl %r10d, %r10d
movq (%rsi,%r10,8), %r15
movq %rax, %rbx
andq %r15, %rbx
movq %r8, %r11
andq %r15, %r11
movq %rbx, %r14
andq %rcx, %r14
movq %r14, %r12
shlq $0x6, %r12
movq %rbx, %r13
shlq $0xf, %r13
movq %r11, %rbp
shlq $0x11, %rbp
andq %rdx, %r15
andq %r8, %r15
movq %r15, %r9
shlq $0xa, %r9
shrq $0x6, %r15
orq %r9, %r15
shrq $0xf, %r11
orq %r15, %r11
shrq $0x11, %rbx
orq %r13, %rbx
orq %r12, %rbx
shrq $0xa, %r14
orq %rbp, %r14
orq %rbx, %r14
orq %r11, %r14
movq %r14, (%rdi,%r10,8)
incq %r10
cmpq $0x8, %r10
jne 0x2ca4
movq -0x8(%rsp), %r9
incq %r9
addq $0x40, %rsi
addq $0x40, %rdi
cmpq $0x8, %r9
jne 0x2c9c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: allBishopAttacks()
void allBishopAttacks(){
    for(square sq= a1; sq<numOfSq; sq++){
     
        magicBishopMask[sq] = clearEdges &( squareBitMask[sq] ^(diagonalBitMask[sq] | antiDiagonalBitMask[sq]));
        openBoardAttacks[p_bishop][sq] =  squareBitMask[sq] ^(diagonalBitMask[sq] | antiDiagonalBitMask[sq]);
       // printBitboard(openBoardAttacks[p_bishop][sq]);
    }
}

// Assembly:
xorl %eax, %eax
leaq 0x90a4(%rip), %rcx      # 0xbde0
leaq 0x931d(%rip), %rdx      # 0xc060
leaq 0x9516(%rip), %rsi      # 0xc260
movabsq $0x7e7e7e7e7e7e00, %rdi # imm = 0x7E7E7E7E7E7E00
leaq 0xe2d85(%rip), %r8      # 0xe5ae0
leaq 0x977e(%rip), %r9       # 0xc4e0
movq (%rax,%rsi), %r10
orq (%rax,%rdx), %r10
xorq (%rax,%rcx), %r10
movq %r10, 0x400(%rax,%r9)
andq %rdi, %r10
movq %r10, (%rax,%r8)
addq $0x8, %rax
cmpq $0x200, %rax            # imm = 0x200
jne 0x2d62
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: allRookAttacks()
void allRookAttacks(){
    bitboard rookMoves = 0ULL;
    square sq = a1;
    for(rank rk = rank_1; rk<numOfRank; rk++)
    {
        for(file f = file_a; f<numOfFile; f++)
        {
            sq = rankFile_to_sq(rk, f);
            rookMoves = fileBitMask[f] | rankBitMask[rk];
            openBoardAttacks[p_rook][sq] = rookMoves ^ squareBitMask[sq];
           
            if ( (sq == a1) || (sq == a8) || (sq == h1) || (sq == h8) )
            {
                magicRookMask[sq] = (rookMoves & clearCorners);
            }
            else if(rk == rank_1)
                magicRookMask[sq] = squareBitMask[sq] ^ (rookMoves & (clearEdges | (rank1 & clearCorners)));
            else if (rk == rank_8)
                magicRookMask[sq] = squareBitMask[sq] ^ (rookMoves & (clearEdges | (rank8 & clearCorners)));
            else if (f == file_a)
                magicRookMask[sq] = squareBitMask[sq] ^ (rookMoves & (clearEdges | (fileA & clearCorners)));
            else if (f == file_h)
                magicRookMask[sq] = squareBitMask[sq] ^ (rookMoves & (clearEdges | (fileH & clearCorners)));
            else
            {
                magicRookMask[sq] = squareBitMask[sq] ^ (rookMoves & clearEdges );
            }
                
            //printBitboard( openBoardAttacks[p_rook][sq]);
            //printBitboard(magicRookMask[sq]);
            rookMoves = 0ULL;
            
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x9045(%rip), %rax      # 0xbde0
leaq 0x9d3e(%rip), %rcx      # 0xcae0
leaq 0x1a737(%rip), %rdx     # 0x1d4e0
movabsq $0x7e7e7e7e7e7e00, %rsi # imm = 0x7E7E7E7E7E7E00
xorl %edi, %edi
movabsq $0x7e7e7e7e7e7e7e00, %r10 # imm = 0x7E7E7E7E7E7E7E00
leaq 0x7e(%rsi), %r11
movabsq $-0x7effffffffffff7f, %r15 # imm = 0x8100000000000081
movabsq $0x7effffffffffff7e, %r12 # imm = 0x7EFFFFFFFFFFFF7E
xorl %r13d, %r13d
leaq 0x923f(%rip), %rsi      # 0xc020
movq (%rsi,%r13,8), %rbp
leaq 0x91f4(%rip), %r9       # 0xbfe0
xorl %ebx, %ebx
movq (%r9), %r14
orq %rbp, %r14
movq (%rax,%rbx,8), %r8
movq %r14, %rsi
xorq %r8, %rsi
movq %rsi, (%rcx,%rbx,8)
leaq (%rdi,%rbx), %rsi
cmpl $0x3f, %esi
ja 0x2e29
movl %esi, %esi
btq %rsi, %r15
jae 0x2e29
andq %r12, %r14
movq %r14, (%rdx,%rbx,8)
incq %rbx
addq $0x8, %r9
cmpq $0x8, %rbx
jne 0x2dee
jmp 0x2e71
cmpl $0x7, %r13d
je 0x2e39
testl %r13d, %r13d
jne 0x2e3e
andq %r11, %r14
jmp 0x2e6c
andq %r10, %r14
jmp 0x2e6c
cmpl $0x7, %ebx
je 0x2e53
testl %ebx, %ebx
jne 0x2e5f
movabsq $0x7f7f7f7f7f7f00, %rsi # imm = 0x7F7F7F7F7F7F00
jmp 0x2e69
movabsq $0xfefefefefefe00, %rsi # imm = 0xFEFEFEFEFEFE00
jmp 0x2e69
movabsq $0x7e7e7e7e7e7e00, %rsi # imm = 0x7E7E7E7E7E7E00
andq %rsi, %r14
xorq %r8, %r14
jmp 0x2e16
incq %r13
addq $0x40, %rax
addq $0x40, %rcx
addq $0x40, %rdx
addq $0x8, %rdi
cmpq $0x8, %r13
jne 0x2dda
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: vertMasks(int, unsigned long)
bitboard vertMasks (int sq, bitboard occupied){
    int iter = sq;
    bitboard bb = squareBitMask[sq];
    
    //vertical
    //north
    bitboard vert = bb;
    while( square_to_rank(square(iter)) < numOfRank-1 )
    {
        
        iter += nort;
        vert |= (vert << nort);
        if( squareBitMask[iter] & occupied) break;
    }
    
    //south
    iter = sq;
    while( square_to_rank(square(iter)) > 0)
    {
        iter +=south;
        vert |= (vert >> -south);
        if( squareBitMask[iter] & occupied) break;
    }
    
    return vert;
}

// Assembly:
movslq %edi, %rdx
leaq 0x89b7(%rip), %rcx      # 0xbde0
movq (%rcx,%rdx,8), %rax
movq %rdx, %rdi
movl %edi, %r8d
notl %r8d
testb $0x38, %r8b
je 0x346e
leaq 0x8(%rdi), %r8
movq %rax, %r9
shlq $0x8, %r9
orq %r9, %rax
testq %rsi, 0x40(%rcx,%rdi,8)
movq %r8, %rdi
je 0x3430
jmp 0x346e
leaq -0x8(%rdx), %rdi
movq %rax, %r8
shrq $0x8, %r8
orq %r8, %rax
testq %rsi, -0x40(%rcx,%rdx,8)
movq %rdi, %rdx
jne 0x3473
testb $0x38, %dl
jne 0x3456
retq
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: printBitboard(unsigned long)
void printBitboard(bitboard board)
{
    std::cout << "---------------\n";
    for(rank r = rank_8; r>=0; r--)
    {
        for(file f = file_a; f<numOfFile; f++)
        {
            if(board & squareBitMask[rankFile_to_sq(r, f)]) std::cout << "# ";
            else std::cout << "- ";
        }
        std::cout <<"\n";
    }
    std::cout << "---------------\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x7a79(%rip), %r14      # 0xafc0
leaq 0x4ac4(%rip), %rsi      # 0x8012
movl $0x10, %edx
movq %r14, %rdi
callq 0x2180
movl $0x7, %eax
leaq 0x8a39(%rip), %r13      # 0xbfa0
leaq 0x4ab8(%rip), %rbp      # 0x8026
leaq 0x4aae(%rip), %r15      # 0x8023
movq %rax, (%rsp)
xorl %r12d, %r12d
movq %rbp, %rsi
testq %rbx, (%r13,%r12,8)
je 0x3589
movq %r15, %rsi
movl $0x2, %edx
movq %r14, %rdi
callq 0x2180
incq %r12
cmpq $0x8, %r12
jne 0x357c
movl $0x1, %edx
movq %r14, %rdi
leaq 0x4dc3(%rip), %rsi      # 0x8371
callq 0x2180
addq $-0x40, %r13
movq (%rsp), %rax
subq $0x1, %rax
jae 0x3575
movq 0x79f8(%rip), %rdi      # 0xafc0
leaq 0x4a43(%rip), %rsi      # 0x8012
movl $0x10, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: generateQuiet(position const&, candidate*)
candidate* generateQuiet(const position& pos, candidate* moveList){
    player us = pos.get_sideToPlay();
    player them = player(!us);
    bitboard quiets = ~(pos.get_pieces());
    bitboard clear7Rank = us == white ? clearRank[rank_8] : clearRank[rank_1];
    
    moveList = sliderMoves(pos, quiets, moveList);
    moveList = pawnPushMoves(pos, pos.get_pieces(us, p_pawn), us, quiets & clear7Rank, moveList);
    moveList = kingMoves(pos, quiets, moveList);
    moveList = knightMoves(pos.get_pieces(us, p_knight), quiets, moveList);
    
    
    return moveList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq %rdi, %rbx
movl 0x17c(%rdi), %ebp
leaq 0x100(%rdi), %rax
leaq 0x138(%rdi), %rcx
leaq 0x108(%rdi), %r12
testl %ebp, %ebp
cmovneq %rcx, %r12
leaq 0x130(%rdi), %r13
testl %ebp, %ebp
leaq 0x8e71(%rip), %rcx      # 0xc4a0
cmoveq %rax, %r13
leaq 0x38(%rcx), %rax
testl %ebp, %ebp
movq 0x170(%rdi), %r14
notq %r14
cmovneq %rcx, %rax
movq (%rax), %r15
andq %r14, %r15
movq %r14, %rsi
callq 0x3ddc
movq (%r13), %rsi
movq %rbx, %rdi
movl %ebp, %edx
movq %r15, %rcx
movq %rax, %r8
callq 0x3f2e
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4001
movq (%r12), %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x406a
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: generateCapture(position const&, candidate*)
candidate* generateCapture(const position& pos, candidate* moveList)
{
    
    player us = pos.get_sideToPlay();
    player them = player(!us);
    bitboard captures = pos.get_pieces(them);
    bitboard pawnCaptures = us == white ? captures & clearRank[rank_8] : captures & clearRank[rank_1];
    
    moveList = kingMoves(pos, captures, moveList);
    moveList = knightMoves(pos.get_pieces(us, p_knight), captures, moveList);
    moveList = pawnAttackMoves(pos.get_pieces(us, p_pawn), us, pawnCaptures , moveList);
    moveList = sliderMoves(pos, captures, moveList);
    
    
    
    return moveList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x17c(%rdi), %ebp
leaq 0x130(%rdi), %r12
leaq 0x100(%rdi), %rax
testl %ebp, %ebp
cmoveq %rax, %r12
movq %rsi, %rdx
leaq 0x138(%rdi), %r13
leaq 0x108(%rdi), %rax
testl %ebp, %ebp
leaq 0x8dc5(%rip), %rcx      # 0xc4a0
cmoveq %rax, %r13
leaq 0x38(%rcx), %rax
xorl %esi, %esi
testl %ebp, %ebp
sete %sil
movq 0x160(%rdi,%rsi,8), %r14
cmovneq %rcx, %rax
movq (%rax), %r15
andq %r14, %r15
movq %r14, %rsi
callq 0x4001
movq (%r13), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x406a
movq (%r12), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0x40af
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ddc
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: generateNonEvasions(position const&, candidate*)
candidate* generateNonEvasions(const position& pos, candidate* moveList)
{
    moveList = generateCapture(pos, moveList);
    moveList = generatePromotions(pos, moveList);
    moveList = generateQuiet(pos, moveList);
    if(pos.get_castlingRights(pos.get_sideToPlay()))moveList = generateCastling(pos, moveList);
    if(pos.get_enPassent() != empty) moveList = generateEnPassent(pos, moveList);

return moveList;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x3699
movq %rbx, %rdi
movq %rax, %rsi
callq 0x39dc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x35ed
xorl %ecx, %ecx
cmpl $0x0, 0x17c(%rbx)
setne %cl
movq 0x188(%rbx), %rdx
leal (%rcx,%rcx,8), %ecx
addl $0x3, %ecx
testl %ecx, 0x8(%rdx)
je 0x39c1
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a6b
movq 0x188(%rbx), %rcx
cmpl $0x40, 0x4(%rcx)
jne 0x39d0
popq %rbx
retq
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x3c96
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: generatePromotions(position const&, candidate*)
candidate* generatePromotions(const position& pos, candidate* moveList){
 
    
    player us = pos.get_sideToPlay();
    player them = player(!us);
    bitboard quiets = ~(pos.get_pieces());
    bitboard captures = pos.get_pieces(them);
    bitboard rank7Sq = us == white ? rankBitMask[rank_7] : rankBitMask[rank_2];
    bitboard rank8Sq = us == white ? rankBitMask[rank_8] : rankBitMask[rank_1];
    
    moveList = pawnPushMoves(pos, pos.get_pieces(us, p_pawn) & rank7Sq, us, quiets & rank8Sq, moveList);
    
    moveList = pawnAttackMoves(pos.get_pieces(us, p_pawn) & rank7Sq, us, captures & rank8Sq, moveList);
    
    return moveList;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r8
movl 0x17c(%rdi), %ebx
leaq 0x862c(%rip), %rax      # 0xc020
leaq 0x30(%rax), %rdx
leaq 0x8(%rax), %rsi
leaq 0x38(%rax), %r9
leaq 0x130(%rdi), %r10
leaq 0x100(%rdi), %r12
xorl %r11d, %r11d
testl %ebx, %ebx
sete %r11b
movq 0x170(%rdi), %rcx
cmoveq %rdx, %rsi
notq %rcx
movq (%rsi), %r14
cmovneq %rax, %r9
movq (%r9), %r15
cmovneq %r10, %r12
movq (%r12), %rsi
andq %r14, %rsi
andq %r15, %rcx
andq 0x160(%rdi,%r11,8), %r15
movl %ebx, %edx
callq 0x3f2e
andq (%r12), %r14
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %rax, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x40af
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: generateAllLegal(position const&, candidate*)
candidate* generateAllLegal (const position& pos, candidate* moveList)
{
   
    if(pos.get_pieces(player(!(pos.get_sideToPlay()))) & pos.squareAttackedBy(pos.get_king_sq(pos.get_sideToPlay()))) {
       //std::cout <<"inside evasion\n";
       // printBitboard(pos.get_pieces(player(!(pos.get_sideToPlay())))&pos.squareAttackedBy(pos.get_king_sq(pos.get_sideToPlay())));
       // pos.printBoard();
        
        return generateEvasion(pos, moveList);
    }
    else{
       //  std::cout <<"inside else\n";
    
    moveList = generateCapture(pos, moveList);
    moveList = generatePromotions(pos, moveList);
    moveList = generateQuiet(pos, moveList);
    if(pos.get_castlingRights(pos.get_sideToPlay()))moveList = generateCastling(pos, moveList);
    if(pos.get_enPassent() != empty) moveList = generateEnPassent(pos, moveList);
    }
   
    
    return moveList;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
bsfq 0x128(%rdi), %rcx
bsfq 0x158(%rdi), %rax
movq %rsi, %r14
xorl %edx, %edx
cmpl $0x0, 0x17c(%rdi)
sete %dl
movq 0x160(%rdi,%rdx,8), %r15
cmovel %ecx, %eax
movl %eax, %esi
callq 0x578c
testq %r15, %rax
je 0x3d6f
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3746
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3699
movq %rbx, %rdi
movq %rax, %rsi
callq 0x39dc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x35ed
xorl %ecx, %ecx
cmpl $0x0, 0x17c(%rbx)
setne %cl
movq 0x188(%rbx), %rdx
leal (%rcx,%rcx,8), %ecx
addl $0x3, %ecx
testl %ecx, 0x8(%rdx)
je 0x3db9
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a6b
movq 0x188(%rbx), %rcx
cmpl $0x40, 0x4(%rcx)
jne 0x3dcc
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3c96
// File: /workspace/github_cpp_makefile_star2_O1/bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: pawnAttackMoves(unsigned long, player, unsigned long, candidate*)
candidate* pawnAttackMoves (bitboard pawns, player color ,bitboard target, candidate* moveList){
    
    bitboard squares = 0;
    square from = empty, to = empty;
    move mov = none;
    bitboard rank8Sq = color == white ? rankBitMask[rank_8] : rankBitMask[rank_1];
    
    while(pawns)
    {
        from = lsb_sq(pawns);
        //check now if the from square is absolute pinned
        squares = target & openBoardPawnAttacks[color][from];
        while(squares)
        {
            //could check here if the to square places their king in check
            to  = lsb_sq(squares);
            
            if (squareBitMask[to]  & rank8Sq) {
               moveList = makePromotionMoves(from, to, moveList);
            }
            else{
                mov = make_move(from, to);
                (*moveList++).mv = mov;
            }
            pop_lsb(&squares);
        }
        pop_lsb(&pawns);
        
    }
    
    return moveList;
}

// Assembly:
pushq %rbp
pushq %rbx
movq %rcx, %rax
leaq 0x7f65(%rip), %r8       # 0xc020
leaq 0x38(%r8), %rcx
testl %esi, %esi
cmovneq %r8, %rcx
testq %rdi, %rdi
je 0x4124
movq (%rcx), %rcx
movl %esi, %esi
shlq $0x9, %rsi
addq 0x6eee(%rip), %rsi      # 0xafc8
leaq 0x7cff(%rip), %r8       # 0xbde0
bsfq %rdi, %r9
movq (%rsi,%r9,8), %r10
andq %rdx, %r10
je 0x411b
bsfq %r10, %r11
movl %r11d, %ebx
shll $0x6, %ebx
leal (%rbx,%r9), %ebp
addl $0xf000, %ebp           # imm = 0xF000
orl %r9d, %ebx
testq %rcx, (%r8,%r11,8)
cmovel %ebx, %ebp
movl %ebp, (%rax)
addq $0x8, %rax
leaq -0x1(%r10), %r11
andq %r11, %r10
jne 0x40ee
leaq -0x1(%rdi), %r9
andq %r9, %rdi
jne 0x40e1
popq %rbx
popq %rbp
retq