// File: /workspace/github_cpp_makefile_star2_O1/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addChunk_bKGD(ucvector*, LodePNGInfo const*)
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 >> 8));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r & 255));
  }
  else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA)
  {
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r >> 8));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r & 255));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_g >> 8));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_g & 255));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_b >> 8));
    ucvector_push_back(&bKGD, (unsigned char)(info->background_b & 255));
  }
  else if(info->color.colortype == LCT_PALETTE)
  {
    ucvector_push_back(&bKGD, (unsigned char)(info->background_r & 255)); /*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 0xc44b
leaq 0x53e5(%rip), %rcx      # 0x115ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%rsi), %ebx
movl $0x1, %r15d
movl $0x1, %edi
callq 0x21e0
movq %rax, %rbp
testq %rax, %rax
je 0xc2c1
movb %bh, (%rbp)
jmp 0xc2c4
movq %rsi, 0x8(%rsp)
movl 0x3c(%rsi), %ebx
movl $0x1, %r14d
movl $0x1, %edi
callq 0x21e0
movq %rax, %rbp
xorl %r13d, %r13d
testq %rax, %rax
setne %r13b
movq %r12, 0x10(%rsp)
je 0xc28f
movb %bh, (%rbp)
jmp 0xc292
movl 0x3c(%rsi), %ebx
movl $0x1, %r15d
movl $0x1, %edi
callq 0x21e0
movq %rax, %rbp
testq %rax, %rax
je 0xc448
movb %bl, (%rbp)
jmp 0xc44b
xorl %r14d, %r14d
movl %ebx, %eax
leaq 0x1(%r14), %r12
cmpq %r13, %r14
jae 0xc2a1
xorl %ecx, %ecx
jmp 0xc2ef
movl %eax, %ebx
leaq (%r12,%r14), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2260
testq %rax, %rax
je 0xc2eb
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0xc2ed
xorl %r15d, %r15d
leaq 0x1(%r15,%r15), %rsi
movq %rbp, %rdi
callq 0x2260
testq %rax, %rax
cmovneq %rax, %rbp
je 0xc44b
incq %r15
movb %bl, -0x1(%rbp,%r15)
jmp 0xc44b
movb $0x1, %cl
movl %ebx, %eax
movq 0x8(%rsp), %rbx
testb %cl, %cl
jne 0xc300
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x41(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r14d, %r13d
jbe 0xc310
xorl %ecx, %ecx
jmp 0xc34b
movb %al, 0x8(%rsp)
leal (%r13,%r13), %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 0x2260
testq %rax, %rax
je 0xc345
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0xc347
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0xc357
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x40(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r14d, %r13d
jbe 0xc367
xorl %ecx, %ecx
jmp 0xc3a2
movb %al, 0x8(%rsp)
leal (%r13,%r13), %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 0x2260
testq %rax, %rax
je 0xc39c
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0xc39e
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0xc3ae
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x45(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r12d, %r13d
jae 0xc3eb
movb %al, 0x8(%rsp)
leal (%r13,%r13), %eax
leal (%r12,%r12,2), %r15d
shrl %r15d
cmpl %r12d, %eax
cmovbq %r12, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2260
testq %rax, %rax
je 0xc3ef
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0xc3f1
xorl %ecx, %ecx
jmp 0xc3f5
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0xc401
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x44(%rbx), %bl
leaq 0x1(%r14), %r15
cmpl %r15d, %r13d
jae 0xc431
addl %r13d, %r13d
leal (%r15,%r15,2), %esi
shrl %esi
cmpl %r15d, %r13d
cmovbq %r15, %rsi
movq %rbp, %rdi
callq 0x2260
testq %rax, %rax
sete %cl
cmovneq %rax, %rbp
jmp 0xc433
xorl %ecx, %ecx
movq 0x10(%rsp), %r12
testb %cl, %cl
je 0xc441
movq %r14, %r15
jmp 0xc44b
movb %bl, -0x1(%rbp,%r15)
jmp 0xc44b
xorl %r15d, %r15d
leaq 0x8(%r12), %rsi
leaq 0x6db0(%rip), %rcx      # 0x13207
movq %r12, %rdi
movl %r15d, %edx
movq %rbp, %r8
callq 0x74cd
testl %eax, %eax
jne 0xc473
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 0x21b0