// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: createComplexPNG(std::vector<unsigned char, std::allocator<unsigned char>>&)
void createComplexPNG(std::vector<unsigned char>& png) {
  unsigned w = 16, h = 17;
  std::vector<unsigned char> image(w * h);
  for(size_t i = 0; i < w * h; i++) {
    image[i] = i % 256;
  }

  lodepng::State state;
  LodePNGInfo& info = state.info_png;
  info.color.colortype = LCT_PALETTE;
  info.color.bitdepth = 8;
  state.info_raw.colortype = LCT_PALETTE;
  state.info_raw.bitdepth = 8;
  state.encoder.auto_convert = false;
  state.encoder.text_compression = 1;
  state.encoder.add_id = 1;
  for(size_t i = 0; i < 256; i++) {
    lodepng_palette_add(&info.color, i, i, i, i);
    lodepng_palette_add(&state.info_raw, i, i, i, i);
  }

  info.background_defined = 1;
  info.background_r = 127;

  lodepng_add_text(&info, "key0", "string0");
  lodepng_add_text(&info, "key1", "string1");

  lodepng_add_itext(&info, "ikey0", "ilangtag0", "itranskey0", "istring0");
  lodepng_add_itext(&info, "ikey1", "ilangtag1", "itranskey1", "istring1");

  info.time_defined = 1;
  info.time.year = 2012;
  info.time.month = 1;
  info.time.day = 2;
  info.time.hour = 3;
  info.time.minute = 4;
  info.time.second = 5;

  info.phys_defined = 1;
  info.phys_x = 1;
  info.phys_y = 2;
  info.phys_unit = 1;

  lodepng_chunk_create(&info.unknown_chunks_data[0], &info.unknown_chunks_size[0], 3, "uNKa", (unsigned char*)"a00");
  lodepng_chunk_create(&info.unknown_chunks_data[0], &info.unknown_chunks_size[0], 3, "uNKa", (unsigned char*)"a01");
  lodepng_chunk_create(&info.unknown_chunks_data[1], &info.unknown_chunks_size[1], 3, "uNKb", (unsigned char*)"b00");
  lodepng_chunk_create(&info.unknown_chunks_data[2], &info.unknown_chunks_size[2], 3, "uNKc", (unsigned char*)"c00");

  unsigned error = lodepng::encode(png, &image[0], w, h, state);
  ASSERT_NO_PNG_ERROR(error);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x360, %rsp            # imm = 0x360
movq %rdi, %rbx
leaq 0xe0(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rcx
movl $0x110, %esi            # imm = 0x110
callq 0x5ab3a
xorl %eax, %eax
cmpq $0x110, %rax            # imm = 0x110
je 0x1bfac
movq 0x8(%rsp), %rcx
movb %al, (%rcx,%rax)
incq %rax
jmp 0x1bf97
leaq 0xe0(%rsp), %rdi
callq 0xb84c
leaq 0x1c0(%rsp), %r15
movabsq $0x800000003, %rax      # imm = 0x800000003
movq %rax, (%r15)
leaq 0x188(%rsp), %r12
movq %rax, (%r12)
andl $0x0, -0x28(%r12)
leaq 0x1b0(%rsp), %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0xc(%r12)
xorl %r13d, %r13d
cmpq $0x100, %r13            # imm = 0x100
je 0x1c02e
movzbl %r13b, %ecx
movq %r15, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x4a2f
movzbl %r13b, %ecx
movq %r12, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x4a2f
incq %r13
jmp 0x1bffa
movabsq $0x7f00000001, %rax     # imm = 0x7F00000001
movq %rax, 0x1e8(%rsp)
leaq 0x44db2(%rip), %rsi     # 0x60df9
leaq 0x44dc6(%rip), %rdx     # 0x60e14
movq %r14, %rdi
callq 0x4be3
leaq 0x44dc0(%rip), %rsi     # 0x60e1d
leaq 0x44dd4(%rip), %rdx     # 0x60e38
movq %r14, %rdi
callq 0x4be3
leaq 0x44d85(%rip), %rsi     # 0x60df8
leaq 0x44d84(%rip), %rdx     # 0x60dfe
leaq 0x44d87(%rip), %rcx     # 0x60e08
leaq 0x44d8b(%rip), %r8      # 0x60e13
movq %r14, %rdi
callq 0x4d97
leaq 0x44d85(%rip), %rsi     # 0x60e1c
leaq 0x44d84(%rip), %rdx     # 0x60e22
leaq 0x44d87(%rip), %rcx     # 0x60e2c
leaq 0x44d8b(%rip), %r8      # 0x60e37
movq %r14, %rdi
callq 0x4d97
movaps 0x43f95(%rip), %xmm0    # 0x60050
leaq 0x328(%rsp), %r14
movups %xmm0, -0xdc(%r14)
movaps 0x43f8e(%rip), %xmm0    # 0x60060
movups %xmm0, -0xcc(%r14)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, -0xbc(%r14)
movl $0x1, -0xb4(%r14)
leaq 0x340(%rsp), %r15
leaq 0x44d3b(%rip), %rcx     # 0x60e40
leaq 0x44d39(%rip), %r8      # 0x60e45
pushq $0x3
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x48d7
leaq 0x44d1f(%rip), %rcx     # 0x60e40
leaq 0x44d21(%rip), %r8      # 0x60e49
pushq $0x3
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x48d7
leaq 0x330(%rsp), %rdi
leaq 0x348(%rsp), %rsi
leaq 0x44d00(%rip), %rcx     # 0x60e4d
leaq 0x44cfe(%rip), %r8      # 0x60e52
pushq $0x3
popq %rdx
callq 0x48d7
leaq 0x338(%rsp), %rdi
leaq 0x350(%rsp), %rsi
leaq 0x44ce3(%rip), %rcx     # 0x60e56
leaq 0x44ce1(%rip), %r8      # 0x60e5b
pushq $0x3
popq %rdx
callq 0x48d7
movq 0x8(%rsp), %rsi
pushq $0x10
popq %rdx
pushq $0x11
popq %rcx
leaq 0xe0(%rsp), %r8
movq %rbx, %rdi
callq 0xbb76
movl %eax, %ebx
leaq 0x44037(%rip), %rsi     # 0x601dd
leaq 0xa0(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20c0
leaq 0x44ca0(%rip), %rdx     # 0x60e5f
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x5a5df
leaq 0x453eb(%rip), %rsi     # 0x615c6
leaq 0x80(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x20c0
movq 0x88(%rsp), %r14
testq %r14, %r14
je 0x1c228
leaq 0x453c5(%rip), %rsi     # 0x615c6
leaq 0x20(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x20c0
leaq 0x4758e(%rip), %rsi     # 0x637a5
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x5a8d9
jmp 0x1c23e
leaq 0x45397(%rip), %rsi     # 0x615c6
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x20c0
leaq 0x60(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x5a61f
leaq 0x60(%rsp), %rsi
movl %ebx, %edi
callq 0x13352
leaq 0x60(%rsp), %rdi
callq 0x2270
leaq 0x40(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x1c284
leaq 0x20(%rsp), %rdi
callq 0x2270
leaq 0x80(%rsp), %rdi
callq 0x2270
leaq 0xc0(%rsp), %rdi
callq 0x2270
leaq 0xa0(%rsp), %rdi
callq 0x2270
leaq 0xe0(%rsp), %rdi
callq 0xb874
leaq 0x8(%rsp), %rdi
callq 0xea7c
addq $0x360, %rsp            # imm = 0x360
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1c2f0
movq %rax, %rbx
jmp 0x1c313
movq %rax, %rbx
jmp 0x1c30e
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2270
jmp 0x1c304
jmp 0x1c34d
movq %rax, %rbx
jmp 0x1c31d
jmp 0x1c34d
movq %rax, %rbx
jmp 0x1c337
movq %rax, %rbx
jmp 0x1c32a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x1c31d
leaq 0x20(%rsp), %rdi
callq 0x2270
leaq 0x80(%rsp), %rdi
callq 0x2270
leaq 0xc0(%rsp), %rdi
callq 0x2270
leaq 0xa0(%rsp), %rdi
callq 0x2270
jmp 0x1c350
movq %rax, %rbx
jmp 0x1c35d
jmp 0x1c34d
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xb874
leaq 0x8(%rsp), %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x2380
movq %rax, %rdi
callq 0xe6cc