// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]eigenmath/eigenmath.c
// Function: eigenvec_step_nib
void
eigenvec_step_nib(double *D, double *Q, int n, int p, int q)
{
	int k;
	double t, theta;
	double c, cc, s, ss;

	// compute c and s

	// from Numerical Recipes (except they have a_qq - a_pp)

	theta = 0.5 * (D[n * p + p] - D[n * q + q]) / D[n * p + q];

	t = 1.0 / (fabs(theta) + sqrt(theta * theta + 1.0));

	if (theta < 0.0)
		t = -t;

	c = 1.0 / sqrt(t * t + 1.0);

	s = t * c;

	// D = GD

	// which means "add rows"

	for (k = 0; k < n; k++) {
		cc = D[n * p + k];
		ss = D[n * q + k];
		D[n * p + k] = c * cc + s * ss;
		D[n * q + k] = c * ss - s * cc;
	}

	// D = D transpose(G)

	// which means "add columns"

	for (k = 0; k < n; k++) {
		cc = D[n * k + p];
		ss = D[n * k + q];
		D[n * k + p] = c * cc + s * ss;
		D[n * k + q] = c * ss - s * cc;
	}

	// Q = GQ

	// which means "add rows"

	for (k = 0; k < n; k++) {
		cc = Q[n * p + k];
		ss = Q[n * q + k];
		Q[n * p + k] = c * cc + s * ss;
		Q[n * q + k] = c * ss - s * cc;
	}

	D[n * p + q] = 0.0;
	D[n * q + p] = 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm1
movsd 0x2b2fa(%rip), %xmm0    # 0x450c8
mulsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movaps 0x2b347(%rip), %xmm1    # 0x45140
pand %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x2b298(%rip), %xmm1    # 0x450b0
addsd %xmm1, %xmm0
callq 0x7340
movsd -0x58(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd 0x2b27e(%rip), %xmm0    # 0x450b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0x19e66
movsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x2b234(%rip), %xmm1    # 0x450b0
addsd %xmm1, %xmm0
callq 0x7340
movaps %xmm0, %xmm1
movsd 0x2b220(%rip), %xmm0    # 0x450b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x28(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x19f7a
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x19eaf
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1a04c
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x19f81
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1a11e
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1a053
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)