// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movl %esi, %ebp
movq %rdi, %rbx
movl 0xf4(%rdi), %eax
movl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
cmpl %edx, %eax
jbe 0x33826
incl %ecx
cmpl $0x20, %ecx
jne 0x3380f
movl $0x20, %ecx
addl %ecx, %ecx
movl %ecx, 0xf0(%rbx)
xorl %r12d, %r12d
movl %r12d, 0xd4(%rbx)
movl %r12d, 0xf8(%rbx)
movq $0x0, 0xe0(%rbx)
movl $0x1, 0xdc(%rbx)
cmpq $0x0, 0x98(%rbx)
jne 0x33886
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdi
callq *(%r15)
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x339e9
addq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x90(%rbx)
cmpl $0x0, 0xd8(%rbx)
je 0x338a6
cmpl $0x0, 0xcc(%rbx)
jne 0x338a6
xorl %r12d, %r12d
cmpb $0x0, 0x649(%rbx)
setne %r12b
movl %r12d, 0xfc(%rbx)
movl 0xc0(%rbx), %r12d
addl 0xbc(%rbx), %r12d
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x338d7
cmpq $0x0, 0x1f888(%rbx)
je 0x338d7
cmpl %r12d, 0xc8(%rbx)
je 0x3393f
movq %r15, %rdi
callq *0x8(%r15)
movq 0x1f888(%rbx), %rsi
movq %r15, %rdi
callq *0x8(%r15)
xorl %eax, %eax
movq %rax, 0x68(%rbx)
movq %rax, 0x1f888(%rbx)
movl $0x600, %r13d           # imm = 0x600
movl %r12d, %ecx
shlq %cl, %r13
movq %r15, %rdi
movq %r13, %rsi
callq *(%r15)
movq %rax, 0x68(%rbx)
movq %r15, %rdi
movq %r13, %rsi
callq *(%r15)
movq %rax, 0x1f888(%rbx)
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x339c7
testq %rax, %rax
je 0x339c7
movl %r12d, 0xc8(%rbx)
movl 0xf4(%rbx), %esi
cmpl $0x1000001, %esi        # imm = 0x1000001
setae 0x64a(%rbx)
movl %esi, %eax
andl $0xbfffffff, %eax       # imm = 0xBFFFFFFF
xorl %ecx, %ecx
negl %eax
seto %cl
subl %ecx, %esi
movl $0x800, %eax            # imm = 0x800
leal (%rsi,%rax), %ecx
movl %ebp, %edx
subl %esi, %edx
cmpl %ebp, %ecx
cmovael %eax, %edx
cmpl $0x0, 0xfc(%rbx)
je 0x339f0
leaq 0x100(%rbx), %r15
movl 0x48(%rbx), %ecx
movq %r15, %rdi
movl $0x112, %r8d            # imm = 0x112
movq %r14, %r9
callq 0x3a1d9
movl %eax, %ecx
movl $0x2, %eax
testl %ecx, %ecx
cmovnel %ecx, %eax
jne 0x33a20
movq %r15, (%rbx)
cmpl $0xffffff, 0x660(%rbx)  # imm = 0xFFFFFF
setae 0x64a(%rbx)
leaq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x3a6a4
jmp 0x33a1e
movq %r15, %rdi
callq *0x8(%r15)
movq 0x1f888(%rbx), %rsi
movq %r15, %rdi
callq *0x8(%r15)
xorl %eax, %eax
movq %rax, 0x68(%rbx)
movq %rax, 0x1f888(%rbx)
movl $0x2, %eax
jmp 0x33a20
leaq 0x628(%rbx), %r15
movl 0x48(%rbx), %ecx
movq %r15, %rdi
movl $0x112, %r8d            # imm = 0x112
movq %r14, %r9
callq 0x37a86
testl %eax, %eax
je 0x339e9
movq %r15, (%rbx)
leaq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x38880
xorl %eax, %eax
testl %eax, %eax
jne 0x33a36
movq %rbx, %rdi
callq 0x33bcd
movq %rbx, %rdi
callq 0x33dab
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq