// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_inflatev(ucvector*, unsigned char const*, unsigned long, LodePNGDecompressSettings const*)
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 0x3516
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 0x351e
movq 0x10(%rsp), %rax
subq 0x18(%rsp), %rax
cmpq $0x3, %rax
jb 0x351a
movq %rbp, %rdi
callq 0xbd60
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 0x2d42
cmpl $0x3, %ebx
je 0x352b
movq 0x58(%rsp), %rax
movq 0x8(%rax), %r14
movq 0x8(%r13), %rsi
movl $0x104, %eax            # imm = 0x104
addq %rax, %rsi
movq %r13, %rdi
callq 0xbdac
testl %eax, %eax
je 0x3523
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 0x2dd3
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xbfb0
movl %eax, %r15d
testl %eax, %eax
jne 0x3205
leaq 0xa0(%rsp), %rdi
callq 0xc057
movl %eax, %r15d
jmp 0x2fb5
movq 0x8(%rsp), %rbx
addq $0xa, %r15
shrq $0x3, %r15
leaq 0x4(%r15), %rbp
cmpq %rbx, %rbp
jae 0x351a
movq (%rsp), %r14
movzwl (%r14,%r15), %edx
movq 0x58(%rsp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x2d83
movzwl 0x2(%r14,%r15), %eax
addl %edx, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x3533
movq %r13, %rdi
movl %edx, %r12d
movl %edx, %r13d
movq 0x8(%rdi), %rsi
addq %r13, %rsi
callq 0xbda6
testl %eax, %eax
je 0x3523
movq %rbp, %r15
addq %r13, %r15
cmpq %rbx, %r15
ja 0x352f
testl %r12d, %r12d
je 0x2e15
movq 0x30(%rsp), %rax
movq (%rax), %rdi
addq 0x8(%rax), %rdi
subq %r13, %rdi
addq %rbp, %r14
movq %r14, %rsi
movq %r13, %rdx
callq 0x4a08
jmp 0x2e18
movq %r14, 0x68(%rsp)
movq 0x10(%rsp), %rbp
movq %rbp, %rax
subq %r12, %rax
pushq $0x31
popq %r14
cmpq $0xe, %rax
jb 0x2fa0
movq %r12, %rax
shrq $0x3, %rax
movq 0x8(%rsp), %rcx
leaq 0x2(%rax), %rdx
cmpq %rcx, %rdx
jae 0x2e33
movq (%rsp), %rcx
movzwl (%rcx,%rax), %ebx
addq %rcx, %rdx
pushq $0x10
jmp 0x2e53
movq %rbp, %r15
movl 0x2c(%rsp), %r14d
shlq $0x3, %r15
movq %r15, 0x18(%rsp)
movq 0x30(%rsp), %r13
movq %rsp, %rbp
jmp 0x3228
xorl %ebx, %ebx
cmpq %rcx, %rax
jae 0x2e42
movq (%rsp), %rdx
movzbl (%rdx,%rax), %ebx
incq %rax
cmpq %rcx, %rax
jae 0x2e5b
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 0x2280
pushq $0x53
popq %r14
testq %rax, %rax
je 0x2fa0
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 0x2f2f
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 0x2f35
movq %rbp, %rdi
callq 0xbd60
movl 0x20(%rsp), %eax
movl %eax, %ecx
shrl $0x3, %eax
movl %eax, 0x20(%rsp)
addq $0x3, 0x18(%rsp)
andl $0x7, %ecx
leaq 0x5b570(%rip), %rax     # 0x5e490
movl (%r14,%rax), %eax
movl %ecx, (%r13,%rax,4)
addq $0x4, %r14
jmp 0x2ef6
pushq $0x32
popq %r14
jmp 0x2f76
movq %r15, %r14
cmpq $0xf, %r12
je 0x2f55
leaq 0x5b54b(%rip), %rax     # 0x5e490
movl 0x10(%rax,%r12,4), %eax
andl $0x0, (%r13,%rax,4)
incq %r12
jmp 0x2f38
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
pushq $0x13
popq %rdx
pushq $0x7
popq %rcx
callq 0xc0ab
testl %eax, %eax
je 0x31b9
movl %eax, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq %r13, %rdi
callq 0x2260
movq %rbx, %rdi
callq 0x2260
movq %r12, %rdi
callq 0x2260
leaq 0xd0(%rsp), %rdi
callq 0xbf88
movq 0x30(%rsp), %r13
movq %rsp, %rbp
leaq 0x70(%rsp), %rbx
movl %r14d, %r15d
movq 0x68(%rsp), %r14
testl %r15d, %r15d
jne 0x3205
xorl %r15d, %r15d
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x3202
movq %rsp, %rbp
movq %rbp, %rdi
callq 0xbde9
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xbe8c
cmpl $0xff, %eax
ja 0x3027
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 0xbe8c
cmpl $0xff, %eax
ja 0x3027
movq (%r13), %rcx
movq 0x8(%r13), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%r13)
movb %al, (%rcx,%rdx)
xorl %ebp, %ebp
jmp 0x3168
cmpl $0x100, %eax            # imm = 0x100
sete %cl
cmpl $0x11e, %eax            # imm = 0x11E
setae %dl
orb %cl, %dl
jne 0x313e
addl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
leaq 0x5b245(%rip), %rcx     # 0x5e290
movl (%rcx,%rax,4), %r12d
leaq -0x1c(%rax), %rcx
cmpq $-0x14, %rcx
jb 0x308f
leaq 0x5b2b0(%rip), %rcx     # 0x5e310
movl (%rcx,%rax,4), %r13d
movq %rbp, %rdi
callq 0xbf0f
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 0xbde9
movq %rbp, %rdi
leaq 0xa0(%rsp), %rsi
callq 0xbe8c
cmpl $0x1e, %eax
jae 0x324d
movl %eax, %ecx
leaq 0x5b2d7(%rip), %rdx     # 0x5e390
movl (%rdx,%rcx,4), %edx
cmpl $0x4, %eax
jb 0x30e5
leaq 0x5b348(%rip), %rax     # 0x5e410
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 0x325f
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 0x314d
movq %r13, %rdx
callq 0x4a08
addq %r13, %r15
movq 0x30(%rsp), %r13
subq $0x1, %rbx
jb 0x315e
movq (%r13), %rax
movb (%rax,%rbp), %cl
incq %rbp
movb %cl, (%rax,%r15)
incq %r15
jmp 0x3125
pushq $0x1
popq %rbp
cmpl $0x100, %eax            # imm = 0x100
je 0x3168
jmp 0x31fe
movq %r12, %rdx
callq 0x4a08
xorl %ebp, %ebp
movq 0x30(%rsp), %r13
jmp 0x3160
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 0x318e
addq $0x104, %rsi            # imm = 0x104
movq %r13, %rdi
callq 0xbdac
testl %eax, %eax
je 0x31b5
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
ja 0x31b1
testq %r14, %r14
je 0x2fc3
cmpq %r14, 0x8(%r13)
jbe 0x2fc3
pushq $0x6d
jmp 0x3200
pushq $0x33
jmp 0x3200
pushq $0x53
jmp 0x3200
movl $0x480, %edi            # imm = 0x480
callq 0x2280
movq %rax, %rbx
movl $0x80, %edi
callq 0x2280
movq %rax, %r8
testq %rbx, %rbx
sete %al
testq %r8, %r8
sete %cl
orb %al, %cl
jne 0x3270
xorl %eax, %eax
cmpq $0x480, %rax            # imm = 0x480
je 0x3277
movb $0x0, (%rbx,%rax)
incq %rax
jmp 0x31e9
pushq $0x10
popq %r15
movq %rsp, %rbp
movq %rbx, %rdi
callq 0xbf88
leaq 0xa0(%rsp), %rdi
callq 0xbf88
testl %r15d, %r15d
movl 0x2c(%rsp), %r14d
jne 0x3537
andl $0x1, %r14d
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x2c67
cmpq %rax, 0x8(%r13)
jbe 0x2c67
jmp 0x3527
xorl %ecx, %ecx
cmpl $0x20, %eax
setb %cl
leal 0x10(,%rcx,2), %r15d
jmp 0x3205
pushq $0x34
popq %r15
movq %rcx, %r13
movq %rsp, %rbp
leaq 0x70(%rsp), %rbx
jmp 0x3205
pushq $0x53
jmp 0x34a8
xorl %eax, %eax
cmpq $0x80, %rax
je 0x328b
movb $0x0, (%r8,%rax)
incq %rax
jmp 0x3279
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 0x34b2
movq %r8, %rbx
movq %rbp, %rdi
callq 0xbf0f
movq %rbp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0xbe8c
cmpl $0xf, %eax
ja 0x3329
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 0x349b
movl %r12d, %ecx
cmpl $0x12, %eax
movq %rbx, %r8
je 0x3432
cmpl $0x11, %eax
movq 0x38(%rsp), %rbx
je 0x33d9
cmpl $0x10, %eax
movq 0x48(%rsp), %r10
jne 0x3505
testl %r12d, %r12d
je 0x3509
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 0x349b
cmpq %r12, %r14
je 0x3494
leal (%r10,%r12), %ecx
cmpq %r15, %r12
leaq (%r8,%rcx,4), %rcx
cmovbq %rdi, %rcx
movl %esi, (%rcx)
incq %r12
addq $0x4, %rdi
jmp 0x33ad
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 0x349b
cmpq %r12, %r14
je 0x348c
leal (%r10,%r12), %ecx
cmpq %r15, %r12
leaq (%r8,%rcx,4), %rcx
cmovbq %rsi, %rcx
andl $0x0, (%rcx)
incq %r12
addq $0x4, %rsi
jmp 0x3409
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 0x349b
cmpq %r12, %r14
je 0x3490
leal (%r10,%r12), %ecx
cmpq %r15, %r12
leaq (%r8,%rcx,4), %rcx
cmovbq %rsi, %rcx
andl $0x0, (%rcx)
incq %r12
addq $0x4, %rsi
jmp 0x3467
pushq $0xe
jmp 0x3496
pushq $0xf
jmp 0x3496
pushq $0xd
popq %rcx
movl %ecx, 0x28(%rsp)
cmpq 0x10(%rsp), %rax
jbe 0x32ca
pushq $0x32
popq %r14
movq %r8, %r12
jmp 0x2f7b
movl 0x28(%rsp), %r14d
testl %r14d, %r14d
jne 0x34aa
movq %r8, %r12
cmpl $0x0, 0x400(%rbx)
je 0x350d
movl $0x120, %edx            # imm = 0x120
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
pushq $0xf
popq %rbx
movl %ebx, %ecx
callq 0xc0ab
testl %eax, %eax
jne 0x34f8
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
pushq $0x20
popq %rdx
movl %ebx, %ecx
callq 0xc0ab
movl %eax, %r14d
movq 0x38(%rsp), %rbx
jmp 0x2f7b
pushq $0x10
jmp 0x34a8
pushq $0x36
jmp 0x34a8
pushq $0x40
popq %r14
jmp 0x2f7b
pushq $0x69
jmp 0x3535
pushq $0x34
jmp 0x3535
xorl %r15d, %r15d
jmp 0x3537
pushq $0x53
jmp 0x3535
pushq $0x6d
jmp 0x3535
pushq $0x14
jmp 0x3535
pushq $0x17
jmp 0x3535
pushq $0x15
popq %r15
movl %r15d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq