// File: drummyfish[P]flowchart/src/lodepng.cpp
// Function: lodepng_add_itext(LodePNGInfo*, char const*, char const*, char const*, char const*)
unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag,
                           const char* transkey, const char* str)
{
  char** new_keys = (char**)(myrealloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1)));
  char** new_langtags = (char**)(myrealloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1)));
  char** new_transkeys = (char**)(myrealloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1)));
  char** new_strings = (char**)(myrealloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1)));
  if(!new_keys || !new_langtags || !new_transkeys || !new_strings)
  {
    myfree(new_keys);
    myfree(new_langtags);
    myfree(new_transkeys);
    myfree(new_strings);
    return 83; /*alloc fail*/
  }

  info->itext_num++;
  info->itext_keys = new_keys;
  info->itext_langtags = new_langtags;
  info->itext_transkeys = new_transkeys;
  info->itext_strings = new_strings;

  string_init(&info->itext_keys[info->itext_num - 1]);
  string_set(&info->itext_keys[info->itext_num - 1], key);

  string_init(&info->itext_langtags[info->itext_num - 1]);
  string_set(&info->itext_langtags[info->itext_num - 1], langtag);

  string_init(&info->itext_transkeys[info->itext_num - 1]);
  string_set(&info->itext_transkeys[info->itext_num - 1], transkey);

  string_init(&info->itext_strings[info->itext_num - 1]);
  string_set(&info->itext_strings[info->itext_num - 1], str);

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x4ed0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x4ed0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x4ed0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x4ed0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x59ef
cmpq $0x0, -0x40(%rbp)
je 0x59ef
cmpq $0x0, -0x48(%rbp)
je 0x59ef
cmpq $0x0, -0x50(%rbp)
jne 0x5a1f
movq -0x38(%rbp), %rdi
callq 0x4050
movq -0x40(%rbp), %rdi
callq 0x4050
movq -0x48(%rbp), %rdi
callq 0x4050
movq -0x50(%rbp), %rdi
callq 0x4050
movl $0x53, -0x4(%rbp)
jmp 0x5b7f
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x5790
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x57c0
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x5790
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x57c0
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x5790
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x57c0
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x5790
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x57c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)