// File: /workspace/github_cpp_makefile_star2_O2/snesic[P]stochastic_thin_films/read_write_msg.cpp
// Function: write_email_with_sim_data(int, int, double, double, double, double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int write_email_with_sim_data(int L,int t,double dx,double dt,double b,double A,double sigma, string dir, string calc_time, int i_sim_0)
{
	string pera; char ch;
	int i,j;
    
    ifstream text("text_email.txt");
    ofstream text_4_mail;
    
	// Make sure the file stream is good
	if(!text) {
		cout << endl << "Failed to open the email file ";
		return 1;
    }
    
    text_4_mail.open("text_email_f.txt", ios::out);
    
    while(!text.eof())
    {
       ch=text.get();
       if(ch==' ' || ch=='\n')
        {  do { text_4_mail<< ch; ch=text.get(); } while (ch==' ' || ch=='\n');
        } text.seekg (-1, ifstream::cur);
        text >> pera;
        text_4_mail<< pera;
        if (pera=="number") text_4_mail<< " " << i_sim_0;
        if (pera=="after") text_4_mail<< " " << calc_time;
        if (pera=="are:") { text_4_mail<< "\n" << "Grid length L = "<<L<<endl;
                            text_4_mail<< "Total time = " << t << endl;
                            text_4_mail<< "Grid distance = " << dx << endl;
                            text_4_mail<< "Time step = " << dt << endl;
                            text_4_mail<< "Precursor = " << b << endl;
                            text_4_mail<< "Hamaker constant = " << A << endl;
                            text_4_mail<< "Noise strenght = " << sigma << endl;
                            text_4_mail<< "The results are written in = " << dir;
                            }
    }
        
      return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movl %r8d, 0x4(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, 0x8(%rsp)
movsd %xmm4, 0x10(%rsp)
movsd %xmm3, 0x18(%rsp)
movsd %xmm2, 0x20(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x30(%rsp)
movl %esi, %ebp
movl %edi, %r12d
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x31a0(%rip), %rsi      # 0x7c97
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2340
leaq 0x268(%rsp), %rdi
callq 0x22d0
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
je 0x4b47
movq 0x54ad(%rip), %rdi      # 0x9fd8
callq 0x20a0
leaq 0x316f(%rip), %rsi      # 0x7ca6
movq %rax, %rdi
callq 0x21b0
pushq $0x1
popq %rbx
jmp 0x4d83
leaq 0x3177(%rip), %rsi      # 0x7cc5
leaq 0x268(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x2040
leaq 0x60(%rsp), %r13
leaq 0x268(%rsp), %rbx
leaq 0x40(%rsp), %r14
leaq 0x316c(%rip), %r15      # 0x7ce3
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x80(%rsp,%rax)
jne 0x4d81
movq %r13, %rdi
callq 0x21e0
cmpb $0x20, %al
je 0x4ba2
movzbl %al, %ecx
cmpl $0xa, %ecx
jne 0x4bc1
movsbl %al, %esi
movq %rbx, %rdi
callq 0x21d0
movq %r13, %rdi
callq 0x21e0
cmpb $0xa, %al
je 0x4ba2
movzbl %al, %ecx
cmpl $0x20, %ecx
je 0x4ba2
movq %r13, %rdi
pushq $-0x1
popq %rsi
pushq $0x1
popq %rdx
callq 0x2230
movq %r13, %rdi
movq %r14, %rsi
callq 0x2200
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2170
movq %r14, %rdi
leaq 0x30e7(%rip), %rsi      # 0x7cd6
callq 0x5395
testb %al, %al
je 0x4c13
movq %rbx, %rdi
leaq 0x327c(%rip), %rsi      # 0x7e7e
callq 0x21b0
movq %rax, %rdi
movl 0x4(%rsp), %esi
callq 0x22e0
movq %r14, %rdi
leaq 0x30c0(%rip), %rsi      # 0x7cdd
callq 0x5395
testb %al, %al
je 0x4c42
movq %rbx, %rdi
leaq 0x324e(%rip), %rsi      # 0x7e7e
callq 0x21b0
movq %rax, %rdi
movq 0x38(%rsp), %rsi
callq 0x2170
movq %r14, %rdi
movq %r15, %rsi
callq 0x5395
testb %al, %al
je 0x4b77
movq %rbx, %rdi
leaq 0x3089(%rip), %rsi      # 0x7ce8
callq 0x21b0
movq %rax, %rdi
leaq 0x307c(%rip), %rsi      # 0x7cea
callq 0x21b0
movq %rax, %rdi
movl %r12d, %esi
callq 0x22e0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x306b(%rip), %rsi      # 0x7cfb
callq 0x21b0
movq %rax, %rdi
movl %ebp, %esi
callq 0x22e0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x3058(%rip), %rsi      # 0x7d09
callq 0x21b0
movq %rax, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x22c0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x3044(%rip), %rsi      # 0x7d1a
callq 0x21b0
movq %rax, %rdi
movsd 0x28(%rsp), %xmm0
callq 0x22c0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x302c(%rip), %rsi      # 0x7d27
callq 0x21b0
movq %rax, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x22c0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x3014(%rip), %rsi      # 0x7d34
callq 0x21b0
movq %rax, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x22c0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x3003(%rip), %rsi      # 0x7d48
callq 0x21b0
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x22c0
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
leaq 0x2ff0(%rip), %rsi      # 0x7d5a
callq 0x21b0
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x2170
jmp 0x4b77
xorl %ebx, %ebx
leaq 0x268(%rsp), %rdi
callq 0x2260
leaq 0x60(%rsp), %rdi
callq 0x2050
leaq 0x40(%rsp), %rdi
callq 0x2090
movl %ebx, %eax
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4dd6
movq %rax, %rbx
jmp 0x4de0
jmp 0x4dc6
jmp 0x4dc6
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x2260
leaq 0x60(%rsp), %rdi
callq 0x2050
leaq 0x40(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2300