// File: lvandeve[P]lodepng/lodepng_benchmark.cpp
// Function: testFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void testFile(const std::string& filename) {
  if(verbose) std::cout << "file " << filename << std::endl;

  std::vector<unsigned char> png;
  if(lodepng::load_file(png, filename)) {
    std::cout << "\nfailed to load file " << filename << std::endl << std::endl;
    return;
  }

  // input image stats
  {
    lodepng::State inspect;
    unsigned w, h;
    lodepng_inspect(&w, &h, &inspect, png.data(), png.size());
    total_pixels += (w * h);
    total_png_orig_size += png.size();
    size_t raw_size = lodepng_get_raw_size(w, h, &inspect.info_png.color);
    total_raw_orig_size += raw_size;
    if(verbose) std::cout << "orig compressed size: " << png.size() << ", pixels: " << (w * h) << ", raw size: " << raw_size << std::endl;
  }

  if(do_encode) {
    Image image;
    image.name = getFilePart(filename);
    image.colorType = LCT_RGBA;
    image.bitDepth = 8;
    assertEquals(0, lodepng::decode(image.data, image.width, image.height, filename, image.colorType, image.bitDepth));

    std::vector<unsigned char> temp = testEncode(image);
    if(decode_encoded) png = temp;
  }

  if(do_decode) {
    testDecode(png);
  }

  if(verbose) std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x400, %rsp            # imm = 0x400
movq %rdi, -0x8(%rbp)
testb $0x1, 0xe342(%rip)      # 0x2a228
je 0x1bf16
movq 0xe0e9(%rip), %rdi      # 0x29fd8
leaq 0x7c1c(%rip), %rsi      # 0x23b12
callq 0x2150
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x2120
movq %rax, %rdi
movq 0xe0af(%rip), %rsi      # 0x29fc0
callq 0x21a0
leaq -0x20(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x192a0
movq -0x380(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x103b0
movl %eax, -0x374(%rbp)
jmp 0x1bf3e
movl -0x374(%rbp), %eax
cmpl $0x0, %eax
je 0x1bfd0
movq 0xe084(%rip), %rdi      # 0x29fd8
leaq 0x7ba7(%rip), %rsi      # 0x23b02
callq 0x2150
movq %rax, -0x388(%rbp)
jmp 0x1bf69
movq -0x388(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x2120
movq %rax, -0x390(%rbp)
jmp 0x1bf82
movq -0x390(%rbp), %rdi
movq 0xe030(%rip), %rsi      # 0x29fc0
callq 0x21a0
movq %rax, -0x398(%rbp)
jmp 0x1bf9e
movq -0x398(%rbp), %rdi
movq 0xe014(%rip), %rsi      # 0x29fc0
callq 0x21a0
jmp 0x1bfb3
movl $0x1, -0x30(%rbp)
jmp 0x1c40a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1c41c
leaq -0x2b0(%rbp), %rdi
callq 0x108d0
jmp 0x1bfde
leaq -0x20(%rbp), %rdi
callq 0x1da40
movq %rax, -0x3a0(%rbp)
jmp 0x1bff0
leaq -0x20(%rbp), %rdi
callq 0x19200
movq %rax, -0x3a8(%rbp)
jmp 0x1c002
movq -0x3a8(%rbp), %r8
movq -0x3a0(%rbp), %rcx
leaq -0x2b4(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
leaq -0x2b0(%rbp), %rdx
callq 0x8fd0
jmp 0x1c02c
movl -0x2b4(%rbp), %eax
movl -0x2b8(%rbp), %ecx
imull %ecx, %eax
movl %eax, %ecx
movq 0xe18c(%rip), %rax      # 0x2a1d0
addq %rcx, %rax
movq %rax, 0xe182(%rip)      # 0x2a1d0
leaq -0x20(%rbp), %rdi
callq 0x19200
movq %rax, -0x3b0(%rbp)
jmp 0x1c060
movq -0x3b0(%rbp), %rcx
movq 0xe16a(%rip), %rax      # 0x2a1d8
addq %rcx, %rax
movq %rax, 0xe160(%rip)      # 0x2a1d8
movl -0x2b4(%rbp), %edi
movl -0x2b8(%rbp), %esi
leaq -0x1d0(%rbp), %rdx
callq 0x4a80
movq %rax, -0x3b8(%rbp)
jmp 0x1c099
movq -0x3b8(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rax
addq 0xe12b(%rip), %rax      # 0x2a1e0
movq %rax, 0xe124(%rip)      # 0x2a1e0
testb $0x1, 0xe165(%rip)      # 0x2a228
je 0x1c1bf
movq 0xdf08(%rip), %rdi      # 0x29fd8
leaq 0x7a41(%rip), %rsi      # 0x23b18
callq 0x2150
movq %rax, -0x3c0(%rbp)
jmp 0x1c0e5
leaq -0x20(%rbp), %rdi
callq 0x19200
movq %rax, -0x3c8(%rbp)
jmp 0x1c0f7
movq -0x3c8(%rbp), %rsi
movq -0x3c0(%rbp), %rdi
callq 0x2050
movq %rax, -0x3d0(%rbp)
jmp 0x1c113
movq -0x3d0(%rbp), %rdi
leaq 0x7a0e(%rip), %rsi      # 0x23b2f
callq 0x2150
movq %rax, -0x3d8(%rbp)
jmp 0x1c12f
movq -0x3d8(%rbp), %rdi
movl -0x2b4(%rbp), %esi
movl -0x2b8(%rbp), %eax
imull %eax, %esi
callq 0x2230
movq %rax, -0x3e0(%rbp)
jmp 0x1c153
movq -0x3e0(%rbp), %rdi
leaq 0x79d9(%rip), %rsi      # 0x23b3a
callq 0x2150
movq %rax, -0x3e8(%rbp)
jmp 0x1c16f
movq -0x3e8(%rbp), %rdi
movq -0x2c0(%rbp), %rsi
callq 0x2050
movq %rax, -0x3f0(%rbp)
jmp 0x1c18b
movq -0x3f0(%rbp), %rdi
movq 0xde27(%rip), %rsi      # 0x29fc0
callq 0x21a0
jmp 0x1c1a0
jmp 0x1c1bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x10920
jmp 0x1c319
leaq -0x2b0(%rbp), %rdi
callq 0x10920
jmp 0x1c1cd
testb $0x1, 0xe056(%rip)      # 0x2a22a
je 0x1c3cd
leaq -0x308(%rbp), %rdi
callq 0x1da60
jmp 0x1c1e8
movq -0x8(%rbp), %rsi
leaq -0x328(%rbp), %rdi
callq 0x1bde0
jmp 0x1c1fa
leaq -0x2e0(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x2040
jmp 0x1c20f
leaq -0x328(%rbp), %rdi
callq 0x2348
jmp 0x1c21d
movl $0x6, -0x2e8(%rbp)
movl $0x8, -0x2e4(%rbp)
movl $0x0, -0x32c(%rbp)
leaq -0x2f0(%rbp), %rsi
leaq -0x2ec(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl -0x2e8(%rbp), %r8d
movl -0x2e4(%rbp), %r9d
leaq -0x308(%rbp), %rdi
callq 0x10cd0
movl %eax, -0x3f4(%rbp)
jmp 0x1c26f
movl -0x3f4(%rbp), %eax
movl %eax, -0x330(%rbp)
leaq -0x351(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x2300
movq -0x400(%rbp), %rdx
leaq 0x7bba(%rip), %rsi      # 0x23e56
leaq -0x350(%rbp), %rdi
callq 0x2250
jmp 0x1c2aa
leaq -0x32c(%rbp), %rdi
leaq -0x330(%rbp), %rsi
leaq -0x350(%rbp), %rdx
callq 0x1d7f0
jmp 0x1c2c6
leaq -0x350(%rbp), %rdi
callq 0x2348
jmp 0x1c2d4
leaq -0x351(%rbp), %rdi
callq 0x21b0
leaq -0x370(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x1af50
jmp 0x1c2f5
testb $0x1, 0xdf2f(%rip)      # 0x2a22b
je 0x1c39d
leaq -0x20(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x1dac0
jmp 0x1c314
jmp 0x1c39d
jmp 0x1c41c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1c3bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x2348
jmp 0x1c349
jmp 0x1c3bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1c375
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x2348
jmp 0x1c373
jmp 0x1c375
leaq -0x351(%rbp), %rdi
callq 0x21b0
jmp 0x1c3bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x192c0
jmp 0x1c3bb
leaq -0x370(%rbp), %rdi
callq 0x192c0
jmp 0x1c3ab
leaq -0x308(%rbp), %rdi
callq 0x1dcf0
jmp 0x1c3b9
jmp 0x1c3cd
jmp 0x1c3bd
leaq -0x308(%rbp), %rdi
callq 0x1dcf0
jmp 0x1c3cb
jmp 0x1c41c
testb $0x1, 0xde55(%rip)      # 0x2a229
je 0x1c3e3
leaq -0x20(%rbp), %rdi
callq 0x1b890
jmp 0x1c3e1
jmp 0x1c3e3
testb $0x1, 0xde3e(%rip)      # 0x2a228
je 0x1c403
movq 0xdbe5(%rip), %rdi      # 0x29fd8
movq 0xdbc6(%rip), %rsi      # 0x29fc0
callq 0x21a0
jmp 0x1c401
jmp 0x1c403
movl $0x0, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x192c0
addq $0x400, %rsp            # imm = 0x400
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x192c0
jmp 0x1c427
jmp 0x1c429
movq -0x28(%rbp), %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x19290
nopw (%rax,%rax)