// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movsd %xmm0, -0x20(%rbp)
movq %rsi, %rbx
leaq -0x50(%rbp), %rdi
pushq $0x6
popq %r14
pushq $0x1
popq %r15
xorps %xmm0, %xmm0
movl %r14d, %esi
movl %r15d, %edx
callq 0x12cf8
leaq -0x80(%rbp), %rdi
xorps %xmm0, %xmm0
movl %r14d, %esi
movl %r15d, %edx
callq 0x12cf8
leaq -0x38(%rbp), %rdi
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
xorps %xmm0, %xmm0
callq 0x12cf8
leaq -0x68(%rbp), %rdi
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
xorps %xmm0, %xmm0
callq 0x12cf8
leaq -0x170(%rbp), %rdi
movq %rbx, %rdx
callq 0x86ca
leaq -0x1e8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x170(%rbp), %rdx
callq 0x13296
leaq -0x1e8(%rbp), %rdi
callq 0x12dd8
leaq -0x170(%rbp), %rdi
callq 0x12dd8
leaq -0x158(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movsd -0x20(%rbp), %xmm0
callq 0x136c2
leaq -0x1d0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x158(%rbp), %rdx
callq 0x13296
leaq -0x1d0(%rbp), %rdi
callq 0x12dd8
leaq -0x158(%rbp), %rdi
callq 0x12dd8
leaq -0x128(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x12d48
leaq -0x140(%rbp), %rdi
leaq -0x128(%rbp), %rdx
movq %rbx, %rsi
callq 0x1331e
leaq -0x1b8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x13296
leaq -0x1b8(%rbp), %rdi
callq 0x12dd8
leaq -0x140(%rbp), %rdi
callq 0x12dd8
leaq -0x128(%rbp), %rdi
callq 0x12dd8
leaq -0x110(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x86ca
leaq -0x1a0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x13296
leaq -0x1a0(%rbp), %rdi
callq 0x12dd8
leaq -0x110(%rbp), %rdi
callq 0x12dd8
leaq -0xb0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x12d48
leaq -0xc8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x1331e
leaq -0xe0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movsd -0x20(%rbp), %xmm0
callq 0x136c2
leaq -0xf8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
movsd 0xcf47(%rip), %xmm0     # 0x15168
callq 0x136c2
leaq -0x188(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0xf8(%rbp), %rdx
callq 0x13296
leaq -0x188(%rbp), %rdi
callq 0x12dd8
leaq -0xf8(%rbp), %rdi
callq 0x12dd8
leaq -0xe0(%rbp), %rdi
callq 0x12dd8
leaq -0xc8(%rbp), %rdi
callq 0x12dd8
leaq -0xb0(%rbp), %rdi
callq 0x12dd8
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x12d48
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x137b0
leaq -0x98(%rbp), %rdi
callq 0x12dd8
leaq -0x68(%rbp), %rdi
callq 0x12dd8
leaq -0x38(%rbp), %rdi
callq 0x12dd8
leaq -0x80(%rbp), %rdi
callq 0x12dd8
leaq -0x50(%rbp), %rdi
callq 0x12dd8
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x8365
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x12dd8
jmp 0x82f9
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x12dd8
jmp 0x830a
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x12dd8
jmp 0x831b
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
jmp 0x8365
jmp 0x837b
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0x8365
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x12dd8
jmp 0x8346
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x8365
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
jmp 0x8365
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x12dd8
jmp 0x837e
movq %rax, %rbx
jmp 0x8387
movq %rax, %rbx
jmp 0x8390
movq %rax, %rbx
jmp 0x8399
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x12dd8
leaq -0x38(%rbp), %rdi
callq 0x12dd8
leaq -0x80(%rbp), %rdi
callq 0x12dd8
leaq -0x50(%rbp), %rdi
callq 0x12dd8
movq %rbx, %rdi
callq 0x3320