// File: joraso[P]Glassius/Protocol.cpp
// Function: Protocol::KobAndersonTest(double, double, int, Stopwatch*)
void Protocol::KobAndersonTest(double Temp, double relax, int record,
                               Stopwatch* timer){
    /* Set to mimick the tests run in LAMMPS */

    std::cout <<"\n"<< "Testing Kob-Anderson 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();
 
    std::cout << "\n" << "Equilibrating at T = " << Temp << std::endl;
    std::cout << "Running for t = " << relax << std::endl;
    std::cout << "Timestep = " << verlet.Getdt() << std::endl;
    std::cout << "Steps = " << relax/verlet.Getdt() << std::endl;
    std::cout << "Recording every = " << verlet.GetRecord() << std::endl;
    std::cout << "Thermostating every 500 timesteps" << std::endl;
    verlet.SetTemp(0.5);
    System.Thermalize(0.5);
    verlet.Equilibrate(relax, 500);
    timer->StampComplete();
 
    std::cout << "\n" << "Begining Production Run" << std::endl;
    std::cout << "Running for t = " << 1.5*relax << std::endl;
    std::cout << "Timestep = " << verlet.Getdt() << std::endl;
    std::cout << "Steps = " << (1.5*relax)/verlet.Getdt() << std::endl;
    std::cout << "Recording every = " << verlet.GetRecord() << std::endl;
    verlet.SetTime(0);
    verlet.SetEnergyFile("Data/Energies.csv");
    verlet.RecordTrajectory(true);
    verlet.Run(1.5*relax);
    timer->StampComplete();
    
    return;
}

// Assembly:
subq $0x2f8, %rsp            # imm = 0x2F8
movsd %xmm0, 0x2f0(%rsp)
movsd %xmm1, 0x2e8(%rsp)
movl %edi, 0x2e4(%rsp)
movq %rsi, 0x2d8(%rsp)
movq 0x59e1(%rip), %rdi      # 0xbfd0
movq %rdi, 0x170(%rsp)
leaq 0x2c92(%rip), %rsi      # 0x9290
movq %rsi, 0x178(%rsp)
callq 0x2140
movq %rax, %rdi
leaq 0x2ddd(%rip), %rsi      # 0x93f2
callq 0x2140
movq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movq 0x5984(%rip), %rsi      # 0xbfb8
movq %rsi, 0x180(%rsp)
callq 0x2150
movq 0x170(%rsp), %rdi
leaq 0x2c64(%rip), %rsi      # 0x92b4
callq 0x2140
movq 0x180(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x170(%rsp), %rdi
leaq 0x2c61(%rip), %rsi      # 0x92d5
callq 0x2140
movq %rax, %rdi
movsd 0x2e8(%rsp), %xmm0
callq 0x2240
movq 0x180(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x170(%rsp), %rdi
movabsq $0x3ff343784bba4763, %rax # imm = 0x3FF343784BBA4763
movq %rax, 0x2d0(%rsp)
leaq 0x2c2d(%rip), %rsi      # 0x92e8
callq 0x2140
movq %rax, %rdi
movsd 0x2d0(%rsp), %xmm0
callq 0x2240
movq 0x180(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x170(%rsp), %rdi
leaq 0x2c03(%rip), %rsi      # 0x92f3
callq 0x2140
movq 0x180(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x170(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x2bdf(%rip), %rsi      # 0x9303
callq 0x2140
movq 0x180(%rsp), %rsi
movq %rax, %rdi
callq 0x2150
movsd 0x2d0(%rsp), %xmm0
leaq 0x240(%rsp), %rdi
movsd 0x2af6(%rip), %xmm1     # 0x9248
movsd 0x2af6(%rip), %xmm2     # 0x9250
callq 0x84f0
movq 0x2d8(%rsp), %rdi
callq 0x30c0
jmp 0x676e
movq 0x585b(%rip), %rdi      # 0xbfd0
leaq 0x2b14(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x168(%rsp)
jmp 0x678b
movq 0x168(%rsp), %rdi
leaq 0x2b7e(%rip), %rsi      # 0x9318
callq 0x2140
movq %rax, 0x160(%rsp)
jmp 0x67a9
movq 0x160(%rsp), %rdi
movq 0x5800(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x67bf
movl 0x2e4(%rsp), %edx
leaq 0x1d8(%rsp), %rdi
leaq 0x240(%rsp), %rsi
movsd 0x2a6a(%rip), %xmm0     # 0x9248
movsd 0x2a92(%rip), %xmm1     # 0x9278
callq 0x85b0
jmp 0x67ed
leaq 0x1b7(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0x2220
movq 0x158(%rsp), %rdx
leaq 0x2bfc(%rip), %rsi      # 0x940d
leaq 0x1b8(%rsp), %rdi
callq 0x2190
jmp 0x6820
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x86e0
jmp 0x6837
leaq 0x1b8(%rsp), %rdi
callq 0x20d0
leaq 0x1b7(%rsp), %rdi
callq 0x2160
movq 0x2d8(%rsp), %rdi
callq 0x30c0
jmp 0x6860
movq 0x5769(%rip), %rdi      # 0xbfd0
leaq 0x2a22(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x150(%rsp)
jmp 0x687d
movq 0x150(%rsp), %rdi
leaq 0x2b98(%rip), %rsi      # 0x9424
callq 0x2140
movq %rax, 0x148(%rsp)
jmp 0x689b
movq 0x148(%rsp), %rdi
movq 0x570e(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x68b1
movq 0x5718(%rip), %rdi      # 0xbfd0
leaq 0x2b77(%rip), %rsi      # 0x9436
callq 0x2140
movq %rax, 0x140(%rsp)
jmp 0x68ce
movq 0x140(%rsp), %rdi
movq 0x56db(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x68e4
movq 0x56e5(%rip), %rdi      # 0xbfd0
leaq 0x2adf(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0x138(%rsp)
jmp 0x6901
leaq 0x1d8(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x130(%rsp)
jmp 0x6919
movsd 0x130(%rsp), %xmm0
movq 0x138(%rsp), %rdi
callq 0x2240
movq %rax, 0x128(%rsp)
jmp 0x6939
movq 0x128(%rsp), %rdi
movq 0x5670(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x694f
movq 0x567a(%rip), %rdi      # 0xbfd0
leaq 0x2aec(%rip), %rsi      # 0x9449
callq 0x2140
movq %rax, 0x120(%rsp)
jmp 0x696c
movq 0x120(%rsp), %rdi
movq 0x563d(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6982
movq 0x5647(%rip), %rdi      # 0xbfd0
leaq 0x29ce(%rip), %rsi      # 0x935e
callq 0x2140
movq %rax, 0x118(%rsp)
jmp 0x699f
leaq 0x1d8(%rsp), %rdi
callq 0x8640
movl %eax, 0x114(%rsp)
jmp 0x69b5
movl 0x114(%rsp), %esi
movq 0x118(%rsp), %rdi
callq 0x21f0
movq %rax, 0x108(%rsp)
jmp 0x69d3
movq 0x108(%rsp), %rdi
movq 0x55d6(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x69e9
movq 0x55e0(%rip), %rdi      # 0xbfd0
leaq 0x2a5f(%rip), %rsi      # 0x9456
callq 0x2140
movq %rax, 0x100(%rsp)
jmp 0x6a06
movq 0x100(%rsp), %rdi
movq 0x55a3(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6a1c
leaq 0x1d8(%rsp), %rdi
movsd 0x2854(%rip), %xmm0     # 0x9280
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x4f10
jmp 0x6a38
movq 0x2d8(%rsp), %rdi
callq 0x30c0
jmp 0x6a47
movq 0x5582(%rip), %rdi      # 0xbfd0
leaq 0x283b(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0xf8(%rsp)
jmp 0x6a64
movq 0xf8(%rsp), %rdi
leaq 0x291f(%rip), %rsi      # 0x9392
callq 0x2140
movq %rax, 0xf0(%rsp)
jmp 0x6a82
movq 0xf0(%rsp), %rdi
movsd 0x2f0(%rsp), %xmm0
callq 0x2240
movq %rax, 0xe8(%rsp)
jmp 0x6aa2
movq 0xe8(%rsp), %rdi
movq 0x5507(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6ab8
movq 0x5511(%rip), %rdi      # 0xbfd0
leaq 0x28e2(%rip), %rsi      # 0x93a8
callq 0x2140
movq %rax, 0xe0(%rsp)
jmp 0x6ad5
movq 0xe0(%rsp), %rdi
movsd 0x2e8(%rsp), %xmm0
callq 0x2240
movq %rax, 0xd8(%rsp)
jmp 0x6af5
movq 0xd8(%rsp), %rdi
movq 0x54b4(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6b0b
movq 0x54be(%rip), %rdi      # 0xbfd0
leaq 0x28b8(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0xd0(%rsp)
jmp 0x6b28
leaq 0x1d8(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0xc8(%rsp)
jmp 0x6b40
movsd 0xc8(%rsp), %xmm0
movq 0xd0(%rsp), %rdi
callq 0x2240
movq %rax, 0xc0(%rsp)
jmp 0x6b60
movq 0xc0(%rsp), %rdi
movq 0x5449(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6b76
movq 0x5453(%rip), %rdi      # 0xbfd0
leaq 0x28f4(%rip), %rsi      # 0x9478
callq 0x2140
movq %rax, 0xb8(%rsp)
jmp 0x6b93
movsd 0x2e8(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0xb0(%rsp)
jmp 0x6bbd
movq 0xb8(%rsp), %rdi
movsd 0xb0(%rsp), %xmm1
movsd 0xa8(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x2240
movq %rax, 0xa0(%rsp)
jmp 0x6bea
movq 0xa0(%rsp), %rdi
movq 0x53bf(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6c00
movq 0x53c9(%rip), %rdi      # 0xbfd0
leaq 0x2750(%rip), %rsi      # 0x935e
callq 0x2140
movq %rax, 0x98(%rsp)
jmp 0x6c1d
leaq 0x1d8(%rsp), %rdi
callq 0x8640
movl %eax, 0x94(%rsp)
jmp 0x6c33
movl 0x94(%rsp), %esi
movq 0x98(%rsp), %rdi
callq 0x21f0
movq %rax, 0x88(%rsp)
jmp 0x6c51
movq 0x88(%rsp), %rdi
movq 0x5358(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6c67
movq 0x5362(%rip), %rdi      # 0xbfd0
leaq 0x27e1(%rip), %rsi      # 0x9456
callq 0x2140
movq %rax, 0x80(%rsp)
jmp 0x6c84
movq 0x80(%rsp), %rdi
movq 0x5325(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6c9a
leaq 0x1d8(%rsp), %rdi
movsd 0x245e(%rip), %xmm0     # 0x9108
callq 0x8650
jmp 0x6cb1
leaq 0x240(%rsp), %rdi
movsd 0x2447(%rip), %xmm0     # 0x9108
callq 0x4050
jmp 0x6cc8
movsd 0x2e8(%rsp), %xmm0
leaq 0x1d8(%rsp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x4f10
jmp 0x6ce5
movq 0x2d8(%rsp), %rdi
callq 0x30c0
jmp 0x6cf4
movq 0x52d5(%rip), %rdi      # 0xbfd0
leaq 0x258e(%rip), %rsi      # 0x9290
callq 0x2140
movq %rax, 0x78(%rsp)
jmp 0x6d0e
movq 0x78(%rsp), %rdi
leaq 0x269f(%rip), %rsi      # 0x93b9
callq 0x2140
movq %rax, 0x70(%rsp)
jmp 0x6d26
movq 0x70(%rsp), %rdi
movq 0x5286(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6d39
movq 0x5290(%rip), %rdi      # 0xbfd0
leaq 0x2661(%rip), %rsi      # 0x93a8
callq 0x2140
movq %rax, 0x68(%rsp)
jmp 0x6d53
movq 0x68(%rsp), %rdi
movsd 0x2e8(%rsp), %xmm0
movsd 0x23a7(%rip), %xmm1     # 0x9110
mulsd %xmm1, %xmm0
callq 0x2240
movq %rax, 0x60(%rsp)
jmp 0x6d79
movq 0x60(%rsp), %rdi
movq 0x5233(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6d8c
movq 0x523d(%rip), %rdi      # 0xbfd0
leaq 0x2637(%rip), %rsi      # 0x93d1
callq 0x2140
movq %rax, 0x58(%rsp)
jmp 0x6da6
leaq 0x1d8(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x50(%rsp)
jmp 0x6dbb
movsd 0x50(%rsp), %xmm0
movq 0x58(%rsp), %rdi
callq 0x2240
movq %rax, 0x48(%rsp)
jmp 0x6dd2
movq 0x48(%rsp), %rdi
movq 0x51da(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6de5
movq 0x51e4(%rip), %rdi      # 0xbfd0
leaq 0x2685(%rip), %rsi      # 0x9478
callq 0x2140
movq %rax, 0x40(%rsp)
jmp 0x6dff
movsd 0x2e8(%rsp), %xmm0
movsd 0x2300(%rip), %xmm1     # 0x9110
mulsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x8690
movsd %xmm0, 0x38(%rsp)
jmp 0x6e2f
movq 0x40(%rsp), %rdi
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x2240
movq %rax, 0x28(%rsp)
jmp 0x6e50
movq 0x28(%rsp), %rdi
movq 0x515c(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6e63
movq 0x5166(%rip), %rdi      # 0xbfd0
leaq 0x24ed(%rip), %rsi      # 0x935e
callq 0x2140
movq %rax, 0x20(%rsp)
jmp 0x6e7d
leaq 0x1d8(%rsp), %rdi
callq 0x8640
movl %eax, 0x1c(%rsp)
jmp 0x6e90
movl 0x1c(%rsp), %esi
movq 0x20(%rsp), %rdi
callq 0x21f0
movq %rax, 0x10(%rsp)
jmp 0x6ea5
movq 0x10(%rsp), %rdi
movq 0x5107(%rip), %rsi      # 0xbfb8
callq 0x2150
jmp 0x6eb8
leaq 0x1d8(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x8710
jmp 0x6eca
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2220
movq 0x8(%rsp), %rdx
leaq 0x2599(%rip), %rsi      # 0x9481
leaq 0x190(%rsp), %rdi
callq 0x2190
jmp 0x6ef7
leaq 0x1d8(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x86e0
jmp 0x6f0e
leaq 0x190(%rsp), %rdi
callq 0x20d0
leaq 0x18f(%rsp), %rdi
callq 0x2160
leaq 0x1d8(%rsp), %rdi
movl $0x1, %esi
callq 0x8740
jmp 0x6f3c
movsd 0x2e8(%rsp), %xmm0
movsd 0x21c3(%rip), %xmm1     # 0x9110
mulsd %xmm1, %xmm0
leaq 0x1d8(%rsp), %rdi
callq 0x5230
jmp 0x6f60
movq 0x2d8(%rsp), %rdi
callq 0x30c0
jmp 0x6f6f
leaq 0x1d8(%rsp), %rdi
callq 0x86c0
leaq 0x240(%rsp), %rdi
callq 0x86d0
addq $0x2f8, %rsp            # imm = 0x2F8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x238(%rsp)
movl %eax, 0x234(%rsp)
jmp 0x7057
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x238(%rsp)
movl %eax, 0x234(%rsp)
jmp 0x6fe1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x238(%rsp)
movl %eax, 0x234(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0x20d0
leaq 0x1b7(%rsp), %rdi
callq 0x2160
jmp 0x704a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x238(%rsp)
movl %eax, 0x234(%rsp)
jmp 0x704a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x238(%rsp)
movl %eax, 0x234(%rsp)
jmp 0x703d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x238(%rsp)
movl %eax, 0x234(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x20d0
leaq 0x18f(%rsp), %rdi
callq 0x2160
leaq 0x1d8(%rsp), %rdi
callq 0x86c0
leaq 0x240(%rsp), %rdi
callq 0x86d0
movq 0x238(%rsp), %rdi
callq 0x2210
nopw %cs:(%rax,%rax)