// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_iCCP
static unsigned readChunk_iCCP(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings,
                               const unsigned char* data, size_t chunkLength) {
  unsigned error = 0;
  unsigned i;
  size_t size = 0;

  unsigned length, string2_begin;

  info->iccp_defined = 1;
  if(info->iccp_name) lodepng_clear_icc(info);

  for(length = 0; length < chunkLength && data[length] != 0; ++length) ;
  if(length + 2 >= chunkLength) return 75; /*no null termination, corrupt?*/
  if(length < 1 || length > 79) return 89; /*keyword too short or long*/

  info->iccp_name = (char*)lodepng_malloc(length + 1);
  if(!info->iccp_name) return 83; /*alloc fail*/

  info->iccp_name[length] = 0;
  for(i = 0; i != length; ++i) info->iccp_name[i] = (char)data[i];

  if(data[length + 1] != 0) return 72; /*the 0 byte indicating compression must be 0*/

  string2_begin = length + 2;
  if(string2_begin > chunkLength) return 75; /*no null termination, corrupt?*/

  length = (unsigned)chunkLength - string2_begin;
  error = zlib_decompress(&info->iccp_profile, &size, 0,
                          &data[string2_begin],
                          length, zlibsettings);
  info->iccp_profile_size = size;
  if(!error && !info->iccp_profile_size) error = 100; /*invalid ICC profile size*/
  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)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0xe8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0xc1cc
movq -0x10(%rbp), %rdi
callq 0x6f10
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x41(%rbp)
jae 0xc1f7
movq -0x20(%rbp), %rax
movl -0x3c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0xc200
jmp 0xc20d
jmp 0xc202
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc1d3
movl -0x3c(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
cmpq -0x28(%rbp), %rax
jb 0xc227
movl $0x4b, -0x4(%rbp)
jmp 0xc362
cmpl $0x1, -0x3c(%rbp)
jb 0xc233
cmpl $0x4f, -0x3c(%rbp)
jbe 0xc23f
movl $0x59, -0x4(%rbp)
jmp 0xc362
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x3de0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xf0(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
jne 0xc276
movl $0x53, -0x4(%rbp)
jmp 0xc362
movq -0x10(%rbp), %rax
movq 0xf0(%rax), %rax
movl -0x3c(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xc2bd
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq 0xf0(%rax), %rax
movl -0x30(%rbp), %ecx
movb %dl, (%rax,%rcx)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xc28f
movq -0x20(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0xc2de
movl $0x48, -0x4(%rbp)
jmp 0xc362
movl -0x3c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpq -0x28(%rbp), %rax
jbe 0xc2f9
movl $0x4b, -0x4(%rbp)
jmp 0xc362
movq -0x28(%rbp), %rax
subl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
addq $0xf8, %rdi
movq -0x20(%rbp), %rcx
movl -0x40(%rbp), %eax
addq %rax, %rcx
movl -0x3c(%rbp), %eax
movl %eax, %r8d
movq -0x18(%rbp), %r9
leaq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x144e0
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x100(%rax)
cmpl $0x0, -0x2c(%rbp)
jne 0xc35c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x100(%rax)
jne 0xc35c
movl $0x64, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)