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

  while(!error) /*not really a while loop, only used to break on error*/ {
    unsigned length, string2_begin;

    length = 0;
    while(length < chunkLength && data[length] != 0) ++length;
    /*even though it's not allowed by the standard, no error is thrown if
    there's no null termination char, if the text is empty*/
    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;

    string2_begin = length + 1; /*skip keyword null terminator*/

    length = (unsigned)(chunkLength < string2_begin ? 0 : chunkLength - string2_begin);
    str = (char*)lodepng_malloc(length + 1);
    if(!str) CERROR_BREAK(error, 83); /*alloc fail*/

    lodepng_memcpy(str, data + string2_begin, length);
    str[length] = 0;

    error = lodepng_add_text(info, key, str);

    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)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpl $0x0, -0x1c(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xb6ad
jmp 0xb7d3
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x39(%rbp)
jae 0xb6d8
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0xb6e1
jmp 0xb6ec
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb6b4
cmpl $0x1, -0x34(%rbp)
jb 0xb6f8
cmpl $0x4f, -0x34(%rbp)
jbe 0xb704
movl $0x59, -0x1c(%rbp)
jmp 0xb7d3
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x3de0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xb72a
movl $0x53, -0x1c(%rbp)
jmp 0xb7d3
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0x6440
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
cmpq %rcx, %rax
jae 0xb764
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0xb772
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x3de0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xb79c
movl $0x53, -0x1c(%rbp)
jmp 0xb7d3
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x38(%rbp), %eax
addq %rax, %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0x6440
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x6930
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5060
movq -0x30(%rbp), %rdi
callq 0x5060
movl -0x1c(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop