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

    std::cout <<"\n"<< "Testing Szamel Brownian Glass" <<"\n"<< std::endl;
    std::cout << "Using Parameters:" << std::endl;
    //std::cout << "Temperature = " << Temp << std::endl;
    std::cout << "RelaxationTime =  " << relax << std::endl;
    
    double rho = 1000 / (9.4*9.4*9.4);
    
    std::cout << "Density = " << rho << std::endl;
    std::cout << "Boxlength = 9.4" << std::endl;
    
    std::cout << "\n" << "Setting up System..." << std::endl;
    Glass System(rho, 5.0, 10);
    timer->StampComplete();
    
    std::cout << "\n" << "Setting up Simulation..." << std::endl;
    Verlet verlet(&System, 5.0, 0.005, record);
    verlet.SetEnergyFile("Data/Equilibration.csv");
    timer->StampComplete();

    std::cout << "\n" << "Mixing at T = 5.0" << std::endl;
    std::cout << "Running for t = 20" << std::endl;
    std::cout << "Timestep = " << verlet.Getdt() << std::endl;
    std::cout << "Steps = 4000" << std::endl;
    std::cout << "Recording every = " << verlet.GetRecord() << std::endl;
    std::cout << "Thermostating every 500 timesteps" << std::endl;
    verlet.Equilibrate(20, 500);
    timer->StampComplete();

    Brownian brownian(&System, Temp, 1.0, 0.00005, record);
    brownian.SetEnergyFile("Data/Equilibration.csv");

    std::cout << "\n" << "Equilibrating at T = " << Temp << std::endl;
    std::cout << "Running for t = " << relax << std::endl;
    std::cout << "Timestep = " << brownian.Getdt() << std::endl;
    std::cout << "Steps = " << relax/brownian.Getdt() << std::endl;
    std::cout << "Recording every = " << brownian.GetRecord() << std::endl;
    brownian.Run(relax);
    timer->StampComplete();
 
    std::cout << "\n" << "Begining Production Run" << std::endl;
    std::cout << "Running for t = " << 1.5*relax << std::endl;
    std::cout << "Timestep = " << brownian.Getdt() << std::endl;
    std::cout << "Steps = " << (1.5*relax)/brownian.Getdt() << std::endl;
    std::cout << "Recording every = " << brownian.GetRecord() << std::endl;
    brownian.SetTime(0);
    brownian.SetEnergyFile("Data/Energies.csv");
    brownian.RecordTrajectory(true);
    brownian.Run(1.5*relax);
    timer->StampComplete();
    
    return;
}

// Assembly:
subq $0x3c8, %rsp            # imm = 0x3C8
movsd %xmm0, 0x3c0(%rsp)
movsd %xmm1, 0x3b8(%rsp)
movl %edi, 0x3b4(%rsp)
movq %rsi, 0x3a8(%rsp)
movq 0x4f21(%rip), %rdi      # 0xbfd0
movq %rdi, 0x168(%rsp)
leaq 0x21d2(%rip), %rsi      # 0x9290
movq %rsi, 0x170(%rsp)
callq 0x2140
movq %rax, %rdi
leaq 0x23be(%rip), %rsi      # 0x9493
callq 0x2140
movq 0x170(%rsp), %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movq 0x4ec4(%rip), %rsi      # 0xbfb8
movq %rsi, 0x178(%rsp)
callq 0x2150
movq 0x168(%rsp), %rdi
leaq 0x21a4(%rip), %rsi      # 0x92b4
callq 0x2140
movq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x168(%rsp), %rdi
leaq 0x21a1(%rip), %rsi      # 0x92d5
callq 0x2140
movq %rax, %rdi
movsd 0x3b8(%rsp), %xmm0
callq 0x2240
movq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x168(%rsp), %rdi
movabsq $0x3ff343784bba4763, %rax # imm = 0x3FF343784BBA4763
movq %rax, 0x3a0(%rsp)
leaq 0x216d(%rip), %rsi      # 0x92e8
callq 0x2140
movq %rax, %rdi
movsd 0x3a0(%rsp), %xmm0
callq 0x2240
movq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x168(%rsp), %rdi
leaq 0x2143(%rip), %rsi      # 0x92f3
callq 0x2140
movq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x168(%rsp), %rdi
movq 0x170(%rsp), %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x211f(%rip), %rsi      # 0x9303
callq 0x2140
movq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movsd 0x3a0(%rsp), %xmm0
leaq 0x310(%rsp), %rdi
movsd 0x2036(%rip), %xmm1     # 0x9248
movsd 0x2036(%rip), %xmm2     # 0x9250
callq 0x84f0
movq 0x3a8(%rsp), %rdi
callq 0x30c0
jmp 0x722e
movq 0x4d9b(%rip), %rdi      # 0xbfd0
leaq 0x2054(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x160(%rsp)
jmp 0x724b
movq 0x160(%rsp), %rdi
leaq 0x20be(%rip), %rsi      # 0x9318
callq 0x2140
movq %rax, 0x158(%rsp)
jmp 0x7269
movq 0x158(%rsp), %rdi
movq 0x4d40(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x727f
movl 0x3b4(%rsp), %edx
leaq 0x2a8(%rsp), %rdi
leaq 0x310(%rsp), %rsi
movsd 0x1faa(%rip), %xmm0     # 0x9248
movsd 0x1fd2(%rip), %xmm1     # 0x9278
callq 0x85b0
jmp 0x72ad
leaq 0x287(%rsp), %rdi
movq %rdi, 0x150(%rsp)
callq 0x2220
movq 0x150(%rsp), %rdx
leaq 0x213c(%rip), %rsi      # 0x940d
leaq 0x288(%rsp), %rdi
callq 0x2190
jmp 0x72e0
leaq 0x2a8(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0x86e0
jmp 0x72f7
leaq 0x288(%rsp), %rdi
callq 0x20d0
leaq 0x287(%rsp), %rdi
callq 0x2160
movq 0x3a8(%rsp), %rdi
callq 0x30c0
jmp 0x7320
movq 0x4ca9(%rip), %rdi      # 0xbfd0
leaq 0x1f62(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x148(%rsp)
jmp 0x733d
movq 0x148(%rsp), %rdi
leaq 0x20d8(%rip), %rsi      # 0x9424
callq 0x2140
movq %rax, 0x140(%rsp)
jmp 0x735b
movq 0x140(%rsp), %rdi
movq 0x4c4e(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x7371
movq 0x4c58(%rip), %rdi      # 0xbfd0
leaq 0x20b7(%rip), %rsi      # 0x9436
callq 0x2140
movq %rax, 0x138(%rsp)
jmp 0x738e
movq 0x138(%rsp), %rdi
movq 0x4c1b(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x73a4
movq 0x4c25(%rip), %rdi      # 0xbfd0
leaq 0x201f(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0x130(%rsp)
jmp 0x73c1
leaq 0x2a8(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x128(%rsp)
jmp 0x73d9
movsd 0x128(%rsp), %xmm0
movq 0x130(%rsp), %rdi
callq 0x2240
movq %rax, 0x120(%rsp)
jmp 0x73f9
movq 0x120(%rsp), %rdi
movq 0x4bb0(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x740f
movq 0x4bba(%rip), %rdi      # 0xbfd0
leaq 0x202c(%rip), %rsi      # 0x9449
callq 0x2140
movq %rax, 0x118(%rsp)
jmp 0x742c
movq 0x118(%rsp), %rdi
movq 0x4b7d(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x7442
movq 0x4b87(%rip), %rdi      # 0xbfd0
leaq 0x1f0e(%rip), %rsi      # 0x935e
callq 0x2140
movq %rax, 0x110(%rsp)
jmp 0x745f
leaq 0x2a8(%rsp), %rdi
callq 0x8640
movl %eax, 0x10c(%rsp)
jmp 0x7475
movl 0x10c(%rsp), %esi
movq 0x110(%rsp), %rdi
callq 0x21f0
movq %rax, 0x100(%rsp)
jmp 0x7493
movq 0x100(%rsp), %rdi
movq 0x4b16(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x74a9
movq 0x4b20(%rip), %rdi      # 0xbfd0
leaq 0x1f9f(%rip), %rsi      # 0x9456
callq 0x2140
movq %rax, 0xf8(%rsp)
jmp 0x74c6
movq 0xf8(%rsp), %rdi
movq 0x4ae3(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x74dc
leaq 0x2a8(%rsp), %rdi
movsd 0x1d94(%rip), %xmm0     # 0x9280
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x4f10
jmp 0x74f8
movq 0x3a8(%rsp), %rdi
callq 0x30c0
jmp 0x7507
movsd 0x3c0(%rsp), %xmm0
movl 0x3b4(%rsp), %edx
leaq 0x1d0(%rsp), %rdi
leaq 0x310(%rsp), %rsi
movsd 0x1b29(%rip), %xmm1     # 0x9058
movsd 0x1d51(%rip), %xmm2     # 0x9288
callq 0x8760
jmp 0x753e
leaq 0x1af(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0x2220
movq 0xf0(%rsp), %rdx
leaq 0x1eab(%rip), %rsi      # 0x940d
leaq 0x1b0(%rsp), %rdi
callq 0x2190
jmp 0x7571
leaq 0x1d0(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x86e0
jmp 0x7588
leaq 0x1b0(%rsp), %rdi
callq 0x20d0
leaq 0x1af(%rsp), %rdi
callq 0x2160
movq 0x4a27(%rip), %rdi      # 0xbfd0
leaq 0x1ce0(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0xe8(%rsp)
jmp 0x75bf
movq 0xe8(%rsp), %rdi
leaq 0x1dc4(%rip), %rsi      # 0x9392
callq 0x2140
movq %rax, 0xe0(%rsp)
jmp 0x75dd
movq 0xe0(%rsp), %rdi
movsd 0x3c0(%rsp), %xmm0
callq 0x2240
movq %rax, 0xd8(%rsp)
jmp 0x75fd
movq 0xd8(%rsp), %rdi
movq 0x49ac(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x7613
movq 0x49b6(%rip), %rdi      # 0xbfd0
leaq 0x1d87(%rip), %rsi      # 0x93a8
callq 0x2140
movq %rax, 0xd0(%rsp)
jmp 0x7630
movq 0xd0(%rsp), %rdi
movsd 0x3b8(%rsp), %xmm0
callq 0x2240
movq %rax, 0xc8(%rsp)
jmp 0x7650
movq 0xc8(%rsp), %rdi
movq 0x4959(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x7666
movq 0x4963(%rip), %rdi      # 0xbfd0
leaq 0x1d5d(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0xc0(%rsp)
jmp 0x7683
leaq 0x1d0(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0xb8(%rsp)
jmp 0x769b
movsd 0xb8(%rsp), %xmm0
movq 0xc0(%rsp), %rdi
callq 0x2240
movq %rax, 0xb0(%rsp)
jmp 0x76bb
movq 0xb0(%rsp), %rdi
movq 0x48ee(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x76d1
movq 0x48f8(%rip), %rdi      # 0xbfd0
leaq 0x1d99(%rip), %rsi      # 0x9478
callq 0x2140
movq %rax, 0xa8(%rsp)
jmp 0x76ee
movsd 0x3b8(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0xa0(%rsp)
jmp 0x7718
movq 0xa8(%rsp), %rdi
movsd 0xa0(%rsp), %xmm1
movsd 0x98(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x2240
movq %rax, 0x90(%rsp)
jmp 0x7745
movq 0x90(%rsp), %rdi
movq 0x4864(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x775b
movq 0x486e(%rip), %rdi      # 0xbfd0
leaq 0x1bf5(%rip), %rsi      # 0x935e
callq 0x2140
movq %rax, 0x88(%rsp)
jmp 0x7778
leaq 0x1d0(%rsp), %rdi
callq 0x8640
movl %eax, 0x84(%rsp)
jmp 0x778e
movl 0x84(%rsp), %esi
movq 0x88(%rsp), %rdi
callq 0x21f0
movq %rax, 0x78(%rsp)
jmp 0x77a9
movq 0x78(%rsp), %rdi
movq 0x4803(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x77bc
movsd 0x3b8(%rsp), %xmm0
leaq 0x1d0(%rsp), %rdi
callq 0x5230
jmp 0x77d4
movq 0x3a8(%rsp), %rdi
callq 0x30c0
jmp 0x77e3
movq 0x47e6(%rip), %rdi      # 0xbfd0
leaq 0x1a9f(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x70(%rsp)
jmp 0x77fd
movq 0x70(%rsp), %rdi
leaq 0x1bb0(%rip), %rsi      # 0x93b9
callq 0x2140
movq %rax, 0x68(%rsp)
jmp 0x7815
movq 0x68(%rsp), %rdi
movq 0x4797(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x7828
movq 0x47a1(%rip), %rdi      # 0xbfd0
leaq 0x1b72(%rip), %rsi      # 0x93a8
callq 0x2140
movq %rax, 0x60(%rsp)
jmp 0x7842
movq 0x60(%rsp), %rdi
movsd 0x3b8(%rsp), %xmm0
movsd 0x18b8(%rip), %xmm1     # 0x9110
mulsd %xmm1, %xmm0
callq 0x2240
movq %rax, 0x58(%rsp)
jmp 0x7868
movq 0x58(%rsp), %rdi
movq 0x4744(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x787b
movq 0x474e(%rip), %rdi      # 0xbfd0
leaq 0x1b48(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0x50(%rsp)
jmp 0x7895
leaq 0x1d0(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x48(%rsp)
jmp 0x78aa
movsd 0x48(%rsp), %xmm0
movq 0x50(%rsp), %rdi
callq 0x2240
movq %rax, 0x40(%rsp)
jmp 0x78c1
movq 0x40(%rsp), %rdi
movq 0x46eb(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x78d4
movq 0x46f5(%rip), %rdi      # 0xbfd0
leaq 0x1b96(%rip), %rsi      # 0x9478
callq 0x2140
movq %rax, 0x38(%rsp)
jmp 0x78ee
movsd 0x3b8(%rsp), %xmm0
movsd 0x1811(%rip), %xmm1     # 0x9110
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x30(%rsp)
jmp 0x791e
movq 0x38(%rsp), %rdi
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x2240
movq %rax, 0x20(%rsp)
jmp 0x793f
movq 0x20(%rsp), %rdi
movq 0x466d(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x7952
movq 0x4677(%rip), %rdi      # 0xbfd0
leaq 0x19fe(%rip), %rsi      # 0x935e
callq 0x2140
movq %rax, 0x18(%rsp)
jmp 0x796c
leaq 0x1d0(%rsp), %rdi
callq 0x8640
movl %eax, 0x14(%rsp)
jmp 0x797f
movl 0x14(%rsp), %esi
movq 0x18(%rsp), %rdi
callq 0x21f0
movq %rax, 0x8(%rsp)
jmp 0x7994
movq 0x8(%rsp), %rdi
movq 0x4618(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x79a7
leaq 0x1d0(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x8710
jmp 0x79b9
leaq 0x187(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x2220
movq (%rsp), %rdx
leaq 0x1aac(%rip), %rsi      # 0x9481
leaq 0x188(%rsp), %rdi
callq 0x2190
jmp 0x79e4
leaq 0x1d0(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x86e0
jmp 0x79fb
leaq 0x188(%rsp), %rdi
callq 0x20d0
leaq 0x187(%rsp), %rdi
callq 0x2160
leaq 0x1d0(%rsp), %rdi
movl $0x1, %esi
callq 0x8740
jmp 0x7a29
movsd 0x3b8(%rsp), %xmm0
movsd 0x16d6(%rip), %xmm1     # 0x9110
mulsd %xmm1, %xmm0
leaq 0x1d0(%rsp), %rdi
callq 0x5230
jmp 0x7a4d
movq 0x3a8(%rsp), %rdi
callq 0x30c0
jmp 0x7a5c
leaq 0x1d0(%rsp), %rdi
callq 0x8890
leaq 0x2a8(%rsp), %rdi
callq 0x86c0
leaq 0x310(%rsp), %rdi
callq 0x86d0
addq $0x3c8, %rsp            # imm = 0x3C8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
jmp 0x7bc0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
jmp 0x7adb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
leaq 0x288(%rsp), %rdi
callq 0x20d0
leaq 0x287(%rsp), %rdi
callq 0x2160
jmp 0x7bb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
jmp 0x7bb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
jmp 0x7b3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x20d0
leaq 0x1af(%rsp), %rdi
callq 0x2160
jmp 0x7ba6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
jmp 0x7ba6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
jmp 0x7b99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x308(%rsp)
movl %eax, 0x304(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x20d0
leaq 0x187(%rsp), %rdi
callq 0x2160
leaq 0x1d0(%rsp), %rdi
callq 0x8890
leaq 0x2a8(%rsp), %rdi
callq 0x86c0
leaq 0x310(%rsp), %rdi
callq 0x86d0
movq 0x308(%rsp), %rdi
callq 0x2210
nopw (%rax,%rax)