// File: /workspace/github_cpp_makefile_star2_O3/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, 0xc(%rsp)
movq %rcx, 0x58(%rsp)
movq %rdx, %r15
movsd %xmm4, 0x30(%rsp)
movsd %xmm3, 0x38(%rsp)
movsd %xmm2, 0x40(%rsp)
movsd %xmm1, 0x48(%rsp)
movsd %xmm0, 0x50(%rsp)
movl %esi, 0x4(%rsp)
movl %edi, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x393c(%rip), %rsi      # 0x8c27
leaq 0x60(%rsp), %rdi
movl $0x8, %edx
callq 0x2350
leaq 0x268(%rsp), %rdi
callq 0x22e0
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
je 0x5367
movq 0x5cb7(%rip), %rdi      # 0xafd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5c9c(%rip), %rdi      # 0xafd8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x1, %ebx
leaq 0x38e1(%rip), %rsi      # 0x8c36
movl $0x1e, %edx
movq %rax, %rdi
callq 0x2200
jmp 0x5702
leaq 0x38e7(%rip), %rsi      # 0x8c55
leaq 0x268(%rsp), %rdi
movl $0x10, %edx
callq 0x2050
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
xorl %ebx, %ebx
testb $0x2, 0x80(%rsp,%rax)
jne 0x5702
leaq 0x60(%rsp), %rbx
leaq 0x268(%rsp), %rbp
leaq 0x3(%rsp), %r12
leaq 0x10(%rsp), %r13
movq %rbx, %rdi
callq 0x2210
cmpb $0x20, %al
je 0x53c4
movzbl %al, %ecx
cmpl $0xa, %ecx
jne 0x53ec
movb %al, 0x3(%rsp)
movl $0x1, %edx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2210
cmpb $0xa, %al
je 0x53c4
movzbl %al, %ecx
cmpl $0x20, %ecx
je 0x53c4
movq %rbx, %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x2250
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2230
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbp, %rdi
callq 0x2200
movq %r13, %rdi
leaq 0x383f(%rip), %rsi      # 0x8c66
callq 0x2070
testl %eax, %eax
jne 0x5450
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x39cf(%rip), %rsi      # 0x8e0e
callq 0x2200
movq %rbp, %rdi
movl 0xc(%rsp), %esi
callq 0x22f0
movq %r13, %rdi
leaq 0x3813(%rip), %rsi      # 0x8c6d
callq 0x2070
testl %eax, %eax
jne 0x548b
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x399c(%rip), %rsi      # 0x8e0e
callq 0x2200
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbp, %rdi
callq 0x2200
movq %r13, %rdi
leaq 0x37de(%rip), %rsi      # 0x8c73
callq 0x2070
testl %eax, %eax
jne 0x56e9
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x37c7(%rip), %rsi      # 0x8c78
callq 0x2200
movl $0x10, %edx
movq %rbp, %rdi
leaq 0x37b5(%rip), %rsi      # 0x8c7a
callq 0x2200
movq %rbp, %rdi
movl 0x8(%rsp), %esi
callq 0x22f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0xd, %edx
movq %rbp, %rdi
leaq 0x377c(%rip), %rsi      # 0x8c8b
callq 0x2200
movq %rbp, %rdi
movl 0x4(%rsp), %esi
callq 0x22f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x10, %edx
movq %rbp, %rdi
leaq 0x3740(%rip), %rsi      # 0x8c99
callq 0x2200
movq %rbp, %rdi
movsd 0x50(%rsp), %xmm0
callq 0x22d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0xc, %edx
movq %rbp, %rdi
leaq 0x3705(%rip), %rsi      # 0x8caa
callq 0x2200
movq %rbp, %rdi
movsd 0x48(%rsp), %xmm0
callq 0x22d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0xc, %edx
movq %rbp, %rdi
leaq 0x36c6(%rip), %rsi      # 0x8cb7
callq 0x2200
movq %rbp, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x22d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x13, %edx
movq %rbp, %rdi
leaq 0x3687(%rip), %rsi      # 0x8cc4
callq 0x2200
movq %rbp, %rdi
movsd 0x38(%rsp), %xmm0
callq 0x22d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x11, %edx
movq %rbp, %rdi
leaq 0x364f(%rip), %rsi      # 0x8cd8
callq 0x2200
movq %rbp, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x22d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x1d, %edx
movq %rbp, %rdi
leaq 0x3615(%rip), %rsi      # 0x8cea
callq 0x2200
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x2200
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x80(%rsp,%rax)
je 0x53b0
xorl %ebx, %ebx
movq 0x58c7(%rip), %rax      # 0xafd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x270(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x268(%rsp,%rcx)
callq 0x2170
leaq 0x360(%rsp), %rdi
callq 0x2090
leaq 0x60(%rsp), %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5760
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21e0
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 0x5792
movq %rax, %rbx
jmp 0x579c
jmp 0x5782
jmp 0x5782
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x2270
leaq 0x60(%rsp), %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x57b8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2310