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

  unsigned length, string2_begin;
  char *key = 0;
  unsigned char* str = 0;
  size_t size = 0;

  while(!error) /*not really a while loop, only used to break on error*/ {
    for(length = 0; length < chunkLength && data[length] != 0; ++length) ;
    if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/
    if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/

    key = (char*)lodepng_malloc(length + 1);
    if(!key) CERROR_BREAK(error, 83); /*alloc fail*/

    lodepng_memcpy(key, data, length);
    key[length] = 0;

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

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

    length = (unsigned)chunkLength - string2_begin;
    /*will fail if zlib error, e.g. if length is too small*/
    error = zlib_decompress(&str, &size, 0, &data[string2_begin],
                            length, zlibsettings);
    if(error) break;
    error = lodepng_add_text_sized(info, key, (char*)str, size);

    break;
  }

  lodepng_free(key);
  lodepng_free(str);

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
cmpl $0x0, -0x24(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xb839
jmp 0xb97a
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x49(%rbp)
jae 0xb864
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xb86d
jmp 0xb87a
jmp 0xb86f
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xb840
movl -0x28(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
cmpq -0x20(%rbp), %rax
jb 0xb894
movl $0x4b, -0x24(%rbp)
jmp 0xb97a
cmpl $0x1, -0x28(%rbp)
jb 0xb8a0
cmpl $0x4f, -0x28(%rbp)
jbe 0xb8ac
movl $0x59, -0x24(%rbp)
jmp 0xb97a
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x3de0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xb8d2
movl $0x53, -0x24(%rbp)
jmp 0xb97a
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x28(%rbp), %eax
movl %eax, %edx
callq 0x6440
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0xb90d
movl $0x48, -0x24(%rbp)
jmp 0xb97a
movl -0x28(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpq -0x20(%rbp), %rax
jbe 0xb928
movl $0x4b, -0x24(%rbp)
jmp 0xb97a
movq -0x20(%rbp), %rax
subl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movl -0x2c(%rbp), %eax
addq %rax, %rcx
movl -0x28(%rbp), %eax
movl %eax, %r8d
movq -0x10(%rbp), %r9
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x144e0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xb962
jmp 0xb97a
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x6980
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rdi
callq 0x5060
movq -0x40(%rbp), %rdi
callq 0x5060
movl -0x24(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)