// File: /workspace/github_cpp_makefile_star2_O3/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 0x71fa(%rip), %rsi      # 0x11dca
callq 0x5510
testq %rax, %rax
je 0xad8e
movq %rax, %r15
leaq 0x7202(%rip), %rdi      # 0x11dea
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x5080
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0xadd4
movq %rax, %r12
movq %rax, %rdi
callq 0x5710
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0xad6f
movq %rax, %r13
movq 0xc380(%rip), %rsi      # 0x16fa8
movl $0xc8, %edx
movq %r12, %rdi
callq 0x54a0
movq %rax, %rdi
callq 0x5600
testl %eax, %eax
jne 0xad6f
movq %r12, %rdi
movq %r15, 0x8(%rsp)
movq %r15, %rsi
callq 0x57a0
xorl %eax, %eax
movl %eax, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x17, %edx
callq 0x5770
movq %r12, %rdi
movq %r13, %rsi
callq 0x52a0
movl %eax, %r15d
movq %r12, %rdi
movq %r13, %rsi
callq 0x57e0
movl %eax, %ebp
movl %r15d, (%rbx)
movl %eax, 0x4(%rbx)
imull %r15d, %eax
cltq
movl $0x3, %ecx
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x5030
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rdi
movq %rdi, (%rsp)
movq %rax, %rsi
callq 0x104de
movq %r12, %rdi
movq %r13, %rsi
callq 0x5350
testl %r15d, %r15d
je 0xad40
movl %ebp, %ecx
movl %ecx, %esi
movl %r15d, %r15d
movl %r15d, %ecx
movl %ebp, %edx
decl %edx
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
movl %edi, %r8d
testl %ebp, %ebp
je 0xad32
movl %edi, %r15d
leaq (%r8,%r8,2), %r9
movslq %r8d, %r10
movl %edx, %r11d
movslq %r11d, %r11
movq (%rax,%r11,8), %r12
movslq 0x4(%rbx), %r13
imulq %r10, %r13
leaq (%r13,%r13,2), %r13
addq 0x8(%rbx), %r13
movb 0x2(%r12,%r9), %r14b
movb %r14b, 0x2(%r15,%r13)
movzwl (%r12,%r9), %r14d
movw %r14w, (%r15,%r13)
movq %r15, %r14
addq $0x3, %r14
decl %r11d
movq %r14, %r15
cmpq %r14, %rsi
jne 0xacf4
movq %r8, %r9
incq %r9
movq %r9, %r8
cmpq %rcx, %r9
jne 0xace3
xorl %eax, %eax
movl %eax, %edx
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5230
movq 0x8(%rsp), %rdi
callq 0x5450
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x707b(%rip), %rsi      # 0x11df1
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xb28d
movq %rbx, %rdi
callq 0x7c81
leaq 0x7038(%rip), %rsi      # 0x11dcd
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xb28d
leaq 0x7031(%rip), %rsi      # 0x11ddd
movq %rbx, %rdi
callq 0x57c0
movq %rax, %rcx
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
addq $0x10, %rax
cmpq %rax, %rdx
jne 0xadf3
movups (%rax), %xmm0
movups %xmm0, (%rbx)
jmp 0xae00
leaq 0x7016(%rip), %rsi      # 0x11df1
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xb28d
movq %rbx, %rdi
callq 0x7c81
movq %rdx, 0x18(%rsp)
movq (%rax), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rcx), %rdx
leaq 0x18(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movb $0x0, 0x10(%rcx)
callq 0x7c81
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xae3b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5470
movq %r14, %rbx
jmp 0xae43
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaeaa
movq 0x48(%rsp), %rsi
jmp 0xaea2
movq %rax, %rbx
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaeaa
movq 0x88(%rsp), %rsi
jmp 0xaea2
movq %rax, %rbx
movq (%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xaeaa
callq 0x105ac
jmp 0xaeaa
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaeaa
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rbx, %rdi
callq 0x5720