// File: /workspace/github_cpp_makefile_star2_O3/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, 0x38(%rsp)
movq %rsi, %rbx
movq %rdi, 0x40(%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 0xaaa8
incq %rbx
xorl %r13d, %r13d
xorl %ecx, %ecx
xorl %edi, %edi
leaq 0x1(%rcx), %r15
cmpq %r15, %r13
jae 0xaa87
leaq (%r15,%r15), %rbp
movq %rbp, %rsi
movq %r13, 0x20(%rsp)
movq %rdi, %r13
movq %rcx, %r14
callq 0x2320
movq %r14, %rcx
movq %r13, %rdi
movq 0x20(%rsp), %r13
testq %rax, %rax
jne 0xaa8d
jmp 0xaa9b
movq %rdi, %rax
movq %r13, %rbp
movb %r12b, -0x1(%rax,%r15)
movq %rbp, %r13
movq %r15, %rcx
movq %rax, %rdi
movb (%rbx), %r12b
incq %rbx
testb %r12b, %r12b
jne 0xaa55
jmp 0xaaaf
xorl %edi, %edi
xorl %ecx, %ecx
xorl %r13d, %r13d
leaq 0x1(%rcx), %rax
cmpq %rax, %r13
jae 0xaae2
movq %rax, %r15
leaq (%rax,%rax), %rbx
movq %rbx, %rsi
movq %rdi, %r14
movq %rcx, %r12
callq 0x2320
movq %r12, %rcx
testq %rax, %rax
movq 0x28(%rsp), %rbp
jne 0xaaf0
movq %r15, %r12
movq %rcx, %r15
jmp 0xab01
movq %rax, %r15
movq %rdi, %rax
movq %r13, %rbx
movq 0x28(%rsp), %rbp
movb $0x0, (%rax,%rcx)
addq $0x2, %rcx
movq %rcx, %r12
movq %rbx, %r13
movq %rax, %r14
cmpq %r12, %r13
jae 0xab26
leaq (%r12,%r12), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2320
testq %rax, %rax
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %rdx
jne 0xab36
jmp 0xab45
movq %r14, %rax
movq %r13, %rbx
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %rdx
movb $0x0, -0x1(%rax,%r12)
movq %rbx, %r13
movq %r12, %r15
movq %rax, %r14
leaq 0x8(%rsp), %rbx
movq 0x10(%r8), %rax
movq %rsp, %rdi
movq %rbx, %rsi
movq %rbp, %rcx
testq %rax, %rax
je 0xab60
callq *%rax
jmp 0xab65
callq 0x5460
testl %eax, %eax
jne 0xac0a
movq %r15, %rdx
cmpq $0x0, 0x8(%rsp)
je 0xabdb
xorl %r12d, %r12d
movq %r14, %r8
movq (%rsp), %rax
movb (%rax,%r12), %bl
leaq 0x1(%rdx), %r14
cmpq %r14, %r13
jae 0xabbb
leaq (%r14,%r14), %r15
movq %r8, %rdi
movq %r15, %rsi
movq %rdx, 0x20(%rsp)
movq %r13, %rbp
movq %r8, %r13
callq 0x2320
movq %r13, %r8
movq %rbp, %r13
movq 0x20(%rsp), %rdx
testq %rax, %rax
jne 0xabc1
jmp 0xabcf
movq %r8, %rax
movq %r13, %r15
movb %bl, -0x1(%rax,%r14)
movq %r15, %r13
movq %r14, %rdx
movq %rax, %r8
incq %r12
cmpq 0x8(%rsp), %r12
jb 0xab7e
jmp 0xabde
movq %r14, %r8
movq 0x40(%rsp), %rbx
leaq 0x8(%rbx), %rsi
leaq 0x8915(%rip), %rcx      # 0x13503
movq %rbx, %rdi
movq %r8, %r14
callq 0x5951
testl %eax, %eax
jne 0xac05
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