// File: /workspace/github_c_makefile_star2_O1/pje[P]pixelsort/lodepng.c
// Function: addChunk_bKGD
static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info)
{
  unsigned error = 0;
  ucvector bKGD;
  ucvector_init(&bKGD);
  if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA)
  {
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r / 256));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256));
  }
  else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA)
  {
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r / 256));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_g / 256));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_g % 256));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_b / 256));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_b % 256));
  }
  else if(info->color.colortype == LCT_PALETTE)
  {
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); /*palette index*/
  }

  error = addChunk(out, "bKGD", bKGD.data, bKGD.size);
  ucvector_cleanup(&bKGD);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
movl 0x10(%rsi), %eax
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq $0x6, %rax
ja 0x9063
leaq 0x52e5(%rip), %rcx      # 0xe0f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%rsi), %ebx
movl $0x1, %r15d
movl $0x1, %edi
callq 0x1130
movq %rax, %rbp
testq %rax, %rax
je 0x8ecd
movb %bh, (%rbp)
jmp 0x8ed0
movq %rsi, 0x8(%rsp)
movl 0x3c(%rsi), %ebx
movl $0x1, %r14d
movl $0x1, %edi
callq 0x1130
movq %rax, %rbp
xorl %r13d, %r13d
testq %rax, %rax
setne %r13b
movq %r12, 0x10(%rsp)
je 0x8e9b
movb %bh, (%rbp)
jmp 0x8e9e
movl 0x3c(%rsi), %ebx
movl $0x1, %r15d
movl $0x1, %edi
callq 0x1130
movq %rax, %rbp
testq %rax, %rax
je 0x9060
movb %bl, (%rbp)
jmp 0x9063
xorl %r14d, %r14d
movl %ebx, %eax
leaq 0x1(%r14), %r12
cmpq %r13, %r14
jae 0x8ead
xorl %ecx, %ecx
jmp 0x8efe
movl %eax, %ebx
leaq (%r12,%r14), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1150
testq %rax, %rax
je 0x8efa
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x8efc
xorl %r15d, %r15d
leaq 0x1(,%r15,2), %rsi
movq %rbp, %rdi
callq 0x1150
testq %rax, %rax
cmovneq %rax, %rbp
je 0x9063
incq %r15
movb %bl, -0x1(%rbp,%r15)
jmp 0x9063
movb $0x1, %cl
movl %ebx, %eax
movq 0x8(%rsp), %rbx
testb %cl, %cl
jne 0x8f0f
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x41(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r14d, %r13d
jbe 0x8f1f
xorl %ecx, %ecx
jmp 0x8f5d
movb %al, 0x8(%rsp)
leal (,%r13,2), %eax
movl %r12d, %ecx
shrl %ecx
xorl %r15d, %r15d
cmpl %r14d, %eax
cmovaq %rcx, %r15
addq %r12, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1150
testq %rax, %rax
je 0x8f57
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x8f59
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0x8f69
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x40(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r14d, %r13d
jbe 0x8f79
xorl %ecx, %ecx
jmp 0x8fb7
movb %al, 0x8(%rsp)
leal (,%r13,2), %eax
movl %r12d, %ecx
shrl %ecx
xorl %r15d, %r15d
cmpl %r14d, %eax
cmovaq %rcx, %r15
addq %r12, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1150
testq %rax, %rax
je 0x8fb1
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x8fb3
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0x8fc3
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x45(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r12d, %r13d
jae 0x9003
movb %al, 0x8(%rsp)
leal (,%r13,2), %eax
leal (%r12,%r12,2), %r15d
shrl %r15d
cmpl %r12d, %eax
cmovbq %r12, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1150
testq %rax, %rax
je 0x9007
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x9009
xorl %ecx, %ecx
jmp 0x900d
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0x9019
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x44(%rbx), %bl
leaq 0x1(%r14), %r15
cmpl %r15d, %r13d
jae 0x9049
addl %r13d, %r13d
leal (%r15,%r15,2), %esi
shrl %esi
cmpl %r15d, %r13d
cmovbq %r15, %rsi
movq %rbp, %rdi
callq 0x1150
testq %rax, %rax
sete %cl
cmovneq %rax, %rbp
jmp 0x904b
xorl %ecx, %ecx
movq 0x10(%rsp), %r12
testb %cl, %cl
je 0x9059
movq %r14, %r15
jmp 0x9063
movb %bl, -0x1(%rbp,%r15)
jmp 0x9063
xorl %r15d, %r15d
leaq 0x8(%r12), %rsi
leaq 0x6841(%rip), %rcx      # 0xf8b0
movq %r12, %rdi
movl %r15d, %edx
movq %rbp, %r8
callq 0x4237
testl %eax, %eax
jne 0x908b
movq 0x8(%r12), %rax
movq %rax, 0x10(%r12)
movq %rbp, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030