// File: /workspace/github_cpp_makefile_star2_O1/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: tokenise_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void tokenise_command(std::string &command, const std::set<std::string> &valid_names)
{
	std::string new_command = "";
	std::string new_subcommand = "";
	size_t marker = 0;
	
	do
	{
		if (command.substr(marker,1) == drill)
		{
			new_command += separator + drill;
			marker++;
		}
		if (command.substr(marker,1) == "(")
		{
			new_command += separator + "(";
			marker++;
		}
		if (command.substr(marker,1) == ")")
		{
			int power = atoi((char *) command.substr(marker).c_str());
			int power_length = digit_length(power);
			
			new_command += separator + command.substr(marker, 2+power_length);
			marker += 2+power_length;
		}
		
		size_t old_marker = marker;
		new_subcommand = find_next_substring(command, separator, marker);
		
		for (int j = new_subcommand.size(); j >= 0; j--)
		{
			if (j > 0)
			{
				if (valid_names.find(new_subcommand.substr(0,j)) != valid_names.end())
				{
					new_command += new_subcommand.substr(0,j) + separator;
					marker = old_marker + j;
					break;
				}
			}
			else
				new_command += new_subcommand + separator;
		}
	} while (marker != 0);
	
	command = new_command;
	
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r15
movq %rdi, %r12
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb7a4(%rip), %rbx      # 0x172f9
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x86fe
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x86fe
leaq 0x10(%rsp), %r14
movq %r15, 0xd0(%rsp)
leaq 0x8(%r15), %rax
movq %rax, 0xc8(%rsp)
xorl %ebp, %ebp
movq %rsp, %r15
movq %r12, 0xc0(%rsp)
movl $0x1, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3240
movq 0x8(%rsp), %rdx
cmpq 0x1294d(%rip), %rdx     # 0x1e510
jne 0xbbe1
testq %rdx, %rdx
je 0xbbe5
movq 0x12937(%rip), %rsi     # 0x1e508
movq (%rsp), %rdi
callq 0x3230
testl %eax, %eax
sete %bl
jmp 0xbbe7
xorl %ebx, %ebx
jmp 0xbbe7
movb $0x1, %bl
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xbbfd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
testb %bl, %bl
je 0xbc43
movq %r15, %rdi
leaq 0x128dd(%rip), %rsi     # 0x1e4e8
leaq 0x128f6(%rip), %rdx     # 0x1e508
callq 0xd38e
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xbc40
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
incq %rbp
movl $0x1, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3240
movq %r15, %rdi
leaq 0xb6f2(%rip), %rsi      # 0x17352
callq 0x30c0
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xbc7d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
testl %ebx, %ebx
jne 0xbcd9
movq %r14, (%rsp)
movq 0x1285c(%rip), %rsi     # 0x1e4e8
movq 0x1285d(%rip), %rdx     # 0x1e4f0
addq %rsi, %rdx
movq %r15, %rdi
callq 0x878e
movq %r15, %rdi
leaq 0xb6aa(%rip), %rsi      # 0x17352
callq 0x3420
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xbcd6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
incq %rbp
movl $0x1, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3240
movq %r15, %rdi
leaq 0xbc96(%rip), %rsi      # 0x1798c
callq 0x30c0
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xbd13
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
testl %ebx, %ebx
jne 0xbe51
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq $-0x1, %rcx
callq 0x3240
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x3350
movl %eax, %r14d
leaq 0x10(%rsp), %rax
cmpq %rax, %rbx
je 0xbd59
movq 0x10(%rsp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x3220
xorl %eax, %eax
testl %r14d, %r14d
setle %al
je 0xbd85
movslq %r14d, %rcx
imulq $0x66666667, %rcx, %r14 # imm = 0x66666667
movq %r14, %rdx
shrq $0x3f, %rdx
sarq $0x22, %r14
addl %edx, %r14d
incl %eax
addl $0x9, %ecx
cmpl $0x12, %ecx
ja 0xbd63
addl $0x2, %eax
movslq %eax, %r14
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x3240
movq 0x12740(%rip), %rcx     # 0x1e4e8
movq 0x12741(%rip), %r8      # 0x1e4f0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3270
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xbde1
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0xbde7
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xbe2d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xbe49
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3220
addq %r14, %rbp
leaq 0x10(%rsp), %r14
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x878e
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x12657(%rip), %rsi     # 0x1e4e8
movq 0x12658(%rip), %rdx     # 0x1e4f0
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0x878e
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rcx
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x3320
movq %rax, %r13
movq %rax, %rcx
subq %rbp, %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x3240
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x32a0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xbf05
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0xbf2a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0xbf4f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3220
incq %r13
movq 0x68(%rsp), %r12
testl %r12d, %r12d
js 0xc0d5
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %r12, %r14
subq $0x1, %r14
jae 0xbfb4
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
leaq 0x12569(%rip), %rdx     # 0x1e4e8
callq 0xd38e
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xbffe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xbffe
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3240
movq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0xd460
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xbff4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
cmpq 0xc8(%rsp), %rbx
jne 0xc018
leaq 0x1(%r14), %rax
movq %r14, %r12
testq %rax, %rax
jg 0xbf6a
leaq 0x10(%rsp), %r14
jmp 0xc0d5
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3240
movq 0x124b2(%rip), %rsi     # 0x1e4e8
movq 0x124b3(%rip), %rdx     # 0x1e4f0
movq %rbx, %rdi
callq 0x30d0
leaq 0x10(%rsp), %r14
movq %r14, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc06b
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0xc072
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xc0b3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xc0cf
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3220
addq %r12, %rbp
movq %rbp, %r13
movq %r13, %rbp
testq %r13, %r13
movq 0xc0(%rsp), %r12
jne 0xbba4
leaq 0x40(%rsp), %rsi
movq %r12, %rdi
callq 0x3150
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xc112
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0xc12e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3220
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc21b
movq %rax, %rbx
jmp 0xc25c
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0xc189
jmp 0xc196
jmp 0xc162
jmp 0xc21b
movq %rax, %rbx
jmp 0xc196
jmp 0xc21b
jmp 0xc21b
jmp 0xc21b
jmp 0xc1b7
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc196
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xc240
movq 0x30(%rsp), %rsi
jmp 0xc238
jmp 0xc1b7
jmp 0xc21b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0xc233
jmp 0xc240
jmp 0xc21b
jmp 0xc21b
movq %rax, %rbx
jmp 0xc1f6
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0xc1f6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0xc240
movq 0xb0(%rsp), %rsi
jmp 0xc238
jmp 0xc21b
jmp 0xc21b
jmp 0xc21b
movq %rax, %rbx
jmp 0xc240
jmp 0xc222
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc240
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xc25c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0xc278
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3220
movq %rbx, %rdi
callq 0x33e0