// File: snesic[P]stochastic_thin_films/read_write_msg.cpp
// Function: write_in_File(double*, int, double, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int write_in_File(double *h, int L, double dx, int j_time, string dir) // write data into files.
{
    int i;
    ofstream dat;
    string file_name;                        // Were results will be written
    stringstream sim_name;
    
    
    sim_name.str("");
    sim_name << j_time;
    
    file_name= dir + "/droplet_at_" + sim_name.str()+ ".txt";
    dat.open(file_name.c_str(), ios::out);
	dat.precision(10);
	dat<< scientific;
    for(i=0;i<L;i++)
        dat << scientific << i*dx << "  " << scientific << h[i] << endl;
    dat.close();

return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rcx, -0x498(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x33f0
leaq -0x250(%rbp), %rdi
callq 0x3370
leaq -0x3d8(%rbp), %rdi
callq 0x31a0
jmp 0x932b
leaq -0x409(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x3430
movq -0x4a0(%rbp), %rdx
leaq 0x29f5(%rip), %rsi      # 0xbd41
leaq -0x408(%rbp), %rdi
callq 0x3f80
jmp 0x935a
leaq -0x3d8(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x32e0
jmp 0x936f
leaq -0x408(%rbp), %rdi
callq 0x3140
leaq -0x409(%rbp), %rdi
callq 0x32b0
leaq -0x3c8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3400
jmp 0x9398
movq -0x498(%rbp), %rsi
leaq 0x27b2(%rip), %rdx      # 0xbb58
leaq -0x470(%rbp), %rdi
callq 0x6f20
jmp 0x93b4
leaq -0x490(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x3260
jmp 0x93c9
leaq -0x450(%rbp), %rdi
leaq -0x470(%rbp), %rsi
leaq -0x490(%rbp), %rdx
callq 0x6e50
jmp 0x93e5
leaq 0x293d(%rip), %rdx      # 0xbd29
leaq -0x430(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x6e00
jmp 0x9401
leaq -0x250(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
leaq -0x430(%rbp), %rsi
movq %rsi, -0x4b0(%rbp)
callq 0x3310
movq -0x4b0(%rbp), %rdi
callq 0x3140
leaq -0x450(%rbp), %rdi
callq 0x3140
leaq -0x490(%rbp), %rdi
callq 0x3140
leaq -0x470(%rbp), %rdi
callq 0x3140
movq -0x4a8(%rbp), %rdi
callq 0x30c0
movq %rax, %rsi
leaq -0x230(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
jmp 0x9474
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
movl $0xa, %esi
callq 0x9910
jmp 0x9493
leaq 0x4a6(%rip), %rsi       # 0x9940
leaq -0x230(%rbp), %rdi
callq 0x30a0
jmp 0x94a8
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x964a
leaq 0x47e(%rip), %rsi       # 0x9940
leaq -0x230(%rbp), %rdi
callq 0x30a0
movq %rax, -0x4b8(%rbp)
jmp 0x94d7
movq -0x4b8(%rbp), %rdi
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x34b0
movq %rax, -0x4c0(%rbp)
jmp 0x94fa
movq -0x4c0(%rbp), %rdi
leaq 0x29cd(%rip), %rsi      # 0xbed5
callq 0x3270
movq %rax, -0x4c8(%rbp)
jmp 0x9516
movq -0x4c8(%rbp), %rdi
leaq 0x41c(%rip), %rsi       # 0x9940
callq 0x30a0
movq %rax, -0x4d0(%rbp)
jmp 0x9532
movq -0x4d0(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x34b0
movq %rax, -0x4d8(%rbp)
jmp 0x9554
movq -0x4d8(%rbp), %rdi
movq 0x5a66(%rip), %rsi      # 0xefc8
callq 0x3290
jmp 0x9569
jmp 0x956b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x94af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
jmp 0x9693
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
jmp 0x95c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
leaq -0x408(%rbp), %rdi
callq 0x3140
leaq -0x409(%rbp), %rdi
callq 0x32b0
jmp 0x9687
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
jmp 0x9687
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
jmp 0x963c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
jmp 0x9630
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3e0(%rbp)
movl %eax, -0x3e4(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x3140
leaq -0x490(%rbp), %rdi
callq 0x3140
leaq -0x470(%rbp), %rdi
callq 0x3140
jmp 0x9687
leaq -0x230(%rbp), %rdi
callq 0x3380
jmp 0x9658
leaq -0x3d8(%rbp), %rdi
callq 0x31c0
leaq -0x250(%rbp), %rdi
callq 0x3140
leaq -0x230(%rbp), %rdi
callq 0x33a0
xorl %eax, %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
leaq -0x3d8(%rbp), %rdi
callq 0x31c0
leaq -0x250(%rbp), %rdi
callq 0x3140
leaq -0x230(%rbp), %rdi
callq 0x33a0
movq -0x3e0(%rbp), %rdi
callq 0x3420
nopw (%rax,%rax)