// File: loverszhaokai[P]TypoCheck/src/typo.cc
// Function: insert_typo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static int insert_typo(const string &ww, const string &rw)
{
	int index = 0;
	TypoInfo *tip;
	bool found;
	list<TypoInfo>::iterator it;

	tip = &typo_info;

	while (index < ww.size()) {
		found = false;
		for (it = tip->children.begin(); it != tip->children.end(); it++) {
			if (it->ch == ww[index]) {
				found = true;
				break;
			} else if (it->ch > ww[index]) {
				// The children is from A to Z and a to z
				break;
			}
		}
		if (!found)
			it = tip->children.insert(it, TypoInfo(ww[index], "", ""));
		tip = &(*it);

		index++;
	}
	tip->ww = ww;
	tip->rw = rw;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3ef0
leaq 0x63ae(%rip), %rax      # 0x91e8
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2140
movq %rax, %rcx
movq -0x120(%rbp), %rax
cmpq %rcx, %rax
jae 0x30fd
movb $0x0, -0x21(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
callq 0x3f10
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
callq 0x3f70
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3f40
testb $0x1, %al
jne 0x2ea6
jmp 0x2f24
leaq -0x30(%rbp), %rdi
callq 0x3fa0
movsbl (%rax), %eax
movl %eax, -0x124(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x2240
movq %rax, %rcx
movl -0x124(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x2edb
movb $0x1, -0x21(%rbp)
jmp 0x2f24
leaq -0x30(%rbp), %rdi
callq 0x3fa0
movsbl (%rax), %eax
movl %eax, -0x128(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x2240
movq %rax, %rcx
movl -0x128(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jle 0x2f0c
jmp 0x2f24
jmp 0x2f0e
jmp 0x2f10
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x3fc0
movq %rax, -0x48(%rbp)
jmp 0x2e82
testb $0x1, -0x21(%rbp)
jne 0x30e2
movq -0x20(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x140(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4030
movq -0x8(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x2240
movb (%rax), %al
movb %al, -0x131(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x2320
movq -0x130(%rbp), %rdx
leaq 0x313a(%rip), %rsi      # 0x60ba
leaq -0xd8(%rbp), %rdi
callq 0x2750
jmp 0x2f8e
leaq -0x111(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x2320
movq -0x148(%rbp), %rdx
leaq 0x310b(%rip), %rsi      # 0x60ba
leaq -0x110(%rbp), %rdi
callq 0x2750
jmp 0x2fbd
movb -0x131(%rbp), %al
movsbl %al, %esi
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
leaq -0x110(%rbp), %rcx
callq 0x4050
jmp 0x2fe2
movq -0x140(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x3ff0
movq %rax, -0x150(%rbp)
jmp 0x3002
movq -0x150(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x38f0
leaq -0x110(%rbp), %rdi
callq 0x2120
leaq -0x111(%rbp), %rdi
callq 0x2220
leaq -0xd8(%rbp), %rdi
callq 0x2120
leaq -0xd9(%rbp), %rdi
callq 0x2220
jmp 0x30e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
jmp 0x30d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
jmp 0x30bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
jmp 0x30b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x38f0
leaq -0x110(%rbp), %rdi
callq 0x2120
leaq -0x111(%rbp), %rdi
callq 0x2220
leaq -0xd8(%rbp), %rdi
callq 0x2120
leaq -0xd9(%rbp), %rdi
callq 0x2220
jmp 0x312a
leaq -0x30(%rbp), %rdi
callq 0x4140
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2e3e
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x2030
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0x2030
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0xe8(%rbp), %rdi
callq 0x2310
nopw %cs:(%rax,%rax)