// File: /workspace/github_cpp_makefile_star2_O3/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 0x2240
movq %rax, %rbx
xorl %r15d, %r15d
movl $0x110, %edx            # imm = 0x110
movq %rax, %rdi
xorl %esi, %esi
callq 0x2140
movdqa 0x553e0(%rip), %xmm0    # 0x761a0
movdqa 0x553e8(%rip), %xmm1    # 0x761b0
movdqu %xmm0, (%rbx,%r15)
addq $0x10, %r15
paddb %xmm1, %xmm0
cmpq $0x110, %r15            # imm = 0x110
jne 0x20dc8
leaq 0xc8(%rsp), %rdi
callq 0xd3c8
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 0x5958
movzbl %bpl, %ecx
movq %r13, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x5958
incq %rbp
cmpq $0x100, %rbp            # imm = 0x100
jne 0x20e2e
movabsq $0x7f00000001, %rax     # imm = 0x7F00000001
movq %rax, 0x1d0(%rsp)
leaq 0x56120(%rip), %rsi     # 0x76f99
leaq 0x56134(%rip), %rdx     # 0x76fb4
movq %r15, %rdi
callq 0x5b30
leaq 0x5612e(%rip), %rsi     # 0x76fbd
leaq 0x56142(%rip), %rdx     # 0x76fd8
movq %r15, %rdi
callq 0x5b30
leaq 0x560f3(%rip), %rsi     # 0x76f98
leaq 0x560f2(%rip), %rdx     # 0x76f9e
leaq 0x560f5(%rip), %rcx     # 0x76fa8
leaq 0x560f9(%rip), %r8      # 0x76fb3
movq %r15, %rdi
callq 0x5d29
leaq 0x560f3(%rip), %rsi     # 0x76fbc
leaq 0x560f2(%rip), %rdx     # 0x76fc2
leaq 0x560f5(%rip), %rcx     # 0x76fcc
leaq 0x560f9(%rip), %r8      # 0x76fd7
movq %r15, %rdi
callq 0x5d29
movaps 0x552d3(%rip), %xmm0    # 0x761c0
leaq 0x310(%rsp), %r15
movups %xmm0, -0xdc(%r15)
movdqa 0x552cb(%rip), %xmm0    # 0x761d0
movdqu %xmm0, -0xcc(%r15)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, -0xbc(%r15)
movl $0x1, -0xb4(%r15)
leaq 0x328(%rsp), %r12
leaq 0x560a7(%rip), %rcx     # 0x76fe0
leaq 0x560a5(%rip), %r8      # 0x76fe5
movl $0x3, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x57c3
leaq 0x56089(%rip), %rcx     # 0x76fe0
leaq 0x5608b(%rip), %r8      # 0x76fe9
movl $0x3, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x57c3
leaq 0x318(%rsp), %rdi
leaq 0x330(%rsp), %rsi
leaq 0x56068(%rip), %rcx     # 0x76fed
leaq 0x56066(%rip), %r8      # 0x76ff2
movl $0x3, %edx
callq 0x57c3
leaq 0x320(%rsp), %rdi
leaq 0x338(%rsp), %rsi
leaq 0x56049(%rip), %rcx     # 0x76ff6
leaq 0x56047(%rip), %r8      # 0x76ffb
movl $0x3, %edx
callq 0x57c3
leaq 0xc8(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movl $0x10, %edx
movl $0x11, %ecx
callq 0xd902
movl %eax, %ebp
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x5538f(%rip), %rsi     # 0x7637d
leaq 0x5538d(%rip), %rdx     # 0x76382
leaq 0x68(%rsp), %rdi
callq 0x14f6e
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x1518a
leaq 0x55fd9(%rip), %rsi     # 0x76fff
leaq 0x8(%rsp), %rdi
callq 0x23e0
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x56723(%rip), %rdx     # 0x77766
leaq 0x88(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
movq 0x90(%rsp), %r14
testq %r14, %r14
je 0x21095
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x566f6(%rip), %rdx     # 0x77766
leaq 0x28(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
leaq 0x588c1(%rip), %rsi     # 0x79945
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x70423
jmp 0x210b2
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x566c1(%rip), %rdx     # 0x77766
leaq 0x48(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x70057
leaq 0xa8(%rsp), %rsi
movl %ebp, %edi
callq 0x16314
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x210ee
callq 0x2210
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21101
callq 0x2210
testq %r14, %r14
leaq 0x18(%rsp), %r14
je 0x2111e
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2111e
callq 0x2210
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x21130
callq 0x2210
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2113f
callq 0x2210
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x2114e
callq 0x2210
leaq 0xc8(%rsp), %rdi
callq 0xd3f0
movq %rbx, %rdi
callq 0x2210
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21186
movq %rax, %rbp
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
jne 0x211cf
jmp 0x211d4
movq %rax, %rbp
jmp 0x211d4
movq %rax, %rbp
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x211a9
callq 0x2210
jmp 0x211a9
movq %rax, %rbp
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x211bc
callq 0x2210
testq %r14, %r14
je 0x211d4
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x211d4
callq 0x2210
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x211eb
callq 0x2210
jmp 0x211eb
movq %rax, %rbp
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21213
callq 0x2210
jmp 0x21213
movq %rax, %rbp
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x211fa
jmp 0x21213
movq %rax, %rbp
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x21232
callq 0x2210
jmp 0x21232
jmp 0x2122f
jmp 0x2122f
movq %rax, %rbp
jmp 0x2123f
jmp 0x2122f
movq %rax, %rbp
leaq 0xc8(%rsp), %rdi
callq 0xd3f0
movq %rbx, %rdi
callq 0x2210
movq %rbp, %rdi
callq 0x23c0
movq %rax, %rdi
callq 0x14d36