// File: /workspace/github_c_makefile_star2_O3/pali[P]bmfdec/./bmfdec.c
// Function: dblb_decrep
INLINE int dblb_decrep(bits_t *pbits, __u8 **p, void *pout, __u8 *pend,
		 int repoffs, int k, int flg)
{ int replen;
  __u8 *r;

  if(repoffs==0){LOG_DECOMP("DMSDOS: decrb: zero offset ?\n");return -2;}
  if(repoffs==0x113f)
  { 
    int pos=*p-(__u8*)pout;
    LOG_DECOMP("DMSDOS: decrb: 0x113f sync found.\n");
    if((pos%512) && !(flg&0x4000))
    { LOG_DECOMP("DMSDOS: decrb: sync at decompressed pos %d ?\n",pos);
      return -2;
    }
    return 0;
  }
  replen=dblb_rdlen(pbits)+k;

  if(replen<=0)
    {LOG_DECOMP("DMSDOS: decrb: illegal count ?\n");return -2;}
  if((__u8*)pout+repoffs>*p)
    {LOG_DECOMP("DMSDOS: decrb: of>pos ?\n");return -2;}
  if(*p+replen>pend)
    {LOG_DECOMP("DMSDOS: decrb: output overfill ?\n");return -2;}
  r=*p-repoffs;
  M_MOVSB(*p,r,replen);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
testl %r8d, %r8d
je 0x2da7
movl %r8d, %ebp
movq %rdx, %r12
movq %rsi, %r14
cmpl $0x113f, %r8d           # imm = 0x113F
jne 0x2c7f
movl (%r14), %eax
subl %r12d, %eax
xorl %ecx, %ecx
testl $0x1ff, %eax            # imm = 0x1FF
sete %cl
xorl %eax, %eax
btl $0xe, %r9d
leal -0x2(%rcx,%rcx), %ebx
cmovbl %eax, %ebx
jmp 0x2da7
movq %rcx, %r15
movl (%rdi), %eax
movl 0x4(%rdi), %ecx
cmpl $0x10, %ecx
jl 0x2cb0
shrl $0x10, %eax
movl %eax, (%rdi)
addl $-0x10, %ecx
movq 0x8(%rdi), %rdx
cmpq 0x10(%rdi), %rdx
jae 0x2cb0
leaq 0x2(%rdx), %rsi
movq %rsi, 0x8(%rdi)
movzwl (%rdx), %edx
shll $0x10, %edx
orl %edx, %eax
movl %eax, (%rdi)
shrl %cl, %eax
movl %eax, %edx
andl $0xf, %edx
leaq 0x4362(%rip), %rsi      # 0x7020
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
incl %ecx
movl %ecx, 0x4(%rdi)
movl $0x3, %eax
jmp 0x2d65
addl $0x3, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x2, %eax
andl $0x1, %eax
orl $0x4, %eax
jmp 0x2d65
addl $0x5, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x3, %eax
andl $0x3, %eax
addl $0x6, %eax
jmp 0x2d65
addl $0x7, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x4, %eax
andl $0x7, %eax
addl $0xa, %eax
jmp 0x2d65
movl %eax, %edx
shrl $0x4, %edx
andl $0xf, %edx
leaq 0x4348(%rip), %rsi      # 0x7060
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
addl $0x9, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x5, %eax
andl $0xf, %eax
addl $0x12, %eax
jmp 0x2d65
addl $0xb, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x6, %eax
andl $0x1f, %eax
addl $0x22, %eax
jmp 0x2d65
addl $0xd, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x7, %eax
andl $0x3f, %eax
addl $0x42, %eax
jmp 0x2d65
addl $0xf, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x8, %eax
andl $0x7f, %eax
addl $0x82, %eax
decl %eax
movl %ebp, %edx
addq %rdx, %r12
movq (%r14), %rcx
cmpq %rcx, %r12
ja 0x2da7
movl %eax, %eax
leaq (%rcx,%rax), %rsi
cmpq %r15, %rsi
ja 0x2da7
testq %rax, %rax
je 0x2da5
subq %rdx, %rcx
xorl %ebx, %ebx
xorl %edx, %edx
movb (%rcx,%rdx), %sil
movq (%r14), %rdi
leaq 0x1(%rdi), %r8
movq %r8, (%r14)
movb %sil, (%rdi)
incq %rdx
cmpl %edx, %eax
jne 0x2d8b
jmp 0x2da7
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addl $0x9, %ecx
movl %ecx, 0x4(%rdi)
btl $0x8, %eax
jae 0x2da7
movl $0x8, %esi
callq 0x2bf2
leal 0x102(%rax), %ecx
cmpl $0x2, %ecx
jl 0x2da7
addl $0x101, %eax            # imm = 0x101
jmp 0x2d67