// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_bKGD
static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk = 0;
  if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r >> 8);
    chunk[9] = (unsigned char)(info->background_r & 255);
  } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r >> 8);
    chunk[9] = (unsigned char)(info->background_r & 255);
    chunk[10] = (unsigned char)(info->background_g >> 8);
    chunk[11] = (unsigned char)(info->background_g & 255);
    chunk[12] = (unsigned char)(info->background_b >> 8);
    chunk[13] = (unsigned char)(info->background_b & 255);
  } else if(info->color.colortype == LCT_PALETTE) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r & 255); /*palette index*/
  }
  if(chunk) lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0xf44c
movq -0x18(%rbp), %rax
cmpl $0x4, 0x10(%rax)
jne 0xf4a6
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdi
movl $0x2, %edx
leaq 0xc137(%rip), %rcx      # 0x1b597
callq 0x14120
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xf479
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xf5c9
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x9(%rax)
jmp 0xf5b2
movq -0x18(%rbp), %rax
cmpl $0x2, 0x10(%rax)
je 0xf4be
movq -0x18(%rbp), %rax
cmpl $0x6, 0x10(%rax)
jne 0xf565
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdi
movl $0x6, %edx
leaq 0xc0c5(%rip), %rcx      # 0x1b597
callq 0x14120
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0xf4eb
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xf5c9
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x9(%rax)
movq -0x18(%rbp), %rax
movl 0x40(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xa(%rax)
movq -0x18(%rbp), %rax
movl 0x40(%rax), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x18(%rbp), %rax
movl 0x44(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x18(%rbp), %rax
movl 0x44(%rax), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xd(%rax)
jmp 0xf5b0
movq -0x18(%rbp), %rax
cmpl $0x3, 0x10(%rax)
jne 0xf5ae
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdi
movl $0x1, %edx
leaq 0xc014(%rip), %rcx      # 0x1b597
callq 0x14120
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0xf599
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xf5c9
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x8(%rax)
jmp 0xf5b0
jmp 0xf5b2
cmpq $0x0, -0x20(%rbp)
je 0xf5c2
movq -0x20(%rbp), %rdi
callq 0x5d00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)