// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/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(!ensureBits9(&reader, 3)) return 52; /*error, bit pointer will jump past memory*/
    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); /*compression, BTYPE 01 or 10*/

    if(error) return error;
  }

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %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 0x367a
movq %rdi, %r14
movq %rsp, %r13
andq $0x0, 0x18(%r13)
andl $0x0, 0x20(%r13)
xorl %eax, %eax
testl %eax, %eax
jne 0x3682
movq %r13, %rdi
pushq $0x3
popq %rsi
callq 0x285e
testl %eax, %eax
je 0x367e
movl 0x20(%rsp), %edi
movl %edi, %ecx
shrl %ecx
movq 0x18(%rsp), %rax
movl %edi, %edx
shrl $0x3, %edx
leaq 0x3(%rax), %rsi
movl %edx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
andl $0x3, %ecx
movl %edi, 0x4c(%rsp)
je 0x2fa3
cmpl $0x3, %ecx
je 0x3687
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
leaq 0xa8(%rsp), %rax
movups %xmm0, (%rax)
movaps %xmm0, 0x60(%rsp)
leaq 0x78(%rsp), %rax
movups %xmm0, (%rax)
cmpl $0x1, %ecx
jne 0x3035
leaq 0x90(%rsp), %rdi
callq 0xa7e1
movl %eax, %r12d
testl %eax, %eax
jne 0x3427
leaq 0x60(%rsp), %rdi
callq 0xa888
movl %eax, %r12d
jmp 0x3427
movq 0x8(%rsp), %rbp
addq $0xa, %rax
shrq $0x3, %rax
leaq 0x4(%rax), %r15
cmpq %rbp, %r15
jae 0x367e
movq (%rsp), %rbx
movzwl (%rbx,%rax), %ecx
movq 0x58(%rsp), %rdx
cmpl $0x0, 0x4(%rdx)
jne 0x2fe2
movzwl 0x2(%rbx,%rax), %eax
addl %ecx, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x3693
movl %ecx, %r12d
movq 0x8(%r14), %rsi
addq %r12, %rsi
movq %r14, %rdi
callq 0xa6f2
testl %eax, %eax
je 0x368b
leaq (%r15,%r12), %r13
cmpq %rbp, %r13
ja 0x368f
movq (%r14), %rdi
addq 0x8(%r14), %rdi
subq %r12, %rdi
addq %r15, %rbx
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4a33
shlq $0x3, %r13
movq %r13, 0x18(%rsp)
xorl %r12d, %r12d
movq %rsp, %r13
jmp 0x35fb
movq %r13, %rdi
pushq $0xe
popq %rsi
callq 0x27e7
pushq $0x31
popq %r12
testl %eax, %eax
je 0x3427
movl 0x20(%rsp), %ebx
movq 0x18(%rsp), %r15
movl %ebx, %eax
shrl $0xe, %eax
movl %eax, 0x20(%rsp)
addq $0xe, %r15
movq %r15, 0x18(%rsp)
pushq $0x4c
popq %rdi
callq 0x1130
pushq $0x53
popq %r12
testq %rax, %rax
je 0x3427
movq %rax, %rbp
movq %rbx, %rdx
shrl $0xa, %ebx
andl $0xf, %ebx
leaq 0x4(%rbx), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
leaq 0xd8(%rsp), %rcx
movups %xmm0, (%rcx)
leaq (%rax,%rax,2), %rax
addq %r15, %rax
pushq $0x32
popq %r12
cmpq %r15, %rax
jb 0x3171
movl $0x0, %esi
movl $0x0, %r9d
cmpq 0x10(%rsp), %rax
ja 0x33fc
movl %edx, %eax
andl $0x1f, %eax
shrl $0x5, %edx
movq %rax, 0x40(%rsp)
addq $0x101, %rax            # imm = 0x101
movq %rax, 0x30(%rsp)
andl $0x1f, %edx
incl %edx
movq %rdx, 0x38(%rsp)
leaq 0x10(,%rbx,4), %r15
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x3134
movq %r13, %rdi
pushq $0x3
popq %rsi
callq 0x285e
movl 0x20(%rsp), %eax
movl %eax, %ecx
shrl $0x3, %eax
movl %eax, 0x20(%rsp)
addq $0x3, 0x18(%rsp)
andl $0x7, %ecx
leaq 0xc7ca(%rip), %rax      # 0xf8f0
movl (%r12,%rax), %eax
movl %ecx, (%rbp,%rax,4)
addq $0x4, %r12
jmp 0x30f9
movq 0x38(%rsp), %r15
cmpq $0xf, %rbx
je 0x3154
leaq 0xc7aa(%rip), %rax      # 0xf8f0
movl 0x10(%rax,%rbx,4), %eax
andl $0x0, (%rbp,%rax,4)
incq %rbx
jmp 0x3139
leaq 0xc0(%rsp), %rdi
movq %rbp, %rsi
pushq $0x13
popq %rdx
pushq $0x7
popq %rcx
callq 0xa8dc
testl %eax, %eax
je 0x317b
movl %eax, %r12d
xorl %esi, %esi
xorl %r9d, %r9d
jmp 0x33fc
movl $0x480, %edi            # imm = 0x480
callq 0x1130
movq %rax, %rbx
movl $0x80, %edi
callq 0x1130
movq %rbx, %rsi
movq %rax, %r9
testq %rbx, %rbx
sete %al
testq %r9, %r9
sete %cl
orb %al, %cl
jne 0x31be
xorl %eax, %eax
movq %r15, %r11
cmpq $0x480, %rax            # imm = 0x480
je 0x31c5
movb $0x0, (%rsi,%rax)
incq %rax
jmp 0x31ad
pushq $0x53
jmp 0x33ec
xorl %eax, %eax
cmpq $0x80, %rax
je 0x31d9
movb $0x0, (%r9,%rax)
incq %rax
jmp 0x31c7
addl 0x30(%rsp), %r11d
movq 0x40(%rsp), %rcx
leal 0x102(%rcx), %eax
movl %eax, 0x48(%rsp)
negl %ecx
movq %rcx, 0x40(%rsp)
movslq %ecx, %r15
addq $-0x101, %r15           # imm = 0xFEFF
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %rsi, 0x28(%rsp)
movq %r11, 0x38(%rsp)
movq %r15, 0x50(%rsp)
movq %r9, %r15
cmpl %r11d, %ebx
jae 0x33f0
movq %r13, %rdi
pushq $0x16
popq %rsi
callq 0x275f
movq %r13, %rdi
leaq 0xc0(%rsp), %rsi
callq 0xa734
cmpl $0xf, %eax
ja 0x3274
movq 0x30(%rsp), %rcx
cmpl %ecx, %ebx
movl $0x0, %edx
cmovbl %edx, %ecx
movq %r15, %r9
movq %r15, %rdx
movq 0x28(%rsp), %rsi
cmovbq %rsi, %rdx
movl %ebx, %edi
subl %ecx, %edi
movl %eax, (%rdx,%rdi,4)
incl %ebx
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %r11
jmp 0x33df
movl %ebx, %ecx
cmpw $0x12, %ax
movq 0x28(%rsp), %rsi
movq %r15, %r9
movq 0x38(%rsp), %r11
je 0x337c
movzwl %ax, %eax
cmpl $0x11, %eax
movq 0x30(%rsp), %r10
movq 0x50(%rsp), %r15
je 0x332b
cmpl $0x10, %eax
jne 0x3641
testl %ebx, %ebx
je 0x3648
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(%rbx), %edi
cmpl 0x48(%rsp), %ebx
leaq (%rsi,%rdi,4), %r8
movq 0x40(%rsp), %rdi
leal -0x102(%rbx,%rdi), %edi
leaq (%r9,%rdi,4), %rdi
cmovbq %r8, %rdi
movq %rax, 0x18(%rsp)
movl (%rdi), %r8d
leaq (%rsi,%rcx,4), %rdi
movq %rcx, %rbx
subl $0x1, %edx
jb 0x33df
cmpq %rbx, %r11
je 0x33db
leal (%r15,%rbx), %ecx
cmpq %r10, %rbx
leaq (%r9,%rcx,4), %rcx
cmovbq %rdi, %rcx
movl %r8d, (%rcx)
incq %rbx
addq $0x4, %rdi
jmp 0x32fe
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 (%rsi,%rcx,4), %rdi
movq %rcx, %rbx
subl $0x1, %edx
jb 0x33df
cmpq %rbx, %r11
je 0x33d3
leal (%r15,%rbx), %ecx
cmpq %r10, %rbx
leaq (%r9,%rcx,4), %rcx
cmovbq %rdi, %rcx
andl $0x0, (%rcx)
incq %rbx
addq $0x4, %rdi
jmp 0x3353
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
leaq (%rsi,%rcx,4), %rdi
movq %rcx, %rbx
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %r15
subl $0x1, %edx
jb 0x33df
cmpq %rbx, %r11
je 0x33d7
leal (%r15,%rbx), %ecx
cmpq %r8, %rbx
leaq (%r9,%rcx,4), %rcx
cmovbq %rdi, %rcx
andl $0x0, (%rcx)
incq %rbx
addq $0x4, %rdi
jmp 0x33ae
pushq $0xe
jmp 0x33dd
pushq $0xf
jmp 0x33dd
pushq $0xd
popq %r12
cmpq 0x10(%rsp), %rax
jbe 0x3212
pushq $0x32
popq %r12
jmp 0x33fc
testl %r12d, %r12d
je 0x3610
movq %r15, %r9
movq %rbp, %rdi
movq %rsi, %rbx
movq %r9, %r15
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
leaq 0xc0(%rsp), %rdi
callq 0xa7b9
testl %r12d, %r12d
jne 0x35e4
movq %r13, %rdi
pushq $0x14
popq %rsi
callq 0x275f
movq %r13, %rdi
leaq 0x90(%rsp), %rsi
callq 0xa734
movl %eax, %ebp
cmpl $0xff, %eax
ja 0x347c
movq 0x8(%r14), %rsi
incq %rsi
movq %r14, %rdi
callq 0xa6f2
testl %eax, %eax
je 0x35c1
movq (%r14), %rax
movq 0x8(%r14), %rcx
movb %bpl, -0x1(%rax,%rcx)
jmp 0x3597
cmpl $0x100, %ebp            # imm = 0x100
je 0x35ae
cmpl $0x11d, %ebp            # imm = 0x11D
ja 0x35ae
addl $0xfffffeff, %ebp       # imm = 0xFFFFFEFF
leaq 0xc24f(%rip), %rax      # 0xf6f0
movl (%rax,%rbp,4), %r13d
leaq -0x1c(%rbp), %rax
cmpq $-0x14, %rax
jb 0x34d4
leaq 0xc2ba(%rip), %rax      # 0xf770
movl (%rax,%rbp,4), %ecx
pushq $-0x1
popq %rax
shll %cl, %eax
movl 0x20(%rsp), %edx
notl %eax
andl %edx, %eax
shrl %cl, %edx
movl %edx, 0x20(%rsp)
addq %rcx, 0x18(%rsp)
addq %rax, %r13
movq %rsp, %rbx
movq %rbx, %rdi
pushq $0x1c
popq %rsi
callq 0x269e
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0xa734
cmpl $0x1e, %eax
jae 0x35c7
movl %eax, %ecx
leaq 0xc2ef(%rip), %rdx      # 0xf7f0
movl (%rdx,%rcx,4), %edx
cmpl $0x4, %eax
jb 0x352d
leaq 0xc360(%rip), %rax      # 0xf870
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(%r14), %r15
movl %edx, %r12d
movq %r15, %rbp
subq %r12, %rbp
jb 0x35d9
leaq (%r15,%r13), %rsi
movq %r14, %rdi
callq 0xa6f2
testl %eax, %eax
je 0x35dd
movq (%r14), %rsi
leaq (%rsi,%r15), %rdi
addq %rbp, %rsi
movq %r13, %rbx
subq %r12, %rbx
jbe 0x358c
movq %r12, %rdx
callq 0x4a33
addq %r12, %r15
movq %rsp, %r13
subq $0x1, %rbx
jb 0x3597
movq (%r14), %rax
movb (%rax,%rbp), %cl
incq %rbp
movb %cl, (%rax,%r15)
incq %r15
jmp 0x3574
movq %r13, %rdx
callq 0x4a33
movq %rsp, %r13
movq 0x18(%rsp), %rax
xorl %r12d, %r12d
cmpq 0x10(%rsp), %rax
jbe 0x3427
pushq $0x33
jmp 0x35c3
xorl %r12d, %r12d
cmpl $0x100, %ebp            # imm = 0x100
setne %r12b
shll $0x4, %r12d
jmp 0x35e4
pushq $0x53
popq %r12
jmp 0x35e4
xorl %ecx, %ecx
cmpl $0x20, %eax
setb %cl
leal 0x10(,%rcx,2), %r12d
jmp 0x35e1
pushq $0x34
jmp 0x35df
pushq $0x53
popq %r12
movq %rsp, %r13
leaq 0x90(%rsp), %rdi
callq 0xa7b9
leaq 0x60(%rsp), %rdi
callq 0xa7b9
movl 0x4c(%rsp), %eax
andl $0x1, %eax
testl %r12d, %r12d
je 0x2f01
jmp 0x3697
cmpl $0x0, 0x400(%rsi)
je 0x364f
movl $0x120, %edx            # imm = 0x120
leaq 0x90(%rsp), %rdi
pushq $0xf
popq %rbx
movl %ebx, %ecx
callq 0xa8dc
testl %eax, %eax
je 0x3658
movl %eax, %r12d
movq 0x28(%rsp), %rsi
jmp 0x33f9
pushq $0x10
jmp 0x33ec
pushq $0x36
jmp 0x33ec
pushq $0x40
popq %r12
jmp 0x33f9
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
pushq $0x20
popq %rdx
movl %ebx, %ecx
callq 0xa8dc
movq %r15, %r9
movl %eax, %r12d
movq 0x28(%rsp), %rsi
jmp 0x33fc
pushq $0x69
jmp 0x3695
pushq $0x34
jmp 0x3695
xorl %r12d, %r12d
jmp 0x3697
pushq $0x14
jmp 0x3695
pushq $0x53
jmp 0x3695
pushq $0x17
jmp 0x3695
pushq $0x15
popq %r12
movl %r12d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq