#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ elgs(double **, int *);
int migs(double a[4][4], double x[4][4], int indx[4]) {
  int i, j, k;
  double b[4][4];
  for (i = 0; i < 4; ++i) {
    for (j = 0; j < 4; ++j) {
      b[i][j] = 0;
    }
  }
  for (i = 0; i < 4; ++i) {
    b[i][i] = 1;
  }
  if (elgs(a, indx) > 0)
    return (1);
  for (i = 0; i < 4 - 1; ++i) {
    for (j = i + 1; j < 4; ++j) {
      for (k = 0; k < 4; ++k) {
        b[indx[j]][k] = b[indx[j]][k] - a[indx[j]][i] * b[indx[i]][k];
      }
    }
  }
  for (i = 0; i < 4; ++i) {
    x[4 - 1][i] = b[indx[4 - 1]][i] / a[indx[4 - 1]][4 - 1];
    for (j = 4 - 2; j >= 0; j = j - 1) {
      x[j][i] = b[indx[j]][i];
      for (k = j + 1; k < 4; ++k) {
        x[j][i] = x[j][i] - a[indx[j]][k] * x[k][i];
      }
      x[j][i] = x[j][i] / a[indx[j]][j];
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<migs>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1188 <migs+0x78>
movl   $0x0,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jge    1175 <migs+0x65>
movslq -0x24(%rbp),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    113f <migs+0x2f>
jmp    117a <migs+0x6a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <migs+0x1e>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    11ca <migs+0xba>
movslq -0x24(%rbp),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  0xe49(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118f <migs+0x7f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <elgs@plt>
cmp    $0x0,%rax
jle    11ed <migs+0xdd>
movl   $0x1,-0x4(%rbp)
jmp    14c0 <migs+0x3b0>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    12fe <migs+0x1ee>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jge    12eb <migs+0x1db>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    12d8 <migs+0x1c8>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq (%rax,%rcx,4),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movslq (%rax,%rcx,4),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq (%rax,%rcx,4),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1218 <migs+0x108>
jmp    12dd <migs+0x1cd>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1207 <migs+0xf7>
jmp    12f0 <migs+0x1e0>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f4 <migs+0xe4>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    14b9 <migs+0x3a9>
mov    -0x20(%rbp),%rax
movslq 0xc(%rax),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq 0xc(%rcx),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
divsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,0x60(%rax,%rcx,8)
movl   $0x2,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     14a6 <migs+0x396>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq (%rax,%rcx,4),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    1448 <migs+0x338>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13a9 <migs+0x299>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    135b <migs+0x24b>
jmp    14ab <migs+0x39b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1305 <migs+0x1f5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<migs>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
xorpd  %xmm0,%xmm0
movapd %xmm0,(%rsp)
movapd %xmm0,0x20(%rsp)
movapd %xmm0,0x50(%rsp)
movapd %xmm0,0x70(%rsp)
movapd %xmm0,0x60(%rsp)
movapd %xmm0,0x40(%rsp)
movapd %xmm0,0x30(%rsp)
movapd %xmm0,0x10(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsp)
mov    %rax,0x28(%rsp)
mov    %rax,0x50(%rsp)
mov    %rax,0x78(%rsp)
mov    %rdx,%rsi
call   1030 <elgs@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jg     1432 <migs+0x322>
movslq (%r15),%rax
movslq 0x4(%r15),%rcx
shl    $0x5,%rcx
shl    $0x5,%rax
movsd  (%r14,%rcx,1),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp,%rax,1),%xmm1
mulpd  %xmm0,%xmm1
movapd (%rsp,%rcx,1),%xmm2
subpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rcx,1),%xmm1
movapd %xmm2,(%rsp,%rcx,1)
mulpd  0x10(%rsp,%rax,1),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp,%rcx,1)
movslq 0x8(%r15),%rcx
shl    $0x5,%rcx
movsd  (%r14,%rcx,1),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp,%rax,1),%xmm1
mulpd  %xmm0,%xmm1
movapd (%rsp,%rcx,1),%xmm2
subpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rcx,1),%xmm1
movapd %xmm2,(%rsp,%rcx,1)
mulpd  0x10(%rsp,%rax,1),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp,%rcx,1)
movslq 0xc(%r15),%rcx
shl    $0x5,%rcx
movsd  (%r14,%rcx,1),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp,%rax,1),%xmm1
mulpd  %xmm0,%xmm1
movapd (%rsp,%rcx,1),%xmm2
subpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rcx,1),%xmm1
movapd %xmm2,(%rsp,%rcx,1)
mulpd  0x10(%rsp,%rax,1),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp,%rcx,1)
movslq 0x4(%r15),%rax
movslq 0x8(%r15),%rcx
shl    $0x5,%rcx
shl    $0x5,%rax
movsd  0x8(%r14,%rcx,1),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp,%rax,1),%xmm1
mulpd  %xmm0,%xmm1
movapd (%rsp,%rcx,1),%xmm2
subpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rcx,1),%xmm1
movapd %xmm2,(%rsp,%rcx,1)
mulpd  0x10(%rsp,%rax,1),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp,%rcx,1)
movslq 0xc(%r15),%rcx
shl    $0x5,%rcx
movsd  0x8(%r14,%rcx,1),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp,%rax,1),%xmm1
mulpd  %xmm0,%xmm1
movapd (%rsp,%rcx,1),%xmm2
subpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rcx,1),%xmm1
movapd %xmm2,(%rsp,%rcx,1)
mulpd  0x10(%rsp,%rax,1),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp,%rcx,1)
movslq 0x8(%r15),%rax
movslq 0xc(%r15),%rcx
shl    $0x5,%rcx
lea    (%rsp,%rcx,1),%r8
shl    $0x5,%rax
movsd  0x10(%r14,%rcx,1),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp,%rax,1),%xmm1
mulpd  %xmm0,%xmm1
movapd (%rsp,%rcx,1),%xmm2
subpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rcx,1),%xmm1
movapd %xmm2,(%rsp,%rcx,1)
mulpd  0x10(%rsp,%rax,1),%xmm0
lea    (%rsp,%rax,1),%r9
subpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp,%rcx,1)
lea    (%r14,%rcx,1),%r10
add    $0x18,%r10
lea    (%r14,%rax,1),%rdi
add    $0x18,%rdi
movslq 0x4(%r15),%rax
shl    $0x5,%rax
lea    (%r14,%rax,1),%rcx
add    $0x10,%rcx
movslq (%r15),%rsi
shl    $0x5,%rsi
lea    (%r14,%rsi,1),%rdx
add    $0x8,%rdx
add    %rsi,%r14
lea    (%rsp,%rax,1),%r11
lea    (%rsp,%rsi,1),%r15
xor    %eax,%eax
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movsd  (%r8,%rsi,1),%xmm0
divsd  (%r10),%xmm0
movsd  %xmm0,0x60(%rbx,%rsi,1)
movsd  (%r9,%rsi,1),%xmm1
movsd  %xmm1,0x40(%rbx,%rsi,1)
movsd  (%rdi),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,0x40(%rbx,%rsi,1)
divsd  -0x8(%rdi),%xmm1
movsd  %xmm1,0x40(%rbx,%rsi,1)
movsd  (%r11,%rsi,1),%xmm2
movsd  %xmm2,0x20(%rbx,%rsi,1)
movsd  (%rcx),%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm2
movsd  %xmm2,0x20(%rbx,%rsi,1)
movsd  0x8(%rcx),%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm2
movsd  %xmm2,0x20(%rbx,%rsi,1)
divsd  -0x8(%rcx),%xmm2
movsd  %xmm2,0x20(%rbx,%rsi,1)
movsd  (%r15,%rsi,1),%xmm3
movsd  %xmm3,(%rbx,%rsi,1)
mulsd  (%rdx),%xmm2
subsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx,%rsi,1)
mulsd  0x8(%rdx),%xmm1
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rbx,%rsi,1)
mulsd  0x10(%rdx),%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,(%rbx,%rsi,1)
divsd  (%r14),%xmm3
movsd  %xmm3,(%rbx,%rsi,1)
add    $0x8,%rsi
cmp    $0x20,%rsi
jne    1370 <migs+0x260>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @migs([4 x double]* %0, [4 x double]* %1, i32* %2) {
%4 = alloca i32
%5 = alloca [4 x double]*
%6 = alloca [4 x double]*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [4 x [4 x double]]
store [4 x double]* %0, [4 x double]** %5
store [4 x double]* %1, [4 x double]** %6
store i32* %2, i32** %7
store i32 0, i32* %8
br label %12
12: ; preds = %30, %3
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 4
br i1 %14, label %15, label %33
15: ; preds = %12
store i32 0, i32* %9
br label %16
16: ; preds = %26, %15
%17 = load i32, i32* %9
%18 = icmp slt i32 %17, 4
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %21
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [4 x double], [4 x double]* %22, i64 0, i64 %24
store double 0.000000e+00, double* %25
br label %26
26: ; preds = %19
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %16
29: ; preds = %16
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %12
33: ; preds = %12
store i32 0, i32* %8
br label %34
34: ; preds = %44, %33
%35 = load i32, i32* %8
%36 = icmp slt i32 %35, 4
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %39
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x double], [4 x double]* %40, i64 0, i64 %42
store double 1.000000e+00, double* %43
br label %44
44: ; preds = %37
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
store i32 %46, i32* %8
br label %34
47: ; preds = %34
%48 = load [4 x double]*, [4 x double]** %5
%49 = bitcast [4 x double]* %48 to double**
%50 = load i32*, i32** %7
%51 = call i64 @elgs(double** %49, i32* %50)
%52 = icmp sgt i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %47
store i32 1, i32* %4
br label %259
54: ; preds = %47
store i32 0, i32* %8
br label %55
55: ; preds = %123, %54
%56 = load i32, i32* %8
%57 = icmp slt i32 %56, 3
br i1 %57, label %58, label %126
58: ; preds = %55
%59 = load i32, i32* %8
%60 = add nsw i32 %59, 1
store i32 %60, i32* %9
br label %61
61: ; preds = %119, %58
%62 = load i32, i32* %9
%63 = icmp slt i32 %62, 4
br i1 %63, label %64, label %122
64: ; preds = %61
store i32 0, i32* %10
br label %65
65: ; preds = %115, %64
%66 = load i32, i32* %10
%67 = icmp slt i32 %66, 4
br i1 %67, label %68, label %118
68: ; preds = %65
%69 = load i32*, i32** %7
%70 = load i32, i32* %9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %69, i64 %71
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %74
%76 = load i32, i32* %10
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [4 x double], [4 x double]* %75, i64 0, i64 %77
%79 = load double, double* %78
%80 = load [4 x double]*, [4 x double]** %5
%81 = load i32*, i32** %7
%82 = load i32, i32* %9
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i32, i32* %81, i64 %83
%85 = load i32, i32* %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [4 x double], [4 x double]* %80, i64 %86
%88 = load i32, i32* %8
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [4 x double], [4 x double]* %87, i64 0, i64 %89
%91 = load double, double* %90
%92 = load i32*, i32** %7
%93 = load i32, i32* %8
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %92, i64 %94
%96 = load i32, i32* %95
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %97
%99 = load i32, i32* %10
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [4 x double], [4 x double]* %98, i64 0, i64 %100
%102 = load double, double* %101
%103 = fneg double %91
%104 = call double @llvm.fmuladd.f64(double %103, double %102, double %79)
%105 = load i32*, i32** %7
%106 = load i32, i32* %9
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %105, i64 %107
%109 = load i32, i32* %108
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %110
%112 = load i32, i32* %10
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [4 x double], [4 x double]* %111, i64 0, i64 %113
store double %104, double* %114
br label %115
115: ; preds = %68
%116 = load i32, i32* %10
%117 = add nsw i32 %116, 1
store i32 %117, i32* %10
br label %65
118: ; preds = %65
br label %119
119: ; preds = %118
%120 = load i32, i32* %9
%121 = add nsw i32 %120, 1
store i32 %121, i32* %9
br label %61
122: ; preds = %61
br label %123
123: ; preds = %122
%124 = load i32, i32* %8
%125 = add nsw i32 %124, 1
store i32 %125, i32* %8
br label %55
126: ; preds = %55
store i32 0, i32* %8
br label %127
127: ; preds = %255, %126
%128 = load i32, i32* %8
%129 = icmp slt i32 %128, 4
br i1 %129, label %130, label %258
130: ; preds = %127
%131 = load i32*, i32** %7
%132 = getelementptr inbounds i32, i32* %131, i64 3
%133 = load i32, i32* %132
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %134
%136 = load i32, i32* %8
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [4 x double], [4 x double]* %135, i64 0, i64 %137
%139 = load double, double* %138
%140 = load [4 x double]*, [4 x double]** %5
%141 = load i32*, i32** %7
%142 = getelementptr inbounds i32, i32* %141, i64 3
%143 = load i32, i32* %142
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [4 x double], [4 x double]* %140, i64 %144
%146 = getelementptr inbounds [4 x double], [4 x double]* %145, i64 0, i64 3
%147 = load double, double* %146
%148 = fdiv double %139, %147
%149 = load [4 x double]*, [4 x double]** %6
%150 = getelementptr inbounds [4 x double], [4 x double]* %149, i64 3
%151 = load i32, i32* %8
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [4 x double], [4 x double]* %150, i64 0, i64 %152
store double %148, double* %153
store i32 2, i32* %9
br label %154
154: ; preds = %251, %130
%155 = load i32, i32* %9
%156 = icmp sge i32 %155, 0
br i1 %156, label %157, label %254
157: ; preds = %154
%158 = load i32*, i32** %7
%159 = load i32, i32* %9
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i32, i32* %158, i64 %160
%162 = load i32, i32* %161
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %11, i64 0, i64 %163
%165 = load i32, i32* %8
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [4 x double], [4 x double]* %164, i64 0, i64 %166
%168 = load double, double* %167
%169 = load [4 x double]*, [4 x double]** %6
%170 = load i32, i32* %9
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [4 x double], [4 x double]* %169, i64 %171
%173 = load i32, i32* %8
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [4 x double], [4 x double]* %172, i64 0, i64 %174
store double %168, double* %175
%176 = load i32, i32* %9
%177 = add nsw i32 %176, 1
store i32 %177, i32* %10
br label %178
178: ; preds = %219, %157
%179 = load i32, i32* %10
%180 = icmp slt i32 %179, 4
br i1 %180, label %181, label %222
181: ; preds = %178
%182 = load [4 x double]*, [4 x double]** %6
%183 = load i32, i32* %9
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [4 x double], [4 x double]* %182, i64 %184
%186 = load i32, i32* %8
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [4 x double], [4 x double]* %185, i64 0, i64 %187
%189 = load double, double* %188
%190 = load [4 x double]*, [4 x double]** %5
%191 = load i32*, i32** %7
%192 = load i32, i32* %9
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i32, i32* %191, i64 %193
%195 = load i32, i32* %194
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [4 x double], [4 x double]* %190, i64 %196
%198 = load i32, i32* %10
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds [4 x double], [4 x double]* %197, i64 0, i64 %199
%201 = load double, double* %200
%202 = load [4 x double]*, [4 x double]** %6
%203 = load i32, i32* %10
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [4 x double], [4 x double]* %202, i64 %204
%206 = load i32, i32* %8
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [4 x double], [4 x double]* %205, i64 0, i64 %207
%209 = load double, double* %208
%210 = fneg double %201
%211 = call double @llvm.fmuladd.f64(double %210, double %209, double %189)
%212 = load [4 x double]*, [4 x double]** %6
%213 = load i32, i32* %9
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [4 x double], [4 x double]* %212, i64 %214
%216 = load i32, i32* %8
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [4 x double], [4 x double]* %215, i64 0, i64 %217
store double %211, double* %218
br label %219
219: ; preds = %181
%220 = load i32, i32* %10
%221 = add nsw i32 %220, 1
store i32 %221, i32* %10
br label %178
222: ; preds = %178
%223 = load [4 x double]*, [4 x double]** %6
%224 = load i32, i32* %9
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds [4 x double], [4 x double]* %223, i64 %225
%227 = load i32, i32* %8
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [4 x double], [4 x double]* %226, i64 0, i64 %228
%230 = load double, double* %229
%231 = load [4 x double]*, [4 x double]** %5
%232 = load i32*, i32** %7
%233 = load i32, i32* %9
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i32, i32* %232, i64 %234
%236 = load i32, i32* %235
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds [4 x double], [4 x double]* %231, i64 %237
%239 = load i32, i32* %9
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [4 x double], [4 x double]* %238, i64 0, i64 %240
%242 = load double, double* %241
%243 = fdiv double %230, %242
%244 = load [4 x double]*, [4 x double]** %6
%245 = load i32, i32* %9
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds [4 x double], [4 x double]* %244, i64 %246
%248 = load i32, i32* %8
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds [4 x double], [4 x double]* %247, i64 0, i64 %249
store double %243, double* %250
br label %251
251: ; preds = %222
%252 = load i32, i32* %9
%253 = sub nsw i32 %252, 1
store i32 %253, i32* %9
br label %154
254: ; preds = %154
br label %255
255: ; preds = %254
%256 = load i32, i32* %8
%257 = add nsw i32 %256, 1
store i32 %257, i32* %8
br label %127
258: ; preds = %127
store i32 0, i32* %4
br label %259
259: ; preds = %258, %53
%260 = load i32, i32* %4
ret i32 %260
}

LLVM IR (-O2):
define i32 @migs([4 x double]* %0, [4 x double]* nocapture %1, i32* %2) {
%4 = alloca [4 x [4 x double]]
%5 = bitcast [4 x [4 x double]]* %4 to i8*
%6 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 0, i64 0
store double 1.000000e+00, double* %6
%7 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 1, i64 1
store double 1.000000e+00, double* %7
%8 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 2, i64 2
store double 1.000000e+00, double* %8
%9 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 3, i64 3
store double 1.000000e+00, double* %9
%10 = bitcast [4 x double]* %0 to double**
%11 = tail call i64 @elgs(double** %10, i32* %2)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %219, label %13
13: ; preds = %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %2, i64 1
%17 = load i32, i32* %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %18, i64 0
%20 = load double, double* %19
%21 = fneg double %20
%22 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %18, i64 0
%23 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %15, i64 0
%24 = bitcast double* %22 to <2 x double>*
%25 = load <2 x double>, <2 x double>* %24
%26 = bitcast double* %23 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = insertelement <2 x double> poison, double %21, i64 0
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
%30 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %27, <2 x double> %25)
%31 = bitcast double* %22 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %18, i64 2
%33 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %15, i64 2
%34 = bitcast double* %32 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = bitcast double* %33 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %37, <2 x double> %35)
%39 = bitcast double* %32 to <2 x double>*
store <2 x double> %38, <2 x double>* %39
%40 = getelementptr inbounds i32, i32* %2, i64 2
%41 = load i32, i32* %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %42, i64 0
%44 = load double, double* %43
%45 = fneg double %44
%46 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %42, i64 0
%47 = bitcast double* %46 to <2 x double>*
%48 = load <2 x double>, <2 x double>* %47
%49 = bitcast double* %23 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = insertelement <2 x double> poison, double %45, i64 0
%52 = shufflevector <2 x double> %51, <2 x double> poison, <2 x i32> zeroinitializer
%53 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> %50, <2 x double> %48)
%54 = bitcast double* %46 to <2 x double>*
store <2 x double> %53, <2 x double>* %54
%55 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %42, i64 2
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = bitcast double* %33 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> %59, <2 x double> %57)
%61 = bitcast double* %55 to <2 x double>*
store <2 x double> %60, <2 x double>* %61
%62 = getelementptr inbounds i32, i32* %2, i64 3
%63 = load i32, i32* %62
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %64, i64 0
%66 = load double, double* %65
%67 = fneg double %66
%68 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %64, i64 0
%69 = bitcast double* %68 to <2 x double>*
%70 = load <2 x double>, <2 x double>* %69
%71 = bitcast double* %23 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = insertelement <2 x double> poison, double %67, i64 0
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> zeroinitializer
%75 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %72, <2 x double> %70)
%76 = bitcast double* %68 to <2 x double>*
store <2 x double> %75, <2 x double>* %76
%77 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %64, i64 2
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = bitcast double* %33 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %81, <2 x double> %79)
%83 = bitcast double* %77 to <2 x double>*
store <2 x double> %82, <2 x double>* %83
%84 = getelementptr inbounds i32, i32* %2, i64 1
%85 = load i32, i32* %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %2, i64 2
%88 = load i32, i32* %87
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %89, i64 1
%91 = load double, double* %90
%92 = fneg double %91
%93 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %89, i64 0
%94 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %86, i64 0
%95 = bitcast double* %93 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = bitcast double* %94 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = insertelement <2 x double> poison, double %92, i64 0
%100 = shufflevector <2 x double> %99, <2 x double> poison, <2 x i32> zeroinitializer
%101 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %98, <2 x double> %96)
%102 = bitcast double* %93 to <2 x double>*
store <2 x double> %101, <2 x double>* %102
%103 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %89, i64 2
%104 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %86, i64 2
%105 = bitcast double* %103 to <2 x double>*
%106 = load <2 x double>, <2 x double>* %105
%107 = bitcast double* %104 to <2 x double>*
%108 = load <2 x double>, <2 x double>* %107
%109 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %108, <2 x double> %106)
%110 = bitcast double* %103 to <2 x double>*
store <2 x double> %109, <2 x double>* %110
%111 = getelementptr inbounds i32, i32* %2, i64 3
%112 = load i32, i32* %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %113, i64 1
%115 = load double, double* %114
%116 = fneg double %115
%117 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %113, i64 0
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = bitcast double* %94 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = insertelement <2 x double> poison, double %116, i64 0
%123 = shufflevector <2 x double> %122, <2 x double> poison, <2 x i32> zeroinitializer
%124 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %123, <2 x double> %121, <2 x double> %119)
%125 = bitcast double* %117 to <2 x double>*
store <2 x double> %124, <2 x double>* %125
%126 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %113, i64 2
%127 = bitcast double* %126 to <2 x double>*
%128 = load <2 x double>, <2 x double>* %127
%129 = bitcast double* %104 to <2 x double>*
%130 = load <2 x double>, <2 x double>* %129
%131 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %123, <2 x double> %130, <2 x double> %128)
%132 = bitcast double* %126 to <2 x double>*
store <2 x double> %131, <2 x double>* %132
%133 = getelementptr inbounds i32, i32* %2, i64 2
%134 = load i32, i32* %133
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i32, i32* %2, i64 3
%137 = load i32, i32* %136
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %138, i64 2
%140 = load double, double* %139
%141 = fneg double %140
%142 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %138, i64 0
%143 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %135, i64 0
%144 = bitcast double* %142 to <2 x double>*
%145 = load <2 x double>, <2 x double>* %144
%146 = bitcast double* %143 to <2 x double>*
%147 = load <2 x double>, <2 x double>* %146
%148 = insertelement <2 x double> poison, double %141, i64 0
%149 = shufflevector <2 x double> %148, <2 x double> poison, <2 x i32> zeroinitializer
%150 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %149, <2 x double> %147, <2 x double> %145)
%151 = bitcast double* %142 to <2 x double>*
store <2 x double> %150, <2 x double>* %151
%152 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %138, i64 2
%153 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %135, i64 2
%154 = bitcast double* %152 to <2 x double>*
%155 = load <2 x double>, <2 x double>* %154
%156 = bitcast double* %153 to <2 x double>*
%157 = load <2 x double>, <2 x double>* %156
%158 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %149, <2 x double> %157, <2 x double> %155)
%159 = bitcast double* %152 to <2 x double>*
store <2 x double> %158, <2 x double>* %159
%160 = sext i32 %137 to i64
%161 = sext i32 %134 to i64
%162 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %160, i64 3
%163 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %161, i64 3
%164 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %161, i64 2
%165 = getelementptr inbounds i32, i32* %2, i64 1
%166 = load i32, i32* %165
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %167, i64 2
%169 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %167, i64 3
%170 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %167, i64 1
%171 = load i32, i32* %2
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %172, i64 1
%174 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %172, i64 2
%175 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %172, i64 3
%176 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %172, i64 0
br label %177
177: ; preds = %13, %177
%178 = phi i64 [ 0, %13 ], [ %217, %177 ]
%179 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %160, i64 %178
%180 = load double, double* %179
%181 = load double, double* %162
%182 = fdiv double %180, %181
%183 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 3, i64 %178
store double %182, double* %183
%184 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %161, i64 %178
%185 = load double, double* %184
%186 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 2, i64 %178
store double %185, double* %186
%187 = load double, double* %163
%188 = fneg double %187
%189 = tail call double @llvm.fmuladd.f64(double %188, double %182, double %185)
store double %189, double* %186
%190 = load double, double* %164
%191 = fdiv double %189, %190
store double %191, double* %186
%192 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %167, i64 %178
%193 = load double, double* %192
%194 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 1, i64 %178
store double %193, double* %194
%195 = load double, double* %168
%196 = fneg double %195
%197 = tail call double @llvm.fmuladd.f64(double %196, double %191, double %193)
store double %197, double* %194
%198 = load double, double* %169
%199 = fneg double %198
%200 = tail call double @llvm.fmuladd.f64(double %199, double %182, double %197)
store double %200, double* %194
%201 = load double, double* %170
%202 = fdiv double %200, %201
store double %202, double* %194
%203 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 %172, i64 %178
%204 = load double, double* %203
%205 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 %178
store double %204, double* %205
%206 = load double, double* %173
%207 = fneg double %206
%208 = tail call double @llvm.fmuladd.f64(double %207, double %202, double %204)
store double %208, double* %205
%209 = load double, double* %174
%210 = fneg double %209
%211 = tail call double @llvm.fmuladd.f64(double %210, double %191, double %208)
store double %211, double* %205
%212 = load double, double* %175
%213 = fneg double %212
%214 = tail call double @llvm.fmuladd.f64(double %213, double %182, double %211)
store double %214, double* %205
%215 = load double, double* %176
%216 = fdiv double %214, %215
store double %216, double* %205
%217 = add nuw nsw i64 %178, 1
%218 = icmp eq i64 %217, 4
br i1 %218, label %219, label %177
219: ; preds = %177, %3
%220 = phi i32 [ 1, %3 ], [ 0, %177 ]
ret i32 %220
}