// File: /workspace/github_cpp_makefile_star2_O3/logicx24[P]RayTracer/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 / 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r15
movl 0x10(%rsi), %eax
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq $0x6, %rax
ja 0x12891
leaq 0x5014(%rip), %rcx      # 0x175f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x3c(%rsi), %ebx
movl $0x1, %r14d
movl $0x1, %edi
callq 0x32e0
testq %rax, %rax
je 0x12838
movl %ebx, %r13d
movb %bh, (%rax)
movl $0x1, %ebx
movl $0x2, %r14d
jmp 0x1283d
movq %r15, -0x48(%rbp)
movq %rsi, -0x38(%rbp)
movl 0x3c(%rsi), %ebx
movl $0x1, %r13d
movl $0x1, %edi
callq 0x32e0
testq %rax, %rax
movl %ebx, -0x30(%rbp)
je 0x12678
movb %bh, (%rax)
movl $0x1, %r15d
movl $0x2, %r13d
jmp 0x1267b
movl 0x3c(%rsi), %r14d
movl $0x1, %ebx
movl $0x1, %edi
callq 0x32e0
testq %rax, %rax
je 0x1288c
movq %rax, %r12
movb %r14b, (%rax)
jmp 0x12891
xorl %r15d, %r15d
leal (%r15,%r15), %edx
movl %r13d, %ecx
shrl %ecx
xorl %r12d, %r12d
cmpl %r13d, %edx
cmovaeq %rcx, %r12
leaq (%r12,%r13), %rbx
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3400
testq %rax, %rax
je 0x126ce
movl -0x30(%rbp), %ecx
movb %cl, -0x1(%rax,%r13)
movq -0x38(%rbp), %rsi
leaq 0x40(%rsi), %r9
movl 0x40(%rsi), %r8d
movl %r8d, %r10d
shrl $0x8, %r10d
leaq 0x1(%r13), %rdi
movq %rax, %r14
testq %r12, %r12
jne 0x12733
jmp 0x126eb
movq -0x38(%rbp), %rax
leaq 0x40(%rax), %r9
movl 0x40(%rax), %r8d
movl %r8d, %r10d
shrl $0x8, %r10d
leaq 0x1(%r15), %rdi
movq %r15, %r13
movq %r15, %rbx
movl %r10d, -0x3c(%rbp)
movq %r9, -0x50(%rbp)
movq %rdi, -0x30(%rbp)
movq %rbx, %r15
leal (%rbx,%rbx), %eax
movl %edi, %ecx
shrl %ecx
xorl %ebx, %ebx
cmpl %r13d, %eax
cmovaq %rcx, %rbx
addq %rdi, %rbx
movq %r14, %rdi
movq %rbx, %rsi
movl %r8d, %r12d
callq 0x3400
movl -0x3c(%rbp), %r10d
movq -0x50(%rbp), %r9
movl %r12d, %r8d
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
testq %rax, %rax
je 0x1274e
movq %rdi, %rcx
movb %r10b, -0x1(%rax,%rdi)
movl (%r9), %r8d
addq $0x2, %r13
movq %r13, %rdi
movq %rbx, %r15
movq %rax, %r14
movq %rcx, %r13
cmpl %r13d, %r15d
jbe 0x12758
movq %r15, %r12
jmp 0x12798
leal (%r15,%r15), %eax
movl %edi, %ecx
shrl %ecx
xorl %r12d, %r12d
cmpl %r13d, %eax
cmovaq %rcx, %r12
addq %rdi, %r12
movq %rdi, %rbx
movq %r14, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movl %r8d, %r14d
callq 0x3400
movl %r14d, %r8d
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %rax, %r14
testq %rax, %rax
je 0x1286e
movb %r8b, -0x1(%r14,%rdi)
leaq 0x1(%rdi), %rbx
movq %r12, %r15
movb 0x45(%rsi), %r13b
cmpl %edi, %r15d
jbe 0x127b5
movq %r14, %rax
movq %r15, %r12
jmp 0x127e5
leal (%r15,%r15), %eax
movl %ebx, %ecx
shrl %ecx
xorl %r12d, %r12d
cmpl %edi, %eax
cmovaq %rcx, %r12
addq %rbx, %r12
movq %rdi, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x3400
movq -0x38(%rbp), %rsi
testq %rax, %rax
je 0x1287d
movb %r13b, -0x1(%rax,%rbx)
leaq 0x1(%rbx), %r13
movq %r12, %r15
movq %rax, %r12
movb 0x44(%rsi), %r14b
cmpl %ebx, %r15d
jbe 0x12806
movq %r12, %rax
movq -0x48(%rbp), %r15
jmp 0x1282b
addl %r15d, %r15d
movl %r13d, %eax
shrl %eax
xorl %esi, %esi
cmpl %ebx, %r15d
cmovaq %rax, %rsi
addq %r13, %rsi
movq %r12, %rdi
callq 0x3400
testq %rax, %rax
movq -0x48(%rbp), %r15
je 0x12891
movb %r14b, -0x1(%rax,%r13)
movq %rax, %r12
movq %r13, %rbx
jmp 0x12891
movl %ebx, %r13d
xorl %ebx, %ebx
leal (%rbx,%rbx), %edx
movl %r14d, %ecx
shrl %ecx
xorl %esi, %esi
cmpl %r14d, %edx
cmovaeq %rcx, %rsi
addq %r14, %rsi
movq %rax, %r12
movq %rax, %rdi
callq 0x3400
testq %rax, %rax
je 0x12891
movb %r13b, -0x1(%rax,%r14)
movq %rax, %r12
movq %r14, %rbx
jmp 0x12891
movq %rdi, %rbx
movq %r13, %rdi
movq -0x30(%rbp), %r14
jmp 0x127a4
movq %rbx, %r13
movq -0x30(%rbp), %rbx
movq %r14, %r12
jmp 0x127f4
xorl %r12d, %r12d
xorl %ebx, %ebx
leaq 0x8(%r15), %rsi
leaq 0x659a(%rip), %rcx      # 0x18e36
movq %r15, %rdi
movl %ebx, %edx
movq %r12, %r8
callq 0xd813
testl %eax, %eax
jne 0x128b5
movq 0x8(%r15), %rax
movq %rax, 0x10(%r15)
movq %r12, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3280