// File: /workspace/github_cpp_makefile_star2_O1/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
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), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
leaq -0x130(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x31d0
movq 0x8(%r15), %rdx
leaq 0x3a4f(%rip), %rsi      # 0x80eb
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
leaq 0x3e44(%rip), %rsi      # 0x854b
movl $0x2, %edx
movq %rbx, %rdi
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
leaq -0x223(%rbp), %r12
movl $0xf3, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x31d0
movabsq $0x474f4c2048545541, %rax # imm = 0x474F4C2048545541
movq %rax, -0xd(%r12)
movabsq $0xa0d4e49474f4c, %rax  # imm = 0xA0D4E49474F4C
movq %rax, -0x8(%r12)
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 0x3d75(%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 %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0x28(%r15), %rdx
leaq 0x395a(%rip), %rsi      # 0x8174
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 0x3cbe(%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 %r13, %rdi
xorl %esi, %esi
callq 0x31d0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31d0
movq 0xa8(%r15), %rdx
movq %r13, %rdi
leaq 0x389d(%rip), %rsi      # 0x8174
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), %r15
movq %r15, %rsi
callq 0x45de
movq %r15, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3420
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x3c04(%rip), %rsi      # 0x854b
callq 0x3420
movq %r14, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3420
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq