// File: /workspace/github_c_makefile_star2_O1/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 0x2dfe
movq %rdx, %r15
movq $0x0, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x1, %ebp
testq %rdx, %rdx
je 0x2e00
movq %r8, %rbx
xorl %r12d, %r12d
movq (%r14,%r12,8), %r13
cmpq $0x1a, %r13
jb 0x2caf
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq %rdx, %rax
shrq $0x3, %rax
leaq 0x4(%rax), %rsi
cmpq %rcx, %rsi
jae 0x2cf3
movq (%rsp), %rsi
movl (%rsi,%rax), %edi
andb $0x7, %dl
movl %edx, %ecx
shrl %cl, %edi
movl %edi, 0x20(%rsp)
movzbl 0x4(%rsi,%rax), %eax
shll $0x18, %eax
movb $0x8, %cl
subb %dl, %cl
shll %cl, %eax
orl %edi, %eax
jmp 0x2ce5
cmpq $0x12, %r13
jb 0x2d52
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq %rdx, %rax
shrq $0x3, %rax
leaq 0x3(%rax), %rsi
cmpq %rcx, %rsi
jae 0x2d65
movq (%rsp), %rcx
movl (%rcx,%rax), %eax
andb $0x7, %dl
movl %edx, %ecx
shrl %cl, %eax
movl %eax, 0x20(%rsp)
movl $0x1, %eax
jmp 0x2dcb
movl $0x0, 0x20(%rsp)
cmpq %rcx, %rax
jae 0x2d0c
movq (%rsp), %rsi
movzbl (%rsi,%rax), %esi
movl %esi, 0x20(%rsp)
leaq 0x1(%rax), %rsi
cmpq %rcx, %rsi
jae 0x2d24
movq (%rsp), %rdi
movzbl (%rdi,%rsi), %esi
shll $0x8, %esi
orl %esi, 0x20(%rsp)
leaq 0x2(%rax), %rsi
cmpq %rcx, %rsi
jae 0x2d3c
movq (%rsp), %rdi
movzbl (%rdi,%rsi), %esi
shll $0x10, %esi
orl %esi, 0x20(%rsp)
addq $0x3, %rax
cmpq %rcx, %rax
jae 0x2dae
movq (%rsp), %rcx
movzbl (%rcx,%rax), %eax
shll $0x18, %eax
jmp 0x2daa
movq %rsp, %rdi
movq %r13, %rsi
cmpq $0xa, %r13
jb 0x2dc6
callq 0x2e11
jmp 0x2dcb
movl $0x0, 0x20(%rsp)
cmpq %rcx, %rax
jae 0x2d7e
movq (%rsp), %rsi
movzbl (%rsi,%rax), %esi
movl %esi, 0x20(%rsp)
leaq 0x1(%rax), %rsi
cmpq %rcx, %rsi
jae 0x2d96
movq (%rsp), %rdi
movzbl (%rdi,%rsi), %esi
shll $0x8, %esi
orl %esi, 0x20(%rsp)
addq $0x2, %rax
cmpq %rcx, %rax
jae 0x2dae
movq (%rsp), %rcx
movzbl (%rcx,%rax), %eax
shll $0x10, %eax
orl %eax, 0x20(%rsp)
movl %edx, %ecx
andb $0x7, %cl
shrl %cl, 0x20(%rsp)
addq %r13, %rdx
xorl %eax, %eax
cmpq 0x10(%rsp), %rdx
setbe %al
jmp 0x2dcb
callq 0x2e8b
testl %eax, %eax
je 0x2dfe
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
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)
movl %eax, (%rbx,%r12,4)
incq %r12
cmpq %r12, %r15
jne 0x2c67
jmp 0x2e00
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq