// File: /workspace/github_c_makefile_star2_O1/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 0x1b019
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, -0x10(%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, -0x8(%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), %rdx
movapd 0x20fff(%rip), %xmm0    # 0x3be40
xorpd %xmm1, %xmm1
movapd 0x19273(%rip), %xmm2    # 0x340c0
movl %r11d, %edi
movq %rbp, %r12
movq %r10, %r13
xorpd %xmm4, %xmm4
movl %r11d, %esi
movapd %xmm4, %xmm3
movsd (%r12), %xmm5
movapd %xmm5, %xmm6
andpd %xmm0, %xmm6
andpd %xmm0, %xmm3
ucomisd %xmm3, %xmm6
cmoval %edi, %esi
cmpltsd %xmm6, %xmm3
andpd %xmm3, %xmm5
andnpd %xmm4, %xmm3
orpd %xmm5, %xmm3
incq %r13
addq %rax, %r12
incl %edi
movapd %xmm3, %xmm4
cmpq %r14, %r13
jl 0x1ae61
movq 0x40(%rsp), %rdi
movl %esi, (%rdi,%r11,4)
cmpl %r11d, %esi
je 0x1af24
cmpq %rbx, %r10
jge 0x1aee9
movl %esi, %edi
imull -0x50(%rsp), %edi
movslq %edi, %rdi
leaq (%rcx,%rdi,8), %rdi
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm4
movsd (%rbp,%r9,8), %xmm5
movsd %xmm5, (%rdi,%r9,8)
movsd %xmm4, (%rbp,%r9,8)
leaq (%r10,%r9), %r15
incq %r15
incq %r9
cmpq %rbx, %r15
jl 0x1aec0
testl %r8d, %r8d
js 0x1af24
movslq %esi, %rsi
movq -0x48(%rsp), %rdi
leaq (%rdi,%rsi,8), %rsi
movq -0x38(%rsp), %rdi
xorl %r9d, %r9d
movsd (%rsi,%r9), %xmm4
movsd 0x8(%rcx,%r9), %xmm5
movsd %xmm5, (%rsi,%r9)
movsd %xmm4, 0x8(%rcx,%r9)
addq %rax, %r9
decq %rdi
jne 0x1af02
ucomisd %xmm1, %xmm3
jne 0x1af30
jnp 0x1aff0
cmpq -0x10(%rsp), %r10
jg 0x1aff0
movq -0x48(%rsp), %rsi
leaq (%rsi,%r10,8), %rsi
movq %rdx, %rdi
movq -0x18(%rsp), %r13
movq -0x40(%rsp), %r12
movq %r12, %r9
imulq %rbx, %r9
movsd (%rsi,%r9,8), %xmm4
ucomisd %xmm1, %xmm4
jne 0x1af66
jnp 0x1afd8
divsd %xmm3, %xmm4
movsd %xmm4, (%rsi,%r9,8)
cmpq %rbx, %r11
jge 0x1afab
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 0x1af83
testl %r8d, %r8d
js 0x1afd8
movq -0x38(%rsp), %r15
xorl %r9d, %r9d
movsd (%rdi,%r9), %xmm5
mulsd %xmm4, %xmm5
addsd 0x8(%rcx,%r9), %xmm5
movsd %xmm5, 0x8(%rcx,%r9)
addq %rax, %r9
decq %r15
jne 0x1afb8
leaq 0x1(%r12), %r9
addq %rax, %r13
addq $0x8, %rdi
cmpq %r14, %r12
movq %r9, %r12
jl 0x1af51
incq %r11
incq %r10
incq -0x40(%rsp)
movq -0x8(%rsp), %rsi
addq %rsi, %rbp
addq $0x8, %rcx
addq %rsi, -0x18(%rsp)
addq $0x8, %rdx
cmpl %r8d, %r11d
jne 0x1ae4d
cmpl $0x0, -0x1c(%rsp)
je 0x1b18d
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
cmpl $0x0, -0x50(%rsp)
movq -0x28(%rsp), %r15
jle 0x1b08a
movq 0x38(%rsp), %rcx
movq -0x50(%rsp), %rsi
leal 0x1(%rsi), %edx
movl %esi, %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 0x1b05f
movl %edx, %r11d
imull %r10d, %r11d
movslq %r11d, %r11
movq %rax, (%r15,%r11,8)
incq %r10
addl -0x50(%rsp), %r9d
cmpq %rsi, %r10
jne 0x1b051
leal -0x1(%r8), %edx
cmpl -0x30(%rsp), %edx
jle 0x1b18d
movslq -0x50(%rsp), %rcx
movslq %edx, %rsi
movslq %r8d, %rdx
movq %rdx, -0x38(%rsp)
movslq -0x30(%rsp), %r10
movq -0x28(%rsp), %rdx
leaq (%rdx,%rsi,8), %r11
addq $-0x10, -0x48(%rsp)
leaq 0x8(,%rcx,8), %r14
shlq $0x3, %rcx
movq %r14, -0x40(%rsp)
imulq %rsi, %r14
addq %rdx, %r14
movq %rcx, %r15
xorq $-0x8, %r15
movl $0x1, %edi
movl $0x2, %r12d
movl %r8d, %r13d
cmpl %r8d, %r13d
jg 0x1b11c
movslq %r13d, %rdx
movq %rcx, %r9
imulq %rdx, %r9
addq %r11, %r9
imulq -0x40(%rsp), %rdx
addq -0x48(%rsp), %rdx
movl %edi, %ebp
xorl %ebx, %ebx
movsd (%rdx,%rbx), %xmm0
movsd %xmm0, (%r9,%rbx)
addq %rcx, %rbx
decl %ebp
jne 0x1b10a
movq 0x40(%rsp), %rdx
movl (%rdx,%rsi,4), %edx
cmpl %esi, %edx
je 0x1b172
cmpq -0x38(%rsp), %rsi
jg 0x1b15d
movl %edx, %r9d
imull -0x50(%rsp), %r9d
movslq %r9d, %r9
leaq (%r11,%r9,8), %r9
xorl %ebx, %ebx
movsd (%r9,%rbx,8), %xmm0
movsd %xmm0, (%r14,%rbx,8)
movq $0x0, (%r9,%rbx,8)
incq %rbx
cmpl %ebx, %r12d
jne 0x1b141
imull -0x50(%rsp), %edx
movslq %edx, %rdx
movq -0x28(%rsp), %r9
leaq (%r9,%rsi,8), %r9
movq %rax, (%r9,%rdx,8)
decq %rsi
decl %r13d
addq $-0x8, %r11
incl %edi
addq %r15, %r14
incq %r12
cmpq %r10, %rsi
jg 0x1b0e9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq