// File: /workspace/github_cpp_makefile_star2_O2/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, -0x30(%rbp)
movq %rdi, %r15
leaq -0x230(%rbp), %r13
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31f0
leaq -0x330(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
leaq -0x130(%rbp), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x31f0
movq 0x8(%r15), %rdx
leaq 0x2e21(%rip), %rsi      # 0x70f7
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %ebx
movq %r13, %rdi
callq 0x3140
movl %ebx, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31c0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x30d0
movq %r12, %rbx
movq %r12, %rsi
callq 0x4212
movq -0x30(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x33a0
leaq 0x3222(%rip), %rsi      # 0x7557
movq %rax, %rdi
callq 0x33a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x33a0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
leaq -0x223(%rbp), %rbx
movl $0xf3, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31f0
movabsq $0x474f4c2048545541, %rax # imm = 0x474F4C2048545541
movq %rax, -0xd(%rbx)
movabsq $0xa0d4e49474f4c, %rax  # imm = 0xA0D4E49474F4C
movq %rax, -0x8(%rbx)
movl 0x32c(%r15), %ebx
movq %r13, %rdi
callq 0x3140
movl %ebx, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31c0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x30d0
leaq -0x130(%rbp), %rbx
movq %rbx, %rsi
callq 0x4212
movq %r12, %rdi
movq %rbx, %rsi
callq 0x33a0
movq %rax, %rdi
leaq 0x3176(%rip), %rsi      # 0x7557
callq 0x33a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x33a0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movq 0x28(%r15), %rdx
leaq 0x2d66(%rip), %rsi      # 0x7180
movq %r13, %rdi
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %ebx
movq %r13, %rdi
callq 0x3140
movl %ebx, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31c0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x30d0
leaq -0x130(%rbp), %rbx
movq %rbx, %rsi
callq 0x4212
movq %r12, %rdi
movq %rbx, %rsi
callq 0x33a0
movq %rax, %rdi
leaq 0x30db(%rip), %rsi      # 0x7557
callq 0x33a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x33a0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movq 0xa8(%r15), %rdx
movq %r13, %rdi
leaq 0x2cc5(%rip), %rsi      # 0x7180
xorl %eax, %eax
callq 0x3070
movl 0x32c(%r15), %ebx
movq %r13, %rdi
callq 0x3140
movl %ebx, %edi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31c0
movl 0x32c(%r15), %edi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x30d0
leaq -0x130(%rbp), %rbx
movq %rbx, %rsi
callq 0x4212
movq %r12, %rdi
movq %rbx, %rsi
callq 0x33a0
movq %rax, %rdi
leaq 0x303d(%rip), %rsi      # 0x7557
callq 0x33a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x33a0
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq