// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: deflateNoCompression
static unsigned deflateNoCompression(ucvector* out, const unsigned char* data, size_t datasize) {
  /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of next byte,
  2 bytes LEN, 2 bytes NLEN, LEN bytes literal DATA*/

  size_t i, numdeflateblocks = (datasize + 65534u) / 65535u;
  unsigned datapos = 0;
  for(i = 0; i != numdeflateblocks; ++i) {
    unsigned BFINAL, BTYPE, LEN, NLEN;
    unsigned char firstbyte;
    size_t pos = out->size;

    BFINAL = (i == numdeflateblocks - 1);
    BTYPE = 0;

    LEN = 65535;
    if(datasize - datapos < 65535u) LEN = (unsigned)datasize - datapos;
    NLEN = 65535 - LEN;

    if(!ucvector_resize(out, out->size + LEN + 5)) return 83; /*alloc fail*/

    firstbyte = (unsigned char)(BFINAL + ((BTYPE & 1u) << 1u) + ((BTYPE & 2u) << 1u));
    out->data[pos + 0] = firstbyte;
    out->data[pos + 1] = (unsigned char)(LEN & 255);
    out->data[pos + 2] = (unsigned char)(LEN >> 8u);
    out->data[pos + 3] = (unsigned char)(NLEN & 255);
    out->data[pos + 4] = (unsigned char)(NLEN >> 8u);
    lodepng_memcpy(out->data + pos + 5, data + datapos, LEN);
    datapos += LEN;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0xfffe, %rax           # imm = 0xFFFE
movl $0xffff, %ecx           # imm = 0xFFFF
xorl %edx, %edx
divq %rcx
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x11e18
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0xffff, -0x40(%rbp)    # imm = 0xFFFF
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
subq %rcx, %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
jae 0x11d19
movq -0x20(%rbp), %rax
subl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0xffff, %eax           # imm = 0xFFFF
subl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl -0x40(%rbp), %eax
addq %rax, %rsi
addq $0x5, %rsi
callq 0x10ac0
cmpl $0x0, %eax
jne 0x11d50
movl $0x53, -0x4(%rbp)
jmp 0x11e1f
movl -0x38(%rbp), %eax
movl -0x3c(%rbp), %ecx
andl $0x1, %ecx
shll %ecx
addl %ecx, %eax
movl -0x3c(%rbp), %ecx
andl $0x2, %ecx
shll %ecx
addl %ecx, %eax
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x40(%rbp), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movl -0x40(%rbp), %eax
shrl $0x8, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movl -0x44(%rbp), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movb %dl, 0x3(%rax,%rcx)
movl -0x44(%rbp), %eax
shrl $0x8, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movb %dl, 0x4(%rax,%rcx)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
addq -0x50(%rbp), %rdi
addq $0x5, %rdi
movq -0x18(%rbp), %rsi
movl -0x34(%rbp), %eax
addq %rax, %rsi
movl -0x40(%rbp), %eax
movl %eax, %edx
callq 0x6440
movl -0x40(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x11cbb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)