// File: /workspace/github_cpp_makefile_star2_O2/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, 0x30(%rsp)
movq %rsi, %r14
movq %rdi, %rbp
leaq 0x8034(%rip), %rsi      # 0x1130f
leaq 0x38(%rsp), %rdi
leaq 0x78(%rsp), %rbx
movq %rbx, %rdx
callq 0x3e82
movq 0x8(%r14), %rax
movq %r14, 0x18(%rsp)
subq (%r14), %rax
shrq $0x5, %rax
xorl %r15d, %r15d
testl %eax, %eax
movl $0x0, %ecx
movq %rax, 0x28(%rsp)
cmovgl %eax, %ecx
shlq $0x5, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x101f9(%rip), %r14     # 0x19518
leaq 0x810f(%rip), %r12      # 0x11435
leaq 0xf8(%rsp), %r13
movq %rbp, 0x10(%rsp)
cmpq %r15, 0x20(%rsp)
je 0x9397
movq 0x18(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c51
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3440
movq %rax, %rbp
movq %rbx, %rdi
callq 0x3458
cmpq $-0x1, %rbp
je 0x938c
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3e82
movq %r13, %rdi
callq 0x3dec
movq %r13, %rdi
callq 0x3458
addq $0x20, %r15
movq 0x10(%rsp), %rbp
jmp 0x9333
movq $0x0, 0x8(%rsp)
leaq 0x78(%rsp), %r13
leaq 0x1014c(%rip), %rbp     # 0x194f8
leaq 0xd8(%rsp), %r12
leaq 0x98(%rsp), %rbx
leaq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x9c89
testb %al, %al
je 0x94ca
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x3160
xorl %r15d, %r15d
cmpq %r15, 0x20(%rsp)
je 0x947a
movq 0x18(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x9c51
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x6703
movq 0x30(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9c51
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x6703
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x844e
movq %r14, %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x3458
movq %r13, %rdi
callq 0x3458
movq %r12, %rdi
callq 0x3458
addq $0x20, %r15
jmp 0x93ee
movq 0x8(%rsp), %rax
leal 0x1(%rax), %r15d
cmpl 0x28(%rsp), %eax
movl %r15d, %eax
movq %rax, 0x8(%rsp)
jle 0x93c4
leaq 0x58(%rsp), %rdi
leaq 0x7faa(%rip), %rsi      # 0x1144b
movq %r13, %rdx
callq 0x3e82
leaq 0x58(%rsp), %rdi
callq 0x3dec
leaq 0x58(%rsp), %rdi
callq 0x3458
movl %r15d, %eax
movq %rax, 0x8(%rsp)
jmp 0x93c4
leaq 0x38(%rsp), %rdi
callq 0x3458
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x9543
jmp 0x954a
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x9543
jmp 0x954a
jmp 0x954a
jmp 0x954a
movq %rax, %rbx
jmp 0x953b
movq %rax, %rbx
jmp 0x9531
movq %rax, %rbx
jmp 0x9524
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x3458
leaq 0x98(%rsp), %rdi
callq 0x3458
leaq 0x78(%rsp), %rdi
callq 0x3458
leaq 0xd8(%rsp), %rdi
callq 0x3458
jmp 0x954d
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0