// File: /workspace/github_c_makefile_star2_O0/pje[P]pixelsort/lodepng.c
// Function: addChunk_tRNS
static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info)
{
  unsigned error = 0;
  size_t i;
  ucvector tRNS;
  ucvector_init(&tRNS);
  if(info->colortype == LCT_PALETTE)
  {
    size_t amount = info->palettesize;
    /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/
    for(i = info->palettesize; i > 0; i--)
    {
      if(info->palette[4 * (i - 1) + 3] == 255) amount--;
      else break;
    }
    /*add only alpha channel*/
    for(i = 0; i < amount; i++) ucvector_push_back(&tRNS, info->palette[4 * i + 3]);
  }
  else if(info->colortype == LCT_GREY)
  {
    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 == LCT_RGB)
  {
    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 0x8620
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x8aef
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jbe 0x8aac
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
shlq $0x2, %rcx
movzbl 0x3(%rax,%rcx), %eax
cmpl $0xff, %eax
jne 0x8a9a
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x8a9c
jmp 0x8aac
jmp 0x8a9e
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8a65
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x8aea
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 0x22d0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8ab4
jmp 0x8be0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x8b35
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x8b30
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
jmp 0x8bde
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x8bdc
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x8bda
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
shrl $0x8, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
andl $0xff, %eax
leaq -0x38(%rbp), %rdi
movzbl %al, %esi
callq 0x22d0
jmp 0x8bdc
jmp 0x8bde
jmp 0x8be0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0xb77c(%rip), %rsi      # 0x1436f
callq 0x11050
movl %eax, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xe800
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)