// File: /workspace/github_cpp_makefile_star2_O3/arinaschwartz[P]KNN-MNIST/MNISTDataset.cpp
// Function: MNISTDataset::createImage(unsigned char*, unsigned char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
MNISTImage* MNISTDataset::createImage(uint8 data[], uint8 label, string type)
{
	if(type == "full")
		return new FullArrayMNISTImage(data, this->numRows * this->numCols, label);
	else if(type == "downsample2")
		return new DownsampleMNISTImage(data, this->numRows * this->numCols, label, 2);
	else if(type == "downsample4")
		return new DownsampleMNISTImage(data, this->numRows * this->numCols, label, 4);
	else if(type == "downsample8")
		return new DownsampleMNISTImage(data, this->numRows * this->numCols, label, 8);
	else if(type == "scaled2")
		return new ScaledMNISTImage(data, this->numRows, this->numCols, label, 2);
	else if(type == "scaled4")
		return new ScaledMNISTImage(data, this->numRows, this->numCols, label, 4);
	else if(type == "scaled7")
		return new ScaledMNISTImage(data, this->numRows, this->numCols, label, 7);
	else if(type == "random")
		return new RandomMNISTImage(label);
	else if(type == "sum")
		return new SumMNISTImage(data, this->numRows * this->numCols, label);
	else
		throw MNISTFileException("Unknown MNIST type");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18bd(%rip), %rsi      # 0x4086
movq %rcx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x28bb
leaq 0x18ab(%rip), %rsi      # 0x408b
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x28e5
leaq 0x18a0(%rip), %rsi      # 0x4097
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x2915
leaq 0x1895(%rip), %rsi      # 0x40a3
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x2945
leaq 0x188a(%rip), %rsi      # 0x40af
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x2975
leaq 0x187b(%rip), %rsi      # 0x40b7
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x29a1
leaq 0x186c(%rip), %rsi      # 0x40bf
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x29cd
leaq 0x185d(%rip), %rsi      # 0x40c7
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x29f9
leaq 0x184d(%rip), %rsi      # 0x40ce
movq %rbx, %rdi
callq 0x20a0
movl $0x10, %edi
testl %eax, %eax
jne 0x2a20
callq 0x21a0
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2e7a
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2c52
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
movl $0x2, %r8d
callq 0x2cd2
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
movl $0x4, %r8d
callq 0x2cd2
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
movl $0x8, %r8d
callq 0x2cd2
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movzbl %bpl, %r8d
movq %rax, %rdi
movq %r14, %rsi
movl $0x2, %r9d
callq 0x2d76
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movzbl %bpl, %r8d
movq %rax, %rdi
movq %r14, %rsi
movl $0x4, %r9d
callq 0x2d76
jmp 0x2a12
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbx
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movzbl %bpl, %r8d
movq %rax, %rdi
movq %r14, %rsi
movl $0x7, %r9d
callq 0x2d76
jmp 0x2a12
movl $0x10, %edi
callq 0x21a0
movq %rax, %rbx
movzbl %bpl, %esi
movq %rax, %rdi
callq 0x2b68
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x20f0
leaq 0x4184(%rip), %rcx      # 0x6bb0
movq %rcx, (%rax)
leaq 0x169c(%rip), %rcx      # 0x40d2
movq %rcx, 0x8(%rax)
leaq 0x4187(%rip), %rsi      # 0x6bc8
movq 0x4590(%rip), %rdx      # 0x6fd8
movq %rax, %rdi
callq 0x2260
jmp 0x2a54
jmp 0x2a68
movq %rax, %r14
movl $0x10, %esi
jmp 0x2a70
jmp 0x2a68
jmp 0x2a68
jmp 0x2a68
jmp 0x2a68
jmp 0x2a68
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x2280