// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: lodepng_inflatev
static unsigned lodepng_inflatev(ucvector* out,
                                 const unsigned char* in, size_t insize,
                                 const LodePNGDecompressSettings* settings) {
  unsigned BFINAL = 0;
  LodePNGBitReader reader;
  unsigned error = LodePNGBitReader_init(&reader, in, insize);

  if(error) return error;

  while(!BFINAL) {
    unsigned BTYPE;
    if(reader.bitsize - reader.bp < 3) return 52; /*error, bit pointer will jump past memory*/
    ensureBits9(&reader, 3);
    BFINAL = readBits(&reader, 1);
    BTYPE = readBits(&reader, 2);

    if(BTYPE == 3) return 20; /*error: invalid BTYPE*/
    else if(BTYPE == 0) error = inflateNoCompression(out, &reader, settings); /*no compression*/
    else error = inflateHuffmanBlock(out, &reader, BTYPE, settings->max_output_size); /*compression, BTYPE 01 or 10*/
    if(!error && settings->max_output_size && out->size > settings->max_output_size) error = 109;
    if(error) break;
  }

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, 0x58(%rsp)
movq %rsi, (%rsp)
movq %rdx, 0x8(%rsp)
leaq (,%rdx,8), %rax
movq %rax, 0x10(%rsp)
shrq $0x3d, %rdx
setne %cl
cmpq $-0x40, %rax
setae %al
orb %cl, %al
jne 0x75f4
movq %rdi, %r13
movq %rsp, %rbp
andq $0x0, 0x18(%rbp)
andl $0x0, 0x20(%rbp)
xorl %r14d, %r14d
movq %rdi, 0x30(%rsp)
testl %r14d, %r14d
jne 0x75fc
movq 0x10(%rsp), %rax
subq 0x18(%rsp), %rax
cmpq $0x3, %rax
jb 0x75f8
movq %rbp, %rdi
callq 0xef2d
movl 0x20(%rsp), %ecx
movl %ecx, %ebx
shrl %ebx
movq 0x18(%rsp), %r15
movl %ecx, %eax
shrl $0x3, %eax
leaq 0x3(%r15), %r12
movl %eax, 0x20(%rsp)
movq %r12, 0x18(%rsp)
andl $0x3, %ebx
movl %ecx, 0x2c(%rsp)
je 0x6e1c
cmpl $0x3, %ebx
je 0x7609
movq 0x58(%rsp), %rax
movq 0x8(%rax), %r14
movq 0x8(%r13), %rsi
movl $0x104, %eax            # imm = 0x104
addq %rax, %rsi
movq %r13, %rdi
callq 0xef79
testl %eax, %eax
je 0x7601
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
leaq 0x88(%rsp), %rax
movups %xmm0, (%rax)
movaps %xmm0, 0xa0(%rsp)
leaq 0xb8(%rsp), %rax
movups %xmm0, (%rax)
cmpl $0x1, %ebx
jne 0x6ead
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xf17d
movl %eax, %r15d
testl %eax, %eax
jne 0x72df
leaq 0xa0(%rsp), %rdi
callq 0xf224
movl %eax, %r15d
jmp 0x708f
movq 0x8(%rsp), %rbx
addq $0xa, %r15
shrq $0x3, %r15
leaq 0x4(%r15), %rbp
cmpq %rbx, %rbp
jae 0x75f8
movq (%rsp), %r14
movzwl (%r14,%r15), %edx
movq 0x58(%rsp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x6e5d
movzwl 0x2(%r14,%r15), %eax
addl %edx, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x7611
movq %r13, %rdi
movl %edx, %r12d
movl %edx, %r13d
movq 0x8(%rdi), %rsi
addq %r13, %rsi
callq 0xef73
testl %eax, %eax
je 0x7601
movq %rbp, %r15
addq %r13, %r15
cmpq %rbx, %r15
ja 0x760d
testl %r12d, %r12d
je 0x6eef
movq 0x30(%rsp), %rax
movq (%rax), %rdi
addq 0x8(%rax), %rdi
subq %r13, %rdi
addq %rbp, %r14
movq %r14, %rsi
movq %r13, %rdx
callq 0x8adc
jmp 0x6ef2
movq %r14, 0x68(%rsp)
movq 0x10(%rsp), %rbp
movq %rbp, %rax
subq %r12, %rax
pushq $0x31
popq %r14
cmpq $0xe, %rax
jb 0x707a
movq %r12, %rax
shrq $0x3, %rax
movq 0x8(%rsp), %rcx
leaq 0x2(%rax), %rdx
cmpq %rcx, %rdx
jae 0x6f0d
movq (%rsp), %rcx
movzwl (%rcx,%rax), %ebx
addq %rcx, %rdx
pushq $0x10
jmp 0x6f2d
movq %rbp, %r15
movl 0x2c(%rsp), %r14d
shlq $0x3, %r15
movq %r15, 0x18(%rsp)
movq 0x30(%rsp), %r13
movq %rsp, %rbp
jmp 0x7302
xorl %ebx, %ebx
cmpq %rcx, %rax
jae 0x6f1c
movq (%rsp), %rdx
movzbl (%rdx,%rax), %ebx
incq %rax
cmpq %rcx, %rax
jae 0x6f35
addq (%rsp), %rax
movq %rax, %rdx
pushq $0x8
popq %rcx
movzbl (%rdx), %eax
shll %cl, %eax
addl %eax, %ebx
andb $0x7, %r12b
movl %r12d, %ecx
shrl %cl, %ebx
movl %ebx, %eax
shrl $0xe, %eax
movl %eax, 0x20(%rsp)
addq $0x11, %r15
movq %r15, 0x18(%rsp)
pushq $0x4c
popq %rdi
callq 0x21a0
pushq $0x53
popq %r14
testq %rax, %rax
je 0x707a
movq %rax, %r13
movl %ebx, %r12d
shrl $0xa, %r12d
andl $0xf, %r12d
leal 0x4(%r12), %eax
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
leaq 0xe8(%rsp), %rcx
movups %xmm0, (%rcx)
leal (%rax,%rax,2), %eax
addq %r15, %rax
cmpq %r15, %rax
setb %cl
cmpq %rbp, %rax
seta %al
orb %cl, %al
jne 0x7009
movl %ebx, %eax
andl $0x1f, %eax
shrl $0x5, %ebx
movq %rax, 0x50(%rsp)
addl $0x101, %eax            # imm = 0x101
movl %eax, 0x44(%rsp)
andl $0x1f, %ebx
incl %ebx
movq %rbx, %r15
leaq 0x10(,%r12,4), %rbx
xorl %r14d, %r14d
movq %rsp, %rbp
cmpq %r14, %rbx
je 0x700f
movq %rbp, %rdi
callq 0xef2d
movl 0x20(%rsp), %eax
movl %eax, %ecx
shrl $0x3, %eax
movl %eax, 0x20(%rsp)
addq $0x3, 0x18(%rsp)
andl $0x7, %ecx
leaq 0xecd6(%rip), %rax      # 0x15cd0
movl (%r14,%rax), %eax
movl %ecx, (%r13,%rax,4)
addq $0x4, %r14
jmp 0x6fd0
pushq $0x32
popq %r14
jmp 0x7050
movq %r15, %r14
cmpq $0xf, %r12
je 0x702f
leaq 0xecb1(%rip), %rax      # 0x15cd0
movl 0x10(%rax,%r12,4), %eax
andl $0x0, (%r13,%rax,4)
incq %r12
jmp 0x7012
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
pushq $0x13
popq %rdx
pushq $0x7
popq %rcx
callq 0xf278
testl %eax, %eax
je 0x7293
movl %eax, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq %r13, %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
movq %r12, %rdi
callq 0x2030
leaq 0xd0(%rsp), %rdi
callq 0xf155
movq 0x30(%rsp), %r13
movq %rsp, %rbp
leaq 0x70(%rsp), %rbx
movl %r14d, %r15d
movq 0x68(%rsp), %r14
testl %r15d, %r15d
jne 0x72df
xorl %r15d, %r15d
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x72dc
movq %rsp, %rbp
movq %rbp, %rdi
callq 0xefb6
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xf059
cmpl $0xff, %eax
ja 0x7101
movq (%r13), %rcx
movq 0x8(%r13), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%r13)
movb %al, (%rcx,%rdx)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xf059
cmpl $0xff, %eax
ja 0x7101
movq (%r13), %rcx
movq 0x8(%r13), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%r13)
movb %al, (%rcx,%rdx)
xorl %ebp, %ebp
jmp 0x7242
cmpl $0x100, %eax            # imm = 0x100
sete %cl
cmpl $0x11e, %eax            # imm = 0x11E
setae %dl
orb %cl, %dl
jne 0x7218
addl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
leaq 0xe9ab(%rip), %rcx      # 0x15ad0
movl (%rcx,%rax,4), %r12d
leaq -0x1c(%rax), %rcx
cmpq $-0x14, %rcx
jb 0x7169
leaq 0xea16(%rip), %rcx      # 0x15b50
movl (%rcx,%rax,4), %r13d
movq %rbp, %rdi
callq 0xf0dc
pushq $-0x1
popq %rax
movl %r13d, %ecx
shll %cl, %eax
movl 0x20(%rsp), %edx
notl %eax
andl %edx, %eax
shrl %cl, %edx
movl %edx, 0x20(%rsp)
addq %r13, 0x18(%rsp)
movq 0x30(%rsp), %r13
addq %rax, %r12
movq %rbp, %rdi
callq 0xefb6
movq %rbp, %rdi
leaq 0xa0(%rsp), %rsi
callq 0xf059
cmpl $0x1e, %eax
jae 0x7327
movl %eax, %ecx
leaq 0xea3d(%rip), %rdx      # 0x15bd0
movl (%rdx,%rcx,4), %edx
cmpl $0x4, %eax
jb 0x71bf
leaq 0xeaae(%rip), %rax      # 0x15c50
movl (%rax,%rcx,4), %ecx
pushq $-0x1
popq %rax
shll %cl, %eax
movl 0x20(%rsp), %esi
notl %eax
andl %esi, %eax
shrl %cl, %esi
movl %esi, 0x20(%rsp)
addq %rcx, 0x18(%rsp)
addl %eax, %edx
movq 0x8(%r13), %r15
movq %r13, %rcx
movl %edx, %r13d
movq %r15, %rbp
subq %r13, %rbp
jb 0x7339
leaq (%r15,%r12), %rax
movq %rax, 0x8(%rcx)
movq (%rcx), %rsi
leaq (%rsi,%r15), %rdi
addq %rbp, %rsi
movq %r12, %rbx
subq %r13, %rbx
jbe 0x7227
movq %r13, %rdx
callq 0x8adc
addq %r13, %r15
movq 0x30(%rsp), %r13
subq $0x1, %rbx
jb 0x7238
movq (%r13), %rax
movb (%rax,%rbp), %cl
incq %rbp
movb %cl, (%rax,%r15)
incq %r15
jmp 0x71ff
pushq $0x1
popq %rbp
cmpl $0x100, %eax            # imm = 0x100
je 0x7242
jmp 0x72d8
movq %r12, %rdx
callq 0x8adc
xorl %ebp, %ebp
movq 0x30(%rsp), %r13
jmp 0x723a
xorl %ebp, %ebp
leaq 0x70(%rsp), %rbx
xorl %r15d, %r15d
movq 0x8(%r13), %rsi
movq 0x10(%r13), %rax
subq %rsi, %rax
cmpq $0x103, %rax            # imm = 0x103
ja 0x7268
addq $0x104, %rsi            # imm = 0x104
movq %r13, %rdi
callq 0xef79
testl %eax, %eax
je 0x728f
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
ja 0x728b
testq %r14, %r14
je 0x709d
cmpq %r14, 0x8(%r13)
jbe 0x709d
pushq $0x6d
jmp 0x72da
pushq $0x33
jmp 0x72da
pushq $0x53
jmp 0x72da
movl $0x480, %edi            # imm = 0x480
callq 0x21a0
movq %rax, %rbx
movl $0x80, %edi
callq 0x21a0
movq %rax, %r8
testq %rbx, %rbx
sete %al
testq %r8, %r8
sete %cl
orb %al, %cl
jne 0x734a
xorl %eax, %eax
cmpq $0x480, %rax            # imm = 0x480
je 0x7351
movb $0x0, (%rbx,%rax)
incq %rax
jmp 0x72c3
pushq $0x10
popq %r15
movq %rsp, %rbp
movq %rbx, %rdi
callq 0xf155
leaq 0xa0(%rsp), %rdi
callq 0xf155
testl %r15d, %r15d
movl 0x2c(%rsp), %r14d
jne 0x7615
andl $0x1, %r14d
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x6d41
cmpq %rax, 0x8(%r13)
jbe 0x6d41
jmp 0x7605
xorl %ecx, %ecx
cmpl $0x20, %eax
setb %cl
leal 0x10(,%rcx,2), %r15d
jmp 0x72df
pushq $0x34
popq %r15
movq %rcx, %r13
movq %rsp, %rbp
leaq 0x70(%rsp), %rbx
jmp 0x72df
pushq $0x53
jmp 0x7586
xorl %eax, %eax
cmpq $0x80, %rax
je 0x7365
movb $0x0, (%r8,%rax)
incq %rax
jmp 0x7353
movl 0x44(%rsp), %eax
addl %eax, %r14d
movq 0x50(%rsp), %rcx
leal 0x102(%rcx), %edx
movl %edx, 0x64(%rsp)
movl %eax, %r15d
negl %ecx
movq %rcx, 0x50(%rsp)
movslq %ecx, %r10
addq $-0x101, %r10           # imm = 0xFEFF
movl $0x0, 0x28(%rsp)
xorl %r12d, %r12d
movq %rbx, 0x38(%rsp)
movq %r10, 0x48(%rsp)
cmpl %r14d, %r12d
jae 0x7590
movq %r8, %rbx
movq %rbp, %rdi
callq 0xf0dc
movq %rbp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0xf059
cmpl $0xf, %eax
ja 0x7403
movl 0x44(%rsp), %ecx
cmpl %ecx, %r12d
movl $0x0, %edx
cmovbl %edx, %ecx
movq %rbx, %r8
movq %rbx, %rdx
movq 0x38(%rsp), %rbx
cmovbq %rbx, %rdx
movl %r12d, %esi
subl %ecx, %esi
movl %eax, (%rdx,%rsi,4)
incl %r12d
movq 0x18(%rsp), %rax
movq %rsp, %rbp
jmp 0x7579
movl %r12d, %ecx
cmpw $0x12, %ax
movq %rbx, %r8
je 0x7510
movzwl %ax, %eax
cmpl $0x11, %eax
movq 0x38(%rsp), %rbx
je 0x74b7
cmpl $0x10, %eax
movq 0x48(%rsp), %r10
jne 0x75e3
testl %r12d, %r12d
je 0x75e7
movl 0x20(%rsp), %eax
movl %eax, %edx
andl $0x3, %edx
shrl $0x2, %eax
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x2, %rax
addl $0x3, %edx
leal -0x1(%r12), %esi
cmpl 0x64(%rsp), %r12d
leaq (%rbx,%rsi,4), %rsi
movq 0x50(%rsp), %rdi
leal -0x102(%r12,%rdi), %edi
leaq (%r8,%rdi,4), %rdi
cmovbq %rsi, %rdi
movq %rax, 0x18(%rsp)
movl (%rdi), %esi
leaq (%rbx,%rcx,4), %rdi
movq %rcx, %r12
movq %rsp, %rbp
subl $0x1, %edx
jb 0x7579
cmpq %r12, %r14
je 0x7572
leal (%r10,%r12), %ecx
cmpq %r15, %r12
leaq (%r8,%rcx,4), %rcx
cmovbq %rdi, %rcx
movl %esi, (%rcx)
incq %r12
addq $0x4, %rdi
jmp 0x748b
movl 0x20(%rsp), %eax
movl %eax, %edx
andl $0x7, %edx
shrl $0x3, %eax
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x3, %rax
movq %rax, 0x18(%rsp)
addl $0x3, %edx
leaq (%rbx,%rcx,4), %rsi
movq %rcx, %r12
movq 0x48(%rsp), %r10
movq %rsp, %rbp
subl $0x1, %edx
jb 0x7579
cmpq %r12, %r14
je 0x756a
leal (%r10,%r12), %ecx
cmpq %r15, %r12
leaq (%r8,%rcx,4), %rcx
cmovbq %rsi, %rcx
andl $0x0, (%rcx)
incq %r12
addq $0x4, %rsi
jmp 0x74e7
movl 0x20(%rsp), %eax
movl %eax, %edx
andl $0x7f, %edx
shrl $0x7, %eax
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x7, %rax
movq %rax, 0x18(%rsp)
addl $0xb, %edx
movq 0x38(%rsp), %rbx
leaq (%rbx,%rcx,4), %rsi
movq %rcx, %r12
movq 0x48(%rsp), %r10
movq %rsp, %rbp
subl $0x1, %edx
jb 0x7579
cmpq %r12, %r14
je 0x756e
leal (%r10,%r12), %ecx
cmpq %r15, %r12
leaq (%r8,%rcx,4), %rcx
cmovbq %rsi, %rcx
andl $0x0, (%rcx)
incq %r12
addq $0x4, %rsi
jmp 0x7545
pushq $0xe
jmp 0x7574
pushq $0xf
jmp 0x7574
pushq $0xd
popq %rcx
movl %ecx, 0x28(%rsp)
cmpq 0x10(%rsp), %rax
jbe 0x73a4
pushq $0x32
popq %r14
movq %r8, %r12
jmp 0x7055
movl 0x28(%rsp), %r14d
testl %r14d, %r14d
jne 0x7588
movq %r8, %r12
cmpl $0x0, 0x400(%rbx)
je 0x75eb
movl $0x120, %edx            # imm = 0x120
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
pushq $0xf
popq %rbx
movl %ebx, %ecx
callq 0xf278
testl %eax, %eax
jne 0x75d6
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
pushq $0x20
popq %rdx
movl %ebx, %ecx
callq 0xf278
movl %eax, %r14d
movq 0x38(%rsp), %rbx
jmp 0x7055
pushq $0x10
jmp 0x7586
pushq $0x36
jmp 0x7586
pushq $0x40
popq %r14
jmp 0x7055
pushq $0x69
jmp 0x7613
pushq $0x34
jmp 0x7613
xorl %r15d, %r15d
jmp 0x7615
pushq $0x53
jmp 0x7613
pushq $0x6d
jmp 0x7613
pushq $0x14
jmp 0x7613
pushq $0x17
jmp 0x7613
pushq $0x15
popq %r15
movl %r15d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq