// File: /workspace/github_cpp_makefile_star2_O1/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 0xb048(%rip), %rdx      # 0x172f9
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x86fe
movq 0x8(%rbx), %rax
movq %rbx, 0x60(%rsp)
subq (%rbx), %rax
shrq $0x5, %rax
movq %rax, 0x48(%rsp)
testl %eax, %eax
jle 0xc3a4
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 0x121f4(%rip), %rsi     # 0x1e508
callq 0xd38e
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 0xc34e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
cmpq $-0x1, %r12
je 0xc397
movq %rbx, 0xf8(%rsp)
movq %rbp, %rdi
leaq 0xb0b9(%rip), %rsi      # 0x1741f
leaq 0xb0c7(%rip), %rdx      # 0x17434
callq 0x86fe
movq %rbp, %rdi
callq 0x4397
movq 0xf8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc397
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3220
addq $0x20, %r15
decq %r14
jne 0xc2ff
leaq 0x78(%rsp), %r14
movq 0x48(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0xa8(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x1211d(%rip), %r13     # 0x1e4e8
leaq 0xd8(%rsp), %rbp
leaq 0xb8(%rsp), %r12
movq 0x58(%rsp), %rbx
movq 0x8(%rbx), %rdx
cmpq 0x10(%rsp), %rdx
jne 0xc409
testq %rdx, %rdx
je 0xc638
movq 0x8(%rsp), %rsi
movq (%rbx), %rdi
callq 0x3230
testl %eax, %eax
je 0xc638
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3150
cmpl $0x0, 0x48(%rsp)
jle 0xc5ad
movq 0xa8(%rsp), %rbx
xorl %r15d, %r15d
movq 0x60(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0xd38e
movq 0x1209f(%rip), %rsi     # 0x1e4e8
movq 0x120a0(%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 0xc480
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xc486
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 0xd38e
movq 0x1202a(%rip), %rsi     # 0x1e4e8
movq 0x1202b(%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 0xc4f0
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0xc4f7
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 0xa68f
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xc53a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xc55f
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xc57b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xc5a0
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3220
addq $0x20, %r15
decq %rbx
jne 0xc42c
movq 0x50(%rsp), %rax
leal 0x1(%rax), %ebx
cmpl 0x48(%rsp), %eax
movl %ebx, %eax
movq %rax, 0x50(%rsp)
leaq 0x88(%rsp), %r15
jle 0xc3db
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %r15, %rdi
leaq 0xae4d(%rip), %rsi      # 0x17435
leaq 0xae78(%rip), %rdx      # 0x17467
callq 0x86fe
movq %r15, %rdi
callq 0x4397
movq 0x88(%rsp), %rdi
movl %ebx, %eax
movq %rax, 0x50(%rsp)
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc3db
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
movl %ebx, %eax
movq %rax, 0x50(%rsp)
jmp 0xc3db
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xc654
movq 0x18(%rsp), %rsi
incq %rsi
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 0xc771
movq 0x108(%rsp), %rsi
jmp 0xc6b2
jmp 0xc76e
jmp 0xc76e
movq %rax, %r15
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc771
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xc771
jmp 0xc76e
jmp 0xc76e
movq %rax, %r15
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r14
jmp 0xc730
movq %rax, %r15
jmp 0xc701
movq %rax, %r15
leaq 0x18(%rsp), %rbx
jmp 0xc747
movq %rax, %r15
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xc701
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 0xc730
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xc747
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xc776
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0xc776
movq %rax, %r15
leaq 0x18(%rsp), %rbx
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc78d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
movq %r15, %rdi
callq 0x33e0