// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %rdi, %r12
movl 0x10(%rsi), %eax
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq $0x6, %rax
ja 0x9a57
movq %rsi, %r15
leaq 0x4a11(%rip), %rcx      # 0xe1d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%r15), %ebx
movl $0x1, %r14d
movl $0x1, %edi
callq 0x1100
movq %rax, %rbp
testq %rax, %rax
je 0x9a0a
movl %ebx, %r15d
movb %bh, (%rbp)
movl $0x1, %ebx
movl $0x2, %r14d
jmp 0x9a0f
movl 0x3c(%r15), %ebx
movl $0x1, %r13d
movl $0x1, %edi
callq 0x1100
movq %rax, %rbp
testq %rax, %rax
movq %r12, 0x18(%rsp)
movl %ebx, 0x8(%rsp)
je 0x9863
movb %bh, (%rbp)
movl $0x1, %r14d
movl $0x2, %r13d
jmp 0x9866
movl 0x3c(%r15), %r14d
movl $0x1, %ebx
movl $0x1, %edi
callq 0x1100
testq %rax, %rax
je 0x9a53
movq %rax, %rbp
movb %r14b, (%rax)
jmp 0x9a57
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 0x1130
testq %rax, %rax
movq %r15, 0x20(%rsp)
je 0x98b6
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 0x9912
jmp 0x98cd
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 0x1130
movl 0x14(%rsp), %edi
movq %r15, %rsi
movq 0x8(%rsp), %r15
movl %r12d, %edx
testq %rax, %rax
je 0x992c
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 0x9939
movq %rbp, %rax
movq %r14, %r12
jmp 0x9967
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 0x1130
movl %ebx, %edx
testq %rax, %rax
je 0x9a3d
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 0x998c
movq %rbp, %rax
movq %r14, %r12
jmp 0x99b5
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 0x1130
testq %rax, %rax
je 0x9a48
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 0x99dc
movq %rbp, %rax
jmp 0x99fd
addl %r14d, %r14d
movl %r13d, %eax
shrl %eax
xorl %esi, %esi
cmpl %ebx, %r14d
cmovaq %rax, %rsi
addq %r13, %rsi
movq %rbp, %rdi
callq 0x1130
testq %rax, %rax
je 0x9a57
movb %r15b, -0x1(%rax,%r13)
movq %rax, %rbp
movq %r13, %rbx
jmp 0x9a57
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 0x1130
testq %rax, %rax
je 0x9a57
movb %r15b, -0x1(%rax,%r14)
movq %rax, %rbp
movq %r14, %rbx
jmp 0x9a57
movq %r15, %rbx
movq %r13, %r15
jmp 0x9976
movq %rbx, %r13
movq %r15, %rbx
jmp 0x99c4
xorl %ebp, %ebp
xorl %ebx, %ebx
leaq 0x8(%r12), %rsi
leaq 0x5ff0(%rip), %rcx      # 0xfa53
movq %r12, %rdi
movl %ebx, %edx
movq %rbp, %r8
callq 0x4a14
testl %eax, %eax
jne 0x9a7e
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