// File: kallaballa[P]PixelStencil/PixelStencil.cpp
// Function: kallaballa::PixelPlanes::PixelPlanes(char*)
PixelPlanes::PixelPlanes(char* filename) : img(filename), width(img.width()), height(img.height()) {
	for (int h = 0; h < img.height(); h++) {
		for (int w = 0; w < img.width(); w++) {
			Color p = 0;
			p |= img(w, h, 0, 0) << 16;
			p |= img(w, h, 0, 1) << 8;
			p |= img(w, h, 0, 2);

			planes[p].push_back({w,h});
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
leaq 0x4b2ee(%rip), %rax     # 0x4fb80
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, -0x48(%rbp)
movq -0x10(%rbp), %rsi
callq 0x5c80
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rdi
addq $0x28, %rax
movq %rax, -0x40(%rbp)
callq 0x5cd0
movl %eax, -0x34(%rbp)
jmp 0x48c0
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rax
movl -0x34(%rbp), %ecx
movslq %ecx, %rcx
movq %rcx, (%rax)
movq %rdi, %rax
addq $0x30, %rax
movq %rax, -0x60(%rbp)
addq $0x8, %rdi
callq 0x5ce0
movl %eax, -0x54(%rbp)
jmp 0x48ea
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rax
movl -0x54(%rbp), %ecx
movslq %ecx, %rcx
movq %rcx, (%rax)
addq $0x38, %rdi
movq %rdi, -0x68(%rbp)
callq 0x5d00
movl $0x0, -0x20(%rbp)
movq -0x50(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, -0x70(%rbp)
addq $0x8, %rdi
callq 0x5ce0
movl %eax, -0x6c(%rbp)
jmp 0x4927
movl -0x70(%rbp), %eax
movl -0x6c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4a8d
movl $0x0, -0x24(%rbp)
movq -0x50(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x78(%rbp)
addq $0x8, %rdi
callq 0x5cd0
movl %eax, -0x74(%rbp)
jmp 0x4954
movl -0x78(%rbp), %eax
movl -0x74(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4a7d
movq -0x50(%rbp), %rdi
movl $0x0, -0x28(%rbp)
addq $0x8, %rdi
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x5d20
movq %rax, -0x80(%rbp)
jmp 0x4988
movq -0x50(%rbp), %rdi
movq -0x80(%rbp), %rax
movzbl (%rax), %ecx
shll $0x10, %ecx
movl -0x28(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x28(%rbp)
addq $0x8, %rdi
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x5d20
movq %rax, -0x88(%rbp)
jmp 0x49be
movq -0x50(%rbp), %rdi
movq -0x88(%rbp), %rax
movzbl (%rax), %ecx
shll $0x8, %ecx
movl -0x28(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x28(%rbp)
addq $0x8, %rdi
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x5d20
movq %rax, -0x90(%rbp)
jmp 0x49f7
movq -0x50(%rbp), %rdi
movq -0x90(%rbp), %rax
movzbl (%rax), %ecx
movl -0x28(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x28(%rbp)
addq $0x38, %rdi
leaq -0x28(%rbp), %rsi
callq 0x5d80
movq %rax, -0x98(%rbp)
jmp 0x4a23
leaq -0x30(%rbp), %rdi
leaq -0x24(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5e90
jmp 0x4a36
movq -0x98(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5e60
jmp 0x4a48
jmp 0x4a4a
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x493c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x4a96
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x5ec0
jmp 0x4a96
jmp 0x4a7f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x490f
addq $0xa0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x5ee0
movq -0x18(%rbp), %rdi
callq 0x4620
nopl (%rax,%rax)