// File: sisong[P]ApkDiffPatch/lzma/C/LzmaEnc.c
// Function: FillAlignPrices
Z7_NO_INLINE static void FillAlignPrices(CLzmaEnc *p)
{
  unsigned i;
  const CProbPrice *ProbPrices = p->ProbPrices;
  const CLzmaProb *probs = p->posAlignEncoder;
  // p->alignPriceCount = 0;
  for (i = 0; i < kAlignTableSize / 2; i++)
  {
    UInt32 price = 0;
    unsigned sym = i;
    unsigned m = 1;
    unsigned bit;
    UInt32 prob;
    bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
    bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
    bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
    prob = probs[m];
    p->alignPrices[i    ] = price + GET_PRICEa_0(prob);
    p->alignPrices[i + 8] = price + GET_PRICEa_1(prob);
    // p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb30, %rax            # imm = 0xB30
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x2200, %rax           # imm = 0x2200
movq %rax, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jae 0x6a7b2
movl $0x0, -0x24(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x28(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
shrl %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x2c(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
xorl %edx, %edx
subl -0x30(%rbp), %edx
andl $0x7ff, %edx            # imm = 0x7FF
xorl %edx, %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
addl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
shrl %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x2c(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
xorl %edx, %edx
subl -0x30(%rbp), %edx
andl $0x7ff, %edx            # imm = 0x7FF
xorl %edx, %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
addl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
shrl %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x2c(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
xorl %edx, %edx
subl -0x30(%rbp), %edx
andl $0x7ff, %edx            # imm = 0x7FF
xorl %edx, %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
addl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
movzwl (%rax,%rcx,2), %eax
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
addl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %edx, 0x15c0(%rax,%rcx,4)
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
xorl $0x7ff, %ecx            # imm = 0x7FF
shrl $0x4, %ecx
movl %ecx, %ecx
addl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x8, %ecx
movl %ecx, %ecx
movl %edx, 0x15c0(%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x6a65b
popq %rbp
retq
nopw %cs:(%rax,%rax)