// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movl 0x10(%rsi), %eax
movq %rdi, %r12
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq $0x6, %rax
ja 0xc472
leaq 0x544d(%rip), %rcx      # 0x1162c
movq %rsi, %r15
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%r15), %ebx
movl $0x1, %edi
movl $0x1, %r14d
callq 0x21e0
movq %rax, %rbp
testq %rax, %rax
je 0xc425
movl %ebx, %r15d
movb %bh, (%rbp)
movl $0x1, %ebx
movl $0x2, %r14d
jmp 0xc42a
movl 0x3c(%r15), %ebx
movl $0x1, %edi
movl $0x1, %r13d
callq 0x21e0
movq %r12, 0x18(%rsp)
movq %rax, %rbp
movl %ebx, 0x8(%rsp)
testq %rax, %rax
je 0xc27e
movl $0x1, %r14d
movl $0x2, %r13d
movb %bh, (%rbp)
jmp 0xc281
movl 0x3c(%r15), %r14d
movl $0x1, %edi
movl $0x1, %ebx
callq 0x21e0
testq %rax, %rax
je 0xc46e
movq %rax, %rbp
movb %r14b, (%rax)
jmp 0xc472
xorl %r14d, %r14d
leal (%r14,%r14), %eax
movl %r13d, %ecx
shrl %ecx
xorl %r12d, %r12d
movq %rbp, %rdi
cmpl %r13d, %eax
cmovaeq %rcx, %r12
leaq (%r12,%r13), %rbx
movq %rbx, %rsi
callq 0x2260
movq %r15, 0x20(%rsp)
testq %rax, %rax
je 0xc2d1
movl 0x8(%rsp), %ecx
leaq 0x40(%r15), %rsi
movq %rax, %rbp
movb %cl, -0x1(%rax,%r13)
movl 0x40(%r15), %edx
leaq 0x1(%r13), %r15
movl %edx, %edi
shrl $0x8, %edi
testq %r12, %r12
jne 0xc32d
jmp 0xc2e8
movl 0x40(%r15), %edx
leaq 0x40(%r15), %rsi
leaq 0x1(%r14), %r15
movq %r14, %r13
movq %r14, %rbx
movl %edx, %edi
shrl $0x8, %edi
leal (%rbx,%rbx), %eax
movl %r15d, %ecx
movq %rbx, %r14
shrl %ecx
xorl %ebx, %ebx
movl %edi, 0x14(%rsp)
movq %r15, 0x8(%rsp)
movq %rbp, %rdi
movl %edx, %r12d
cmpl %r13d, %eax
cmovaq %rcx, %rbx
addq %r15, %rbx
movq %rsi, %r15
movq %rbx, %rsi
callq 0x2260
movq %r15, %rsi
movl 0x14(%rsp), %edi
movq 0x8(%rsp), %r15
movl %r12d, %edx
testq %rax, %rax
je 0xc347
movb %dil, -0x1(%rax,%r15)
addq $0x2, %r13
movq %r15, %rcx
movq %rbx, %r14
movq %rax, %rbp
movl (%rsi), %edx
movq %r13, %r15
movq %rcx, %r13
cmpl %r13d, %r14d
jbe 0xc354
movq %rbp, %rax
movq %r14, %r12
jmp 0xc382
leal (%r14,%r14), %eax
movl %r15d, %ecx
shrl %ecx
xorl %r12d, %r12d
movq %rbp, %rdi
movl %edx, %ebx
cmpl %r13d, %eax
cmovaq %rcx, %r12
addq %r15, %r12
movq %r12, %rsi
callq 0x2260
movl %ebx, %edx
testq %rax, %rax
je 0xc458
movb %dl, -0x1(%rax,%r15)
leaq 0x1(%r15), %rbx
movq %r12, %r14
movq %rax, %rbp
movq 0x20(%rsp), %rax
movb 0x45(%rax), %r13b
cmpl %r15d, %r14d
jbe 0xc3a7
movq %rbp, %rax
movq %r14, %r12
jmp 0xc3d0
leal (%r14,%r14), %eax
movl %ebx, %ecx
shrl %ecx
xorl %r12d, %r12d
movq %rbp, %rdi
cmpl %r15d, %eax
cmovaq %rcx, %r12
addq %rbx, %r12
movq %r12, %rsi
callq 0x2260
testq %rax, %rax
je 0xc463
movb %r13b, -0x1(%rax,%rbx)
leaq 0x1(%rbx), %r13
movq %r12, %r14
movq %rax, %rbp
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %r12
movb 0x44(%rax), %r15b
cmpl %ebx, %r14d
jbe 0xc3f7
movq %rbp, %rax
jmp 0xc418
addl %r14d, %r14d
movl %r13d, %eax
shrl %eax
xorl %esi, %esi
movq %rbp, %rdi
cmpl %ebx, %r14d
cmovaq %rax, %rsi
addq %r13, %rsi
callq 0x2260
testq %rax, %rax
je 0xc472
movb %r15b, -0x1(%rax,%r13)
movq %rax, %rbp
movq %r13, %rbx
jmp 0xc472
movl %ebx, %r15d
xorl %ebx, %ebx
leal (%rbx,%rbx), %eax
movl %r14d, %ecx
shrl %ecx
xorl %esi, %esi
movq %rbp, %rdi
cmpl %r14d, %eax
cmovaeq %rcx, %rsi
addq %r14, %rsi
callq 0x2260
testq %rax, %rax
je 0xc472
movb %r15b, -0x1(%rax,%r14)
movq %rax, %rbp
movq %r14, %rbx
jmp 0xc472
movq %r15, %rbx
movq %r13, %r15
jmp 0xc391
movq %rbx, %r13
movq %r15, %rbx
jmp 0xc3df
xorl %ebp, %ebp
xorl %ebx, %ebx
leaq 0x8(%r12), %rsi
leaq 0x6de9(%rip), %rcx      # 0x13267
movq %r12, %rdi
movl %ebx, %edx
movq %rbp, %r8
callq 0x74dc
testl %eax, %eax
jne 0xc499
movq 0x8(%r12), %rax
movq %rax, 0x10(%r12)
movq %rbp, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0