// File: lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_add_itext_sized(LodePNGInfo*, char const*, char const*, char const*, char const*, unsigned long)
static unsigned lodepng_add_itext_sized(LodePNGInfo* info, const char* key, const char* langtag,
                                        const char* transkey, const char* str, size_t size) {
  char** new_keys = (char**)(lodepng_realloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1)));
  char** new_langtags = (char**)(lodepng_realloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1)));
  char** new_transkeys = (char**)(lodepng_realloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1)));
  char** new_strings = (char**)(lodepng_realloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1)));

  if(new_keys) info->itext_keys = new_keys;
  if(new_langtags) info->itext_langtags = new_langtags;
  if(new_transkeys) info->itext_transkeys = new_transkeys;
  if(new_strings) info->itext_strings = new_strings;

  if(!new_keys || !new_langtags || !new_transkeys || !new_strings) return 83; /*alloc fail*/

  ++info->itext_num;

  info->itext_keys[info->itext_num - 1] = alloc_string(key);
  info->itext_langtags[info->itext_num - 1] = alloc_string(langtag);
  info->itext_transkeys[info->itext_num - 1] = alloc_string(transkey);
  info->itext_strings[info->itext_num - 1] = alloc_string_sized(str, size);

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x5590
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x5590
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x5590
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x5590
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x616a
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
cmpq $0x0, -0x48(%rbp)
je 0x617d
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
cmpq $0x0, -0x50(%rbp)
je 0x6190
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
cmpq $0x0, -0x58(%rbp)
je 0x61a6
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
cmpq $0x0, -0x40(%rbp)
je 0x61c2
cmpq $0x0, -0x48(%rbp)
je 0x61c2
cmpq $0x0, -0x50(%rbp)
je 0x61c2
cmpq $0x0, -0x58(%rbp)
jne 0x61ce
movl $0x53, -0x4(%rbp)
jmp 0x627c
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rdi
callq 0x63e0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x60(%rcx), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rdi
callq 0x63e0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x60(%rcx), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rdi
callq 0x63e0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x60(%rcx), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x16880
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x60(%rcx), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)