// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng_benchmark.cpp
// Function: testDecode(std::vector<unsigned char, std::allocator<unsigned char>> const&)
void testDecode(const std::vector<unsigned char>& png) {
  lodepng::State state;
  unsigned char* decoded = 0;
  unsigned w, h;

  // Try custom decompression settings
  if(apply_mods) {
    state.decoder.color_convert = 0;
    //state.decoder.ignore_crc = 1;
  }

  double t_dec0 = getTime();
  for(int i = 0; i < NUM_DECODE; i++) {
    unsigned error_dec = lodepng_decode(&decoded, &w, &h, &state, png.data(), png.size());
    assertEquals(0, error_dec, "decoder error");
  }
  double t_dec1 = getTime();

  total_dec_time += (t_dec1 - t_dec0);

  total_raw_dec_size += lodepng_get_raw_size(w, h, &state.info_raw);

  if(verbose) {
    printValue("decoding time", t_dec1 - t_dec0, "/", NUM_DECODE, " s");
  }
  free(decoded);

  // input image stats
  {
    lodepng::State inspect;
    unsigned w, h;
    lodepng_inspect(&w, &h, &inspect, png.data(), png.size());
    total_raw_in_size += lodepng_get_raw_size(w, h, &inspect.info_png.color);
    total_png_in_size += png.size();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x568, %rsp            # imm = 0x568
movq %rdi, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0xd258
movq $0x0, 0x18(%rsp)
cmpb $0x1, 0xc169(%rip)      # 0x1d1c9
jne 0x1106d
movl $0x0, 0x31c(%rsp)
callq 0x21d0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
divsd 0x6c9f(%rip), %xmm0     # 0x17d20
movsd %xmm0, (%rsp)
movl $0x5, %ebp
leaq 0x6d8e(%rip), %r14      # 0x17e20
leaq 0x68(%rsp), %r15
leaq 0x20(%rsp), %r12
leaq 0x40(%rsp), %r13
movq (%rbx), %r8
movq 0x8(%rbx), %r9
subq %r8, %r9
leaq 0x18(%rsp), %rdi
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x2e8(%rsp), %rcx
callq 0x9499
movl %eax, 0x40(%rsp)
movl $0x0, 0x20(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %r15, %rdi
leaq 0x6d2c(%rip), %rsi      # 0x17e13
movq %r14, %rdx
callq 0x12d56
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x129e4
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x11111
callq 0x2180
decl %ebp
jne 0x110a1
callq 0x21d0
movl %eax, %eax
cvtsi2sd %rax, %xmm1
divsd 0x6bf7(%rip), %xmm1     # 0x17d20
subsd (%rsp), %xmm1
movsd 0xc0b2(%rip), %xmm0     # 0x1d1e8
movsd %xmm1, (%rsp)
addsd %xmm1, %xmm0
movsd %xmm0, 0xc0a1(%rip)     # 0x1d1e8
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
leaq 0x390(%rsp), %rdx
callq 0x597f
addq %rax, 0xc09d(%rip)      # 0x1d200
cmpb $0x1, 0xc0be(%rip)      # 0x1d228
jne 0x11235
leaq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
movq %rax, (%rdi)
leaq 0x6c9d(%rip), %rsi      # 0x17e21
leaq 0x6ca3(%rip), %rdx      # 0x17e2e
callq 0x12d56
movsd (%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6c24(%rip), %rsi      # 0x17dcf
leaq 0x6c1e(%rip), %rdx      # 0x17dd0
leaq 0x40(%rsp), %rdi
callq 0x12d56
movl $0x5, 0xc(%rsp)
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x6c5b(%rip), %rsi      # 0x17e2f
leaq 0x6c56(%rip), %rdx      # 0x17e31
leaq 0x20(%rsp), %rdi
callq 0x12d56
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x12b40
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x11212
callq 0x2180
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x11221
callq 0x2180
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x11235
callq 0x2180
movq 0x18(%rsp), %rdi
callq 0x2220
leaq 0x68(%rsp), %rdi
callq 0xd258
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
subq %rcx, %r8
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x80a5
movl 0x40(%rsp), %edi
movl 0x20(%rsp), %esi
leaq 0x148(%rsp), %rdx
callq 0x597f
addq %rax, 0xbf75(%rip)      # 0x1d1f8
movq 0x8(%rbx), %rax
subq (%rbx), %rax
addq %rax, 0xbf5f(%rip)      # 0x1d1f0
leaq 0x68(%rsp), %rdi
callq 0xd280
leaq 0x2e8(%rsp), %rdi
callq 0xd280
addq $0x568, %rsp            # imm = 0x568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x112d1
callq 0x2180
jmp 0x112d1
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x11318
callq 0x2180
jmp 0x11318
jmp 0x11315
jmp 0x112fd
jmp 0x112fd
jmp 0x112fd
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd280
jmp 0x11300
jmp 0x112fd
jmp 0x112fd
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0xd280
movq %rbx, %rdi
callq 0x2300
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x11300
callq 0x2180
jmp 0x11300
movq %rax, %rdi
callq 0x12a7b