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

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

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

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

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

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

    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 0xe70d
jmp 0xe86a
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x3d(%rbp)
jae 0xe738
movq -0x10(%rbp), %rax
movl -0x38(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0xe741
jmp 0xe74c
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xe714
cmpl $0x1, -0x38(%rbp)
jb 0xe758
cmpl $0x4f, -0x38(%rbp)
jbe 0xe764
movl $0x59, -0x1c(%rbp)
jmp 0xe86a
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x13b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xe78a
movl $0x53, -0x1c(%rbp)
jmp 0xe86a
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
je 0xe7c3
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
movb %dl, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xe79c
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0xe7e0
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0xe7ee
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x13b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xe818
movl $0x53, -0x1c(%rbp)
jmp 0xe86a
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
je 0xe856
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x34(%rbp), %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
movb %dl, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xe82a
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x3440
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1e60
movq -0x30(%rbp), %rdi
callq 0x1e60
movl -0x1c(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)