// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x230(%rbp), %r13
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31d0
leaq -0x330(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x31d0
leaq -0x130(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0x8(%r15), %rdx
leaq 0x372a(%rip), %rsi      # 0x8102
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
leaq -0x330(%rbp), %r12
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x30c0
movq %r14, %rsi
callq 0x45de
movq %r14, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3420
leaq 0x3b08(%rip), %rsi      # 0x854b
movl $0x2, %edx
movq %rbx, %rdi
callq 0x3420
movq %r12, %r14
movq %r12, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x31d0
movl $0x100, %edx            # imm = 0x100
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
callq 0x31d0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0x48(%r15), %rdx
leaq 0x366f(%rip), %rsi      # 0x8114
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x30c0
leaq -0x130(%rbp), %r12
movq %r12, %rsi
callq 0x45de
movq %r12, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x3a33(%rip), %rsi      # 0x854b
callq 0x3420
movq %r14, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x31d0
leaq -0x229(%rbp), %r14
movl $0xf9, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
movl $0x41544144, -0x7(%r14) # imm = 0x41544144
movl $0xa0d41, -0x4(%r14)    # imm = 0xA0D41
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
leaq -0x330(%rbp), %r12
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x30c0
leaq -0x130(%rbp), %r14
movq %r14, %rsi
callq 0x45de
movq %r14, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x3964(%rip), %rsi      # 0x854b
callq 0x3420
movq %r12, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r12, %rsi
movq %r12, %r14
movq %rax, %rdx
callq 0x3420
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0x8(%r15), %rdx
movq 0x48(%r15), %rcx
leaq 0x3508(%rip), %rsi      # 0x812b
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0xc8(%r15), %rdx
leaq 0x34d5(%rip), %rsi      # 0x813e
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0x6710(%rip), %rdx      # 0xb3b8
leaq 0x349d(%rip), %rsi      # 0x814c
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0xe8(%r15), %rdx
leaq 0x347d(%rip), %rsi      # 0x8172
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %r12d
movq %r13, %rdi
callq 0x3150
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl $0x100, %edx            # imm = 0x100
movq %r14, %r12
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
leaq -0x22a(%rbp), %r14
movl $0xfa, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
movl $0xd2e0a0d, -0x6(%r14)  # imm = 0xD2E0A0D
movw $0xa, -0x2(%r14)
movl 0x32c(%r15), %r14d
movq %r13, %rdi
callq 0x3150
movl %r14d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r12, %r14
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x30c0
leaq -0x130(%rbp), %r12
movq %r12, %rsi
callq 0x45de
movq %r12, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x378a(%rip), %rsi      # 0x854b
callq 0x3420
movq %r14, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movq %r14, %r12
xorl %esi, %esi
callq 0x31d0
movl $0xf9, %edx
leaq -0x229(%rbp), %rdi
xorl %esi, %esi
callq 0x31d0
leaq -0x22a(%rbp), %rax
movl $0x54495551, -0x6(%rax) # imm = 0x54495551
movl $0xa0d54, -0x3(%rax)    # imm = 0xA0D54
movl 0x32c(%r15), %r14d
movq %r13, %rdi
callq 0x3150
movl %r14d, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31a0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x30c0
leaq -0x130(%rbp), %r14
movq %r14, %rsi
callq 0x45de
movq %r14, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x36cc(%rip), %rsi      # 0x854b
callq 0x3420
movq %r12, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3420
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq