// File: /workspace/github_cpp_makefile_star2_O2/wangyufei95[P]watchdog_linux/./maile.h
// Function: CAutoMail::init_mail_info()
void CAutoMail::init_mail_info()
{
	wchar_t _buf[BUF_LEN] = {0};
	wifstream _ifs(STR_EMAIL_CONF_FILE);
	int _iPrefixLen = 4; // length of prefix per line, such as src=xxx@gmail.com, the prefix is "src="
	wstring _str_pre;
	
	while (!_ifs.eof()) 
	{
		memset(_buf, 0, sizeof(_buf));
		_ifs.getline(_buf, sizeof(_buf));
		_str_pre = _buf;
    	_str_pre = _str_pre.substr(0, _iPrefixLen); // get the prefix

		if (wcscmp(_str_pre.data(), L"src=") == 0) // get sender mail address
		{
			m_str_src_mail_p = _buf;
			m_str_src_mail_p = m_str_src_mail_p.substr(_iPrefixLen);
		}
		
		else if (wcscmp(_str_pre.data(), L"dst=") == 0) // get receiver mail address 
		{
			m_str_dst_mail_p = _buf;
			m_str_dst_mail_p = m_str_dst_mail_p.substr(_iPrefixLen);
		}
		else if (wcscmp(_str_pre.data(), L"svr=") == 0) // get the mail server, like "smtp.163.com"
		{
			m_str_email_server = _buf; 
			m_str_email_server = m_str_email_server.substr(_iPrefixLen);
		}
		else if (wcscmp(_str_pre.data(), L"prt=") == 0) // get the server port
		{
			char _buf_tmp[16] = {0};
			wstring _str(_buf);
			_str = _str.substr(_iPrefixLen);
			wcstombs(_buf_tmp, _str.data(), _iPrefixLen+1);
			m_ns_server_port = atoi(_buf_tmp);
		}
		else if (wcscmp(_str_pre.data(), L"psd=") == 0) // get sender email password
		{
			m_str_pwd_p = _buf;
			m_str_pwd_p = m_str_pwd_p.substr(_iPrefixLen);
		}
		else if (wcscmp(_str_pre.data(), L"dat=") == 0) // get the content of email
		{
			m_str_data = _buf;
			m_str_data = m_str_data.substr(_iPrefixLen);			
		}
		else if (wcscmp(_str_pre.data(), L"tit=") == 0) // get the title of email
		{
			m_str_title = _buf;
			m_str_title = m_str_title.substr(_iPrefixLen);
		}
		else // if content is multi-line，get all
		{
			m_str_data += L"\n";
			m_str_data += _buf;
		}
	}
	_ifs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6b8, %rsp            # imm = 0x6B8
movq %rdi, %rbx
leaq -0x6e0(%rbp), %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movq 0x6780(%rip), %rsi      # 0xa388
leaq -0x2d8(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x32d0
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
andl $0x0, (%rax)
leaq 0xe8(%rbx), %r12
leaq 0xc8(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0x88(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq 0x308(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x48(%rbx), %rax
movq %rax, -0x48(%rbp)
movq %rbx, -0x58(%rbp)
leaq 0x8(%rbx), %rax
movq %rax, -0x50(%rbp)
leaq -0xb0(%rbp), %r15
movq -0x2d8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x2b8(%rbp,%rax)
jne 0x3f1b
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x400, %edx            # imm = 0x400
leaq -0x2d8(%rbp), %rdi
movq %r14, %rsi
callq 0x3360
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x3390
movq %r12, %rbx
movq %r15, %rdi
leaq -0x78(%rbp), %r12
movq %r12, %rsi
xorl %edx, %edx
pushq $0x4
popq %rcx
callq 0x31b0
movq %r12, %rdi
movq %r15, %rsi
callq 0x3680
movq %r15, %rdi
callq 0x3050
movq -0x78(%rbp), %r12
movq %r12, %rdi
leaq 0x39be(%rip), %rsi      # 0x76a8
callq 0x3440
testl %eax, %eax
je 0x3da3
movq %r12, %rdi
leaq 0x39bb(%rip), %rsi      # 0x76bc
callq 0x3440
testl %eax, %eax
je 0x3dcc
movq %r12, %rdi
leaq 0x39b8(%rip), %rsi      # 0x76d0
callq 0x3440
testl %eax, %eax
je 0x3df5
movq %r12, %rdi
leaq 0x39b5(%rip), %rsi      # 0x76e4
callq 0x3440
testl %eax, %eax
je 0x3e1e
movq %r12, %rdi
leaq 0x39b2(%rip), %rsi      # 0x76f8
callq 0x3440
testl %eax, %eax
je 0x3e95
movq %r12, %rdi
leaq 0x39af(%rip), %rsi      # 0x770c
callq 0x3440
testl %eax, %eax
je 0x3ebb
movq %r12, %rdi
leaq 0x39ac(%rip), %rsi      # 0x7720
callq 0x3440
testl %eax, %eax
je 0x3edf
movq %rbx, %r12
movq %rbx, %rdi
leaq 0x39a6(%rip), %rsi      # 0x7734
callq 0x3650
movq %r12, %rdi
movq %r14, %rsi
callq 0x3650
jmp 0x3c6a
movq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x3390
movq %rbx, %r12
movq %r15, %rdi
movq -0x50(%rbp), %rbx
movq %rbx, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
jmp 0x3f03
movq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x3390
movq %rbx, %r12
movq %r15, %rdi
movq -0x48(%rbp), %rbx
movq %rbx, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
jmp 0x3f03
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x3390
movq %rbx, %r12
movq %r15, %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
jmp 0x3f03
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
movq %r15, %rdi
movq %r14, %rsi
leaq -0xd0(%rbp), %r12
movq %r12, %rdx
callq 0x3630
movq %r12, %rdi
movq %r15, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
movq %r12, %r13
movq %rbx, %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0x3680
movq %r13, %rdi
callq 0x3050
movq -0xb0(%rbp), %rsi
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
pushq $0x5
popq %rdx
callq 0x3320
movq %rbx, %rdi
callq 0x3570
movq -0x58(%rbp), %rcx
movw %ax, 0x328(%rcx)
jmp 0x3f0e
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x3390
movq %rbx, %r12
movq %r15, %rdi
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
jmp 0x3f03
movq %rbx, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3390
movq %r15, %rdi
movq %r12, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
movq %r12, %rdi
jmp 0x3f06
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x3390
movq %rbx, %r12
movq %r15, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x31b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3680
movq %r15, %rdi
callq 0x3050
jmp 0x3c6a
leaq -0x2d8(%rbp), %rdi
callq 0x3060
leaq -0x78(%rbp), %rdi
callq 0x3050
leaq -0x2d8(%rbp), %rdi
callq 0x32a0
addq $0x6b8, %rsp            # imm = 0x6B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f71
jmp 0x3f71
jmp 0x3f71
jmp 0x3f71
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x3050
jmp 0x3f74
jmp 0x3f71
jmp 0x3f71
jmp 0x3f71
jmp 0x3f71
jmp 0x3f71
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3050
leaq -0x2d8(%rbp), %rdi
callq 0x32a0
movq %rbx, %rdi
callq 0x3600
nop