// File: /workspace/github_cpp_makefile_star2_O3/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: replace_macros(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::vector<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&, std::vector<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 replace_macros(std::string &command, const std::vector<std::string> &macro_name, const std::vector<std::string> &macro)
{
	std::string old_command = "";
	int num_macros = int(macro_name.size());
	
	for (int i = 0; i < num_macros; i++)
		if (command.find(drill + macro_name[i]) != std::string::npos)
			output_error("Cannot drill a macro.");
	
	int c = 0;  // Count the number of replacements we make.
	while (command != old_command)
	{
		old_command = command;
		for (int i = 0; i < num_macros; i++)
			find_and_replace(command, separator + macro_name[i] + separator, separator + macro[i] + separator);
		
		if (c++ > num_macros)
			output_error("Circular references detected in macros in command.");
	}
	
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, 0xb0(%rsp)
movq %rsi, %rbx
movq %rdi, 0x58(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xaea8(%rip), %rdx      # 0x17339
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x892e
movq 0x8(%rbx), %rax
movq %rbx, 0x60(%rsp)
subq (%rbx), %rax
shrq $0x5, %rax
movq %rax, 0x48(%rsp)
testl %eax, %eax
jle 0xc584
leaq 0x108(%rsp), %rbx
movq 0x48(%rsp), %r14
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
leaq 0x28(%rsp), %r13
leaq 0xf8(%rsp), %rbp
movq 0x60(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %r13, %rdi
leaq 0x12014(%rip), %rsi     # 0x1e508
callq 0xd584
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %rdi
xorl %edx, %edx
callq 0x33d0
movq %rax, %r12
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xc52e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
cmpq $-0x1, %r12
je 0xc577
movq %rbx, 0xf8(%rsp)
movq %rbp, %rdi
leaq 0xaf19(%rip), %rsi      # 0x1745f
leaq 0xaf27(%rip), %rdx      # 0x17474
callq 0x892e
movq %rbp, %rdi
callq 0x43b0
movq 0xf8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc577
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3220
addq $0x20, %r15
decq %r14
jne 0xc4df
leaq 0x78(%rsp), %r14
movq 0x48(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0xa8(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x11f3d(%rip), %r13     # 0x1e4e8
leaq 0xd8(%rsp), %rbp
leaq 0xb8(%rsp), %r12
movq 0x58(%rsp), %rbx
movq 0x8(%rbx), %rdx
cmpq 0x10(%rsp), %rdx
jne 0xc5ec
movq 0x8(%rsp), %r15
testq %rdx, %rdx
je 0xc81b
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x3230
testl %eax, %eax
je 0xc81b
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3150
cmpl $0x0, 0x48(%rsp)
jle 0xc790
movq 0xa8(%rsp), %rbx
xorl %r15d, %r15d
movq 0x60(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0xd584
movq 0x11ebc(%rip), %rsi     # 0x1e4e8
movq 0x11ebd(%rip), %rdx     # 0x1e4f0
movq %rbp, %rdi
callq 0x30d0
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc663
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xc669
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xb0(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0xd584
movq 0x11e47(%rip), %rsi     # 0x1e4e8
movq 0x11e48(%rip), %rdx     # 0x1e4f0
movq %r12, %rdi
callq 0x30d0
movq %r14, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc6d3
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0xc6da
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x58(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0xa8e1
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xc71d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xc742
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xc75e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xc783
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3220
addq $0x20, %r15
decq %rbx
jne 0xc60f
movq 0x50(%rsp), %rax
leal 0x1(%rax), %ebx
cmpl 0x48(%rsp), %eax
movl %ebx, %eax
movq %rax, 0x50(%rsp)
leaq 0x88(%rsp), %r15
jle 0xc5bb
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %r15, %rdi
leaq 0xacaa(%rip), %rsi      # 0x17475
leaq 0xacd5(%rip), %rdx      # 0x174a7
callq 0x892e
movq %r15, %rdi
callq 0x43b0
movq 0x88(%rsp), %rdi
movl %ebx, %eax
movq %rax, 0x50(%rsp)
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc5bb
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
movl %ebx, %eax
movq %rax, 0x50(%rsp)
jmp 0xc5bb
leaq 0x18(%rsp), %rax
cmpq %rax, %r15
je 0xc835
movq 0x18(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x3220
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq 0xf8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc952
movq 0x108(%rsp), %rsi
jmp 0xc893
jmp 0xc94f
jmp 0xc94f
movq %rax, %r15
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc952
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xc952
jmp 0xc94f
jmp 0xc94f
movq %rax, %r15
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r14
jmp 0xc911
movq %rax, %r15
jmp 0xc8e2
movq %rax, %r15
leaq 0x18(%rsp), %rbx
jmp 0xc928
movq %rax, %r15
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xc8e2
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r14
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xc911
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xc928
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xc957
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xc957
movq %rax, %r15
leaq 0x18(%rsp), %rbx
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc96e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
movq %r15, %rdi
callq 0x33e0