// File: /workspace/github_cpp_makefile_star2_O1/DavidLBruce[P]sim3dof/build/../src/FcTse6.cpp
// Function: FcTse6::IntegrateRK2(Matrix&, double)
void FcTse6::IntegrateRK2( Matrix &XX, double deltaTime  )
{
  double  half = 0.5;
  Matrix  stateDerivK(6,1);
  Matrix  stateDerivKp1(6,1);
  Matrix  stateIncrement(6,1);
  Matrix  stateTemp(6,1);

  //
  // Get derivative at current time
  //
  stateDerivK = CalcStateDeriv( XX );

  //
  // Get derivative at next time step
  //
  stateIncrement = stateDerivK * deltaTime;

  stateTemp = XX + stateIncrement;

  stateDerivKp1 = CalcStateDeriv( stateTemp );

  //
  // The final state increment is calculated from the average of the current
  // and next state derivatives.
  //
  stateIncrement = (stateDerivK + stateDerivKp1) * deltaTime * half;

  XX += stateIncrement;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movsd %xmm0, -0x10(%rbp)
movq %rsi, %rbx
leaq -0x40(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13504
leaq -0x70(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13504
leaq -0x28(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13504
leaq -0x58(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13504
leaq -0x160(%rbp), %rdi
movq %rbx, %rdx
callq 0x887c
leaq -0x1d8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x13b92
leaq -0x1d8(%rbp), %rdi
callq 0x13642
leaq -0x160(%rbp), %rdi
callq 0x13642
leaq -0x148(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movsd -0x10(%rbp), %xmm0
callq 0x14000
leaq -0x1c0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x13b92
leaq -0x1c0(%rbp), %rdi
callq 0x13642
leaq -0x148(%rbp), %rdi
callq 0x13642
leaq -0x118(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x13576
leaq -0x130(%rbp), %rdi
leaq -0x118(%rbp), %rdx
movq %rbx, %rsi
callq 0x13c48
leaq -0x1a8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x13b92
leaq -0x1a8(%rbp), %rdi
callq 0x13642
leaq -0x130(%rbp), %rdi
callq 0x13642
leaq -0x118(%rbp), %rdi
callq 0x13642
leaq -0x100(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x887c
leaq -0x190(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x13b92
leaq -0x190(%rbp), %rdi
callq 0x13642
leaq -0x100(%rbp), %rdi
callq 0x13642
leaq -0xa0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x13576
leaq -0xb8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x13c48
leaq -0xd0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movsd -0x10(%rbp), %xmm0
callq 0x14000
leaq -0xe8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movsd 0xdda1(%rip), %xmm0     # 0x16168
callq 0x14000
leaq -0x178(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x13b92
leaq -0x178(%rbp), %rdi
callq 0x13642
leaq -0xe8(%rbp), %rdi
callq 0x13642
leaq -0xd0(%rbp), %rdi
callq 0x13642
leaq -0xb8(%rbp), %rdi
callq 0x13642
leaq -0xa0(%rbp), %rdi
callq 0x13642
leaq -0x88(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x13576
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x140ee
leaq -0x88(%rbp), %rdi
callq 0x13642
leaq -0x58(%rbp), %rdi
callq 0x13642
leaq -0x28(%rbp), %rdi
callq 0x13642
leaq -0x70(%rbp), %rdi
callq 0x13642
leaq -0x40(%rbp), %rdi
callq 0x13642
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x8507
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x13642
jmp 0x849b
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x13642
jmp 0x84ac
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x13642
jmp 0x84bd
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x8507
jmp 0x851d
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
jmp 0x8507
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x13642
jmp 0x84e8
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
jmp 0x8507
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
jmp 0x8507
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x13642
jmp 0x8520
movq %rax, %rbx
jmp 0x8529
movq %rax, %rbx
jmp 0x8532
movq %rax, %rbx
jmp 0x853b
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x13642
leaq -0x28(%rbp), %rdi
callq 0x13642
leaq -0x70(%rbp), %rdi
callq 0x13642
leaq -0x40(%rbp), %rdi
callq 0x13642
movq %rbx, %rdi
callq 0x32d0