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

	while (index < line.size()) {

		if (cidx[line[index]] == -1) {
			// current char is not a~z or A~Z, so it is a delimiter

			if (found && tip->rw != "") {
				cout << "find typo:'" << tip->ww << "' maybe it should be '"
					<< tip->rw << "'" << endl;
			}

			tip = &typo_info;
			index++;
			continue;
		}

		found = false;
		for (it = tip->children.begin(); it != tip->children.end(); it++) {
			if (it->ch == line[index]) {
				found = true;


				break;
			} else if (it->ch > line[index]) {
				// The children is from A to Z and a to z
				break;
			}
		}

		if (found)
			tip = &(*it);
		else
			tip = &typo_info;

		index++;
	}

	// The last word is a typo
	if (found && tip->rw != "") {
		cout << "find typo:'" << tip->ww << "' maybe it should be '"
			<< tip->rw << "'" << endl;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0x5eab(%rip), %rax      # 0x91e8
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3930
leaq -0x38(%rbp), %rdi
callq 0x4690
leaq -0x40(%rbp), %rdi
callq 0x3ef0
movslq -0xc(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2140
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x3590
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x2240
movsbq (%rax), %rcx
leaq 0x5ebb(%rip), %rax      # 0x9250
movsbl (%rax,%rcx), %eax
cmpl $-0x1, %eax
jne 0x34a3
testb $0x1, -0xd(%rbp)
je 0x348a
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
leaq 0x2cff(%rip), %rsi      # 0x60ba
callq 0x46b0
movb %al, -0x71(%rbp)
jmp 0x33c5
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x33d1
jmp 0x348a
movq 0x5c00(%rip), %rdi      # 0x8fd8
leaq 0x2cb9(%rip), %rsi      # 0x6098
callq 0x21c0
movq %rax, -0x80(%rbp)
jmp 0x33ea
movq -0x80(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x21a0
movq %rax, -0x88(%rbp)
jmp 0x3404
movq -0x88(%rbp), %rdi
leaq 0x2c92(%rip), %rsi      # 0x60a4
callq 0x21c0
movq %rax, -0x90(%rbp)
jmp 0x3420
movq -0x90(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
callq 0x21a0
movq %rax, -0x98(%rbp)
jmp 0x343d
movq -0x98(%rbp), %rdi
leaq 0x2c6e(%rip), %rsi      # 0x60b9
callq 0x21c0
movq %rax, -0xa0(%rbp)
jmp 0x3459
movq -0xa0(%rbp), %rdi
movq 0x5b61(%rip), %rsi      # 0x8fc8
callq 0x2200
jmp 0x346e
jmp 0x348a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3950
jmp 0x367e
leaq 0x5d57(%rip), %rax      # 0x91e8
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x335c
movb $0x0, -0xd(%rbp)
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
callq 0x3f10
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
callq 0x3f70
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3f40
testb $0x1, %al
jne 0x34e4
jmp 0x3562
leaq -0x40(%rbp), %rdi
callq 0x3fa0
movsbl (%rax), %eax
movl %eax, -0xa4(%rbp)
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x2240
movq %rax, %rcx
movl -0xa4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x3519
movb $0x1, -0xd(%rbp)
jmp 0x3562
leaq -0x40(%rbp), %rdi
callq 0x3fa0
movsbl (%rax), %eax
movl %eax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x2240
movq %rax, %rcx
movl -0xa8(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jle 0x354a
jmp 0x3562
jmp 0x354c
jmp 0x354e
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x3fc0
movq %rax, -0x68(%rbp)
jmp 0x34c0
testb $0x1, -0xd(%rbp)
je 0x3577
leaq -0x40(%rbp), %rdi
callq 0x4140
movq %rax, -0x18(%rbp)
jmp 0x3582
leaq 0x5c6a(%rip), %rax      # 0x91e8
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x335c
testb $0x1, -0xd(%rbp)
je 0x366a
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
leaq 0x2b11(%rip), %rsi      # 0x60ba
callq 0x46b0
movb %al, -0xa9(%rbp)
jmp 0x35b6
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x35c5
jmp 0x366a
movq 0x5a0c(%rip), %rdi      # 0x8fd8
leaq 0x2ac5(%rip), %rsi      # 0x6098
callq 0x21c0
movq %rax, -0xb8(%rbp)
jmp 0x35e1
movq -0xb8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x21a0
movq %rax, -0xc0(%rbp)
jmp 0x35fe
movq -0xc0(%rbp), %rdi
leaq 0x2a98(%rip), %rsi      # 0x60a4
callq 0x21c0
movq %rax, -0xc8(%rbp)
jmp 0x361a
movq -0xc8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
callq 0x21a0
movq %rax, -0xd0(%rbp)
jmp 0x3637
movq -0xd0(%rbp), %rdi
leaq 0x2a74(%rip), %rsi      # 0x60b9
callq 0x21c0
movq %rax, -0xd8(%rbp)
jmp 0x3653
movq -0xd8(%rbp), %rdi
movq 0x5967(%rip), %rsi      # 0x8fc8
callq 0x2200
jmp 0x3668
jmp 0x366a
leaq -0x30(%rbp), %rdi
callq 0x3950
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2310
nopw (%rax,%rax)