// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdi, %r14
movl $0x110, %edi            # imm = 0x110
callq 0x2230
movq %rax, %rbx
xorl %r15d, %r15d
movl $0x110, %edx            # imm = 0x110
movq %rax, %rdi
xorl %esi, %esi
callq 0x2140
movb %r15b, (%rbx,%r15)
incq %r15
cmpq $0x110, %r15            # imm = 0x110
jne 0x20fb2
leaq 0xc8(%rsp), %rdi
callq 0xd1a0
leaq 0x198(%rsp), %r15
leaq 0x1a8(%rsp), %r12
movabsq $0x800000003, %rax      # imm = 0x800000003
movq %rax, (%r12)
leaq 0x170(%rsp), %r13
movq %rax, (%r13)
movl $0x0, -0x28(%r13)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0xc(%r13)
xorl %ebp, %ebp
movzbl %bpl, %ecx
movq %r12, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x537e
movzbl %bpl, %ecx
movq %r13, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x537e
incq %rbp
cmpq $0x100, %rbp            # imm = 0x100
jne 0x21011
movabsq $0x7f00000001, %rax     # imm = 0x7F00000001
movq %rax, 0x1d0(%rsp)
leaq 0x55d1d(%rip), %rsi     # 0x76d79
leaq 0x55d31(%rip), %rdx     # 0x76d94
movq %r15, %rdi
callq 0x5558
leaq 0x55d2b(%rip), %rsi     # 0x76d9d
leaq 0x55d3f(%rip), %rdx     # 0x76db8
movq %r15, %rdi
callq 0x5558
leaq 0x55cf0(%rip), %rsi     # 0x76d78
leaq 0x55cef(%rip), %rdx     # 0x76d7e
leaq 0x55cf2(%rip), %rcx     # 0x76d88
leaq 0x55cf6(%rip), %r8      # 0x76d93
movq %r15, %rdi
callq 0x5751
leaq 0x55cf0(%rip), %rsi     # 0x76d9c
leaq 0x55cef(%rip), %rdx     # 0x76da2
leaq 0x55cf2(%rip), %rcx     # 0x76dac
leaq 0x55cf6(%rip), %r8      # 0x76db7
movq %r15, %rdi
callq 0x5751
movaps 0x54ee0(%rip), %xmm0    # 0x75fb0
leaq 0x310(%rsp), %r15
movups %xmm0, -0xdc(%r15)
movaps 0x54ed9(%rip), %xmm0    # 0x75fc0
movups %xmm0, -0xcc(%r15)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, -0xbc(%r15)
movl $0x1, -0xb4(%r15)
leaq 0x328(%rsp), %r12
leaq 0x55ca6(%rip), %rcx     # 0x76dc0
leaq 0x55ca4(%rip), %r8      # 0x76dc5
movl $0x3, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x51ef
leaq 0x55c88(%rip), %rcx     # 0x76dc0
leaq 0x55c8a(%rip), %r8      # 0x76dc9
movl $0x3, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x51ef
leaq 0x318(%rsp), %rdi
leaq 0x330(%rsp), %rsi
leaq 0x55c67(%rip), %rcx     # 0x76dcd
leaq 0x55c65(%rip), %r8      # 0x76dd2
movl $0x3, %edx
callq 0x51ef
leaq 0x320(%rsp), %rdi
leaq 0x338(%rsp), %rsi
leaq 0x55c48(%rip), %rcx     # 0x76dd6
leaq 0x55c46(%rip), %r8      # 0x76ddb
movl $0x3, %edx
callq 0x51ef
leaq 0xc8(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movl $0x10, %edx
movl $0x11, %ecx
callq 0xd6e9
movl %eax, %ebp
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x54f8e(%rip), %rsi     # 0x7615d
leaq 0x54f8c(%rip), %rdx     # 0x76162
leaq 0x48(%rsp), %rdi
callq 0x1517a
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x15390
leaq 0x55bd8(%rip), %rsi     # 0x76ddf
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x56322(%rip), %rdx     # 0x77546
leaq 0x88(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
movq 0x90(%rsp), %r15
testq %r15, %r15
setne %r14b
je 0x2127a
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x562f1(%rip), %rdx     # 0x77546
leaq 0x68(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
leaq 0x584bc(%rip), %rsi     # 0x79725
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x702b8
jmp 0x21297
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x562bc(%rip), %rdx     # 0x77546
leaq 0x28(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x6feec
leaq 0xa8(%rsp), %rsi
movl %ebp, %edi
callq 0x16534
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x212d3
callq 0x2200
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x212e6
callq 0x2200
testq %r15, %r15
leaq 0x18(%rsp), %r14
je 0x21303
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21303
callq 0x2200
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x21315
callq 0x2200
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x21324
callq 0x2200
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x21333
callq 0x2200
leaq 0xc8(%rsp), %rdi
callq 0xd1c8
movq %rbx, %rdi
callq 0x2200
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbp
jmp 0x213bb
movq %rax, %rbp
movb $0x1, %r14b
jmp 0x213a0
movq %rax, %rbp
movb $0x1, %r14b
jmp 0x213b8
movq %rax, %rbp
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2138d
callq 0x2200
jmp 0x2138d
movq %rax, %rbp
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x213a0
callq 0x2200
testb %r14b, %r14b
je 0x213b8
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x213b8
callq 0x2200
testb %r14b, %r14b
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x213d2
callq 0x2200
jmp 0x213d2
movq %rax, %rbp
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x213fa
callq 0x2200
jmp 0x213fa
movq %rax, %rbp
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x213e1
jmp 0x213fa
movq %rax, %rbp
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x21419
callq 0x2200
jmp 0x21419
jmp 0x21416
jmp 0x21416
movq %rax, %rbp
jmp 0x21426
jmp 0x21416
movq %rax, %rbp
leaq 0xc8(%rsp), %rdi
callq 0xd1c8
movq %rbx, %rdi
callq 0x2200
movq %rbp, %rdi
callq 0x23b0
movq %rax, %rdi
callq 0x14f59