// File: /workspace/github_cpp_makefile_star2_O1/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 0x18b9(%rip), %rsi      # 0x4086
movq %rcx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x28bf
leaq 0x18a7(%rip), %rsi      # 0x408b
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x28e9
leaq 0x189c(%rip), %rsi      # 0x4097
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x2919
leaq 0x1891(%rip), %rsi      # 0x40a3
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x2949
leaq 0x1886(%rip), %rsi      # 0x40af
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x2979
leaq 0x1877(%rip), %rsi      # 0x40b7
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x29a5
leaq 0x1868(%rip), %rsi      # 0x40bf
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x29d1
leaq 0x1859(%rip), %rsi      # 0x40c7
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x29fd
leaq 0x1849(%rip), %rsi      # 0x40ce
movq %rbx, %rdi
callq 0x20a0
movl $0x10, %edi
testl %eax, %eax
jne 0x2a24
callq 0x21a0
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2e7c
jmp 0x2a16
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 0x2c4e
jmp 0x2a16
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 0x2cce
jmp 0x2a16
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 0x2cce
jmp 0x2a16
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 0x2cce
jmp 0x2a16
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 0x2d78
jmp 0x2a16
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 0x2d78
jmp 0x2a16
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 0x2d78
jmp 0x2a16
movl $0x10, %edi
callq 0x21a0
movq %rax, %rbx
movzbl %bpl, %esi
movq %rax, %rdi
callq 0x2b64
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x20f0
leaq 0x4180(%rip), %rcx      # 0x6bb0
movq %rcx, (%rax)
leaq 0x1698(%rip), %rcx      # 0x40d2
movq %rcx, 0x8(%rax)
leaq 0x4183(%rip), %rsi      # 0x6bc8
movq 0x458c(%rip), %rdx      # 0x6fd8
movq %rax, %rdi
callq 0x2260
jmp 0x2a58
jmp 0x2a6c
movq %rax, %r14
movl $0x10, %esi
jmp 0x2a74
jmp 0x2a6c
jmp 0x2a6c
jmp 0x2a6c
jmp 0x2a6c
jmp 0x2a6c
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x2280