// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: inflateNoCompression
static unsigned inflateNoCompression(ucvector* out, const unsigned char* in, size_t* bp, size_t* pos, size_t inlength)
{
  size_t p;
  unsigned LEN, NLEN, n, error = 0;

  /*go to first boundary of byte*/
  while(((*bp) & 0x7) != 0) ++(*bp);
  p = (*bp) / 8; /*byte position*/

  /*read LEN (2 bytes) and NLEN (2 bytes)*/
  if(p + 4 >= inlength) return 52; /*error, bit pointer will jump past memory*/
  LEN = in[p] + 256u * in[p + 1]; p += 2;
  NLEN = in[p] + 256u * in[p + 1]; p += 2;

  /*check if 16-bit NLEN is really the one's complement of LEN*/
  if(LEN + NLEN != 65535) return 21; /*error: NLEN is not one's complement of LEN*/

  if(!ucvector_resize(out, (*pos) + LEN)) return 83; /*alloc fail*/

  /*read the literal data: LEN bytes are now stored in the out buffer*/
  if(p + LEN > inlength) return 23; /*error: reading outside of in buffer*/
  for(n = 0; n < LEN; ++n) out->data[(*pos)++] = in[p++];

  (*bp) = p * 8;

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0xa534
movq -0x20(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0xa513
movq -0x20(%rbp), %rax
movq (%rax), %rax
shrq $0x3, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x4, %rax
cmpq -0x30(%rbp), %rax
jb 0xa55d
movl $0x34, -0x4(%rbp)
jmp 0xa66d
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl -0x40(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xa5d0
movl $0x15, -0x4(%rbp)
jmp 0xa66d
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movl -0x3c(%rbp), %eax
addq %rax, %rsi
callq 0xaa50
cmpl $0x0, %eax
jne 0xa5f4
movl $0x53, -0x4(%rbp)
jmp 0xa66d
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %ecx
addq %rcx, %rax
cmpq -0x30(%rbp), %rax
jbe 0xa60d
movl $0x17, -0x4(%rbp)
jmp 0xa66d
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jae 0xa658
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movb %dl, (%rax,%rcx)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xa614
movq -0x38(%rbp), %rcx
shlq $0x3, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x48(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)