// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-mgs/lodepng/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 >> 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 0x9310
leaq 0x5038(%rip), %rcx      # 0xe0f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%rsi), %ebx
movl $0x1, %r15d
movl $0x1, %edi
callq 0x10f0
movq %rax, %rbp
testq %rax, %rax
je 0x917a
movb %bh, (%rbp)
jmp 0x917d
movq %rsi, 0x8(%rsp)
movl 0x3c(%rsi), %ebx
movl $0x1, %r14d
movl $0x1, %edi
callq 0x10f0
movq %rax, %rbp
xorl %r13d, %r13d
testq %rax, %rax
setne %r13b
movq %r12, 0x10(%rsp)
je 0x9148
movb %bh, (%rbp)
jmp 0x914b
movl 0x3c(%rsi), %ebx
movl $0x1, %r15d
movl $0x1, %edi
callq 0x10f0
movq %rax, %rbp
testq %rax, %rax
je 0x930d
movb %bl, (%rbp)
jmp 0x9310
xorl %r14d, %r14d
movl %ebx, %eax
leaq 0x1(%r14), %r12
cmpq %r13, %r14
jae 0x915a
xorl %ecx, %ecx
jmp 0x91ab
movl %eax, %ebx
leaq (%r12,%r14), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1120
testq %rax, %rax
je 0x91a7
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x91a9
xorl %r15d, %r15d
leaq 0x1(,%r15,2), %rsi
movq %rbp, %rdi
callq 0x1120
testq %rax, %rax
cmovneq %rax, %rbp
je 0x9310
incq %r15
movb %bl, -0x1(%rbp,%r15)
jmp 0x9310
movb $0x1, %cl
movl %ebx, %eax
movq 0x8(%rsp), %rbx
testb %cl, %cl
jne 0x91bc
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x41(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r14d, %r13d
jbe 0x91cc
xorl %ecx, %ecx
jmp 0x920a
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 0x1120
testq %rax, %rax
je 0x9204
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x9206
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0x9216
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x40(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r14d, %r13d
jbe 0x9226
xorl %ecx, %ecx
jmp 0x9264
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 0x1120
testq %rax, %rax
je 0x925e
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x9260
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0x9270
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x45(%rbx), %al
leaq 0x1(%r14), %r12
cmpl %r12d, %r13d
jae 0x92b0
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 0x1120
testq %rax, %rax
je 0x92b4
xorl %ecx, %ecx
movq %rax, %rbp
movq %r15, %r13
jmp 0x92b6
xorl %ecx, %ecx
jmp 0x92ba
movb $0x1, %cl
movb 0x8(%rsp), %al
testb %cl, %cl
jne 0x92c6
movb %al, -0x1(%rbp,%r12)
movq %r12, %r14
movb 0x44(%rbx), %bl
leaq 0x1(%r14), %r15
cmpl %r15d, %r13d
jae 0x92f6
addl %r13d, %r13d
leal (%r15,%r15,2), %esi
shrl %esi
cmpl %r15d, %r13d
cmovbq %r15, %rsi
movq %rbp, %rdi
callq 0x1120
testq %rax, %rax
sete %cl
cmovneq %rax, %rbp
jmp 0x92f8
xorl %ecx, %ecx
movq 0x10(%rsp), %r12
testb %cl, %cl
je 0x9306
movq %r14, %r15
jmp 0x9310
movb %bl, -0x1(%rbp,%r15)
jmp 0x9310
xorl %r15d, %r15d
leaq 0x8(%r12), %rsi
leaq 0x6657(%rip), %rcx      # 0xf973
movq %r12, %rdi
movl %r15d, %edx
movq %rbp, %r8
callq 0x4357
testl %eax, %eax
jne 0x9338
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