// File: 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
movq %rsp, %rbp
subq $0x570, %rsp            # imm = 0x570
movq %rdx, -0x4b0(%rbp)
movq %rcx, -0x4a8(%rbp)
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movsd %xmm3, -0x30(%rbp)
movsd %xmm4, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movl %r8d, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3370
leaq 0x31cb(%rip), %rsi      # 0xbcef
leaq -0x288(%rbp), %rdi
movl $0x8, %edx
callq 0x3480
jmp 0x8b37
leaq -0x498(%rbp), %rdi
callq 0x33f0
jmp 0x8b45
movq -0x288(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x288(%rbp,%rax), %rdi
callq 0x3100
movb %al, -0x4b1(%rbp)
jmp 0x8b65
movb -0x4b1(%rbp), %al
testb $0x1, %al
jne 0x8b74
jmp 0x8c0c
movq 0x645d(%rip), %rdi      # 0xefd8
movq 0x6446(%rip), %rsi      # 0xefc8
callq 0x3290
movq %rax, -0x4c0(%rbp)
jmp 0x8b90
movq -0x4c0(%rbp), %rdi
leaq 0x3160(%rip), %rsi      # 0xbcfe
callq 0x3270
jmp 0x8ba5
movl $0x1, -0x4(%rbp)
movl $0x1, -0x49c(%rbp)
jmp 0x9063
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
jmp 0x909c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
jmp 0x9090
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
leaq -0x498(%rbp), %rdi
callq 0x33a0
jmp 0x9090
leaq 0x310a(%rip), %rsi      # 0xbd1d
leaq -0x498(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
jmp 0x8c26
jmp 0x8c28
movq -0x288(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x288(%rbp,%rax), %rdi
callq 0x3490
movb %al, -0x4c1(%rbp)
jmp 0x8c48
movb -0x4c1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8c59
jmp 0x9052
leaq -0x288(%rbp), %rdi
callq 0x3300
movl %eax, -0x4c8(%rbp)
jmp 0x8c6d
movl -0x4c8(%rbp), %eax
movb %al, -0x71(%rbp)
movsbl -0x71(%rbp), %eax
cmpl $0x20, %eax
je 0x8c88
movsbl -0x71(%rbp), %eax
cmpl $0xa, %eax
jne 0x8ce6
jmp 0x8c8a
movsbl -0x71(%rbp), %esi
leaq -0x498(%rbp), %rdi
callq 0x32f0
jmp 0x8c9c
leaq -0x288(%rbp), %rdi
callq 0x3300
movl %eax, -0x4cc(%rbp)
jmp 0x8cb0
movl -0x4cc(%rbp), %eax
movb %al, -0x71(%rbp)
movsbl -0x71(%rbp), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x4cd(%rbp)
je 0x8cda
movsbl -0x71(%rbp), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x4cd(%rbp)
movb -0x4cd(%rbp), %al
testb $0x1, %al
jne 0x8c8a
jmp 0x8ce6
leaq -0x288(%rbp), %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x3350
jmp 0x8d00
leaq -0x288(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3330
jmp 0x8d12
leaq -0x498(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3230
jmp 0x8d24
leaq 0x3003(%rip), %rsi      # 0xbd2e
leaq -0x70(%rbp), %rdi
callq 0x98e0
movb %al, -0x4ce(%rbp)
jmp 0x8d3c
movb -0x4ce(%rbp), %al
testb $0x1, %al
jne 0x8d48
jmp 0x8d77
leaq 0x3187(%rip), %rsi      # 0xbed6
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x4d8(%rbp)
jmp 0x8d64
movq -0x4d8(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x3400
jmp 0x8d75
jmp 0x8d77
leaq 0x2fb7(%rip), %rsi      # 0xbd35
leaq -0x70(%rbp), %rdi
callq 0x98e0
movb %al, -0x4d9(%rbp)
jmp 0x8d8f
movb -0x4d9(%rbp), %al
testb $0x1, %al
jne 0x8d9b
jmp 0x8dce
leaq 0x3134(%rip), %rsi      # 0xbed6
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x4e8(%rbp)
jmp 0x8db7
movq -0x4a8(%rbp), %rsi
movq -0x4e8(%rbp), %rdi
callq 0x3230
jmp 0x8dcc
jmp 0x8dce
leaq 0x2f66(%rip), %rsi      # 0xbd3b
leaq -0x70(%rbp), %rdi
callq 0x98e0
movb %al, -0x4e9(%rbp)
jmp 0x8de6
movb -0x4e9(%rbp), %al
testb $0x1, %al
jne 0x8df5
jmp 0x904d
leaq 0x2f44(%rip), %rsi      # 0xbd40
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x4f8(%rbp)
jmp 0x8e11
movq -0x4f8(%rbp), %rdi
leaq 0x2f23(%rip), %rsi      # 0xbd42
callq 0x3270
movq %rax, -0x500(%rbp)
jmp 0x8e2d
movq -0x500(%rbp), %rdi
movl -0x8(%rbp), %esi
callq 0x3400
movq %rax, -0x508(%rbp)
jmp 0x8e45
movq -0x508(%rbp), %rdi
movq 0x6175(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x8e5a
leaq 0x2ef2(%rip), %rsi      # 0xbd53
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x510(%rbp)
jmp 0x8e76
movq -0x510(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x3400
movq %rax, -0x518(%rbp)
jmp 0x8e8e
movq -0x518(%rbp), %rdi
movq 0x612c(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x8ea3
leaq 0x2eb7(%rip), %rsi      # 0xbd61
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x520(%rbp)
jmp 0x8ebf
movq -0x520(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0x34b0
movq %rax, -0x528(%rbp)
jmp 0x8ed9
movq -0x528(%rbp), %rdi
movq 0x60e1(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x8eee
leaq 0x2e7d(%rip), %rsi      # 0xbd72
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x530(%rbp)
jmp 0x8f0a
movq -0x530(%rbp), %rdi
movsd -0x20(%rbp), %xmm0
callq 0x34b0
movq %rax, -0x538(%rbp)
jmp 0x8f24
movq -0x538(%rbp), %rdi
movq 0x6096(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x8f39
leaq 0x2e3f(%rip), %rsi      # 0xbd7f
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x540(%rbp)
jmp 0x8f55
movq -0x540(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
callq 0x34b0
movq %rax, -0x548(%rbp)
jmp 0x8f6f
movq -0x548(%rbp), %rdi
movq 0x604b(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x8f84
leaq 0x2e01(%rip), %rsi      # 0xbd8c
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x550(%rbp)
jmp 0x8fa0
movq -0x550(%rbp), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x34b0
movq %rax, -0x558(%rbp)
jmp 0x8fba
movq -0x558(%rbp), %rdi
movq 0x6000(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x8fcf
leaq 0x2dca(%rip), %rsi      # 0xbda0
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x560(%rbp)
jmp 0x8feb
movq -0x560(%rbp), %rdi
movsd -0x38(%rbp), %xmm0
callq 0x34b0
movq %rax, -0x568(%rbp)
jmp 0x9005
movq -0x568(%rbp), %rdi
movq 0x5fb5(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x901a
leaq 0x2d91(%rip), %rsi      # 0xbdb2
leaq -0x498(%rbp), %rdi
callq 0x3270
movq %rax, -0x570(%rbp)
jmp 0x9036
movq -0x4b0(%rbp), %rsi
movq -0x570(%rbp), %rdi
callq 0x3230
jmp 0x904b
jmp 0x904d
jmp 0x8c28
movl $0x0, -0x4(%rbp)
movl $0x1, -0x49c(%rbp)
leaq -0x498(%rbp), %rdi
callq 0x33a0
leaq -0x288(%rbp), %rdi
callq 0x3070
leaq -0x70(%rbp), %rdi
callq 0x3140
movl -0x4(%rbp), %eax
addq $0x570, %rsp            # imm = 0x570
popq %rbp
retq
leaq -0x288(%rbp), %rdi
callq 0x3070
leaq -0x70(%rbp), %rdi
callq 0x3140
movq -0x290(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)