// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/matrix.c
// Function: elmhes
int* elmhes(matrix a)
{
 int m, i, j, *perm;
 double x, y;
 perm = safemalloc(a.row * sizeof(int), "elmhes", 3);
 for (m = 1; m < a.row - 1; m++) 
  {	
   x = 0.0;
   i = m;
   for (j = m; j < a.row; j++) 
    {	
     if (fabs(a.values[j][m-1]) > fabs(x)) 
      { 
       x = a.values[j][m-1];
       i = j;   
      }
    }
   perm[m] = i; 
   if (i != m) 
    {
     for (j = m - 1; j < a.row; j++) 
       swap_double(&(a.values[i][j]), &(a.values[m][j])); 
     for (j = 0; j < a.row; j++) 
       swap_double(&(a.values[j][i]), &(a.values[j][m]));
    } 
   if (x != 0.0) 
    {
     for (i = m + 1; i < a.row; i++) 
      { 
       y = a.values[i][m-1]; 
       if (y != 0.0) 
        {
         y /= x; 
         a.values[i][m - 1] = y; 
         for (j = m; j < a.row; j++) 
           a.values[i][j] -= y * a.values[m][j]; 
         for (j = 0; j < a.row; j++) 
           a.values[j][m] += y * a.values[j][i];
        }
      }
    }
  }
 return perm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r13
movq %rdi, %r14
shlq $0x20, %r14
movq %r14, %rdi
sarq $0x1e, %rdi
leaq 0x5e92b(%rip), %rsi     # 0x99f5e
pushq $0x3
popq %rdx
callq 0x34f59
movq %rax, (%rsp)
movslq %r13d, %r12
movq $0x0, 0x8(%rsp)
testl %r12d, %r12d
movl $0x0, %ebp
cmovgl %r13d, %ebp
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r14, %rax
sarq $0x20, %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %r15
xorl %eax, %eax
movq %r13, 0x20(%rsp)
cmpl %r13d, %eax
movl %r13d, %r14d
cmovgl %eax, %r14d
cmpq 0x28(%rsp), %r15
jge 0x3b813
movq %rax, 0x10(%rsp)
xorpd %xmm4, %xmm4
movq %r15, %rcx
movl %r15d, %eax
cmpq %r12, %rcx
jge 0x3b6e5
movq (%rbx,%rcx,8), %rdx
movsd -0x8(%rdx,%r15,8), %xmm0
movapd %xmm0, %xmm1
movapd 0x5ab28(%rip), %xmm3    # 0x961e0
andpd %xmm3, %xmm1
movapd %xmm4, %xmm2
andpd %xmm3, %xmm2
ucomisd %xmm2, %xmm1
cmoval %ecx, %eax
cmpltsd %xmm1, %xmm2
andpd %xmm2, %xmm0
andnpd %xmm4, %xmm2
orpd %xmm0, %xmm2
incq %rcx
movapd %xmm2, %xmm4
jmp 0x3b69c
movq (%rsp), %rcx
movl %eax, (%rcx,%r15,4)
movl %eax, %ecx
cmpq %rcx, %r15
jne 0x3b7a1
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm4
jne 0x3b708
jnp 0x3b78b
movq %r15, %rax
movq %rax, %rcx
incq %rax
cmpl %r13d, %eax
jge 0x3b78b
movq 0x8(%rbx,%rcx,8), %rdx
movsd -0x8(%rdx,%r15,8), %xmm0
ucomisd %xmm3, %xmm0
jne 0x3b72a
jnp 0x3b70b
divsd %xmm4, %xmm0
movsd %xmm0, -0x8(%rdx,%r15,8)
movapd %xmm0, %xmm1
xorpd 0x5aa8f(%rip), %xmm1    # 0x961d0
movq %r15, %rsi
cmpq %r12, %rsi
jge 0x3b765
movq (%rbx,%r15,8), %rdi
movsd (%rdi,%rsi,8), %xmm2
mulsd %xmm1, %xmm2
addsd (%rdx,%rsi,8), %xmm2
movsd %xmm2, (%rdx,%rsi,8)
incq %rsi
jmp 0x3b744
xorl %edx, %edx
cmpq %rdx, %rbp
je 0x3b70b
movq (%rbx,%rdx,8), %rsi
movsd 0x8(%rsi,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%rsi,%r15,8), %xmm1
movsd %xmm1, (%rsi,%r15,8)
incq %rdx
jmp 0x3b767
incq %r15
movq 0x10(%rsp), %rax
incq %rax
addq $0x8, 0x8(%rsp)
jmp 0x3b678
movapd %xmm4, 0x30(%rsp)
cltq
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %r13
cmpq %r14, 0x10(%rsp)
je 0x3b7db
movq 0x18(%rsp), %rax
movq (%rbx,%rax,8), %rdi
addq %r13, %rdi
movq (%rbx,%r15,8), %rsi
addq %r13, %rsi
callq 0x35388
decq %r14
addq $0x8, %r13
jmp 0x3b7b3
xorl %r14d, %r14d
movq 0x20(%rsp), %r13
movapd 0x30(%rsp), %xmm4
cmpq %r14, %rbp
je 0x3b6f8
movq (%rbx,%r14,8), %rax
movq 0x18(%rsp), %rcx
leaq (%rax,%rcx,8), %rdi
leaq (%rax,%r15,8), %rsi
callq 0x35388
movapd 0x30(%rsp), %xmm4
incq %r14
jmp 0x3b7e9
movq (%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq