// File: /workspace/github_c_makefile_star2_O3/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 0x6888f(%rip), %rsi     # 0xaa02e
movl $0x3, %edx
callq 0x3a0e1
movq %rax, (%rsp)
cmpl $0x3, %r14d
jl 0x41983
movl %ebp, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
addl $-0x2, %ebp
movl $0x1, %r13d
movl $0x2, %edi
xorl %r8d, %r8d
movapd 0x64a06(%rip), %xmm3    # 0xa61e0
movq %r12, %r14
xorl %eax, %eax
movq %rbp, 0x18(%rsp)
movq %rax, 0x20(%rsp)
cmpq %r12, %r13
movq %rdi, 0x28(%rsp)
jae 0x4183e
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 0x41801
jmp 0x41845
movl %r13d, %eax
xorpd %xmm4, %xmm4
movapd %xmm4, 0x30(%rsp)
movq %r8, 0x8(%rsp)
movq (%rsp), %rcx
movl %eax, (%rcx,%r13,4)
movl %eax, %ecx
cmpq %rcx, %r13
je 0x418bb
movslq %eax, %rcx
cmpq %r12, %r13
movq %rcx, 0x10(%rsp)
ja 0x41895
movq %r14, %r15
movq 0x8(%rsp), %rbp
movq (%rbx,%rcx,8), %rdi
addq %rbp, %rdi
movq (%rbx,%r13,8), %rsi
addq %rbp, %rsi
callq 0x3a5b8
movq 0x10(%rsp), %rcx
addq $0x8, %rbp
decq %r15
jne 0x41874
xorl %r15d, %r15d
movq 0x18(%rsp), %rbp
movq (%rbx,%r15,8), %rax
leaq (%rax,%rcx,8), %rdi
leaq (%rax,%r13,8), %rsi
callq 0x3a5b8
movq 0x10(%rsp), %rcx
incq %r15
cmpq %r15, %r12
jne 0x4189d
xorpd %xmm4, %xmm4
movapd 0x30(%rsp), %xmm6
ucomisd %xmm4, %xmm6
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %r8
movapd 0x64905(%rip), %xmm3    # 0xa61e0
movapd 0x648ed(%rip), %xmm5    # 0xa61d0
jne 0x418e7
jnp 0x41965
movq %rdi, %rax
movq (%rbx,%rax,8), %rcx
movsd -0x8(%rcx,%r13,8), %xmm0
ucomisd %xmm4, %xmm0
jne 0x418fd
jnp 0x4195d
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 0x4191f
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 0x4193c
incq %rax
cmpq %r12, %rax
jne 0x418ea
incq %r13
movq 0x20(%rsp), %rax
incq %rax
incq %rdi
addq $0x8, %r8
decq %r14
cmpq %rbp, %rax
jne 0x417e4
movq (%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq