// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lode_png_test_bitreader
unsigned lode_png_test_bitreader(const unsigned char* data, size_t size,
                                 size_t numsteps, const size_t* steps, unsigned* result) {
  size_t i;
  LodePNGBitReader reader;
  unsigned error = LodePNGBitReader_init(&reader, data, size);
  if(error) return 0;
  for(i = 0; i < numsteps; i++) {
    size_t step = steps[i];
    unsigned ok;
    if(step > 25) ok = ensureBits32(&reader, step);
    else if(step > 17) ok = ensureBits25(&reader, step);
    else if(step > 9) ok = ensureBits17(&reader, step);
    else ok = ensureBits9(&reader, step);
    if(!ok) return 0;
    result[i] = readBits(&reader, step);
  }
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
leaq (,%rsi,8), %rax
movq %rax, 0x10(%rsp)
shrq $0x3d, %rsi
setne %cl
cmpq $-0x40, %rax
setae %al
orb %cl, %al
jne 0x2b29
movq %rdx, %r15
movq $0x0, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x1, %ebp
testq %rdx, %rdx
je 0x2b2b
movq %r8, %rbx
xorl %edx, %edx
xorl %r12d, %r12d
movq (%r14,%r12,8), %r13
cmpq $0x1a, %r13
jb 0x29ea
movq %rdx, %rax
shrq $0x3, %rax
movq 0x8(%rsp), %rcx
leaq 0x4(%rax), %rsi
cmpq %rcx, %rsi
jae 0x2a20
movq (%rsp), %rsi
movl (%rsi,%rax), %edi
movl %edx, %ecx
andb $0x7, %cl
shrl %cl, %edi
movzbl 0x4(%rsi,%rax), %esi
shll $0x18, %esi
movb $0x8, %al
subb %cl, %al
movl %eax, %ecx
shll %cl, %esi
orl %edi, %esi
jmp 0x2afb
cmpq $0x12, %r13
jb 0x2a80
movq %rdx, %rcx
shrq $0x3, %rcx
movq 0x8(%rsp), %rsi
leaq 0x3(%rcx), %rax
cmpq %rsi, %rax
jae 0x2a93
movq (%rsp), %rax
movl (%rax,%rcx), %esi
movl %edx, %ecx
andb $0x7, %cl
shrl %cl, %esi
jmp 0x2afb
xorl %esi, %esi
cmpq %rcx, %rax
jae 0x2a2f
movq (%rsp), %rsi
movzbl (%rsi,%rax), %esi
leaq 0x1(%rax), %rdi
cmpq %rcx, %rdi
jae 0x2a46
movq (%rsp), %r8
movzbl (%r8,%rdi), %edi
shll $0x8, %edi
orl %edi, %esi
leaq 0x2(%rax), %rdi
cmpq %rcx, %rdi
jae 0x2a5d
movq (%rsp), %r8
movzbl (%r8,%rdi), %edi
shll $0x10, %edi
orl %edi, %esi
addq $0x3, %rax
cmpq %rcx, %rax
jae 0x2a73
movq (%rsp), %rcx
movzbl (%rcx,%rax), %eax
shll $0x18, %eax
orl %eax, %esi
movl %edx, %ecx
andb $0x7, %cl
shrl %cl, %esi
movl %esi, 0x20(%rsp)
jmp 0x2ada
movq %rsp, %rdi
movq %r13, %rsi
cmpq $0xa, %r13
jb 0x2ae9
callq 0x2b3c
jmp 0x2aee
xorl %eax, %eax
cmpq %rsi, %rcx
jae 0x2aa2
movq (%rsp), %rax
movzbl (%rax,%rcx), %eax
leaq 0x1(%rcx), %rdi
cmpq %rsi, %rdi
jae 0x2ab9
movq (%rsp), %r8
movzbl (%r8,%rdi), %edi
shll $0x8, %edi
orl %edi, %eax
addq $0x2, %rcx
cmpq %rsi, %rcx
jae 0x2acf
movq (%rsp), %rsi
movzbl (%rsi,%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movl %edx, %ecx
andb $0x7, %cl
shrl %cl, %eax
movl %eax, 0x20(%rsp)
addq %r13, %rdx
xorl %eax, %eax
cmpq 0x10(%rsp), %rdx
setbe %al
jmp 0x2aee
callq 0x2bb8
testl %eax, %eax
je 0x2b29
movl 0x20(%rsp), %esi
movq 0x18(%rsp), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %r13d, %ecx
shll %cl, %eax
notl %eax
andl %esi, %eax
shrl %cl, %esi
movl %esi, 0x20(%rsp)
addq %r13, %rdx
movq %rdx, 0x18(%rsp)
movl %eax, (%rbx,%r12,4)
incq %r12
cmpq %r12, %r15
jne 0x29a6
jmp 0x2b2b
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq