// File: /workspace/github_c_makefile_star2_O3/dapogon[P]cellcoal/src/eigen.c
// Function: elemhess
void elemhess(int job,double mat[],int n,int low,int hi, double vr[],
              double vi[], int work[])
{
/* work[n] */
    int i,j,m;
    double x,y;

    for (m = low + 1; m < hi; m++) {
        for (x = 0,i = m,j = m; j <= hi; j++) {
            if (fabs(mat[pos(j,m-1,n)]) > fabs(x)) {
                x = mat[pos(j,m-1,n)];
                i = j;
            }
        }

        if ((work[m] = i) != m) {
            for (j = m - 1; j < n; j++) {
               y = mat[pos(i,j,n)];
               mat[pos(i,j,n)] = mat[pos(m,j,n)];
               mat[pos(m,j,n)] = y;
            }

            for (j = 0; j <= hi; j++) {
               y = mat[pos(j,i,n)];
               mat[pos(j,i,n)] = mat[pos(j,m,n)];
               mat[pos(j,m,n)] = y;
            }
        }

        if (x != 0) {
            for (i = m + 1; i <= hi; i++) {
                if ((y = mat[pos(i,m-1,n)]) != 0) {
                    y = mat[pos(i,m-1,n)] = y / x;

                    for (j = m; j < n; j++) {
                        mat[pos(i,j,n)] -= y * mat[pos(m,j,n)];
                    }

                    for (j = 0; j <= hi; j++) {
                        mat[pos(j,m,n)] += y * mat[pos(j,i,n)];
                    }
                }
            }
        }
    }
    if (job) {
       for (i=0; i<n; i++) {
          for (j=0; j<n; j++) {
             vr[pos(i,j,n)] = 0.0; vi[pos(i,j,n)] = 0.0;
          }
          vr[pos(i,i,n)] = 1.0;
       }

       for (m = hi - 1; m > low; m--) {
          for (i = m + 1; i <= hi; i++) {
             vr[pos(i,m,n)] = mat[pos(i,m-1,n)];
          }

         if ((i = work[m]) != m) {
            for (j = m; j <= hi; j++) {
               vr[pos(m,j,n)] = vr[pos(i,j,n)];
               vr[pos(i,j,n)] = 0.0;
            }
            vr[pos(i,m,n)] = 1.0;
         }
      }
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, -0x28(%rsp)
movq %rdx, -0x50(%rsp)
movq %rsi, -0x48(%rsp)
movl %edi, -0x1c(%rsp)
movq %rcx, -0x30(%rsp)
leal 0x1(%rcx), %eax
cmpl %r8d, %eax
jge 0x1b2fb
movq -0x30(%rsp), %rax
movslq %eax, %r10
leaq 0x1(%r10), %r11
movslq -0x50(%rsp), %rbx
movslq %r8d, %r14
leal 0x1(%r8), %ecx
movq %rcx, -0x38(%rsp)
addl $0x2, %eax
movslq %eax, %r9
leaq -0x2(%r14), %rax
movq %rax, -0x8(%rsp)
movq %r11, %rax
imulq %rbx, %rax
leaq (,%r10,8), %rdx
leaq (%rdx,%rax,8), %rbp
movq -0x48(%rsp), %rdi
addq %rdi, %rbp
leaq (,%rbx,8), %rax
leaq 0x8(,%rbx,8), %rcx
movq %rcx, -0x10(%rsp)
leaq (%rdi,%r10,8), %rcx
movq %rbx, %rsi
imulq %r9, %rsi
leaq (%rdx,%rsi,8), %rdx
addq %rdi, %rdx
movq %rdx, -0x18(%rsp)
movq %r9, -0x40(%rsp)
leaq (%rdi,%r9,8), %rdi
movapd 0xfde5(%rip), %xmm0     # 0x2af00
xorpd %xmm1, %xmm1
movapd 0x7f19(%rip), %xmm2     # 0x23040
movl %r11d, %esi
movq %rbp, %r12
movq %r10, %r13
xorpd %xmm4, %xmm4
movl %r11d, %edx
movapd %xmm4, %xmm3
movsd (%r12), %xmm5
movapd %xmm5, %xmm6
andpd %xmm0, %xmm6
andpd %xmm0, %xmm3
ucomisd %xmm3, %xmm6
cmoval %esi, %edx
cmpltsd %xmm6, %xmm3
andpd %xmm3, %xmm5
andnpd %xmm4, %xmm3
orpd %xmm5, %xmm3
incq %r13
addq %rax, %r12
incl %esi
movapd %xmm3, %xmm4
cmpq %r14, %r13
jl 0x1b13b
movq 0x40(%rsp), %rsi
movl %edx, (%rsi,%r11,4)
cmpl %r11d, %edx
je 0x1b1fe
cmpq %rbx, %r10
jge 0x1b1c3
movl %edx, %esi
imull -0x50(%rsp), %esi
movslq %esi, %rsi
leaq (%rcx,%rsi,8), %rsi
xorl %r9d, %r9d
movsd (%rsi,%r9,8), %xmm4
movsd (%rbp,%r9,8), %xmm5
movsd %xmm5, (%rsi,%r9,8)
movsd %xmm4, (%rbp,%r9,8)
leaq (%r10,%r9), %r15
incq %r15
incq %r9
cmpq %rbx, %r15
jl 0x1b19a
testl %r8d, %r8d
js 0x1b1fe
movslq %edx, %rdx
movq -0x48(%rsp), %rsi
leaq (%rsi,%rdx,8), %rdx
movq -0x38(%rsp), %rsi
xorl %r9d, %r9d
movsd (%rdx,%r9), %xmm4
movsd 0x8(%rcx,%r9), %xmm5
movsd %xmm5, (%rdx,%r9)
movsd %xmm4, 0x8(%rcx,%r9)
addq %rax, %r9
decq %rsi
jne 0x1b1dc
ucomisd %xmm1, %xmm3
setnp %dl
sete %sil
andb %dl, %sil
cmpq -0x8(%rsp), %r10
setg %dl
orb %sil, %dl
jne 0x1b2d2
movq -0x48(%rsp), %rdx
leaq (%rdx,%r10,8), %rdx
movq %rdi, %rsi
movq -0x18(%rsp), %r13
movq -0x40(%rsp), %r12
movq %r12, %r9
imulq %rbx, %r9
movsd (%rdx,%r9,8), %xmm4
ucomisd %xmm1, %xmm4
jne 0x1b248
jnp 0x1b2ba
divsd %xmm3, %xmm4
movsd %xmm4, (%rdx,%r9,8)
cmpq %rbx, %r11
jge 0x1b28d
movapd %xmm4, %xmm5
xorpd %xmm2, %xmm5
movl $0x1, %r15d
movsd (%rbp,%r15,8), %xmm6
mulsd %xmm5, %xmm6
addsd (%r13,%r15,8), %xmm6
movsd %xmm6, (%r13,%r15,8)
leaq (%r10,%r15), %r9
incq %r9
incq %r15
cmpq %rbx, %r9
jl 0x1b265
testl %r8d, %r8d
js 0x1b2ba
movq -0x38(%rsp), %r15
xorl %r9d, %r9d
movsd (%rsi,%r9), %xmm5
mulsd %xmm4, %xmm5
addsd 0x8(%rcx,%r9), %xmm5
movsd %xmm5, 0x8(%rcx,%r9)
addq %rax, %r9
decq %r15
jne 0x1b29a
leaq 0x1(%r12), %r9
addq %rax, %r13
addq $0x8, %rsi
cmpq %r14, %r12
movq %r9, %r12
jl 0x1b233
incq %r11
incq %r10
incq -0x40(%rsp)
movq -0x10(%rsp), %rdx
addq %rdx, %rbp
addq $0x8, %rcx
addq %rdx, -0x18(%rsp)
addq $0x8, %rdi
cmpl %r8d, %r11d
jne 0x1b127
cmpl $0x0, -0x1c(%rsp)
je 0x1b470
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq -0x50(%rsp), %r12
testl %r12d, %r12d
movq -0x28(%rsp), %r15
jle 0x1b36b
movq 0x38(%rsp), %rcx
leal 0x1(%r12), %edx
movl %r12d, %esi
xorl %edi, %edi
xorl %r9d, %r9d
xorl %r10d, %r10d
movl %r9d, %ebx
leaq (%rcx,%rbx,8), %r11
leaq (%r15,%rbx,8), %rbx
xorl %r14d, %r14d
movq %rdi, (%rbx,%r14,8)
movq %rdi, (%r11,%r14,8)
incq %r14
cmpq %r14, %rsi
jne 0x1b342
movl %edx, %r11d
imull %r10d, %r11d
movslq %r11d, %r11
movq %rax, (%r15,%r11,8)
incq %r10
addl %r12d, %r9d
cmpq %rsi, %r10
jne 0x1b334
leal -0x1(%r8), %edx
cmpl -0x30(%rsp), %edx
jle 0x1b470
movslq -0x50(%rsp), %rcx
movslq %edx, %rdx
movslq %r8d, %rsi
movq %rsi, -0x38(%rsp)
movslq -0x30(%rsp), %rdi
movq -0x28(%rsp), %rsi
leaq (%rsi,%rdx,8), %r10
addq $-0x10, -0x48(%rsp)
leaq 0x8(,%rcx,8), %rbx
shlq $0x3, %rcx
movq %rbx, -0x40(%rsp)
imulq %rdx, %rbx
addq %rsi, %rbx
movq %rcx, %r14
xorq $-0x8, %r14
movl $0x1, %esi
movl $0x2, %r15d
movl %r8d, %r12d
cmpl %r8d, %r12d
jg 0x1b400
movslq %r12d, %r9
movq %rcx, %r13
imulq %r9, %r13
addq %r10, %r13
imulq -0x40(%rsp), %r9
addq -0x48(%rsp), %r9
movl %esi, %ebp
xorl %r11d, %r11d
movsd (%r9,%r11), %xmm0
movsd %xmm0, (%r13,%r11)
addq %rcx, %r11
decl %ebp
jne 0x1b3ec
movq 0x40(%rsp), %r9
movl (%r9,%rdx,4), %r9d
cmpl %edx, %r9d
je 0x1b455
imull -0x50(%rsp), %r9d
cmpq -0x38(%rsp), %rdx
jle 0x1b420
movslq %r9d, %r9
jmp 0x1b448
movslq %r9d, %r9
leaq (%r10,%r9,8), %r13
xorl %r11d, %r11d
movsd (%r13,%r11,8), %xmm0
movsd %xmm0, (%rbx,%r11,8)
movq $0x0, (%r13,%r11,8)
incq %r11
cmpl %r11d, %r15d
jne 0x1b42a
movq -0x28(%rsp), %r11
leaq (%r11,%r9,8), %r9
movq %rax, (%r9,%rdx,8)
decq %rdx
decl %r12d
addq $-0x8, %r10
incl %esi
addq %r14, %rbx
incq %r15
cmpq %rdi, %rdx
jg 0x1b3ca
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq