// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %rdi, %r12
movl 0x10(%rsi), %eax
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq $0x6, %rax
ja 0x9627
movq %rsi, %r15
leaq 0x4e3d(%rip), %rcx      # 0xe1d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%r15), %ebx
movl $0x1, %r14d
movl $0x1, %edi
callq 0x1140
movq %rax, %rbp
testq %rax, %rax
je 0x95da
movl %ebx, %r15d
movb %bh, (%rbp)
movl $0x1, %ebx
movl $0x2, %r14d
jmp 0x95df
movl 0x3c(%r15), %ebx
movl $0x1, %r13d
movl $0x1, %edi
callq 0x1140
movq %rax, %rbp
testq %rax, %rax
movq %r12, 0x18(%rsp)
movl %ebx, 0x8(%rsp)
je 0x9433
movb %bh, (%rbp)
movl $0x1, %r14d
movl $0x2, %r13d
jmp 0x9436
movl 0x3c(%r15), %r14d
movl $0x1, %ebx
movl $0x1, %edi
callq 0x1140
testq %rax, %rax
je 0x9623
movq %rax, %rbp
movb %r14b, (%rax)
jmp 0x9627
xorl %r14d, %r14d
leal (%r14,%r14), %eax
movl %r13d, %ecx
shrl %ecx
xorl %r12d, %r12d
cmpl %r13d, %eax
cmovaeq %rcx, %r12
leaq (%r12,%r13), %rbx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1160
testq %rax, %rax
movq %r15, 0x20(%rsp)
je 0x9486
movl 0x8(%rsp), %ecx
movb %cl, -0x1(%rax,%r13)
leaq 0x40(%r15), %rsi
movl 0x40(%r15), %edx
movl %edx, %edi
shrl $0x8, %edi
leaq 0x1(%r13), %r15
movq %rax, %rbp
testq %r12, %r12
jne 0x94e2
jmp 0x949d
leaq 0x40(%r15), %rsi
movl 0x40(%r15), %edx
movl %edx, %edi
shrl $0x8, %edi
leaq 0x1(%r14), %r15
movq %r14, %r13
movq %r14, %rbx
movl %edi, 0x14(%rsp)
movq %r15, 0x8(%rsp)
movq %rbx, %r14
leal (%rbx,%rbx), %eax
movl %r15d, %ecx
shrl %ecx
xorl %ebx, %ebx
cmpl %r13d, %eax
cmovaq %rcx, %rbx
addq %r15, %rbx
movq %rbp, %rdi
movq %rsi, %r15
movq %rbx, %rsi
movl %edx, %r12d
callq 0x1160
movl 0x14(%rsp), %edi
movq %r15, %rsi
movq 0x8(%rsp), %r15
movl %r12d, %edx
testq %rax, %rax
je 0x94fc
movq %r15, %rcx
movb %dil, -0x1(%rax,%r15)
movl (%rsi), %edx
addq $0x2, %r13
movq %r13, %r15
movq %rbx, %r14
movq %rax, %rbp
movq %rcx, %r13
cmpl %r13d, %r14d
jbe 0x9509
movq %rbp, %rax
movq %r14, %r12
jmp 0x9537
leal (%r14,%r14), %eax
movl %r15d, %ecx
shrl %ecx
xorl %r12d, %r12d
cmpl %r13d, %eax
cmovaq %rcx, %r12
addq %r15, %r12
movq %rbp, %rdi
movq %r12, %rsi
movl %edx, %ebx
callq 0x1160
movl %ebx, %edx
testq %rax, %rax
je 0x960d
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 0x955c
movq %rbp, %rax
movq %r14, %r12
jmp 0x9585
leal (%r14,%r14), %eax
movl %ebx, %ecx
shrl %ecx
xorl %r12d, %r12d
cmpl %r15d, %eax
cmovaq %rcx, %r12
addq %rbx, %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1160
testq %rax, %rax
je 0x9618
movb %r13b, -0x1(%rax,%rbx)
leaq 0x1(%rbx), %r13
movq %r12, %r14
movq %rax, %rbp
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %rax
movb 0x44(%rax), %r15b
cmpl %ebx, %r14d
jbe 0x95ac
movq %rbp, %rax
jmp 0x95cd
addl %r14d, %r14d
movl %r13d, %eax
shrl %eax
xorl %esi, %esi
cmpl %ebx, %r14d
cmovaq %rax, %rsi
addq %r13, %rsi
movq %rbp, %rdi
callq 0x1160
testq %rax, %rax
je 0x9627
movb %r15b, -0x1(%rax,%r13)
movq %rax, %rbp
movq %r13, %rbx
jmp 0x9627
movl %ebx, %r15d
xorl %ebx, %ebx
leal (%rbx,%rbx), %eax
movl %r14d, %ecx
shrl %ecx
xorl %esi, %esi
cmpl %r14d, %eax
cmovaeq %rcx, %rsi
addq %r14, %rsi
movq %rbp, %rdi
callq 0x1160
testq %rax, %rax
je 0x9627
movb %r15b, -0x1(%rax,%r14)
movq %rax, %rbp
movq %r14, %rbx
jmp 0x9627
movq %r15, %rbx
movq %r13, %r15
jmp 0x9546
movq %rbx, %r13
movq %r15, %rbx
jmp 0x9594
xorl %ebp, %ebp
xorl %ebx, %ebx
leaq 0x8(%r12), %rsi
leaq 0x633d(%rip), %rcx      # 0xf970
movq %r12, %rdi
movl %ebx, %edx
movq %rbp, %r8
callq 0x47eb
testl %eax, %eax
jne 0x964e
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 0x1030