// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/lzma/C/LzmaEnc.c
// Function: LzmaEnc_AllocAndInit
static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
  unsigned i;
  for (i = kEndPosModelIndex / 2; i < kDicLogSizeMax; i++)
    if (p->dictSize <= ((UInt32)1 << i))
      break;
  p->distTableSize = i * 2;

  p->finished = False;
  p->result = SZ_OK;
  p->nowPos64 = 0;
  p->needInit = 1;
  RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig))
  LzmaEnc_Init(p);
  LzmaEnc_InitPrices(p);
  return SZ_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movl %esi, %r15d
movq %rdi, %rbx
pushq $0x7
popq %rcx
pushq $0xe
popq %rax
pushq $0x1
popq %rdx
cmpl $0x40, %eax
je 0x2b626
movl %edx, %esi
shll %cl, %esi
cmpl %esi, 0xf4(%rbx)
jbe 0x2b626
incl %ecx
addl $0x2, %eax
jmp 0x2b60e
movl %eax, 0xf0(%rbx)
andl $0x0, 0xd4(%rbx)
andl $0x0, 0xf8(%rbx)
andq $0x0, 0xe0(%rbx)
movl $0x1, 0xdc(%rbx)
cmpq $0x0, 0x98(%rbx)
pushq $0x2
popq %rbp
jne 0x2b682
movl $0x10000, %esi          # imm = 0x10000
movq %r12, %rdi
callq *(%r12)
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x2b804
addq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x90(%rbx)
xorl %eax, %eax
cmpl $0x0, 0xd8(%rbx)
je 0x2b6a2
cmpl $0x0, 0xcc(%rbx)
jne 0x2b6a2
xorl %eax, %eax
cmpb $0x0, 0x649(%rbx)
setne %al
movl %eax, 0xfc(%rbx)
movl 0xc0(%rbx), %r13d
addl 0xbc(%rbx), %r13d
cmpq $0x0, 0x68(%rbx)
je 0x2b6d0
cmpq $0x0, 0x1f888(%rbx)
je 0x2b6d0
cmpl %r13d, 0xc8(%rbx)
je 0x2b736
movl %r15d, %ebp
movq %r14, %r15
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2e27c
movl $0x600, %r14d           # imm = 0x600
movl %r13d, %ecx
shlq %cl, %r14
movq %r12, %rdi
movq %r14, %rsi
callq *(%r12)
movq %rax, 0x68(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq *(%r12)
movq %rax, 0x1f888(%rbx)
cmpq $0x0, 0x68(%rbx)
je 0x2b7b4
testq %rax, %rax
je 0x2b7b4
movl %r13d, 0xc8(%rbx)
movl 0xfc(%rbx), %eax
movq %r15, %r14
movl %ebp, %r15d
pushq $0x2
popq %rbp
movl 0xf4(%rbx), %esi
cmpl $0x1000001, %esi        # imm = 0x1000001
setae 0x64a(%rbx)
movl %esi, %ecx
andl $0xbfffffff, %ecx       # imm = 0xBFFFFFFF
xorl %edx, %edx
negl %ecx
seto %dl
subl %edx, %esi
movl $0x800, %ecx            # imm = 0x800
leal (%rsi,%rcx), %edi
movl %r15d, %edx
subl %esi, %edx
cmpl %r15d, %edi
cmovael %ecx, %edx
testl %eax, %eax
je 0x2b7c4
leaq 0x100(%rbx), %r15
movl 0x48(%rbx), %ecx
movq %r15, %rdi
movl $0x112, %r8d            # imm = 0x112
movq %r14, %r9
callq 0x31a22
movl %eax, %ebp
testl %eax, %eax
jne 0x2b804
movq %r15, (%rbx)
cmpl $0xffffff, 0x660(%rbx)  # imm = 0xFFFFFF
setae 0x64a(%rbx)
leaq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x31ea2
jmp 0x2b7f2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2e27c
pushq $0x2
popq %rbp
jmp 0x2b804
leaq 0x628(%rbx), %r15
movl 0x48(%rbx), %ecx
movq %r15, %rdi
movl $0x112, %r8d            # imm = 0x112
movq %r14, %r9
callq 0x2f4c6
testl %eax, %eax
je 0x2b804
movq %r15, (%rbx)
leaq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x301a1
movq %rbx, %rdi
callq 0x2b98f
movq %rbx, %rdi
callq 0x2bb1a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq