// File: /workspace/github_cpp_makefile_star2_O2/ThePhage[P]horse_tornado/fast.cpp
// Function: (anonymous namespace)::read_png(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Image read_png(const string& path) {
  FILE* file = fopen(path.c_str(),"rb");
  if (!file)
    die("Failed to open "+path+" for reading");
  png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);
  if (!png)
    die("Error reading png file "+path);
  png_infop info = png_create_info_struct(png);
  if (!info || setjmp(png_jmpbuf(png)))
    die("Error reading png file "+path);
  png_init_io(png,file);
  png_read_png(png,info,PNG_TRANSFORM_STRIP_16|PNG_TRANSFORM_STRIP_ALPHA
                       |PNG_TRANSFORM_PACKING|PNG_TRANSFORM_EXPAND,0);
  const int w = png_get_image_width(png,info),
            h = png_get_image_height(png,info);
  Image image(w,h);
  Pixel** rows = (Pixel**)png_get_rows(png,info);
  for (const int x : range(w))
    for (const int y : range(h))
      image(x,y) = rows[h-y-1][x];
  png_destroy_read_struct(&png,&info,0);
  fclose(file);
  return image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
leaq 0x7abb(%rip), %rsi      # 0x103b6
callq 0x5510
testq %rax, %rax
je 0x8a80
movq %rax, %r12
leaq 0x7ac3(%rip), %rdi      # 0x103d6
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x5070
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x8ab5
movq %rax, %r15
movq %rax, %rdi
callq 0x5720
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x8a61
movq %rax, %r13
movq 0xe65d(%rip), %rsi      # 0x16fb0
movl $0xc8, %edx
movq %r15, %rdi
callq 0x54b0
movq %rax, %rdi
callq 0x5610
testl %eax, %eax
jne 0x8a61
movq %r12, %r14
movq %r13, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x57a0
xorl %eax, %eax
movl %eax, %ecx
pushq $0x17
popq %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x5780
movq %r15, %rdi
movq %r13, %rsi
callq 0x52c0
movl %eax, %ebp
movq %r15, %rdi
movq %r13, %rsi
callq 0x5800
movl %eax, %r13d
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x8ba4
movq %r15, %rdi
movq %r12, %rsi
callq 0x5360
movq %rbx, 0x8(%rsp)
movl %r13d, %ecx
movl %ecx, %edx
movl %ebp, %ebp
movl %ebp, %ecx
decl %r13d
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movl %esi, %edi
cmpq %rcx, %rdi
je 0x8a2f
movl %esi, %r10d
leaq (%rdi,%rdi,2), %r8
movslq %edi, %r9
movl %r13d, %r11d
cmpq %r10, %rdx
je 0x8a2a
movslq %r11d, %r11
movslq 0x4(%rbx), %r12
imulq %r9, %r12
leaq (%r12,%r12,2), %r12
addq 0x8(%rbx), %r12
movq (%rax,%r11,8), %rbp
movb 0x2(%rbp,%r8), %r15b
movb %r15b, 0x2(%r10,%r12)
movzwl (%rbp,%r8), %ebp
movw %bp, (%r10,%r12)
addq $0x3, %r10
decl %r11d
jmp 0x89f0
incq %rdi
jmp 0x89de
xorl %eax, %eax
movl %eax, %edx
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5250
movq %r14, %rdi
callq 0x5470
movq 0x8(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7975(%rip), %rsi      # 0x103dd
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8f42
movq %rbx, %rdi
callq 0x6cf6
leaq 0x7932(%rip), %rsi      # 0x103b9
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8f42
leaq 0x792b(%rip), %rdx      # 0x103c9
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x8cf3
leaq 0x38(%rsp), %rdi
callq 0x6cf6
leaq 0x7921(%rip), %rsi      # 0x103dd
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8f42
movq %rbx, %rdi
callq 0x6cf6
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x51c0
movq %rbx, %rax
jmp 0x8ae6
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x51c0
movq %rbx, %rdi
callq 0x5730
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x8b21
movq %rax, %r14
addq $0x10, %rbx
movq %rbx, %rdi
callq 0xe06c
movq %r14, %rax
jmp 0x8b29
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51c0
movq %rbx, %rax
movq %rax, %rdi
callq 0x5730