// File: joraso[P]Glassius/Protocol.cpp
// Function: Protocol::DiffusionTest(double, double, Stopwatch*)
void Protocol::DiffusionTest(double Temp, double relax, Stopwatch* timer){

    std::cout <<"\n"<< "Diffusion Testing Brownian Integrator" <<"\n"<< std::endl;
    
    double rho = 1000 / (9.4*9.4*9.4);
    //double rho = 1;
    
    std::cout << "\n" << "Setting up System..." << std::endl;
    Free System(rho, Temp, 10);
    timer->StampComplete();
    
    std::cout << "\n" << "Setting up Simulation..." << std::endl;
    Brownian Simulation(&System, 1.0, 1.0, 0.00005, 1);
    timer->StampComplete();
    
    std::cout << "\n" << "Begining Production Run" << std::endl;
    std::cout << "Using Parameters:" << std::endl;
    double dt = Simulation.Getdt();
    std::cout << "Timestep = " << dt << std::endl;
    Simulation.Propigate();
    int Npoints = 100;
    std::cout << "Total Data Points = " << Npoints << std::endl;
    int Nrec = int( relax / (dt*Npoints) );
    Simulation.SetRecord(Nrec);
    std::cout << "Recording every = " << Simulation.GetRecord() << std::endl;
    Simulation.Run(relax);
    timer->StampComplete();
    
    return;
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movsd %xmm0, 0x1f0(%rsp)
movsd %xmm1, 0x1e8(%rsp)
movq %rdi, 0x1e0(%rsp)
movq 0x3e98(%rip), %rdi      # 0xbfd0
movq %rdi, 0x68(%rsp)
leaq 0x114c(%rip), %rsi      # 0x9290
movq %rsi, 0x70(%rsp)
callq 0x2140
movq %rax, %rdi
leaq 0x1397(%rip), %rsi      # 0x94ef
callq 0x2140
movq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movq 0x3e44(%rip), %rsi      # 0xbfb8
movq %rsi, 0x78(%rsp)
callq 0x2150
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movabsq $0x3ff343784bba4763, %rax # imm = 0x3FF343784BBA4763
movq %rax, 0x1d8(%rsp)
callq 0x2140
movq %rax, %rdi
leaq 0x115a(%rip), %rsi      # 0x9303
callq 0x2140
movq 0x78(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movsd 0x1d8(%rsp), %xmm0
movsd 0x1f0(%rsp), %xmm1
leaq 0x150(%rsp), %rdi
movsd 0x1073(%rip), %xmm2     # 0x9250
callq 0x8990
movq 0x1e0(%rsp), %rdi
callq 0x30c0
jmp 0x81f1
movq 0x3dd8(%rip), %rdi      # 0xbfd0
leaq 0x1091(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x60(%rsp)
jmp 0x820b
movq 0x60(%rsp), %rdi
leaq 0x1101(%rip), %rsi      # 0x9318
callq 0x2140
movq %rax, 0x58(%rsp)
jmp 0x8223
movq 0x58(%rsp), %rdi
movq 0x3d89(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x8236
leaq 0x90(%rsp), %rdi
leaq 0x150(%rsp), %rsi
movsd 0xe0a(%rip), %xmm1      # 0x9058
movsd 0x1032(%rip), %xmm2     # 0x9288
movl $0x1, %edx
movaps %xmm1, %xmm0
callq 0x8760
jmp 0x8265
movq 0x1e0(%rsp), %rdi
callq 0x30c0
jmp 0x8274
movq 0x3d55(%rip), %rdi      # 0xbfd0
leaq 0x100e(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x50(%rsp)
jmp 0x828e
movq 0x50(%rsp), %rdi
leaq 0x111f(%rip), %rsi      # 0x93b9
callq 0x2140
movq %rax, 0x48(%rsp)
jmp 0x82a6
movq 0x48(%rsp), %rdi
movq 0x3d06(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x82b9
movq 0x3d10(%rip), %rdi      # 0xbfd0
leaq 0xfed(%rip), %rsi       # 0x92b4
callq 0x2140
movq %rax, 0x40(%rsp)
jmp 0x82d3
movq 0x40(%rsp), %rdi
movq 0x3cd9(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x82e6
leaq 0x90(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x38(%rsp)
jmp 0x82fb
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x3cbf(%rip), %rdi      # 0xbfd0
leaq 0x10b9(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0x30(%rsp)
jmp 0x8324
movq 0x30(%rsp), %rdi
movsd 0x88(%rsp), %xmm0
callq 0x2240
movq %rax, 0x28(%rsp)
jmp 0x833e
movq 0x28(%rsp), %rdi
movq 0x3c6e(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x8351
leaq 0x90(%rsp), %rdi
callq 0x59c0
jmp 0x8360
movl $0x64, 0x84(%rsp)
movq 0x3c5e(%rip), %rdi      # 0xbfd0
leaq 0x1064(%rip), %rsi      # 0x93dd
callq 0x2140
movq %rax, 0x20(%rsp)
jmp 0x8385
movq 0x20(%rsp), %rdi
movl 0x84(%rsp), %esi
callq 0x21f0
movq %rax, 0x18(%rsp)
jmp 0x839d
movq 0x18(%rsp), %rdi
movq 0x3c0f(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x83b0
movsd 0x1e8(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
cvtsi2sdl 0x84(%rsp), %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x80(%rsp)
movl 0x80(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0x86a0
jmp 0x83f4
movq 0x3bd5(%rip), %rdi      # 0xbfd0
leaq 0xf5c(%rip), %rsi       # 0x935e
callq 0x2140
movq %rax, 0x10(%rsp)
jmp 0x840e
leaq 0x90(%rsp), %rdi
callq 0x8640
movl %eax, 0xc(%rsp)
jmp 0x8421
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x21f0
movq %rax, (%rsp)
jmp 0x8435
movq (%rsp), %rdi
movq 0x3b78(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x8447
movsd 0x1e8(%rsp), %xmm0
leaq 0x90(%rsp), %rdi
callq 0x5230
jmp 0x845f
movq 0x1e0(%rsp), %rdi
callq 0x30c0
jmp 0x846e
leaq 0x90(%rsp), %rdi
callq 0x8890
leaq 0x150(%rsp), %rdi
callq 0x8a20
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
jmp 0x84c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x8890
leaq 0x150(%rsp), %rdi
callq 0x8a20
movq 0x148(%rsp), %rdi
callq 0x2210
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)