// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::householder_zero_row(double*, double*, int, int, int, int, double*)
void householder_zero_row(RNScalar *a,RNScalar *v,int i,int j,int m,int n,RNScalar *hv)
{
    RNScalar scale, sigma,snorm, f, h, s, dot;
    int k,l;

    for (scale=0, k=j; k<n; k++) scale += ((RNScalar) fabs(REF2D(a,m,n,i,k)));
    if (!scale) return;

    for (k=j; k<n; k++) hv[k] = REF2D(a,m,n,i,k) / scale;
    for (sigma=0, k=j; k<n; k++) sigma += hv[k]*hv[k];

    f = hv[j];
    snorm = ((RNScalar) ((f > 0) ? -sqrt(sigma) : sqrt(sigma)));
    h = f*snorm - sigma;
    hv[j] = f - snorm;

    REF2D(a,m,n,i,j) = scale * snorm;
    for (k=j+1; k<n; k++) REF2D(a,m,n,i,k) = 0;

    for (k=i+1; k<m; k++) {
	for (dot=0, l=j; l<n; l++) dot += REF2D(a,m,n,k,l)*hv[l];
	s = dot/h;
	for (l=j; l<n; l++) REF2D(a,m,n,k,l) += s*hv[l];
    }

    for (k=0; k<n; k++) {
	for (dot=0, l=j; l<n; l++) dot += REF2D(v,n,n,l,k)*hv[l];
	s = dot/h;
	for (l=j; l<n; l++) REF2D(v,n,n,l,k) += s*hv[l];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %r12d
movq 0x80(%rsp), %r13
movslq %ecx, %rbx
movslq %r9d, %rbp
imull %edx, %r12d
movslq %r12d, %rax
leaq (%rdi,%rax,8), %r15
xorpd %xmm4, %xmm4
movapd 0x2c8f8(%rip), %xmm0    # 0x93270
movq %rbx, %rax
cmpq %rbp, %rax
jge 0x66993
movsd (%r15,%rax,8), %xmm1
andpd %xmm0, %xmm1
addsd %xmm1, %xmm4
incq %rax
jmp 0x6697b
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm4
jne 0x669a3
jnp 0x66b8f
movq %rbx, %rax
cmpq %rbp, %rax
jge 0x669c1
movsd (%r15,%rax,8), %xmm0
divsd %xmm4, %xmm0
movsd %xmm0, (%r13,%rax,8)
incq %rax
jmp 0x669a6
xorpd %xmm5, %xmm5
movq %rbx, %rax
cmpq %rbp, %rax
jge 0x669e1
movsd (%r13,%rax,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm5
incq %rax
jmp 0x669c8
movsd (%r13,%rbx,8), %xmm3
xorpd %xmm6, %xmm6
ucomisd %xmm6, %xmm5
jb 0x669f8
sqrtsd %xmm5, %xmm0
jmp 0x66a4b
movapd %xmm5, %xmm0
movq %rsi, 0x18(%rsp)
movsd %xmm3, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
movl %r8d, %r14d
movl %edx, 0xc(%rsp)
movsd %xmm4, 0x10(%rsp)
movapd %xmm5, 0x30(%rsp)
callq 0xe350
xorpd %xmm6, %xmm6
movapd 0x30(%rsp), %xmm5
movsd 0x10(%rsp), %xmm4
movl 0xc(%rsp), %edx
movl %r14d, %r8d
movq 0x20(%rsp), %rdi
movsd 0x28(%rsp), %xmm3
movq 0x18(%rsp), %rsi
movapd 0x2c5dd(%rip), %xmm1    # 0x93030
movapd %xmm0, %xmm2
xorpd %xmm1, %xmm2
cmpltsd %xmm3, %xmm6
andpd %xmm6, %xmm2
andnpd %xmm0, %xmm6
orpd %xmm2, %xmm6
xorpd %xmm1, %xmm5
movapd %xmm3, %xmm0
subsd %xmm6, %xmm0
movsd %xmm0, (%r13,%rbx,8)
mulsd %xmm6, %xmm4
addl %ebx, %r12d
movslq %r12d, %rax
movsd %xmm4, (%rdi,%rax,8)
leaq 0x1(%rbx), %rax
cmpq %rbp, %rax
jge 0x66aa1
andq $0x0, (%r15,%rax,8)
incq %rax
jmp 0x66a92
mulsd %xmm6, %xmm3
addsd %xmm5, %xmm3
movslq %edx, %rcx
movslq %r8d, %rdx
leaq 0x1(%rcx), %rax
imulq %rbp, %rax
leaq (%rdi,%rax,8), %r8
leaq (,%rbp,8), %rax
incq %rcx
cmpq %rdx, %rcx
jge 0x66b1a
xorpd %xmm0, %xmm0
movq %rbx, %rdi
cmpq %rbp, %rdi
jge 0x66aed
movsd (%r8,%rdi,8), %xmm1
mulsd (%r13,%rdi,8), %xmm1
addsd %xmm1, %xmm0
incq %rdi
jmp 0x66ad2
divsd %xmm3, %xmm0
movq %rbx, %rdi
cmpq %rbp, %rdi
jge 0x66b15
movsd (%r13,%rdi,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%r8,%rdi,8), %xmm1
movsd %xmm1, (%r8,%rdi,8)
incq %rdi
jmp 0x66af4
addq %rax, %r8
jmp 0x66ac3
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %edx
cmovgl %ebp, %edx
movq %rbp, %rdi
imulq %rbx, %rdi
leaq (%rsi,%rdi,8), %rsi
cmpq %rdx, %rcx
je 0x66b8f
xorpd %xmm0, %xmm0
movq %rsi, %rdi
movq %rbx, %r8
cmpq %rbp, %r8
jge 0x66b5c
movsd (%rdi), %xmm1
mulsd (%r13,%r8,8), %xmm1
addsd %xmm1, %xmm0
incq %r8
addq %rax, %rdi
jmp 0x66b40
divsd %xmm3, %xmm0
movq %rsi, %rdi
movq %rbx, %r8
cmpq %rbp, %r8
jge 0x66b86
movsd (%r13,%r8,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%rdi), %xmm1
movsd %xmm1, (%rdi)
incq %r8
addq %rax, %rdi
jmp 0x66b66
incq %rcx
addq $0x8, %rsi
jmp 0x66b31
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq