minv(A, X, n, B, IPS) double A[], X[];
int n;
double B[];
int IPS[];
{
  double *pX;
  int i, j, k;
  for (i = 1; i < n; i++)
    B[i] = 0.0;
  B[0] = 1.0;
  pX = X;
  k = simq(A, B, pX, n, 1, IPS);
  if (k)
    return (-1);
  for (i = 1; i < n; i++) {
    B[i - 1] = 0.0;
    B[i] = 1.0;
    pX += n;
    k = simq(A, B, pX, n, -1, IPS);
    if (k)
      return (-1);
  }
  mtransp(n, X, X);
  return (0);
}


x86 assembly (clang, -O0):
<minv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    116c <minv+0x4c>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1142 <minv+0x22>
mov    -0x28(%rbp),%rax
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%r9
mov    $0x1,%r8d
mov    $0x0,%al
call   1040 <simq@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     11bd <minv+0x9d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1274 <minv+0x154>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    125b <minv+0x13b>
mov    -0x28(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe0b(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%r9
mov    $0xffffffff,%r8d
mov    $0x0,%al
call   1040 <simq@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     1248 <minv+0x128>
movl   $0xffffffff,-0x4(%rbp)
jmp    1274 <minv+0x154>
jmp    124d <minv+0x12d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11c4 <minv+0xa4>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <mtransp@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%r14
mov    %rcx,%rbx
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %rdi,%r15
cmp    $0x2,%edx
mov    %rsi,(%rsp)
jl     121e <minv+0xee>
lea    0x8(%rbx),%rdi
lea    -0x1(%r12),%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rbx)
mov    %r15,0x10(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    $0x1,%r8d
mov    %r14,0x18(%rsp)
mov    %r14,%r9
xor    %eax,%eax
call   1050 <simq@plt>
mov    $0xffffffff,%r14d
test   %eax,%eax
jne    1265 <minv+0x135>
mov    %r12d,%r15d
lea    -0x1(%r15),%rax
mov    %rax,0x8(%rsp)
mov    (%rsp),%rax
lea    (%rax,%r15,8),%rbp
shl    $0x3,%r15
xorps  %xmm0,%xmm0
movhps 0xe2f(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xor    %r13d,%r13d
mov    $0xffffffff,%r14d
nop
movaps 0x20(%rsp),%xmm0
movups %xmm0,(%rbx,%r13,8)
mov    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    $0xffffffff,%r8d
mov    0x18(%rsp),%r9
xor    %eax,%eax
call   1050 <simq@plt>
test   %eax,%eax
jne    1265 <minv+0x135>
add    $0x1,%r13
add    %r15,%rbp
cmp    %r13,0x8(%rsp)
jne    11e0 <minv+0xb0>
jmp    1251 <minv+0x121>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rbx)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    $0x1,%r8d
mov    %r14,%r9
xor    %eax,%eax
call   1050 <simq@plt>
mov    $0xffffffff,%r14d
test   %eax,%eax
jne    1265 <minv+0x135>
xor    %r14d,%r14d
mov    %r12d,%edi
mov    (%rsp),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <mtransp@plt>
mov    %r14d,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @minv(double* %0, double* %1, i32 %2, double* %3, i32* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double* %3, double** %10
store i32* %4, i32** %11
store i32 1, i32* %13
br label %16
16: ; preds = %25, %5
%17 = load i32, i32* %13
%18 = load i32, i32* %9
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load double*, double** %10
%22 = load i32, i32* %13
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
store double 0.000000e+00, double* %24
br label %25
25: ; preds = %20
%26 = load i32, i32* %13
%27 = add nsw i32 %26, 1
store i32 %27, i32* %13
br label %16
28: ; preds = %16
%29 = load double*, double** %10
%30 = getelementptr inbounds double, double* %29, i64 0
store double 1.000000e+00, double* %30
%31 = load double*, double** %8
store double* %31, double** %12
%32 = load double*, double** %7
%33 = load double*, double** %10
%34 = load double*, double** %12
%35 = load i32, i32* %9
%36 = load i32*, i32** %11
%37 = call i32 (double*, double*, double*, i32, i32, i32*, ...) bitcast (i32 (...)* @simq to i32 (double*, double*, double*, i32, i32, i32*, ...)*)(double* %32, double* %33, double* %34, i32 %35, i32 1, i32* %36)
store i32 %37, i32* %15
%38 = load i32, i32* %15
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %28
store i32 -1, i32* %6
br label %78
41: ; preds = %28
store i32 1, i32* %13
br label %42
42: ; preds = %70, %41
%43 = load i32, i32* %13
%44 = load i32, i32* %9
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %73
46: ; preds = %42
%47 = load double*, double** %10
%48 = load i32, i32* %13
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %47, i64 %50
store double 0.000000e+00, double* %51
%52 = load double*, double** %10
%53 = load i32, i32* %13
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %52, i64 %54
store double 1.000000e+00, double* %55
%56 = load i32, i32* %9
%57 = load double*, double** %12
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds double, double* %57, i64 %58
store double* %59, double** %12
%60 = load double*, double** %7
%61 = load double*, double** %10
%62 = load double*, double** %12
%63 = load i32, i32* %9
%64 = load i32*, i32** %11
%65 = call i32 (double*, double*, double*, i32, i32, i32*, ...) bitcast (i32 (...)* @simq to i32 (double*, double*, double*, i32, i32, i32*, ...)*)(double* %60, double* %61, double* %62, i32 %63, i32 -1, i32* %64)
store i32 %65, i32* %15
%66 = load i32, i32* %15
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %46
store i32 -1, i32* %6
br label %78
69: ; preds = %46
br label %70
70: ; preds = %69
%71 = load i32, i32* %13
%72 = add nsw i32 %71, 1
store i32 %72, i32* %13
br label %42
73: ; preds = %42
%74 = load i32, i32* %9
%75 = load double*, double** %8
%76 = load double*, double** %8
%77 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @mtransp to i32 (i32, double*, double*, ...)*)(i32 %74, double* %75, double* %76)
store i32 0, i32* %6
br label %78
78: ; preds = %73, %68, %40
%79 = load i32, i32* %6
ret i32 %79
}

LLVM IR (-O2):
define i32 @minv(double* %0, double* %1, i32 %2, double* %3, i32* %4) {
%6 = icmp sgt i32 %2, 1
br i1 %6, label %7, label %15
7: ; preds = %5
%8 = getelementptr double, double* %3, i64 1
%9 = bitcast double* %8 to i8*
%10 = add nsw i32 %2, -1
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
store double 1.000000e+00, double* %3
%13 = tail call i32 (double*, double*, double*, i32, i32, i32*, ...) bitcast (i32 (...)* @simq to i32 (double*, double*, double*, i32, i32, i32*, ...)*)(double* %0, double* %3, double* %1, i32 %2, i32 1, i32* %4)
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %35
15: ; preds = %5
store double 1.000000e+00, double* %3
%16 = tail call i32 (double*, double*, double*, i32, i32, i32*, ...) bitcast (i32 (...)* @simq to i32 (double*, double*, double*, i32, i32, i32*, ...)*)(double* %0, double* %3, double* %1, i32 %2, i32 1, i32* %4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %33, label %35
18: ; preds = %7
%19 = zext i32 %2 to i64
%20 = zext i32 %2 to i64
br label %23
21: ; preds = %23
%22 = icmp eq i64 %32, %20
br i1 %22, label %33, label %23
23: ; preds = %18, %21
%24 = phi i64 [ 1, %18 ], [ %32, %21 ]
%25 = phi double* [ %1, %18 ], [ %29, %21 ]
%26 = add nsw i64 %24, -1
%27 = getelementptr inbounds double, double* %3, i64 %26
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %28
%29 = getelementptr inbounds double, double* %25, i64 %19
%30 = tail call i32 (double*, double*, double*, i32, i32, i32*, ...) bitcast (i32 (...)* @simq to i32 (double*, double*, double*, i32, i32, i32*, ...)*)(double* %0, double* %3, double* %29, i32 %2, i32 -1, i32* %4)
%31 = icmp eq i32 %30, 0
%32 = add nuw nsw i64 %24, 1
br i1 %31, label %21, label %35
33: ; preds = %21, %15
%34 = tail call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @mtransp to i32 (i32, double*, double*, ...)*)(i32 %2, double* %1, double* %1)
br label %35
35: ; preds = %23, %15, %7, %33
%36 = phi i32 [ 0, %33 ], [ -1, %7 ], [ -1, %15 ], [ -1, %23 ]
ret i32 %36
}