// File: /workspace/github_cpp_makefile_star2_O3/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 0x13378
leaq -0x70(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13378
leaq -0x28(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13378
leaq -0x58(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x6, %esi
movl $0x1, %edx
callq 0x13378
leaq -0x160(%rbp), %rdi
movq %rbx, %rdx
callq 0x881c
leaq -0x1d8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x139f0
leaq -0x1d8(%rbp), %rdi
callq 0x134aa
leaq -0x160(%rbp), %rdi
callq 0x134aa
leaq -0x148(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movsd -0x10(%rbp), %xmm0
callq 0x13e52
leaq -0x1c0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x139f0
leaq -0x1c0(%rbp), %rdi
callq 0x134aa
leaq -0x148(%rbp), %rdi
callq 0x134aa
leaq -0x118(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x133e2
leaq -0x130(%rbp), %rdi
leaq -0x118(%rbp), %rdx
movq %rbx, %rsi
callq 0x13a9a
leaq -0x1a8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x139f0
leaq -0x1a8(%rbp), %rdi
callq 0x134aa
leaq -0x130(%rbp), %rdi
callq 0x134aa
leaq -0x118(%rbp), %rdi
callq 0x134aa
leaq -0x100(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x881c
leaq -0x190(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x139f0
leaq -0x190(%rbp), %rdi
callq 0x134aa
leaq -0x100(%rbp), %rdi
callq 0x134aa
leaq -0xa0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x133e2
leaq -0xb8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x13a9a
leaq -0xd0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movsd -0x10(%rbp), %xmm0
callq 0x13e52
leaq -0xe8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movsd 0xddf1(%rip), %xmm0     # 0x16168
callq 0x13e52
leaq -0x178(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x139f0
leaq -0x178(%rbp), %rdi
callq 0x134aa
leaq -0xe8(%rbp), %rdi
callq 0x134aa
leaq -0xd0(%rbp), %rdi
callq 0x134aa
leaq -0xb8(%rbp), %rdi
callq 0x134aa
leaq -0xa0(%rbp), %rdi
callq 0x134aa
leaq -0x88(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x133e2
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x13f40
leaq -0x88(%rbp), %rdi
callq 0x134aa
leaq -0x58(%rbp), %rdi
callq 0x134aa
leaq -0x28(%rbp), %rdi
callq 0x134aa
leaq -0x70(%rbp), %rdi
callq 0x134aa
leaq -0x40(%rbp), %rdi
callq 0x134aa
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x84b7
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x134aa
jmp 0x844b
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x134aa
jmp 0x845c
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x134aa
jmp 0x846d
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x84b7
jmp 0x84cd
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
jmp 0x84b7
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x134aa
jmp 0x8498
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
jmp 0x84b7
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
jmp 0x84b7
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x134aa
jmp 0x84d0
movq %rax, %rbx
jmp 0x84d9
movq %rax, %rbx
jmp 0x84e2
movq %rax, %rbx
jmp 0x84eb
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x134aa
leaq -0x28(%rbp), %rdi
callq 0x134aa
leaq -0x70(%rbp), %rdi
callq 0x134aa
leaq -0x40(%rbp), %rdi
callq 0x134aa
movq %rbx, %rdi
callq 0x32d0