// File: /workspace/github_cpp_makefile_star2_O3/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, 0x20(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb5af(%rip), %r14      # 0x17339
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x892e
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x892e
leaq 0x10(%rsp), %rbx
movq %r15, 0xd0(%rsp)
leaq 0x8(%r15), %rax
movq %rax, 0xc8(%rsp)
xorl %r12d, %r12d
movq %rsp, %r15
movl $0x1, %ecx
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x3240
movq 0x8(%rsp), %rdx
cmpq 0x1271d(%rip), %rdx     # 0x1e510
jne 0xbe15
movq (%rsp), %r13
testq %rdx, %rdx
je 0xbe1d
movq 0x12703(%rip), %rsi     # 0x1e508
movq %r13, %rdi
callq 0x3230
testl %eax, %eax
sete %bpl
jmp 0xbe20
movq (%rsp), %r13
xorl %ebp, %ebp
jmp 0xbe20
movb $0x1, %bpl
cmpq %rbx, %r13
je 0xbe35
movq 0x10(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x3220
testb %bpl, %bpl
je 0xbe7c
movq %r15, %rdi
leaq 0x126a4(%rip), %rsi     # 0x1e4e8
leaq 0x126bd(%rip), %rdx     # 0x1e508
callq 0xd584
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xbe79
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
incq %r12
movl $0x1, %ecx
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x3240
movq %r15, %rdi
leaq 0xb4f7(%rip), %rsi      # 0x17392
callq 0x30c0
movl %eax, %ebp
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xbeb8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
testl %ebp, %ebp
jne 0xbf14
movq %rbx, (%rsp)
movq 0x12621(%rip), %rsi     # 0x1e4e8
movq 0x12622(%rip), %rdx     # 0x1e4f0
addq %rsi, %rdx
movq %r15, %rdi
callq 0x89c4
movq %r15, %rdi
leaq 0xb4af(%rip), %rsi      # 0x17392
callq 0x3420
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xbf11
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
incq %r12
movl $0x1, %ecx
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x3240
movq %r15, %rdi
leaq 0xba99(%rip), %rsi      # 0x179cc
callq 0x30c0
movl %eax, %ebp
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xbf50
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
testl %ebp, %ebp
jne 0xc07e
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
movq $-0x1, %rcx
callq 0x3240
movq (%rsp), %r14
movq %r14, %rdi
callq 0x3350
movl %eax, %r13d
cmpq %rbx, %r14
je 0xbf93
movq 0x10(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x3220
xorl %eax, %eax
testl %r13d, %r13d
setle %al
je 0xbfbf
movslq %r13d, %rcx
imulq $0x66666667, %rcx, %r13 # imm = 0x66666667
movq %r13, %rdx
shrq $0x3f, %rdx
sarq $0x22, %r13
addl %edx, %r13d
incl %eax
addl $0x9, %ecx
cmpl $0x12, %ecx
ja 0xbf9d
addl $0x2, %eax
movslq %eax, %r13
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3240
movq 0x12504(%rip), %rcx     # 0x1e4e8
movq 0x12505(%rip), %r8      # 0x1e4f0
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3270
movq %rbx, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc018
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0xc01e
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
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 0x48(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc05f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xc07b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
addq %r13, %r12
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x89c4
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x12427(%rip), %rsi     # 0x1e4e8
movq 0x12428(%rip), %rdx     # 0x1e4f0
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x89c4
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rcx
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rdx
callq 0x3320
movq %rax, %rbp
movq %rax, %rcx
subq %r12, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3240
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x32a0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc135
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc15a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0xc17f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3220
incq %rbp
movq 0x70(%rsp), %r13
testl %r13d, %r13d
js 0xc2e0
andq $0x7fffffff, %r13       # imm = 0x7FFFFFFF
je 0xc1e3
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x3240
movq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0xd656
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc1d4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
cmpq 0xc8(%rsp), %r14
jne 0xc229
decq %r13
jne 0xc199
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
leaq 0x122f6(%rip), %rdx     # 0x1e4e8
callq 0xd584
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc2e0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xc2e0
leaq 0x28(%rsp), %r14
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x3240
movq 0x122a1(%rip), %rsi     # 0x1e4e8
movq 0x122a2(%rip), %rdx     # 0x1e4f0
movq %r14, %rdi
callq 0x30d0
movq %rbx, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc277
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0xc27d
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
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 0x48(%rsp), %rdi
callq 0x30d0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc2be
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xc2da
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
addq %r13, %r12
movq %r12, %rbp
movq %rbp, %r12
testq %rbp, %rbp
jne 0xbdd2
leaq 0x48(%rsp), %rsi
movq 0x20(%rsp), %rdi
callq 0x3150
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xc317
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xc333
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3220
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc402
movq %rax, %r14
jmp 0xc43c
jmp 0xc365
jmp 0xc385
jmp 0xc402
jmp 0xc407
jmp 0xc402
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc388
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xc388
jmp 0xc407
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xc420
movq 0x38(%rsp), %rsi
jmp 0xc418
jmp 0xc402
jmp 0xc402
jmp 0xc402
jmp 0xc407
jmp 0xc407
jmp 0xc402
jmp 0xc402
jmp 0xc402
jmp 0xc402
jmp 0xc402
movq %rax, %r14
jmp 0xc3e3
movq %rax, %r14
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc3e3
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0xc420
movq 0xb8(%rsp), %rsi
jmp 0xc418
movq %rax, %r14
jmp 0xc420
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0xc420
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xc43c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xc458
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3220
movq %r14, %rdi
callq 0x33e0