// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_tRNS(ucvector*, LodePNG_InfoColor const*)
static unsigned addChunk_tRNS(ucvector* out, const LodePNG_InfoColor* info)
{
  unsigned error = 0;
  size_t i;
  ucvector tRNS;
  ucvector_init(&tRNS);
  if(info->colorType == 3)
  {
    for(i = 0; i < info->palettesize; i++) ucvector_push_back(&tRNS, info->palette[4 * i + 3]); /*add only alpha channel*/
  }
  else if(info->colorType == 0)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256));
    }
  }
  else if(info->colorType == 2)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g % 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b % 256));
    }
  }
  
  error = addChunk(out, "tRNS", tRNS.data, tRNS.size);
  ucvector_cleanup(&tRNS);
  
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x25960
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x2af10
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2af0b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x2, %rcx
leaq -0x38(%rbp), %rdi
movzbl 0x3(%rax,%rcx), %esi
callq 0x25570
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x2aed1
jmp 0x2b001
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x2af56
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x2af51
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
jmp 0x2afff
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x2affd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x2affb
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x25570
jmp 0x2affd
jmp 0x2afff
jmp 0x2b001
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x20b4e(%rip), %rsi     # 0x4bb62
callq 0x31760
movl %eax, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x25990
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop