// File: 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
movq %rsp, %rbp
subq $0x660, %rsp            # imm = 0x660
movq %rdi, -0x8(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x108d0
movq $0x0, -0x290(%rbp)
testb $0x1, 0xe90c(%rip)      # 0x2a1c9
je 0x1b8c9
movl $0x0, -0x254(%rbp)
callq 0x1aeb0
movsd %xmm0, -0x5f8(%rbp)
jmp 0x1b8d8
movsd -0x5f8(%rbp), %xmm0
movsd %xmm0, -0x2a0(%rbp)
movl $0x0, -0x2b0(%rbp)
cmpl $0x5, -0x2b0(%rbp)
jge 0x1ba47
movq -0x8(%rbp), %rdi
callq 0x1d990
movq %rax, -0x600(%rbp)
jmp 0x1b911
movq -0x8(%rbp), %rdi
callq 0x19200
movq %rax, -0x608(%rbp)
jmp 0x1b923
movq -0x608(%rbp), %r9
movq -0x600(%rbp), %r8
leaq -0x290(%rbp), %rdi
leaq -0x294(%rbp), %rsi
leaq -0x298(%rbp), %rdx
leaq -0x288(%rbp), %rcx
callq 0xb110
movl %eax, -0x60c(%rbp)
jmp 0x1b95a
movl -0x60c(%rbp), %eax
movl %eax, -0x2b4(%rbp)
movl $0x0, -0x2b8(%rbp)
leaq -0x2d9(%rbp), %rdi
movq %rdi, -0x618(%rbp)
callq 0x2300
movq -0x618(%rbp), %rdx
leaq 0x8152(%rip), %rsi      # 0x23ae3
leaq -0x2d8(%rbp), %rdi
callq 0x2250
jmp 0x1b99f
leaq -0x2b8(%rbp), %rdi
leaq -0x2b4(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
callq 0x1d7f0
jmp 0x1b9bb
leaq -0x2d8(%rbp), %rdi
callq 0x2348
jmp 0x1b9c9
leaq -0x2d9(%rbp), %rdi
callq 0x21b0
movl -0x2b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b0(%rbp)
jmp 0x1b8f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x1bdbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x1ba36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x2348
jmp 0x1ba34
jmp 0x1ba36
leaq -0x2d9(%rbp), %rdi
callq 0x21b0
jmp 0x1bdbb
callq 0x1aeb0
movsd %xmm0, -0x620(%rbp)
jmp 0x1ba56
movsd -0x620(%rbp), %xmm0
movsd %xmm0, -0x2e8(%rbp)
movsd -0x2e8(%rbp), %xmm1
movsd -0x2a0(%rbp), %xmm0
subsd %xmm0, %xmm1
movsd 0xe766(%rip), %xmm0     # 0x2a1e8
addsd %xmm1, %xmm0
movsd %xmm0, 0xe75a(%rip)     # 0x2a1e8
movl -0x294(%rbp), %edi
movl -0x298(%rbp), %esi
leaq -0x1e0(%rbp), %rdx
callq 0x4a80
movq %rax, -0x628(%rbp)
jmp 0x1baaf
movq -0x628(%rbp), %rax
addq 0xe743(%rip), %rax      # 0x2a200
movq %rax, 0xe73c(%rip)      # 0x2a200
testb $0x1, 0xe75d(%rip)      # 0x2a228
je 0x1bcab
leaq -0x309(%rbp), %rdi
movq %rdi, -0x630(%rbp)
callq 0x2300
movq -0x630(%rbp), %rdx
leaq 0x7fff(%rip), %rsi      # 0x23af1
leaq -0x308(%rbp), %rdi
callq 0x2250
jmp 0x1bb00
movsd -0x2e8(%rbp), %xmm0
movsd -0x2a0(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x318(%rbp)
leaq -0x339(%rbp), %rdi
movq %rdi, -0x638(%rbp)
callq 0x2300
movq -0x638(%rbp), %rdx
leaq 0x7f62(%rip), %rsi      # 0x23a9f
leaq -0x338(%rbp), %rdi
callq 0x2250
jmp 0x1bb4b
movl $0x5, -0x340(%rbp)
leaq -0x361(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0x2300
movq -0x640(%rbp), %rdx
leaq 0x7f89(%rip), %rsi      # 0x23aff
leaq -0x360(%rbp), %rdi
callq 0x2250
jmp 0x1bb84
leaq -0x308(%rbp), %rdi
leaq -0x318(%rbp), %rsi
leaq -0x338(%rbp), %rdx
leaq -0x340(%rbp), %rcx
leaq -0x360(%rbp), %r8
callq 0x1d9b0
jmp 0x1bbae
leaq -0x360(%rbp), %rdi
callq 0x2348
jmp 0x1bbbc
leaq -0x361(%rbp), %rdi
callq 0x21b0
leaq -0x338(%rbp), %rdi
callq 0x2348
jmp 0x1bbd6
leaq -0x339(%rbp), %rdi
callq 0x21b0
leaq -0x308(%rbp), %rdi
callq 0x2348
jmp 0x1bbf0
leaq -0x309(%rbp), %rdi
callq 0x21b0
jmp 0x1bcab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x1bc9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x1bc7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x1bc62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x2348
jmp 0x1bc60
jmp 0x1bc62
leaq -0x361(%rbp), %rdi
callq 0x21b0
leaq -0x338(%rbp), %rdi
callq 0x2348
jmp 0x1bc7c
jmp 0x1bc7e
leaq -0x339(%rbp), %rdi
callq 0x21b0
leaq -0x308(%rbp), %rdi
callq 0x2348
jmp 0x1bc98
jmp 0x1bc9a
leaq -0x309(%rbp), %rdi
callq 0x21b0
jmp 0x1bdbb
movq -0x290(%rbp), %rdi
callq 0x21f0
leaq -0x5e8(%rbp), %rdi
callq 0x108d0
jmp 0x1bcc5
movq -0x8(%rbp), %rdi
callq 0x1d990
movq %rax, -0x648(%rbp)
jmp 0x1bcd7
movq -0x8(%rbp), %rdi
callq 0x19200
movq %rax, -0x650(%rbp)
jmp 0x1bce9
movq -0x650(%rbp), %r8
movq -0x648(%rbp), %rcx
leaq -0x5ec(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
leaq -0x5e8(%rbp), %rdx
callq 0x8fd0
jmp 0x1bd13
movl -0x5ec(%rbp), %edi
movl -0x5f0(%rbp), %esi
leaq -0x508(%rbp), %rdx
callq 0x4a80
movq %rax, -0x658(%rbp)
jmp 0x1bd34
movq -0x658(%rbp), %rcx
movq 0xe4b6(%rip), %rax      # 0x2a1f8
addq %rcx, %rax
movq %rax, 0xe4ac(%rip)      # 0x2a1f8
movq -0x8(%rbp), %rdi
callq 0x19200
movq %rax, -0x660(%rbp)
jmp 0x1bd5e
movq -0x660(%rbp), %rcx
movq 0xe484(%rip), %rax      # 0x2a1f0
addq %rcx, %rax
movq %rax, 0xe47a(%rip)      # 0x2a1f0
leaq -0x5e8(%rbp), %rdi
callq 0x10920
jmp 0x1bd84
leaq -0x288(%rbp), %rdi
callq 0x10920
addq $0x660, %rsp            # imm = 0x660
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
leaq -0x5e8(%rbp), %rdi
callq 0x10920
jmp 0x1bdb9
jmp 0x1bdbb
leaq -0x288(%rbp), %rdi
callq 0x10920
jmp 0x1bdc9
jmp 0x1bdcb
movq -0x2a8(%rbp), %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x19290
nop