// File: lvandeve[P]lodepng/examples/example_sdl.cpp
// Function: showfile(char const*)
int showfile(const char* filename) {
  std::cout << "showing " << filename << std::endl;

  std::vector<unsigned char> buffer, image;
  lodepng::load_file(buffer, filename); //load the image file with given filename
  unsigned w, h;
  unsigned error = lodepng::decode(image, w, h, buffer); //decode the png

  //stop if there is an error
  if(error) {
    std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl;
    return 0;
  }

  return show(filename, &image[0], w, h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq 0xac72(%rip), %rdi      # 0x25fd8
leaq 0x5693(%rip), %rsi      # 0x20a00
callq 0x2160
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x2160
movq %rax, %rdi
movq 0xac40(%rip), %rsi      # 0x25fc8
callq 0x2190
leaq -0x28(%rbp), %rdi
callq 0x19210
leaq -0x40(%rbp), %rdi
callq 0x19210
jmp 0x1b3a1
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x22a0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x2210
jmp 0x1b3d5
leaq -0x28(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x10320
jmp 0x1b3e4
leaq -0x70(%rbp), %rdi
callq 0x20e0
jmp 0x1b3ef
leaq -0x71(%rbp), %rdi
callq 0x21a0
leaq -0x40(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x7c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
movl $0x6, %r8d
movl $0x8, %r9d
callq 0x10a40
movl %eax, -0xc4(%rbp)
jmp 0x1b421
movl -0xc4(%rbp), %eax
movl %eax, -0x80(%rbp)
cmpl $0x0, -0x80(%rbp)
je 0x1b533
movq 0xab9d(%rip), %rdi      # 0x25fd8
leaq 0x55c7(%rip), %rsi      # 0x20a09
callq 0x2160
movq %rax, -0xd0(%rbp)
jmp 0x1b450
movq -0xd0(%rbp), %rdi
movl -0x80(%rbp), %esi
callq 0x2200
movq %rax, -0xd8(%rbp)
jmp 0x1b468
movq -0xd8(%rbp), %rdi
leaq 0x55a2(%rip), %rsi      # 0x20a18
callq 0x2160
movq %rax, -0xe0(%rbp)
jmp 0x1b484
movl -0x80(%rbp), %edi
callq 0xfc20
movq %rax, -0xe8(%rbp)
jmp 0x1b495
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdi
callq 0x2160
movq %rax, -0xf0(%rbp)
jmp 0x1b4b1
movq -0xf0(%rbp), %rdi
movq 0xab09(%rip), %rsi      # 0x25fc8
callq 0x2190
jmp 0x1b4c6
movl $0x0, -0x4(%rbp)
movl $0x1, -0x84(%rbp)
jmp 0x1b60b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1b638
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1b514
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x20e0
jmp 0x1b512
jmp 0x1b514
leaq -0x71(%rbp), %rdi
callq 0x21a0
jmp 0x1b62b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1b62b
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x22a0
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x2210
jmp 0x1b56d
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x19360
movq %rax, -0x108(%rbp)
jmp 0x1b583
movq -0x108(%rbp), %rsi
movl -0x78(%rbp), %edx
movl -0x7c(%rbp), %ecx
leaq -0xa8(%rbp), %rdi
callq 0x1ae20
movl %eax, -0x10c(%rbp)
jmp 0x1b5a4
movl -0x10c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x20e0
jmp 0x1b5bb
leaq -0xa9(%rbp), %rdi
callq 0x21a0
movl $0x1, -0x84(%rbp)
jmp 0x1b60b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1b5fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x20e0
jmp 0x1b5fb
jmp 0x1b5fd
leaq -0xa9(%rbp), %rdi
callq 0x21a0
jmp 0x1b62b
leaq -0x40(%rbp), %rdi
callq 0x19230
jmp 0x1b616
leaq -0x28(%rbp), %rdi
callq 0x19230
movl -0x4(%rbp), %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x19230
jmp 0x1b636
jmp 0x1b638
leaq -0x28(%rbp), %rdi
callq 0x19230
jmp 0x1b643
jmp 0x1b645
movq -0x48(%rbp), %rdi
callq 0x2290
movq %rax, %rdi
callq 0x19200
nopw %cs:(%rax,%rax)