// File: wangyufei95[P]watchdog_linux/./maile.h
// Function: CAutoMail::send_mail_head(std::basic_ofstream<char, std::char_traits<char>>&)
void CAutoMail::send_mail_head(ofstream &ofs)
{
	char buf_send[BUF_LEN] = {0};
	char buf_recv[BUF_LEN] = {0};
	char time[BUF_LEN] = {0};
	int reval = 0;

	sprintf(buf_send, "EHLO %S\r\n", m_str_src_mail_p.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0); // send with src mail
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(time);
	ofs << time << ": " << buf_recv;

	memset(buf_send, 0, sizeof(buf_send));
	memset(buf_recv, 0, sizeof(buf_recv));
	sprintf(buf_send,"AUTH LOGIN\r\n");
	send(m_socket_server, buf_send, strlen(buf_send), 0);
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(time);
	ofs << time << ": " << buf_recv;

	memset(buf_send, 0, sizeof(buf_send));
	memset(buf_recv, 0, sizeof(buf_recv));
	sprintf(buf_send, "%S\r\n", m_str_src_mail_c.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0); // send username, after encode with base64
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(time);
	ofs << time << ": " << buf_recv;

	memset(buf_send, 0, sizeof(buf_send));
	memset(buf_recv, 0, sizeof(buf_recv));
	sprintf(buf_send, "%S\r\n", m_str_pwd_c.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0); // send password, after encode with base64
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(time);
	ofs << time << ": " << buf_recv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x320(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x310(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
movq -0x320(%rbp), %rdi
movl $0x0, -0x314(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x378(%rbp)
addq $0x8, %rdi
callq 0x3530
movq -0x378(%rbp), %rdi
movq %rax, %rdx
leaq 0x76e4(%rip), %rsi      # 0xc0b4
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x36c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x368(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x36c(%rbp), %edi
movq -0x368(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %edi
leaq -0x210(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
callq 0x30f0
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x48b0
movq -0x10(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x33e0
movq %rax, %rdi
leaq 0x7bd6(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x110(%rbp), %rdi
leaq 0x760e(%rip), %rsi      # 0xc0be
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x35c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x358(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x35c(%rbp), %edi
movq -0x358(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %edi
leaq -0x210(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
callq 0x30f0
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x48b0
movq -0x10(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x33e0
movq %rax, %rdi
leaq 0x7af6(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
movq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rax
movq %rax, -0x350(%rbp)
addq $0x28, %rdi
callq 0x3530
movq -0x350(%rbp), %rdi
movq %rax, %rdx
leaq 0x758c(%rip), %rsi      # 0xc13d
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x344(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x340(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x344(%rbp), %edi
movq -0x340(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %edi
leaq -0x210(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
callq 0x30f0
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x48b0
movq -0x10(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x33e0
movq %rax, %rdi
leaq 0x79f5(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
movq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rax
movq %rax, -0x338(%rbp)
addq $0xa8, %rdi
callq 0x3530
movq -0x338(%rbp), %rdi
movq %rax, %rdx
leaq 0x7488(%rip), %rsi      # 0xc13d
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x32c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x328(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x32c(%rbp), %edi
movq -0x328(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %edi
leaq -0x210(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
callq 0x30f0
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x48b0
movq -0x10(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x33e0
movq %rax, %rdi
leaq 0x78f1(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
nopw (%rax,%rax)