// File: codeandkey[P]neocortex/src/util.cpp
// Function: neocortex::util::split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char)
std::vector<std::string> util::split(std::string input, char delim) {
	char* buf = new char[input.size() + 1];
	int token_ind = 0;

	std::vector<std::string> result;

	for (size_t c = 0; c < input.size(); ++c) {
		if (input[c] == delim) {
			if (token_ind > 0) {
				buf[token_ind] = '\0';
				token_ind = 0;
				result.push_back(std::string(buf));
			} else {
				continue;
			}
		} else {
			buf[token_ind++] = input[c];
		}
	}

	if (token_ind > 0) {
		buf[token_ind] = '\0';
		token_ind = 0;
		result.push_back(std::string(buf));
	}

	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rsi, -0xa8(%rbp)
movq %rdi, %rcx
movq -0xa8(%rbp), %rdi
movq %rcx, -0x98(%rbp)
movb %dl, %al
movq %rcx, %rdx
movq %rdx, -0xa0(%rbp)
movq %rcx, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
callq 0x52d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x5030
movq -0x98(%rbp), %rdi
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movb $0x0, -0x25(%rbp)
callq 0x22f40
movq $0x0, -0x30(%rbp)
movq -0xa8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq %rax, -0xb0(%rbp)
callq 0x52d0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2205e
movq -0xa8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5740
movq %rax, -0xb8(%rbp)
jmp 0x21f41
movq -0xb8(%rbp), %rax
movsbl (%rax), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jne 0x22014
cmpl $0x0, -0x24(%rbp)
jle 0x22010
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x56d0
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x89b0
jmp 0x21fa8
movq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x22f60
jmp 0x21fba
leaq -0x60(%rbp), %rdi
callq 0x5230
leaq -0x61(%rbp), %rdi
callq 0x5480
jmp 0x22012
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2213e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x22002
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5230
leaq -0x61(%rbp), %rdi
callq 0x5480
jmp 0x2213e
jmp 0x2204d
jmp 0x2204b
movq -0xa8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5740
movq %rax, -0xd0(%rbp)
jmp 0x2202d
movq -0xd0(%rbp), %rax
movb (%rax), %dl
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x2204d
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x21efe
cmpl $0x0, -0x24(%rbp)
jle 0x22118
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x56d0
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x89b0
jmp 0x220b5
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x22f60
jmp 0x220ca
leaq -0x88(%rbp), %rdi
callq 0x5230
leaq -0x89(%rbp), %rdi
callq 0x5480
jmp 0x22118
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2210a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5230
leaq -0x89(%rbp), %rdi
callq 0x5480
jmp 0x2213e
movb $0x1, -0x25(%rbp)
testb $0x1, -0x25(%rbp)
jne 0x2212e
movq -0x98(%rbp), %rdi
callq 0x8c90
movq -0xa0(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x8c90
movq -0x38(%rbp), %rdi
callq 0x56c0
nopw %cs:(%rax,%rax)