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

	sprintf(buf_send, "MAIL FROM: <%S>\r\n", m_str_src_mail_p.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0);
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(buf_time);
	ofs << buf_time << ": " << buf_recv;

	memset(buf_recv, 0, sizeof(buf_recv));
	memset(buf_time, 0, sizeof(buf_time));
	memset(buf_send, 0, sizeof(buf_send));
	sprintf(buf_send, "RCPT TO: <%S>\r\n", m_str_dst_mail_p.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0);
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(buf_time);
	ofs << buf_time << ": " << buf_recv;

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

	memset(buf_send, 0, sizeof(buf_send));

	sprintf(buf_send, "FROM: %S\r\nTO: %S\r\n", m_str_src_mail_p.data(), m_str_dst_mail_p.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0);
	
	memset(buf_send, 0, sizeof(buf_send));
	sprintf(buf_send, "SUBJECT: %S\r\n", m_str_title.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0);

	memset(buf_send, 0, sizeof(buf_send));
	sprintf(buf_send, "Content-type: text/plain;charset=%s\r\n", STR_CODE);
	send(m_socket_server, buf_send, strlen(buf_send), 0);

	memset(buf_send, 0, sizeof(buf_send));
	sprintf(buf_send, "\r\n%S\r\n", m_str_data.data());
	send(m_socket_server, buf_send, strlen(buf_send), 0);

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

	memset(buf_send, 0, sizeof(buf_send));
	memset(buf_recv, 0, sizeof(buf_recv));
	sprintf(buf_send, "QUIT\r\n");
	send(m_socket_server, buf_send, strlen(buf_send), 0);
	recv(m_socket_server, buf_recv, sizeof(buf_recv), 0);
	get_time(buf_time);
	ofs << buf_time << ": " << buf_recv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
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, -0x3e0(%rbp)
addq $0x8, %rdi
callq 0x3530
movq -0x3e0(%rbp), %rdi
movq %rax, %rdx
leaq 0x72cb(%rip), %rsi      # 0xc0cb
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x3d4(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x3d0(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x3d4(%rbp), %edi
movq -0x3d0(%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 0x77a6(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
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
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
movq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rax
movq %rax, -0x3c8(%rbp)
addq $0x48, %rdi
callq 0x3530
movq -0x3c8(%rbp), %rdi
movq %rax, %rdx
leaq 0x71c9(%rip), %rsi      # 0xc0dd
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x3bc(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x3b8(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x3bc(%rbp), %edi
movq -0x3b8(%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 0x7692(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
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
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x110(%rbp), %rdi
leaq 0x70e6(%rip), %rsi      # 0xc0ed
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x3ac(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x3a8(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x3ac(%rbp), %edi
movq -0x3a8(%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 0x759f(%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
movq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rax
movq %rax, -0x3a0(%rbp)
addq $0x8, %rdi
callq 0x3530
movq -0x320(%rbp), %rdi
movq %rax, -0x398(%rbp)
addq $0x48, %rdi
callq 0x3530
movq -0x3a0(%rbp), %rdi
movq -0x398(%rbp), %rdx
movq %rax, %rcx
leaq 0x6fe1(%rip), %rsi      # 0xc0f4
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x38c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x388(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x38c(%rbp), %edi
movq -0x388(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
movq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rax
movq %rax, -0x380(%rbp)
addq $0xc8, %rdi
callq 0x3530
movq -0x380(%rbp), %rdi
movq %rax, %rdx
leaq 0x6f64(%rip), %rsi      # 0xc107
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x374(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x370(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x374(%rbp), %edi
movq -0x370(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
leaq -0x110(%rbp), %rdi
movq 0xc1f9(%rip), %rdx      # 0x11408
leaq 0x6eff(%rip), %rsi      # 0xc115
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x364(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x360(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x364(%rbp), %edi
movq -0x360(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3220
movq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rax
movq %rax, -0x358(%rbp)
addq $0xe8, %rdi
callq 0x3530
movq -0x358(%rbp), %rdi
movq %rax, %rdx
leaq 0x6e95(%rip), %rsi      # 0xc13b
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x34c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x348(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x34c(%rbp), %edi
movq -0x348(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x3200
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 0x6e1d(%rip), %rsi      # 0xc142
movb $0x0, %al
callq 0x3080
movq -0x320(%rbp), %rax
movl 0x32c(%rax), %eax
movl %eax, -0x33c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x338(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
movl -0x33c(%rbp), %edi
movq -0x338(%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 0x7281(%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 0x6d43(%rip), %rsi      # 0xc148
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 0x71a1(%rip), %rsi      # 0xc63e
callq 0x33e0
movq %rax, %rdi
leaq -0x210(%rbp), %rsi
callq 0x33e0
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
nopw (%rax,%rax)