// File: /workspace/github_cpp_makefile_star2_O1/drummyfish[P]flowchart/src/lodepng.cpp
// Function: addChunk_zTXt(ucvector*, char const*, char const*, LodePNGCompressSettings*)
static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring,
                              LodePNGCompressSettings* zlibsettings)
{
  unsigned error = 0;
  ucvector data, compressed;
  size_t i, textsize = strlen(textstring);

  ucvector_init(&data);
  ucvector_init(&compressed);
  for(i = 0; keyword[i] != 0; i++) ucvector_push_back(&data, (unsigned char)keyword[i]);
  ucvector_push_back(&data, 0); /*0 termination char*/
  ucvector_push_back(&data, 0); /*compression method: 0*/

  error = zlib_compress(&compressed.data, &compressed.size,
                        (unsigned char*)textstring, textsize, zlibsettings);
  if(!error)
  {
    for(i = 0; i < compressed.size; i++) ucvector_push_back(&data, compressed.data[i]);
    error = addChunk(out, "zTXt", data.data, data.size);
  }

  ucvector_cleanup(&compressed);
  ucvector_cleanup(&data);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x40(%rsp)
movq %rsi, %rbx
movq %rdi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rdx, %rdi
callq 0x20d0
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movb (%rbx), %r12b
testb %r12b, %r12b
je 0xabc6
incq %rbx
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %edi, %edi
leaq 0x1(%r14), %r15
cmpq %r15, %r13
jae 0xab9f
movq %r13, 0x20(%rsp)
leaq (%r15,%r15), %rbp
movq %rbp, %rsi
movq %rdi, %r13
callq 0x2320
testq %rax, %rax
je 0xaba6
xorl %ecx, %ecx
movq %rax, %rdi
movq %r15, %r14
movq %rbp, %r13
jmp 0xabb0
xorl %ecx, %ecx
movq %r15, %r14
jmp 0xabb0
movb $0x1, %cl
movq %r13, %rdi
movq 0x20(%rsp), %r13
testb %cl, %cl
jne 0xabb9
movb %r12b, -0x1(%rdi,%r14)
movb (%rbx), %r12b
incq %rbx
testb %r12b, %r12b
jne 0xab70
jmp 0xabce
xorl %edi, %edi
xorl %r14d, %r14d
xorl %r13d, %r13d
leaq 0x1(%r14), %r12
cmpq %r12, %r13
jae 0xabf5
leaq (%r12,%r12), %rbx
movq %rbx, %rsi
movq %rdi, %r15
callq 0x2320
testq %rax, %rax
je 0xabf9
xorl %ecx, %ecx
movq %rax, %rdi
movq %rbx, %r13
jmp 0xac01
xorl %ecx, %ecx
jmp 0xac01
movb $0x1, %cl
movq %r14, %r12
movq %r15, %rdi
testb %cl, %cl
jne 0xac0b
movb $0x0, -0x1(%rdi,%r12)
leaq 0x1(%r12), %rbp
cmpq %rbp, %r13
jae 0xac37
leaq (,%rbp,2), %rbx
movq %rbx, %rsi
movq %rdi, %r14
callq 0x2320
testq %rax, %rax
je 0xac3b
xorl %ecx, %ecx
movq %rax, %rdi
movq %rbx, %r13
jmp 0xac43
xorl %ecx, %ecx
jmp 0xac43
movb $0x1, %cl
movq %r12, %rbp
movq %r14, %rdi
testb %cl, %cl
movq 0x40(%rsp), %r8
jne 0xac51
movb $0x0, -0x1(%rdi,%rbp)
movq %rdi, %r14
leaq 0x8(%rsp), %rbx
movq 0x10(%r8), %rax
movq %rsp, %rdi
movq %rbx, %rsi
testq %rax, %rax
je 0xac76
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq *%rax
jmp 0xac85
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x5296
testl %eax, %eax
jne 0xad32
cmpq $0x0, 0x8(%rsp)
je 0xad01
xorl %r12d, %r12d
movq %r14, %r8
movq (%rsp), %rax
movb (%rax,%r12), %bl
leaq 0x1(%rbp), %r14
cmpq %r14, %r13
jae 0xacd8
movq %rbp, 0x20(%rsp)
movq %r13, %rbp
leaq (%r14,%r14), %r15
movq %r8, %rdi
movq %r15, %rsi
movq %r8, %r13
callq 0x2320
testq %rax, %rax
je 0xacdf
xorl %ecx, %ecx
movq %rax, %r8
movq %r14, %rbp
movq %r15, %r13
jmp 0xacec
xorl %ecx, %ecx
movq %r14, %rbp
jmp 0xacec
movb $0x1, %cl
movq %r13, %r8
movq %rbp, %r13
movq 0x20(%rsp), %rbp
testb %cl, %cl
jne 0xacf5
movb %bl, -0x1(%r8,%rbp)
incq %r12
cmpq 0x8(%rsp), %r12
jb 0xac9b
jmp 0xad04
movq %r14, %r8
movq 0x38(%rsp), %rbx
leaq 0x8(%rbx), %rsi
leaq 0x871f(%rip), %rcx      # 0x13433
movq %rbx, %rdi
movl %ebp, %edx
movq %r8, %r14
callq 0x579a
testl %eax, %eax
jne 0xad2d
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
leaq 0x8(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq (%rsp), %rdi
callq 0x2220
movq $0x0, (%rsp)
movq %r14, %rdi
callq 0x2220
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq