// File: /workspace/github_cpp_makefile_star2_O1/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, -0x70(%rbp)
movq %rcx, -0x48(%rbp)
movq %rdx, %rbx
movl %esi, -0x4c(%rbp)
movq %rdi, -0x58(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq %r9, -0x40(%rbp)
movq %r9, %rdi
callq 0x5120
movq %rax, -0x60(%rbp)
movb (%rbx), %r12b
testb %r12b, %r12b
je 0x2214d
incq %rbx
xorl %esi, %esi
xorl %r13d, %r13d
xorl %r8d, %r8d
leaq 0x1(%r13), %r15
leaq 0x4(,%r13,4), %rax
cmpq %rsi, %rax
jbe 0x22126
movq %rsi, -0x30(%rbp)
leaq (,%r15,8), %r14
movq %r8, %rdi
movq %r14, %rsi
movq %r8, -0x38(%rbp)
callq 0x5500
testq %rax, %rax
je 0x2212d
xorl %ecx, %ecx
movq %rax, %r8
movq %r15, %r13
movq %r14, %rsi
jmp 0x22137
xorl %ecx, %ecx
movq %r15, %r13
jmp 0x22137
movb $0x1, %cl
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rsi
testb %cl, %cl
jne 0x22140
movb %r12b, -0x1(%r8,%r13)
movb (%rbx), %r12b
incq %rbx
testb %r12b, %r12b
jne 0x220e8
jmp 0x22155
xorl %r8d, %r8d
xorl %r13d, %r13d
xorl %esi, %esi
leaq 0x1(%r13), %r14
leaq 0x4(,%r13,4), %rax
cmpq %rsi, %rax
jbe 0x2218e
movq %rsi, %r12
leaq (,%r14,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, %r15
callq 0x5500
testq %rax, %rax
je 0x22192
xorl %ecx, %ecx
movq %rax, %r8
movq %rbx, %rsi
jmp 0x2219d
xorl %ecx, %ecx
jmp 0x2219d
movb $0x1, %cl
movq %r13, %r14
movq %r15, %r8
movq %r12, %rsi
testb %cl, %cl
movq -0x48(%rbp), %r13
jne 0x221ab
movb $0x0, -0x1(%r8,%r14)
cmpl $0x0, -0x4c(%rbp)
setne %r12b
leaq 0x1(%r14), %r15
leaq 0x4(,%r14,4), %rax
cmpq %rsi, %rax
jbe 0x221ed
movq %rsi, -0x30(%rbp)
leaq (,%r15,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, %r13
callq 0x5500
testq %rax, %rax
je 0x221f1
xorl %ecx, %ecx
movq %rax, %r8
movq %rbx, %rsi
jmp 0x221fd
xorl %ecx, %ecx
jmp 0x22201
movb $0x1, %cl
movq %r14, %r15
movq %r13, %r8
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %r13
testb %cl, %cl
jne 0x2220a
movb %r12b, -0x1(%r8,%r15)
leaq 0x1(%r15), %r14
leaq 0x4(,%r15,4), %rax
cmpq %rsi, %rax
jbe 0x22243
movq %rsi, %r13
leaq (,%r14,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, %r12
callq 0x5500
testq %rax, %rax
je 0x22247
xorl %ecx, %ecx
movq %rax, %r8
movq %rbx, %rsi
jmp 0x22252
xorl %ecx, %ecx
jmp 0x22256
movb $0x1, %cl
movq %r15, %r14
movq %r12, %r8
movq %r13, %rsi
movq -0x48(%rbp), %r13
testb %cl, %cl
jne 0x22260
movb $0x0, -0x1(%r8,%r14)
movb (%r13), %r15b
testb %r15b, %r15b
je 0x222d0
incq %r13
leaq 0x1(%r14), %r12
leaq 0x4(,%r14,4), %rax
cmpq %rsi, %rax
jbe 0x222aa
movq %rsi, -0x30(%rbp)
leaq (,%r12,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x38(%rbp)
callq 0x5500
testq %rax, %rax
je 0x222b1
xorl %ecx, %ecx
movq %rax, %r8
movq %r12, %r14
movq %rbx, %rsi
jmp 0x222bb
xorl %ecx, %ecx
movq %r12, %r14
jmp 0x222bb
movb $0x1, %cl
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rsi
testb %cl, %cl
jne 0x222c4
movb %r15b, -0x1(%r8,%r14)
movb (%r13), %r15b
incq %r13
testb %r15b, %r15b
jne 0x2226c
leaq 0x1(%r14), %r13
leaq 0x4(,%r14,4), %rax
cmpq %rsi, %rax
jbe 0x22309
movq %rsi, %r12
leaq (,%r13,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, %r15
callq 0x5500
testq %rax, %rax
je 0x2230d
xorl %ecx, %ecx
movq %rax, %r8
movq %rbx, %rsi
jmp 0x22318
xorl %ecx, %ecx
jmp 0x22318
movb $0x1, %cl
movq %r14, %r13
movq %r15, %r8
movq %r12, %rsi
testb %cl, %cl
movq -0x70(%rbp), %r12
jne 0x22326
movb $0x0, -0x1(%r8,%r13)
movb (%r12), %r14b
testb %r14b, %r14b
je 0x22396
incq %r12
leaq 0x1(%r13), %r15
leaq 0x4(,%r13,4), %rax
cmpq %rsi, %rax
jbe 0x22370
movq %rsi, -0x30(%rbp)
leaq (,%r15,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x38(%rbp)
callq 0x5500
testq %rax, %rax
je 0x22377
xorl %ecx, %ecx
movq %rax, %r8
movq %r15, %r13
movq %rbx, %rsi
jmp 0x22381
xorl %ecx, %ecx
movq %r15, %r13
jmp 0x22381
movb $0x1, %cl
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rsi
testb %cl, %cl
jne 0x2238a
movb %r14b, -0x1(%r8,%r13)
movb (%r12), %r14b
incq %r12
testb %r14b, %r14b
jne 0x22332
leaq 0x1(%r13), %r12
leaq 0x4(,%r13,4), %rax
cmpq %rsi, %rax
jbe 0x223cf
movq %rsi, %r15
leaq (,%r12,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, %r14
callq 0x5500
testq %rax, %rax
je 0x223d3
xorl %ecx, %ecx
movq %rax, %r8
movq %rbx, %rsi
jmp 0x223de
xorl %ecx, %ecx
jmp 0x223de
movb $0x1, %cl
movq %r13, %r12
movq %r14, %r8
movq %r15, %rsi
testb %cl, %cl
jne 0x223e8
movb $0x0, -0x1(%r8,%r12)
cmpl $0x0, -0x4c(%rbp)
je 0x22434
movq %rsi, %r15
movq %r8, %rbx
xorps %xmm0, %xmm0
leaq -0x88(%rbp), %rsi
movaps %xmm0, -0x8(%rsi)
movq $0x0, 0x8(%rsi)
leaq -0x90(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %r8
callq 0x1cf1d
testl %eax, %eax
je 0x224b9
xorl %eax, %eax
movq %rbx, %r8
jmp 0x225cc
movq -0x40(%rbp), %rdx
movb (%rdx), %r15b
testb %r15b, %r15b
je 0x225ca
incq %rdx
leaq 0x1(%r12), %r13
leaq 0x4(,%r12,4), %rax
cmpq %rsi, %rax
jbe 0x2248c
movq %rsi, -0x30(%rbp)
movq %rdx, %r14
leaq (,%r13,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x38(%rbp)
callq 0x5500
testq %rax, %rax
je 0x22493
xorl %ecx, %ecx
movq %rax, %r8
movq %r13, %r12
movq %rbx, %rsi
movq %r14, %rdx
jmp 0x224a0
xorl %ecx, %ecx
movq %r13, %r12
jmp 0x224a0
movb $0x1, %cl
movq %r14, %rdx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rsi
testb %cl, %cl
jne 0x224a9
movb %r15b, -0x1(%r8,%r12)
movb (%rdx), %r15b
incq %rdx
testb %r15b, %r15b
jne 0x22447
jmp 0x225ca
cmpq $0x0, -0x88(%rbp)
je 0x2254b
xorl %r14d, %r14d
movq -0x40(%rbp), %rdx
movq %rbx, %r8
movq %r15, %rbx
movq -0x90(%rbp), %rax
movb (%rax,%r14), %r15b
leaq 0x1(%r12), %r13
leaq 0x4(,%r12,4), %rax
cmpq %rbx, %rax
jbe 0x2251f
movq %rbx, -0x30(%rbp)
leaq (,%r13,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x38(%rbp)
callq 0x5500
testq %rax, %rax
je 0x22526
xorl %ecx, %ecx
movq %rax, %r8
movq %r13, %r12
movq -0x40(%rbp), %rdx
jmp 0x22534
xorl %ecx, %ecx
movq %r13, %r12
jmp 0x22534
movb $0x1, %cl
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rbx
testb %cl, %cl
jne 0x2253d
movb %r15b, -0x1(%r8,%r12)
incq %r14
cmpq -0x88(%rbp), %r14
jb 0x224d4
jmp 0x22555
movq -0x40(%rbp), %rdx
movq %rbx, %r8
movq %r15, %rbx
movb (%rdx), %r15b
testb %r15b, %r15b
je 0x225ca
incq %rdx
leaq 0x1(%r12), %r13
leaq 0x4(,%r12,4), %rax
cmpq %rbx, %rax
jbe 0x225a2
movq %rbx, -0x30(%rbp)
movq %rdx, %r14
leaq (,%r13,8), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r8, -0x38(%rbp)
callq 0x5500
testq %rax, %rax
je 0x225a9
xorl %ecx, %ecx
movq %rax, %r8
movq %r13, %r12
movq %r14, %rdx
jmp 0x225b6
xorl %ecx, %ecx
movq %r13, %r12
jmp 0x225b6
movb $0x1, %cl
movq %r14, %rdx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rbx
testb %cl, %cl
jne 0x225bf
movb %r15b, -0x1(%r8,%r12)
movb (%rdx), %r15b
incq %rdx
testb %r15b, %r15b
jne 0x22560
movb $0x1, %al
testb %al, %al
je 0x225fd
movq -0x58(%rbp), %rdi
leaq 0x8(%rdi), %rsi
leaq 0xf5f3(%rip), %rcx      # 0x31bd2
movl %r12d, %edx
movq %r8, %rbx
callq 0x1d440
movq %rbx, %r8
testl %eax, %eax
jne 0x225fd
movq -0x58(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, 0x10(%rcx)
movq %r8, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5390