// File: lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_mDCV(ucvector*, LodePNGInfo const*)
static unsigned addChunk_mDCV(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  /* Allow up to 65535 since they are 16-bit ints. */
  if(info->mdcv_red_x > 65535) return 118;
  if(info->mdcv_red_y > 65535) return 118;
  if(info->mdcv_green_x > 65535) return 118;
  if(info->mdcv_green_y > 65535) return 118;
  if(info->mdcv_blue_x > 65535) return 118;
  if(info->mdcv_blue_y > 65535) return 118;
  if(info->mdcv_white_x > 65535) return 118;
  if(info->mdcv_white_y > 65535) return 118;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 24, "mDCV"));
  chunk[8 + 0] = (unsigned char)((info->mdcv_red_x) >> 8u);
  chunk[8 + 1] = (unsigned char)(info->mdcv_red_x);
  chunk[8 + 2] = (unsigned char)((info->mdcv_red_y) >> 8u);
  chunk[8 + 3] = (unsigned char)(info->mdcv_red_y);
  chunk[8 + 4] = (unsigned char)((info->mdcv_green_x) >> 8u);
  chunk[8 + 5] = (unsigned char)(info->mdcv_green_x);
  chunk[8 + 6] = (unsigned char)((info->mdcv_green_y) >> 8u);
  chunk[8 + 7] = (unsigned char)(info->mdcv_green_y);
  chunk[8 + 8] = (unsigned char)((info->mdcv_blue_x) >> 8u);
  chunk[8 + 9] = (unsigned char)(info->mdcv_blue_x);
  chunk[8 + 10] = (unsigned char)((info->mdcv_blue_y) >> 8u);
  chunk[8 + 11] = (unsigned char)(info->mdcv_blue_y);
  chunk[8 + 12] = (unsigned char)((info->mdcv_white_x) >> 8u);
  chunk[8 + 13] = (unsigned char)(info->mdcv_white_x);
  chunk[8 + 14] = (unsigned char)((info->mdcv_white_y) >> 8u);
  chunk[8 + 15] = (unsigned char)(info->mdcv_white_y);
  lodepng_set32bitInt(chunk + 8 + 16, info->mdcv_max_luminance);
  lodepng_set32bitInt(chunk + 8 + 20, info->mdcv_min_luminance);
  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 -0x18(%rbp), %rax
cmpl $0xffff, 0x12c(%rax)    # imm = 0xFFFF
jbe 0xf5fc
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x130(%rax)    # imm = 0xFFFF
jbe 0xf618
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x134(%rax)    # imm = 0xFFFF
jbe 0xf634
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x138(%rax)    # imm = 0xFFFF
jbe 0xf650
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x13c(%rax)    # imm = 0xFFFF
jbe 0xf66c
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x140(%rax)    # imm = 0xFFFF
jbe 0xf688
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x144(%rax)    # imm = 0xFFFF
jbe 0xf6a4
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
cmpl $0xffff, 0x148(%rax)    # imm = 0xFFFF
jbe 0xf6c0
movl $0x76, -0x4(%rbp)
jmp 0xf87b
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdi
movl $0x18, %edx
leaq 0xa1ecd(%rip), %rcx     # 0xb15a1
callq 0x167a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xf6ed
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xf87b
movq -0x18(%rbp), %rax
movl 0x12c(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0x12c(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x9(%rax)
movq -0x18(%rbp), %rax
movl 0x130(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xa(%rax)
movq -0x18(%rbp), %rax
movl 0x130(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x18(%rbp), %rax
movl 0x134(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x18(%rbp), %rax
movl 0x134(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xd(%rax)
movq -0x18(%rbp), %rax
movl 0x138(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xe(%rax)
movq -0x18(%rbp), %rax
movl 0x138(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0xf(%rax)
movq -0x18(%rbp), %rax
movl 0x13c(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x10(%rax)
movq -0x18(%rbp), %rax
movl 0x13c(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x11(%rax)
movq -0x18(%rbp), %rax
movl 0x140(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x12(%rax)
movq -0x18(%rbp), %rax
movl 0x140(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x13(%rax)
movq -0x18(%rbp), %rax
movl 0x144(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x18(%rbp), %rax
movl 0x144(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x15(%rax)
movq -0x18(%rbp), %rax
movl 0x148(%rax), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x16(%rax)
movq -0x18(%rbp), %rax
movl 0x148(%rax), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x17(%rax)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rax
movl 0x14c(%rax), %esi
callq 0x4af0
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
addq $0x14, %rdi
movq -0x18(%rbp), %rax
movl 0x150(%rax), %esi
callq 0x4af0
movq -0x20(%rbp), %rdi
callq 0x5020
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)