// File: /workspace/github_c_makefile_star2_O1/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, %rbp
movslq %ebp, %r14
leaq (,%r14,4), %rdi
leaq 0x66b31(%rip), %rsi     # 0xa6f8e
movl $0x3, %edx
callq 0x390f5
movq %rax, (%rsp)
cmpl $0x3, %r14d
jl 0x4063f
movl %ebp, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
addl $-0x2, %ebp
movl $0x1, %r13d
movl $0x2, %edi
xorl %r8d, %r8d
movapd 0x62d48(%rip), %xmm3    # 0xa31e0
movq %r12, %r14
xorl %eax, %eax
movq %rbp, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq %rdi, 0x28(%rsp)
movl %r13d, %eax
xorpd %xmm4, %xmm4
cmpq %r12, %r13
jae 0x40501
xorpd %xmm0, %xmm0
movq %r13, %rcx
movl %r13d, %eax
movapd %xmm0, %xmm4
movq (%rbx,%rcx,8), %rdx
movsd -0x8(%rdx,%r13,8), %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
andpd %xmm3, %xmm4
ucomisd %xmm4, %xmm2
cmoval %ecx, %eax
cmpltsd %xmm2, %xmm4
andpd %xmm4, %xmm1
andnpd %xmm0, %xmm4
orpd %xmm1, %xmm4
incq %rcx
movapd %xmm4, %xmm0
cmpq %rcx, %r12
jne 0x404c6
movapd %xmm4, 0x30(%rsp)
movq %r8, 0x8(%rsp)
movq (%rsp), %rcx
movl %eax, (%rcx,%r13,4)
movl %eax, %ecx
cmpq %rcx, %r13
je 0x40577
movslq %eax, %rcx
cmpq %r12, %r13
movq %rcx, 0x10(%rsp)
ja 0x40551
movq %r14, %r15
movq 0x8(%rsp), %rbp
movq (%rbx,%rcx,8), %rdi
addq %rbp, %rdi
movq (%rbx,%r13,8), %rsi
addq %rbp, %rsi
callq 0x395ac
movq 0x10(%rsp), %rcx
addq $0x8, %rbp
decq %r15
jne 0x40530
xorl %r15d, %r15d
movq 0x18(%rsp), %rbp
movq (%rbx,%r15,8), %rax
leaq (%rax,%rcx,8), %rdi
leaq (%rax,%r13,8), %rsi
callq 0x395ac
movq 0x10(%rsp), %rcx
incq %r15
cmpq %r15, %r12
jne 0x40559
xorpd %xmm4, %xmm4
movapd 0x30(%rsp), %xmm6
ucomisd %xmm4, %xmm6
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %r8
movapd 0x62c49(%rip), %xmm3    # 0xa31e0
movapd 0x62c31(%rip), %xmm5    # 0xa31d0
jne 0x405a3
jnp 0x40621
movq %rdi, %rax
movq (%rbx,%rax,8), %rcx
movsd -0x8(%rcx,%r13,8), %xmm0
ucomisd %xmm4, %xmm0
jne 0x405b9
jnp 0x40619
divsd %xmm6, %xmm0
movsd %xmm0, -0x8(%rcx,%r13,8)
movapd %xmm0, %xmm1
xorpd %xmm5, %xmm1
addq %r8, %rcx
movq (%rbx,%r13,8), %rdx
addq %r8, %rdx
movl $0x1, %esi
movsd (%rdx,%rsi,8), %xmm2
mulsd %xmm1, %xmm2
addsd (%rcx,%rsi,8), %xmm2
movsd %xmm2, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %r14
jne 0x405db
xorl %ecx, %ecx
movq (%rbx,%rcx,8), %rdx
movsd (%rdx,%rax,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%rdx,%r13,8), %xmm1
movsd %xmm1, (%rdx,%r13,8)
incq %rcx
cmpq %rcx, %r12
jne 0x405f8
incq %rax
cmpq %r12, %rax
jne 0x405a6
incq %r13
movq 0x20(%rsp), %rax
incq %rax
incq %rdi
addq $0x8, %r8
decq %r14
cmpq %rbp, %rax
jne 0x404a2
movq (%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq