// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-mgs/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 i;

  unsigned length, string2_begin;
  char *key = 0;
  ucvector decoded;

  ucvector_init(&decoded);

  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*/

    key[length] = 0;
    for(i = 0; i != length; ++i) key[i] = (char)data[i];

    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 = chunkLength - string2_begin;
    /*will fail if zlib error, e.g. if length is too small*/
    error = zlib_decompress(&decoded.data, &decoded.size,
                            (unsigned char*)(&data[string2_begin]),
                            length, zlibsettings);
    if(error) break;
    ucvector_push_back(&decoded, 0);

    error = lodepng_add_text(info, key, (char*)decoded.data);

    break;
  }

  lodepng_free(key);
  ucvector_cleanup(&decoded);

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %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)
leaq -0x50(%rbp), %rdi
callq 0x8f00
cmpl $0x0, -0x24(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe8d2
jmp 0xea38
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x51(%rbp)
jae 0xe8fd
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0xe906
jmp 0xe913
jmp 0xe908
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xe8d9
movl -0x2c(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
cmpq -0x20(%rbp), %rax
jb 0xe92d
movl $0x4b, -0x24(%rbp)
jmp 0xea38
cmpl $0x1, -0x2c(%rbp)
jb 0xe939
cmpl $0x4f, -0x2c(%rbp)
jbe 0xe945
movl $0x59, -0x24(%rbp)
jmp 0xea38
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x13b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xe96b
movl $0x53, -0x24(%rbp)
jmp 0xea38
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0xe9a4
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe97d
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0xe9c2
movl $0x48, -0x24(%rbp)
jmp 0xea38
movl -0x2c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpq -0x20(%rbp), %rax
jbe 0xe9dd
movl $0x4b, -0x24(%rbp)
jmp 0xea38
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
subq %rcx, %rax
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x50(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
movl -0x30(%rbp), %eax
addq %rax, %rdx
movl -0x2c(%rbp), %eax
movl %eax, %ecx
movq -0x10(%rbp), %r8
callq 0xf060
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xea19
jmp 0xea38
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x2660
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x3440
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1e60
leaq -0x50(%rbp), %rdi
callq 0xf0d0
movl -0x24(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)