// File: /workspace/github_cpp_makefile_star2_O2/deadshot465[P]OwoifyCpp/./owoify.h
// Function: Word::replace(std::__cxx11::basic_regex<wchar_t, std::__cxx11::regex_traits<wchar_t>> const&, std::function<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> ()> const&, bool)
Word& replace(const std::wregex& regex, const std::function<std::wstring()>& func,
		bool replaceReplacedWords = false)
	{
		auto replace_value = func();

		if (!replaceReplacedWords &&
			searchValueContainsReplacedWords(regex, replace_value))
			return *this;

		auto replacing_word = m_word;

		if (std::regex_search(m_word, regex))
			replacing_word = std::regex_replace(m_word, regex, replace_value);

		auto begin = std::wsregex_iterator(m_word.cbegin(), m_word.cend(), regex);
		auto end = std::wsregex_iterator();
		auto replaced_words = std::vector<std::wstring>();

		for (auto i = begin; i != end; ++i)
		{
			replaced_words.emplace_back(std::regex_replace(i->str(), regex, replace_value));
		}

		if (replacing_word != m_word)
		{
			for (const auto& word : replaced_words)
			{
				m_replacedWords.emplace(word);
			}
			m_word = replacing_word;
		}

		return *this;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %ecx, %ebx
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0xd5cc
testl %ebx, %ebx
movq %r14, (%rsp)
jne 0xd332
leaq 0x50(%rsp), %rdx
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x97f4
testb %al, %al
movq (%rsp), %r14
jne 0xd4ec
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x52c0
movq %r14, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x9805
testb %al, %al
je 0xd387
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rcx
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
xorl %r8d, %r8d
callq 0x981d
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x5520
movq %rbx, %rdi
callq 0x5060
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rax
leaq (%rsi,%rax,4), %rdx
leaq 0x70(%rsp), %rdi
movq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x986e
leaq 0x110(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movaps %xmm0, -0x10(%rax)
movaps %xmm0, -0x20(%rax)
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x9902
leaq 0xb0(%rsp), %r13
leaq 0xf0(%rsp), %rbp
leaq 0x138(%rsp), %r14
leaq 0x158(%rsp), %rbx
leaq 0x50(%rsp), %r12
leaq 0x10(%rsp), %r15
movq %r13, %rdi
movq %rbp, %rsi
callq 0x991e
testb %al, %al
je 0xd465
movq %r14, %rdi
leaq 0xd0(%rsp), %rsi
xorl %edx, %edx
callq 0x9964
movq %rbx, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x981d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9928
movq %rbx, %rdi
callq 0x5060
movq %r14, %rdi
callq 0x5060
movq %r13, %rdi
callq 0x9984
jmp 0xd409
leaq 0xd0(%rsp), %rdi
callq 0xa15a
leaq 0x30(%rsp), %rdi
movq (%rsp), %rsi
callq 0x9a61
testb %al, %al
je 0xd4ba
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
movq (%rsp), %rax
leaq 0x20(%rax), %r14
cmpq %r15, %rbx
je 0xd4ac
movq %r14, %rdi
movq %rbx, %rsi
callq 0xca2c
addq $0x20, %rbx
jmp 0xd496
leaq 0x30(%rsp), %rsi
movq (%rsp), %rdi
callq 0x5420
leaq 0x10(%rsp), %rdi
callq 0x775c
leaq 0x110(%rsp), %rdi
callq 0xa15a
leaq 0x90(%rsp), %rdi
callq 0xa15a
leaq 0x30(%rsp), %rdi
callq 0x5060
movq (%rsp), %r14
leaq 0x50(%rsp), %rdi
callq 0x5060
movq %r14, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd51f
jmp 0xd515
jmp 0xd51a
jmp 0xd51f
jmp 0xd515
movq %rax, %rbx
jmp 0xd57e
movq %rax, %rbx
jmp 0xd588
movq %rax, %rbx
jmp 0xd55a
jmp 0xd538
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x5060
jmp 0xd540
movq %rax, %rbx
jmp 0xd54d
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x5060
leaq 0xd0(%rsp), %rdi
callq 0xa15a
leaq 0x10(%rsp), %rdi
callq 0x775c
leaq 0x110(%rsp), %rdi
callq 0xa15a
leaq 0x90(%rsp), %rdi
callq 0xa15a
leaq 0x30(%rsp), %rdi
callq 0x5060
leaq 0x50(%rsp), %rdi
callq 0x5060
movq %rbx, %rdi
callq 0x54a0