// File: /workspace/github_cpp_makefile_star2_O3/kaityo256[P]thermostats/thermostats.cpp
// Function: void integrate<Euler<NoseHooverChain>>(Euler<NoseHooverChain>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void integrate(Method f, std::string name) {
  Vars v;
  v.q = 1.0;
  double t = 0;
  std::string pfile = name + "_ps.dat";
  std::ofstream ofs_p(pfile.c_str());
  std::cout << name << std::endl;
  std::vector<double> data_e;
  for (int i = 0; i < LOOP; i++) {
    t += dt;
    v = f(v);
    if (i % O_LOOP == 0) {
      ofs_p << t << " ";
      ofs_p << v.p << " ";
      ofs_p << v.q << " ";
      ofs_p << f.H(v) << std::endl;
      data_e.push_back(v.p * v.p * 0.5 + v.q * v.q * 0.5);
    }
  }
  std::sort(data_e.begin(), data_e.end());
  const int n = data_e.size();
  const double nd = static_cast<double>(n);
  std::string efile = name + ".dat";
  std::ofstream ofs(efile.c_str());
  for (int i = 0; i < n; i++) {
    ofs << data_e[i] << " " << static_cast<double>(i) / nd << std::endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x508, %rsp            # imm = 0x508
movq %rdi, %rbx
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x5012
leaq 0x2ef3(%rip), %rsi      # 0x71b6
movq %r14, %rdi
callq 0x21c0
movq 0x40(%rsp), %rsi
leaq 0x308(%rsp), %rdi
movl $0x10, %edx
callq 0x2140
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x4ce8(%rip), %rdi      # 0x8fd8
callq 0x2150
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq 0x540(%rsp), %rax
xorps %xmm1, %xmm1
movq %rsp, %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, (%rcx)
movq $0x0, 0x10(%rcx)
movups 0x8(%rax), %xmm0
movaps %xmm0, %xmm1
shufps $0x4e, %xmm0, %xmm1     # xmm1 = xmm1[2,3],xmm0[0,1]
movaps %xmm1, 0xf0(%rsp)
movsd (%rax), %xmm1
movapd %xmm1, 0xe0(%rsp)
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movapd %xmm1, 0xd0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movaps %xmm0, 0xb0(%rsp)
movsd 0x2d78(%rip), %xmm0     # 0x7100
movapd %xmm0, 0x30(%rsp)
xorl %r13d, %r13d
leaq 0x308(%rsp), %r15
leaq 0x2e1e(%rip), %r12      # 0x71be
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %r14d, %r14d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movapd 0x20(%rsp), %xmm1
movapd 0x60(%rsp), %xmm4
movapd %xmm4, %xmm0
movapd 0x30(%rsp), %xmm2
movapd %xmm1, %xmm3
mulsd 0xe0(%rsp), %xmm3
addsd %xmm2, %xmm3
movapd %xmm3, 0x30(%rsp)
movapd %xmm2, %xmm6
xorpd 0x2c70(%rip), %xmm6     # 0x7060
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2d10(%rip), %xmm3     # 0x7118
unpcklpd %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0]
movapd %xmm2, %xmm3
mulsd %xmm2, %xmm3
shufpd $0x1, %xmm3, %xmm4      # xmm4 = xmm4[1],xmm3[0]
movapd %xmm0, %xmm3
movsd %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1]
mulpd %xmm2, %xmm3
movapd 0xa0(%rsp), %xmm5
divsd %xmm5, %xmm2
shufpd $0x2, 0x2c35(%rip), %xmm2 # xmm2 = xmm2[0],mem[1]
divpd 0xf0(%rsp), %xmm4
addpd %xmm2, %xmm4
divpd %xmm5, %xmm3
subpd %xmm3, %xmm6
movapd 0xd0(%rsp), %xmm2
mulpd %xmm2, %xmm6
addpd %xmm1, %xmm6
movapd %xmm6, 0x20(%rsp)
mulpd %xmm2, %xmm4
addpd %xmm0, %xmm4
movapd %xmm4, 0x60(%rsp)
movl %r14d, %eax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
shrq $0x26, %rax
imull $0xfffffc18, %eax, %eax # imm = 0xFFFFFC18
movsd 0x18(%rsp), %xmm0
addsd 0x2c59(%rip), %xmm0     # 0x70f0
movsd %xmm0, 0x18(%rsp)
cmpl %r13d, %eax
jne 0x45fc
movq %r15, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x2180
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2150
movq %r15, %rdi
movapd 0x20(%rsp), %xmm0
callq 0x2180
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2150
movq %r15, %rdi
movapd 0x30(%rsp), %xmm0
callq 0x2180
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2150
movapd 0x20(%rsp), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
movsd 0x2bf2(%rip), %xmm3     # 0x7108
mulsd %xmm3, %xmm2
movsd %xmm2, 0x78(%rsp)
movapd %xmm2, %xmm0
addsd 0x2be4(%rip), %xmm0     # 0x7110
movapd 0x30(%rsp), %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm3, %xmm2
movapd %xmm2, 0xc0(%rsp)
addsd %xmm2, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
mulsd %xmm1, %xmm1
mulsd %xmm3, %xmm1
divsd 0xa0(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd 0x60(%rsp), %xmm2
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
mulsd %xmm0, %xmm0
mulsd %xmm3, %xmm0
divsd 0xb0(%rsp), %xmm0
addsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movq %r15, %rdi
callq 0x2180
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
movsd 0x78(%rsp), %xmm0
addsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x108(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x45ec
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x45fc
movq %rsp, %rdi
leaq 0x108(%rsp), %rdx
callq 0x50a8
incl %r14d
decl %r13d
cmpl $0xff676980, %r13d      # imm = 0xFF676980
jne 0x43b7
movq (%rsp), %r14
movq 0x8(%rsp), %r15
cmpq %r15, %r14
je 0x4655
movq %r15, %rax
subq %r14, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x51df
movq %r14, %rdi
movq %r15, %rsi
callq 0x52d8
movq (%rsp), %r14
movq 0x8(%rsp), %r13
jmp 0x4658
movq %r14, %r13
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0x5012
leaq 0x2b36(%rip), %rsi      # 0x71b9
leaq 0x80(%rsp), %rdi
callq 0x21c0
movq 0x80(%rsp), %rsi
leaq 0x108(%rsp), %rdi
movl $0x10, %edx
callq 0x2140
subq %r14, %r13
shrq $0x3, %r13
testl %r13d, %r13d
jle 0x474b
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x20(%rsp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
leaq 0x108(%rsp), %rbx
leaq 0x2ade(%rip), %r14      # 0x71be
movq (%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
movq %rbx, %rdi
callq 0x2180
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
divsd 0x20(%rsp), %xmm0
movq %r15, %rdi
callq 0x2180
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
incq %rbp
cmpq %rbp, %r13
jne 0x46e0
movq 0x487e(%rip), %rax      # 0x8fd0
movq (%rax), %rbx
movq 0x18(%rax), %r14
leaq 0x110(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x108(%rsp,%rax)
callq 0x20f0
leaq 0x200(%rsp), %rdi
callq 0x2040
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x4795
callq 0x2110
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x47a3
callq 0x2110
leaq 0x310(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x308(%rsp,%rax)
callq 0x20f0
leaq 0x400(%rsp), %rdi
callq 0x2040
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x47e1
callq 0x2110
addq $0x508, %rsp            # imm = 0x508
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x47f5
movq %rax, %rbx
jmp 0x481c
jmp 0x4830
jmp 0x47fe
movq %rax, %rbx
jmp 0x484e
jmp 0x4830
movq %rax, %rbx
jmp 0x4841
jmp 0x4830
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x2160
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x4833
callq 0x2110
jmp 0x4833
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4841
callq 0x2110
leaq 0x308(%rsp), %rdi
callq 0x2160
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4862
callq 0x2110
movq %rbx, %rdi
callq 0x21a0