// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_iTXt(ucvector*, unsigned int, char const*, char const*, char const*, char const*, LodeZlib_DeflateSettings*)
static unsigned addChunk_iTXt(ucvector* out, unsigned compressed, const char* keyword, const char* langtag, const char* transkey, const char* textstring, LodeZlib_DeflateSettings* zlibsettings)
{
  unsigned error = 0;
  ucvector data, compressed_data;
  size_t i, textsize = strlen(textstring);
  
  ucvector_init(&data);
  
  for(i = 0; keyword[i] != 0; i++) ucvector_push_back(&data, (unsigned char)keyword[i]);
  ucvector_push_back(&data, 0); /*null termination char*/
  ucvector_push_back(&data, compressed ? 1 : 0); /*compression flag*/
  ucvector_push_back(&data, 0); /*compression method*/
  for(i = 0; langtag[i] != 0; i++) ucvector_push_back(&data, (unsigned char)langtag[i]);
  ucvector_push_back(&data, 0); /*null termination char*/
  for(i = 0; transkey[i] != 0; i++) ucvector_push_back(&data, (unsigned char)transkey[i]);
  ucvector_push_back(&data, 0); /*null termination char*/
    
  if(compressed)
  {
    ucvector_init(&compressed_data);
    error = LodePNG_compress(&compressed_data.data, &compressed_data.size, (unsigned char*)textstring, textsize, zlibsettings);
    if(!error)
    {
      for(i = 0; i < compressed_data.size; i++) ucvector_push_back(&data, compressed_data.data[i]);
      for(i = 0; textstring[i] != 0; i++) ucvector_push_back(&data, (unsigned char)textstring[i]);
    }
  }
  else /*not compressed*/
  {
    for(i = 0; textstring[i] != 0; i++) ucvector_push_back(&data, (unsigned char)textstring[i]);
  }
  
  if(!error) error = addChunk(out, "iTXt", data.data, data.size);
  ucvector_cleanup(&data);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, -0x58(%rbp)
movq %rcx, -0x50(%rbp)
movq %rdx, %r12
movl %esi, -0x3c(%rbp)
movq %rdi, -0x60(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %r9, -0x48(%rbp)
movq %r9, %rdi
callq 0x4120
movq %rax, -0x68(%rbp)
movb (%r12), %bl
testb %bl, %bl
je 0x20e3a
incq %r12
xorl %ecx, %ecx
xorl %r13d, %r13d
xorl %edi, %edi
leaq 0x1(%r13), %r15
leaq 0x4(,%r13,4), %rax
cmpq %rcx, %rax
jbe 0x20e19
leaq (,%r15,8), %r14
movq %r14, %rsi
movq %rdi, -0x30(%rbp)
movq %r13, -0x38(%rbp)
movq %rcx, %r13
callq 0x44f0
movq %r13, %rcx
movq -0x38(%rbp), %r13
movq -0x30(%rbp), %rdi
testq %rax, %rax
jne 0x20e1f
jmp 0x20e2d
movq %rdi, %rax
movq %rcx, %r14
movb %bl, -0x1(%rax,%r15)
movq %r14, %rcx
movq %r15, %r13
movq %rax, %rdi
movb (%r12), %bl
incq %r12
testb %bl, %bl
jne 0x20ddb
jmp 0x20e41
xorl %edi, %edi
xorl %r13d, %r13d
xorl %ecx, %ecx
leaq 0x1(%r13), %r12
leaq 0x4(,%r13,4), %r14
cmpq %rcx, %r14
jbe 0x20e7b
movq %rcx, -0x30(%rbp)
leaq (,%r12,8), %r15
movq %r15, %rsi
movq %rdi, %rbx
callq 0x44f0
testq %rax, %rax
jne 0x20e81
movq %r13, -0x38(%rbp)
movq %rbx, %rdi
movq -0x30(%rbp), %r15
jmp 0x20e9c
movq %rdi, %rax
movq %rcx, %r15
movq %r12, -0x38(%rbp)
movb $0x0, (%rax,%r13)
leaq 0x8(,%r13,4), %r14
addq $0x2, %r13
movq %r13, %r12
movq %rax, %rdi
cmpl $0x0, -0x3c(%rbp)
setne %bl
cmpq %r15, %r14
jbe 0x20ed4
movq %r15, %r13
leaq (,%r12,8), %r15
movq %r15, %rsi
movq %rdi, -0x30(%rbp)
callq 0x44f0
testq %rax, %rax
jne 0x20ed7
movq %r12, %rbx
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rdi
movq %r13, %rcx
jmp 0x20eef
movq %rdi, %rax
movb %bl, -0x1(%rax,%r12)
leaq 0x1(%r12), %rbx
leaq 0x4(,%r12,4), %r14
movq %r15, %rcx
movq %rax, %rdi
cmpq %rcx, %r14
jbe 0x20f1b
leaq (,%rbx,8), %r14
movq %r14, %rsi
movq %rdi, %r15
movq %rcx, %r13
callq 0x44f0
movq %r13, %rcx
movq %r15, %rdi
testq %rax, %rax
movq -0x50(%rbp), %r13
jne 0x20f25
jmp 0x20f33
movq %rdi, %rax
movq %rcx, %r14
movq -0x50(%rbp), %r13
movb $0x0, -0x1(%rax,%rbx)
movq %r14, %rcx
movq %rbx, %r12
movq %rax, %rdi
movb (%r13), %bl
testb %bl, %bl
je 0x20f9c
incq %r13
leaq 0x1(%r12), %r15
leaq 0x4(,%r12,4), %rax
cmpq %rcx, %rax
jbe 0x20f7d
leaq (,%r15,8), %r14
movq %r14, %rsi
movq %rdi, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq %rcx, %r12
callq 0x44f0
movq %r12, %rcx
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rdi
testq %rax, %rax
jne 0x20f83
jmp 0x20f91
movq %rdi, %rax
movq %rcx, %r14
movb %bl, -0x1(%rax,%r15)
movq %r14, %rcx
movq %r15, %r12
movq %rax, %rdi
movb (%r13), %bl
incq %r13
testb %bl, %bl
jne 0x20f3e
leaq 0x1(%r12), %rbx
leaq 0x4(,%r12,4), %rax
cmpq %rcx, %rax
jbe 0x20fdb
leaq (,%rbx,8), %r14
movq %r14, %rsi
movq %rdi, %r15
movq %r12, %r13
movq %rcx, %r12
callq 0x44f0
movq %r12, %rcx
movq %r13, %rdx
movq %r15, %rdi
testq %rax, %rax
movq -0x58(%rbp), %r13
jne 0x20fe5
jmp 0x20ff3
movq %rdi, %rax
movq %rcx, %r14
movq -0x58(%rbp), %r13
movb $0x0, -0x1(%rax,%rbx)
movq %r14, %rcx
movq %rbx, %rdx
movq %rax, %rdi
movb (%r13), %bl
testb %bl, %bl
je 0x2105b
incq %r13
leaq 0x1(%rdx), %r15
leaq 0x4(,%rdx,4), %rax
cmpq %rcx, %rax
jbe 0x2103c
leaq (,%r15,8), %r14
movq %r14, %rsi
movq %rdi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq %rcx, %r12
callq 0x44f0
movq %r12, %rcx
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rdi
testq %rax, %rax
jne 0x21042
jmp 0x21050
movq %rdi, %rax
movq %rcx, %r14
movb %bl, -0x1(%rax,%r15)
movq %r14, %rcx
movq %r15, %rdx
movq %rax, %rdi
movb (%r13), %bl
incq %r13
testb %bl, %bl
jne 0x20ffe
leaq 0x1(%rdx), %r14
leaq 0x4(,%rdx,4), %rax
cmpq %rcx, %rax
jbe 0x21099
leaq (,%r14,8), %rbx
movq %rbx, %rsi
movq %rdi, %r15
movq %rdx, %r13
movq %rcx, %r12
callq 0x44f0
movq %r12, %rcx
movq %r13, %r12
movq %r15, %r8
testq %rax, %rax
movq -0x48(%rbp), %r13
jne 0x210a3
jmp 0x210b2
movq %rdi, %rax
movq %rcx, %rbx
movq -0x48(%rbp), %r13
movb $0x0, -0x1(%rax,%r14)
movq %rbx, %rcx
movq %r14, %r12
movq %rax, %r8
cmpl $0x0, -0x3c(%rbp)
je 0x210f7
movq %rcx, %r14
movq %r8, %rbx
xorps %xmm0, %xmm0
leaq -0x88(%rbp), %rsi
movaps %xmm0, -0x8(%rsi)
movq $0x0, 0x8(%rsi)
leaq -0x90(%rbp), %rdi
movq %r13, %rdx
movq -0x68(%rbp), %rcx
movq -0x70(%rbp), %r8
callq 0x1be80
testl %eax, %eax
je 0x2116e
movq %rbx, %rdi
jmp 0x21299
movb (%r13), %r14b
testb %r14b, %r14b
je 0x2126d
incq %r13
leaq 0x1(%r12), %r15
leaq 0x4(,%r12,4), %rax
cmpq %rcx, %rax
jbe 0x21149
leaq (,%r15,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq %rcx, %r12
callq 0x44f0
movq %r12, %rcx
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %r8
testq %rax, %rax
jne 0x2114f
jmp 0x2115d
movq %r8, %rax
movq %rcx, %rbx
movb %r14b, -0x1(%rax,%r15)
movq %rbx, %rcx
movq %r15, %r12
movq %rax, %r8
movb (%r13), %r14b
incq %r13
testb %r14b, %r14b
jne 0x21107
jmp 0x2126d
movq -0x88(%rbp), %r15
testq %r15, %r15
movq %rbx, %r8
movq %r14, %rcx
je 0x211fb
xorl %r14d, %r14d
movq -0x90(%rbp), %rax
movb (%rax,%r14), %sil
leaq 0x1(%r12), %r13
leaq 0x4(,%r12,4), %rax
cmpq %rcx, %rax
jbe 0x211d8
leaq (,%r13,8), %rbx
movq %r8, %rdi
movb %sil, -0x3c(%rbp)
movq %rbx, %rsi
movq %r8, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq %rcx, %r12
callq 0x44f0
movb -0x3c(%rbp), %sil
movq %r12, %rcx
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %r8
testq %rax, %rax
jne 0x211de
jmp 0x211f3
movq %r8, %rax
movq %rcx, %rbx
movb %sil, -0x1(%rax,%r13)
movq -0x88(%rbp), %r15
movq %rbx, %rcx
movq %r13, %r12
movq %rax, %r8
incq %r14
cmpq %r15, %r14
jb 0x21183
movq -0x48(%rbp), %r13
movb (%r13), %r14b
testb %r14b, %r14b
je 0x2126d
incq %r13
leaq 0x1(%r12), %r15
leaq 0x4(,%r12,4), %rax
cmpq %rcx, %rax
jbe 0x2124d
leaq (,%r15,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq %rcx, %r12
callq 0x44f0
movq %r12, %rcx
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %r8
testq %rax, %rax
jne 0x21253
jmp 0x21261
movq %r8, %rax
movq %rcx, %rbx
movb %r14b, -0x1(%rax,%r15)
movq %rbx, %rcx
movq %r15, %r12
movq %rax, %r8
movb (%r13), %r14b
incq %r13
testb %r14b, %r14b
jne 0x2120b
movq -0x60(%rbp), %rbx
leaq 0x8(%rbx), %rsi
leaq 0xf966(%rip), %rcx      # 0x30be2
movq %rbx, %rdi
movl %r12d, %edx
movq %r8, %r14
callq 0x1c3c3
testl %eax, %eax
jne 0x21296
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4380