// File: /workspace/github_c_makefile_star2_O1/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 0x2e83
movl %r8d, %ebp
movq %rdx, %r12
movq %rsi, %r14
cmpl $0x113f, %r8d           # imm = 0x113F
jne 0x2d4c
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 0x2e83
movq %rcx, %r15
movl 0x4(%rdi), %ecx
cmpl $0x10, %ecx
jl 0x2d80
movl (%rdi), %eax
shrl $0x10, %eax
movl %eax, (%rdi)
addl $-0x10, %ecx
movl %ecx, 0x4(%rdi)
movq 0x8(%rdi), %rcx
cmpq 0x10(%rdi), %rcx
jae 0x2d80
leaq 0x2(%rcx), %rdx
movq %rdx, 0x8(%rdi)
movzwl (%rcx), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movl %ecx, (%rdi)
movl (%rdi), %edx
movl 0x4(%rdi), %ecx
shrl %cl, %edx
movl %edx, %eax
andl $0xf, %eax
leaq 0x428d(%rip), %rsi      # 0x7020
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
incl %ecx
movl %ecx, 0x4(%rdi)
movl $0x3, %eax
jmp 0x2e3d
addl $0x3, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x2, %edx
andl $0x1, %edx
orl $0x4, %edx
jmp 0x2e3b
addl $0x5, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x3, %edx
andl $0x3, %edx
addl $0x6, %edx
jmp 0x2e3b
addl $0x7, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x4, %edx
andl $0x7, %edx
addl $0xa, %edx
jmp 0x2e3b
movl %edx, %eax
shrl $0x4, %eax
andl $0xf, %eax
leaq 0x4273(%rip), %rsi      # 0x7060
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
addl $0x9, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x5, %edx
andl $0xf, %edx
addl $0x12, %edx
jmp 0x2e3b
addl $0xb, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x6, %edx
andl $0x1f, %edx
addl $0x22, %edx
jmp 0x2e3b
addl $0xd, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x7, %edx
andl $0x3f, %edx
addl $0x42, %edx
jmp 0x2e3b
addl $0xf, %ecx
movl %ecx, 0x4(%rdi)
shrl $0x8, %edx
andl $0x7f, %edx
addl $0x82, %edx
movl %edx, %eax
cmpl $0x2, %eax
jl 0x2e83
movl %ebp, %esi
addq %rsi, %r12
movq (%r14), %rcx
cmpq %rcx, %r12
ja 0x2e83
decl %eax
movl %eax, %edx
leaq (%rcx,%rdx), %rdi
cmpq %r15, %rdi
ja 0x2e83
testl %eax, %eax
je 0x2e81
subq %rsi, %rcx
xorl %ebx, %ebx
xorl %eax, %eax
movb (%rcx,%rax), %sil
movq (%r14), %rdi
leaq 0x1(%rdi), %r8
movq %r8, (%r14)
movb %sil, (%rdi)
incq %rax
cmpl %eax, %edx
jne 0x2e67
jmp 0x2e83
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addl $0x9, %ecx
movl %ecx, 0x4(%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
btl $0x8, %edx
jae 0x2e3d
movl $0x8, %esi
callq 0x2cb7
addl $0x102, %eax            # imm = 0x102
jmp 0x2e3d