// File: /workspace/github_cpp_makefile_star2_O2/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 0x19c9(%rip), %rsi      # 0x4086
movq %rcx, %rdi
callq 0x294c
testb %al, %al
je 0x26f1
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2a52
jmp 0x28c7
leaq 0x1993(%rip), %rsi      # 0x408b
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x2730
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
pushq $0x2
popq %r8
movq %rax, %rdi
movq %r14, %rsi
callq 0x2ac0
jmp 0x28c7
leaq 0x1960(%rip), %rsi      # 0x4097
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x276f
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
pushq $0x4
popq %r8
movq %rax, %rdi
movq %r14, %rsi
callq 0x2ac0
jmp 0x28c7
leaq 0x192d(%rip), %rsi      # 0x40a3
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x27ae
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
pushq $0x8
popq %r8
movq %rax, %rdi
movq %r14, %rsi
callq 0x2ac0
jmp 0x28c7
leaq 0x18fa(%rip), %rsi      # 0x40af
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x27ec
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movzbl %bpl, %r8d
pushq $0x2
popq %r9
movq %rax, %rdi
movq %r14, %rsi
callq 0x2b52
jmp 0x28c7
leaq 0x18c4(%rip), %rsi      # 0x40b7
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x282a
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movzbl %bpl, %r8d
pushq $0x4
popq %r9
movq %rax, %rdi
movq %r14, %rsi
callq 0x2b52
jmp 0x28c7
leaq 0x188e(%rip), %rsi      # 0x40bf
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x2865
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movzbl %bpl, %r8d
pushq $0x7
popq %r9
movq %rax, %rdi
movq %r14, %rsi
callq 0x2b52
jmp 0x28c7
leaq 0x185b(%rip), %rsi      # 0x40c7
movq %rbx, %rdi
callq 0x294c
testb %al, %al
je 0x2891
pushq $0x10
popq %rdi
callq 0x2180
movq %rax, %rbx
movzbl %bpl, %esi
movq %rax, %rdi
callq 0x298c
jmp 0x28c7
leaq 0x1836(%rip), %rsi      # 0x40ce
movq %rbx, %rdi
callq 0x294c
pushq $0x10
popq %rdi
testb %al, %al
je 0x28d5
callq 0x2180
movq %rax, %rbx
movl 0x10(%r15), %edx
imull 0xc(%r15), %edx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2c48
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x20e0
leaq 0x42cf(%rip), %rcx      # 0x6bb0
movq %rcx, (%rax)
leaq 0x17e7(%rip), %rcx      # 0x40d2
movq %rcx, 0x8(%rax)
leaq 0x42d2(%rip), %rsi      # 0x6bc8
movq 0x46db(%rip), %rdx      # 0x6fd8
movq %rax, %rdi
callq 0x2240
jmp 0x2907
movq %rax, %r14
pushq $0x10
jmp 0x291f
jmp 0x291a
jmp 0x291a
jmp 0x291a
jmp 0x291a
jmp 0x291a
jmp 0x291a
movq %rax, %r14
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2260