void egauss(int n, double *a, double *b, double *x) {
  int i, j, k;
  double pivot, tmp;
  for (k = 0; k < n; k++) {
    pivot = *(a + (k + 1) * n);
    for (j = k + 1; j < n; j++)
      *(a + k * n + j) /= pivot;
    *(b + k) /= pivot;
    for (i = k + 1; i < n; i++) {
      tmp = *(a + i * n + k);
      for (j = k + 1; j < n; j++)
        *(a + i * n + j) -= tmp * *(a + k * i + j);
      *(b + i) -= tmp * *(b + k);
    }
  }
  for (i = n - 1; i > -1; i--) {
    *(x + i) = *(b + i);
    for (j = i + 1; j < n; j++)
      *(x + i) -= *(a + j) * *(x + j);
  }
}


x86 assembly (clang, -O0):
<egauss>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12cf <egauss+0x1cf>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1190 <egauss+0x90>
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114a <egauss+0x4a>
movsd  -0x38(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12bc <egauss+0x1bc>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    126b <egauss+0x16b>
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11ec <egauss+0xec>
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b4 <egauss+0xb4>
jmp    12c1 <egauss+0x1c1>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    111a <egauss+0x1a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jle    137d <egauss+0x27d>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    136a <egauss+0x26a>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1305 <egauss+0x205>
jmp    136f <egauss+0x26f>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    12d8 <egauss+0x1d8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<egauss>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
test   %edi,%edi
jle    16e7 <egauss+0x5e7>
mov    %rdx,%r8
mov    %rsi,%r11
mov    %rcx,-0x28(%rsp)
mov    %edi,-0x64(%rsp)
mov    %edi,%eax
lea    0x1(%rax),%rcx
mov    %rcx,0x58(%rsp)
lea    0x0(,%rax,8),%rcx
mov    %rcx,-0x38(%rsp)
lea    0x8(,%rax,8),%rcx
mov    %rcx,-0x48(%rsp)
lea    (%rsi,%rax,8),%rcx
mov    %rcx,0x50(%rsp)
mov    %rax,%rcx
neg    %rcx
mov    %rcx,0x68(%rsp)
lea    0x18(%rsi),%rdx
lea    -0x3(%rax),%r10
lea    (%rsi,%rax,8),%rcx
add    $0x38,%rcx
mov    %rcx,-0x50(%rsp)
lea    -0x5(%rax),%rcx
mov    %rcx,-0x58(%rsp)
lea    0x28(%rsi),%rcx
mov    %rcx,-0x40(%rsp)
lea    0x8(%rsi,%rax,8),%rcx
mov    %rcx,-0x60(%rsp)
lea    0x8(%rsi),%rcx
mov    %rcx,0x48(%rsp)
mov    $0x1,%ecx
mov    %rcx,-0x80(%rsp)
xor    %ecx,%ecx
mov    %rcx,-0x70(%rsp)
movapd 0xe4f(%rip),%xmm0
xor    %ecx,%ecx
mov    %r8,0x10(%rsp)
mov    %rsi,0x8(%rsp)
jmp    122c <egauss+0x12c>
nop
movsd  (%r8,%r9,8),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%r8,%r9,8)
mov    %r9,%rsi
lea    (%rsi,%rsi,1),%rcx
add    $0x2,%rcx
addq   $0x1,-0x80(%rsp)
add    %rcx,-0x70(%rsp)
mov    -0x48(%rsp),%rdi
mov    (%rsp),%rdx
add    %rdi,%rdx
mov    -0x8(%rsp),%r10
add    $0xffffffffffffffff,%r10
mov    -0x38(%rsp),%rcx
mov    -0x10(%rsp),%rsi
add    %rcx,%rsi
add    %rdi,-0x50(%rsp)
addq   $0xffffffffffffffff,-0x58(%rsp)
addq   $0x8,-0x40(%rsp)
add    %rcx,-0x60(%rsp)
mov    -0x18(%rsp),%rcx
cmp    %rax,%rcx
je     162d <egauss+0x52d>
mov    %rcx,%r9
lea    0x1(%rcx),%r14
mov    %r14,%rcx
imul   %rax,%rcx
movsd  (%r11,%rcx,8),%xmm1
cmp    %rax,%r14
mov    %rdx,(%rsp)
mov    %r10,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    %r14,-0x18(%rsp)
jae    11c0 <egauss+0xc0>
mov    %r9,%r15
not    %r9
lea    (%r9,%rax,1),%rcx
mov    -0x80(%rsp),%rbp
mov    %rcx,-0x78(%rsp)
cmp    $0x2,%rcx
jb     1310 <egauss+0x210>
lea    (%r9,%rax,1),%rdi
add    $0xfffffffffffffffe,%rdi
mov    %rdi,%rcx
shr    %rcx
add    $0x1,%rcx
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
cmp    $0x2,%rdi
jae    129e <egauss+0x19e>
xor    %ebx,%ebx
jmp    12d8 <egauss+0x1d8>
mov    %r10,%rdi
shr    %rdi
add    $0x1,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %ebx,%ebx
xchg   %ax,%ax
movupd -0x10(%rdx,%rbx,8),%xmm3
movupd (%rdx,%rbx,8),%xmm4
divpd  %xmm2,%xmm3
movupd %xmm3,-0x10(%rdx,%rbx,8)
divpd  %xmm2,%xmm4
movupd %xmm4,(%rdx,%rbx,8)
add    $0x4,%rbx
add    $0xfffffffffffffffe,%rdi
jne    12b0 <egauss+0x1b0>
mov    -0x78(%rsp),%rbp
and    $0xfffffffffffffffe,%rbp
test   $0x1,%cl
je     1304 <egauss+0x204>
mov    %r15,%rcx
imul   %rax,%rcx
lea    (%r11,%rcx,8),%rcx
add    -0x80(%rsp),%rbx
movupd (%rcx,%rbx,8),%xmm3
divpd  %xmm2,%xmm3
movupd %xmm3,(%rcx,%rbx,8)
cmp    %rbp,-0x78(%rsp)
je     1327 <egauss+0x227>
add    -0x80(%rsp),%rbp
movsd  (%rsi,%rbp,8),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsi,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rax
jne    1310 <egauss+0x210>
mov    %r15,%rsi
movsd  (%r8,%r15,8),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%r8,%r15,8)
cmp    %rax,%r14
jae    11d3 <egauss+0xd3>
mov    -0x58(%rsp),%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
lea    (%r9,%rax,1),%rdi
add    $0xfffffffffffffffc,%rdi
mov    %rdi,0x30(%rsp)
shr    $0x2,%rdi
lea    0x2(%rsi),%rbp
and    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x20(%rsp)
add    $0x1,%rdi
mov    %rdi,0x28(%rsp)
mov    -0x48(%rsp),%rcx
imul   %rsi,%rcx
mov    %rcx,0x60(%rsp)
imul   %rax,%rbp
mov    %rbp,0x40(%rsp)
mov    -0x80(%rsp),%r15
lea    (%r11,%r15,8),%rcx
mov    %rcx,0x38(%rsp)
mov    -0x78(%rsp),%rcx
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x20(%rsp)
add    %r15,%rcx
mov    %rcx,0x18(%rsp)
mov    -0x60(%rsp),%r13
mov    -0x70(%rsp),%rcx
mov    %ecx,%r12d
mov    -0x50(%rsp),%r14
xor    %r10d,%r10d
jmp    1401 <egauss+0x301>
nopl   0x0(%rax)
mulsd  (%r8,%rsi,8),%xmm1
addsd  (%r8,%r15,8),%xmm1
movsd  %xmm1,(%r8,%r15,8)
add    $0x1,%r15
add    $0x1,%r10
mov    -0x38(%rsp),%rcx
add    %rcx,%r14
add    %esi,%r12d
add    %rcx,%r13
cmp    %rax,%r15
je     11d3 <egauss+0xd3>
mov    %r15,%rcx
imul   %rax,%rcx
mov    %r15d,%edi
imul   %esi,%edi
mov    %r12d,%ebp
mov    %rbp,-0x30(%rsp)
lea    (%r11,%rcx,8),%r9
lea    (%r11,%rdi,8),%rdx
movsd  (%r9,%rsi,8),%xmm1
xorpd  %xmm0,%xmm1
mov    -0x80(%rsp),%rbp
cmpq   $0x4,-0x78(%rsp)
jb     15a0 <egauss+0x4a0>
mov    %r10,%rbp
imul   %rax,%rbp
mov    %esi,%ebx
imul   %r10d,%ebx
add    -0x70(%rsp),%ebx
mov    0x50(%rsp),%rcx
lea    (%rcx,%rbx,8),%rdi
mov    0x58(%rsp),%rcx
add    %rbp,%rcx
lea    (%r11,%rcx,8),%rcx
add    0x60(%rsp),%rcx
cmp    %rdi,%rcx
jae    1489 <egauss+0x389>
mov    0x38(%rsp),%rcx
lea    (%rcx,%rbx,8),%rcx
add    0x40(%rsp),%rbp
lea    (%r11,%rbp,8),%rdi
mov    -0x80(%rsp),%rbp
cmp    %rdi,%rcx
jb     15a0 <egauss+0x4a0>
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
cmpq   $0x4,0x30(%rsp)
jae    14a1 <egauss+0x3a1>
xor    %r8d,%r8d
jmp    153b <egauss+0x43b>
mov    -0x40(%rsp),%rcx
mov    -0x30(%rsp),%rdi
lea    (%rcx,%rdi,8),%rbx
mov    -0x20(%rsp),%r11
xor    %r8d,%r8d
nopw   0x0(%rax,%rax,1)
movupd -0x20(%rbx,%r8,8),%xmm3
movupd -0x10(%rbx,%r8,8),%xmm4
mulpd  %xmm2,%xmm3
movupd -0x30(%r14,%r8,8),%xmm5
addpd  %xmm3,%xmm5
movupd -0x20(%r14,%r8,8),%xmm3
movupd -0x10(%r14,%r8,8),%xmm6
movupd (%r14,%r8,8),%xmm7
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
movupd %xmm5,-0x30(%r14,%r8,8)
movupd %xmm4,-0x20(%r14,%r8,8)
movupd (%rbx,%r8,8),%xmm3
movupd 0x10(%rbx,%r8,8),%xmm4
mulpd  %xmm2,%xmm3
addpd  %xmm6,%xmm3
mulpd  %xmm2,%xmm4
addpd  %xmm7,%xmm4
movupd %xmm3,-0x10(%r14,%r8,8)
movupd %xmm4,(%r14,%r8,8)
add    $0x8,%r8
add    $0xfffffffffffffffe,%r11
jne    14c0 <egauss+0x3c0>
testb  $0x1,0x28(%rsp)
mov    0x8(%rsp),%r11
je     1586 <egauss+0x486>
add    -0x80(%rsp),%r8
mov    %rdx,%rcx
movupd (%rdx,%r8,8),%xmm3
movupd 0x10(%rdx,%r8,8),%xmm4
movupd (%r9,%r8,8),%xmm5
movupd 0x10(%r9,%r8,8),%xmm6
mulpd  %xmm2,%xmm3
addpd  %xmm5,%xmm3
mulpd  %xmm2,%xmm4
addpd  %xmm6,%xmm4
movupd %xmm3,(%r9,%r8,8)
movupd %xmm4,0x10(%r9,%r8,8)
mov    0x18(%rsp),%rbp
mov    0x20(%rsp),%rcx
cmp    %rcx,-0x78(%rsp)
mov    0x10(%rsp),%r8
je     13d0 <egauss+0x2d0>
mov    %eax,%ecx
sub    %ebp,%ecx
mov    %rbp,%rbx
test   $0x1,%cl
je     15c5 <egauss+0x4c5>
movsd  (%rdx,%rbp,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  (%r9,%rbp,8),%xmm2
movsd  %xmm2,(%r9,%rbp,8)
lea    0x1(%rbp),%rbx
not    %rbp
cmp    0x68(%rsp),%rbp
je     13d0 <egauss+0x2d0>
mov    0x48(%rsp),%rcx
mov    -0x30(%rsp),%rdi
lea    (%rcx,%rdi,8),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rcx,%rbx,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  -0x8(%r13,%rbx,8),%xmm2
movsd  %xmm2,-0x8(%r13,%rbx,8)
movsd  (%rcx,%rbx,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x0(%r13,%rbx,8),%xmm2
movsd  %xmm2,0x0(%r13,%rbx,8)
add    $0x2,%rbx
cmp    %rbx,%rax
jne    15f0 <egauss+0x4f0>
jmp    13d0 <egauss+0x2d0>
cmpl   $0x0,-0x64(%rsp)
mov    -0x28(%rsp),%rbx
jle    16e7 <egauss+0x5e7>
xor    %ecx,%ecx
mov    %rax,%rdx
jmp    165d <egauss+0x55d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ecx
cmp    $0x2,%r9
jl     16e7 <egauss+0x5e7>
mov    %rdx,%r9
add    $0xffffffffffffffff,%rdx
mov    %edx,%ebp
movsd  (%r8,%rbp,8),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
cmp    %rax,%r9
jge    1650 <egauss+0x550>
test   $0x1,%cl
jne    1690 <egauss+0x590>
mov    %r9,%rdi
cmp    $0x1,%ecx
jne    16b0 <egauss+0x5b0>
jmp    1650 <egauss+0x550>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r11,%r9,8),%xmm1
mulsd  (%rbx,%r9,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
lea    0x1(%r9),%rdi
cmp    $0x1,%ecx
je     1650 <egauss+0x550>
xchg   %ax,%ax
movsd  (%r11,%rdi,8),%xmm1
mulsd  (%rbx,%rdi,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
movsd  0x8(%r11,%rdi,8),%xmm1
mulsd  0x8(%rbx,%rdi,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x2,%rdi
cmp    %edi,%eax
jne    16b0 <egauss+0x5b0>
jmp    1650 <egauss+0x550>
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @egauss(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store i32 0, i32* %11
br label %14
14: ; preds = %125, %4
%15 = load i32, i32* %11
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %128
18: ; preds = %14
%19 = load double*, double** %6
%20 = load i32, i32* %11
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %5
%23 = mul nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %19, i64 %24
%26 = load double, double* %25
store double %26, double* %12
%27 = load i32, i32* %11
%28 = add nsw i32 %27, 1
store i32 %28, i32* %10
br label %29
29: ; preds = %46, %18
%30 = load i32, i32* %10
%31 = load i32, i32* %5
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %49
33: ; preds = %29
%34 = load double, double* %12
%35 = load double*, double** %6
%36 = load i32, i32* %11
%37 = load i32, i32* %5
%38 = mul nsw i32 %36, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %35, i64 %39
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = load double, double* %43
%45 = fdiv double %44, %34
store double %45, double* %43
br label %46
46: ; preds = %33
%47 = load i32, i32* %10
%48 = add nsw i32 %47, 1
store i32 %48, i32* %10
br label %29
49: ; preds = %29
%50 = load double, double* %12
%51 = load double*, double** %7
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = fdiv double %55, %50
store double %56, double* %54
%57 = load i32, i32* %11
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
br label %59
59: ; preds = %121, %49
%60 = load i32, i32* %9
%61 = load i32, i32* %5
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %124
63: ; preds = %59
%64 = load double*, double** %6
%65 = load i32, i32* %9
%66 = load i32, i32* %5
%67 = mul nsw i32 %65, %66
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %64, i64 %68
%70 = load i32, i32* %11
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
store double %73, double* %13
%74 = load i32, i32* %11
%75 = add nsw i32 %74, 1
store i32 %75, i32* %10
br label %76
76: ; preds = %104, %63
%77 = load i32, i32* %10
%78 = load i32, i32* %5
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %107
80: ; preds = %76
%81 = load double, double* %13
%82 = load double*, double** %6
%83 = load i32, i32* %11
%84 = load i32, i32* %9
%85 = mul nsw i32 %83, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %82, i64 %86
%88 = load i32, i32* %10
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
%91 = load double, double* %90
%92 = load double*, double** %6
%93 = load i32, i32* %9
%94 = load i32, i32* %5
%95 = mul nsw i32 %93, %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %92, i64 %96
%98 = load i32, i32* %10
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %97, i64 %99
%101 = load double, double* %100
%102 = fneg double %81
%103 = call double @llvm.fmuladd.f64(double %102, double %91, double %101)
store double %103, double* %100
br label %104
104: ; preds = %80
%105 = load i32, i32* %10
%106 = add nsw i32 %105, 1
store i32 %106, i32* %10
br label %76
107: ; preds = %76
%108 = load double, double* %13
%109 = load double*, double** %7
%110 = load i32, i32* %11
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %109, i64 %111
%113 = load double, double* %112
%114 = load double*, double** %7
%115 = load i32, i32* %9
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds double, double* %114, i64 %116
%118 = load double, double* %117
%119 = fneg double %108
%120 = call double @llvm.fmuladd.f64(double %119, double %113, double %118)
store double %120, double* %117
br label %121
121: ; preds = %107
%122 = load i32, i32* %9
%123 = add nsw i32 %122, 1
store i32 %123, i32* %9
br label %59
124: ; preds = %59
br label %125
125: ; preds = %124
%126 = load i32, i32* %11
%127 = add nsw i32 %126, 1
store i32 %127, i32* %11
br label %14
128: ; preds = %14
%129 = load i32, i32* %5
%130 = sub nsw i32 %129, 1
store i32 %130, i32* %9
br label %131
131: ; preds = %172, %128
%132 = load i32, i32* %9
%133 = icmp sgt i32 %132, -1
br i1 %133, label %134, label %175
134: ; preds = %131
%135 = load double*, double** %7
%136 = load i32, i32* %9
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
%139 = load double, double* %138
%140 = load double*, double** %8
%141 = load i32, i32* %9
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
store double %139, double* %143
%144 = load i32, i32* %9
%145 = add nsw i32 %144, 1
store i32 %145, i32* %10
br label %146
146: ; preds = %168, %134
%147 = load i32, i32* %10
%148 = load i32, i32* %5
%149 = icmp slt i32 %147, %148
br i1 %149, label %150, label %171
150: ; preds = %146
%151 = load double*, double** %6
%152 = load i32, i32* %10
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
%155 = load double, double* %154
%156 = load double*, double** %8
%157 = load i32, i32* %10
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
%160 = load double, double* %159
%161 = load double*, double** %8
%162 = load i32, i32* %9
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
%165 = load double, double* %164
%166 = fneg double %155
%167 = call double @llvm.fmuladd.f64(double %166, double %160, double %165)
store double %167, double* %164
br label %168
168: ; preds = %150
%169 = load i32, i32* %10
%170 = add nsw i32 %169, 1
store i32 %170, i32* %10
br label %146
171: ; preds = %146
br label %172
172: ; preds = %171
%173 = load i32, i32* %9
%174 = add nsw i32 %173, -1
store i32 %174, i32* %9
br label %131
175: ; preds = %131
ret void
}

LLVM IR (-O2):
define void @egauss(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %303
6: ; preds = %4
%7 = zext i32 %0 to i64
%8 = zext i32 %0 to i64
%9 = add nuw nsw i64 %8, 1
%10 = shl nuw nsw i64 %8, 3
%11 = add nuw nsw i64 %10, 8
%12 = getelementptr double, double* %1, i64 %8
%13 = sub nsw i64 0, %8
br label %22
14: ; preds = %247, %51, %108
%15 = add nuw nsw i64 %25, 1
%16 = icmp eq i64 %46, %8
%17 = add i64 %23, %41
br i1 %16, label %18, label %22
18: ; preds = %14
br i1 %5, label %19, label %303
19: ; preds = %18
%20 = zext i32 %0 to i64
%21 = zext i32 %0 to i64
br label %259
22: ; preds = %6, %14
%23 = phi i64 [ 0, %6 ], [ %17, %14 ]
%24 = phi i64 [ 0, %6 ], [ %46, %14 ]
%25 = phi i64 [ 1, %6 ], [ %15, %14 ]
%26 = xor i64 %24, -1
%27 = add nsw i64 %26, %8
%28 = add i64 %27, -4
%29 = lshr i64 %28, 2
%30 = add nuw nsw i64 %29, 1
%31 = xor i64 %24, -1
%32 = add nsw i64 %31, %8
%33 = add i64 %32, -2
%34 = lshr i64 %33, 1
%35 = add nuw i64 %34, 1
%36 = xor i64 %24, -1
%37 = add nsw i64 %36, %8
%38 = xor i64 %24, -1
%39 = add nsw i64 %38, %8
%40 = shl nuw nsw i64 %24, 1
%41 = add nuw i64 %40, 2
%42 = mul i64 %11, %24
%43 = add nuw i64 %24, 2
%44 = mul i64 %43, %8
%45 = getelementptr double, double* %1, i64 %25
%46 = add nuw nsw i64 %24, 1
%47 = mul nsw i64 %46, %7
%48 = getelementptr inbounds double, double* %1, i64 %47
%49 = load double, double* %48
%50 = icmp ult i64 %46, %7
br i1 %50, label %55, label %51
51: ; preds = %22
%52 = getelementptr inbounds double, double* %2, i64 %24
%53 = load double, double* %52
%54 = fdiv double %53, %49
store double %54, double* %52
br label %14
55: ; preds = %22
%56 = mul nsw i64 %24, %7
%57 = getelementptr inbounds double, double* %1, i64 %56
%58 = icmp ult i64 %37, 2
br i1 %58, label %99, label %59
59: ; preds = %55
%60 = and i64 %37, -2
%61 = add i64 %25, %60
%62 = insertelement <2 x double> poison, double %49, i64 0
%63 = shufflevector <2 x double> %62, <2 x double> poison, <2 x i32> zeroinitializer
%64 = and i64 %35, 1
%65 = icmp ult i64 %33, 2
br i1 %65, label %87, label %66
66: ; preds = %59
%67 = and i64 %35, -2
br label %68
68: ; preds = %68, %66
%69 = phi i64 [ 0, %66 ], [ %84, %68 ]
%70 = phi i64 [ 0, %66 ], [ %85, %68 ]
%71 = add i64 %25, %69
%72 = getelementptr inbounds double, double* %57, i64 %71
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = fdiv <2 x double> %74, %63
%76 = bitcast double* %72 to <2 x double>*
store <2 x double> %75, <2 x double>* %76
%77 = or i64 %69, 2
%78 = add i64 %25, %77
%79 = getelementptr inbounds double, double* %57, i64 %78
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = fdiv <2 x double> %81, %63
%83 = bitcast double* %79 to <2 x double>*
store <2 x double> %82, <2 x double>* %83
%84 = add nuw i64 %69, 4
%85 = add nuw i64 %70, 2
%86 = icmp eq i64 %85, %67
br i1 %86, label %87, label %68
87: ; preds = %68, %59
%88 = phi i64 [ 0, %59 ], [ %84, %68 ]
%89 = icmp eq i64 %64, 0
br i1 %89, label %97, label %90
90: ; preds = %87
%91 = add i64 %25, %88
%92 = getelementptr inbounds double, double* %57, i64 %91
%93 = bitcast double* %92 to <2 x double>*
%94 = load <2 x double>, <2 x double>* %93
%95 = fdiv <2 x double> %94, %63
%96 = bitcast double* %92 to <2 x double>*
store <2 x double> %95, <2 x double>* %96
br label %97
97: ; preds = %87, %90
%98 = icmp eq i64 %37, %60
br i1 %98, label %108, label %99
99: ; preds = %55, %97
%100 = phi i64 [ %25, %55 ], [ %61, %97 ]
br label %101
101: ; preds = %99, %101
%102 = phi i64 [ %106, %101 ], [ %100, %99 ]
%103 = getelementptr inbounds double, double* %57, i64 %102
%104 = load double, double* %103
%105 = fdiv double %104, %49
store double %105, double* %103
%106 = add nuw nsw i64 %102, 1
%107 = icmp eq i64 %106, %8
br i1 %107, label %108, label %101
108: ; preds = %101, %97
%109 = getelementptr inbounds double, double* %2, i64 %24
%110 = load double, double* %109
%111 = fdiv double %110, %49
store double %111, double* %109
br i1 %50, label %112, label %14
112: ; preds = %108
%113 = icmp ult i64 %39, 4
%114 = and i64 %39, -4
%115 = add i64 %25, %114
%116 = and i64 %30, 1
%117 = icmp ult i64 %28, 4
%118 = and i64 %30, 9223372036854775806
%119 = icmp eq i64 %116, 0
%120 = icmp eq i64 %39, %114
br label %121
121: ; preds = %112, %247
%122 = phi i64 [ %254, %247 ], [ 0, %112 ]
%123 = phi i64 [ %252, %247 ], [ %25, %112 ]
%124 = mul i64 %122, %8
%125 = mul i64 %24, %122
%126 = add i64 %23, %125
%127 = and i64 %126, 4294967295
%128 = mul nsw i64 %123, %7
%129 = getelementptr inbounds double, double* %1, i64 %128
%130 = getelementptr inbounds double, double* %129, i64 %24
%131 = load double, double* %130
%132 = mul nsw i64 %123, %24
%133 = and i64 %132, 4294967295
%134 = getelementptr inbounds double, double* %1, i64 %133
%135 = fneg double %131
br i1 %113, label %216, label %136
136: ; preds = %121
%137 = getelementptr double, double* %12, i64 %127
%138 = bitcast double* %137 to i8*
%139 = getelementptr double, double* %45, i64 %127
%140 = add i64 %44, %124
%141 = getelementptr double, double* %1, i64 %140
%142 = add i64 %9, %124
%143 = getelementptr double, double* %1, i64 %142
%144 = bitcast double* %143 to i8*
%145 = getelementptr i8, i8* %144, i64 %42
%146 = icmp ult i8* %145, %138
%147 = icmp ult double* %139, %141
%148 = and i1 %146, %147
br i1 %148, label %216, label %149
149: ; preds = %136
%150 = insertelement <2 x double> poison, double %135, i64 0
%151 = shufflevector <2 x double> %150, <2 x double> poison, <2 x i32> zeroinitializer
%152 = insertelement <2 x double> poison, double %135, i64 0
%153 = shufflevector <2 x double> %152, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %117, label %195, label %154
154: ; preds = %149, %154
%155 = phi i64 [ %192, %154 ], [ 0, %149 ]
%156 = phi i64 [ %193, %154 ], [ 0, %149 ]
%157 = add i64 %25, %155
%158 = getelementptr inbounds double, double* %134, i64 %157
%159 = bitcast double* %158 to <2 x double>*
%160 = load <2 x double>, <2 x double>* %159
%161 = getelementptr inbounds double, double* %158, i64 2
%162 = bitcast double* %161 to <2 x double>*
%163 = load <2 x double>, <2 x double>* %162
%164 = getelementptr inbounds double, double* %129, i64 %157
%165 = bitcast double* %164 to <2 x double>*
%166 = load <2 x double>, <2 x double>* %165
%167 = getelementptr inbounds double, double* %164, i64 2
%168 = bitcast double* %167 to <2 x double>*
%169 = load <2 x double>, <2 x double>* %168
%170 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %151, <2 x double> %160, <2 x double> %166)
%171 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %153, <2 x double> %163, <2 x double> %169)
%172 = bitcast double* %164 to <2 x double>*
store <2 x double> %170, <2 x double>* %172
%173 = bitcast double* %167 to <2 x double>*
store <2 x double> %171, <2 x double>* %173
%174 = or i64 %155, 4
%175 = add i64 %25, %174
%176 = getelementptr inbounds double, double* %134, i64 %175
%177 = bitcast double* %176 to <2 x double>*
%178 = load <2 x double>, <2 x double>* %177
%179 = getelementptr inbounds double, double* %176, i64 2
%180 = bitcast double* %179 to <2 x double>*
%181 = load <2 x double>, <2 x double>* %180
%182 = getelementptr inbounds double, double* %129, i64 %175
%183 = bitcast double* %182 to <2 x double>*
%184 = load <2 x double>, <2 x double>* %183
%185 = getelementptr inbounds double, double* %182, i64 2
%186 = bitcast double* %185 to <2 x double>*
%187 = load <2 x double>, <2 x double>* %186
%188 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %151, <2 x double> %178, <2 x double> %184)
%189 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %153, <2 x double> %181, <2 x double> %187)
%190 = bitcast double* %182 to <2 x double>*
store <2 x double> %188, <2 x double>* %190
%191 = bitcast double* %185 to <2 x double>*
store <2 x double> %189, <2 x double>* %191
%192 = add nuw i64 %155, 8
%193 = add i64 %156, 2
%194 = icmp eq i64 %193, %118
br i1 %194, label %195, label %154
195: ; preds = %154, %149
%196 = phi i64 [ 0, %149 ], [ %192, %154 ]
br i1 %119, label %215, label %197
197: ; preds = %195
%198 = add i64 %25, %196
%199 = getelementptr inbounds double, double* %134, i64 %198
%200 = bitcast double* %199 to <2 x double>*
%201 = load <2 x double>, <2 x double>* %200
%202 = getelementptr inbounds double, double* %199, i64 2
%203 = bitcast double* %202 to <2 x double>*
%204 = load <2 x double>, <2 x double>* %203
%205 = getelementptr inbounds double, double* %129, i64 %198
%206 = bitcast double* %205 to <2 x double>*
%207 = load <2 x double>, <2 x double>* %206
%208 = getelementptr inbounds double, double* %205, i64 2
%209 = bitcast double* %208 to <2 x double>*
%210 = load <2 x double>, <2 x double>* %209
%211 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %151, <2 x double> %201, <2 x double> %207)
%212 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %153, <2 x double> %204, <2 x double> %210)
%213 = bitcast double* %205 to <2 x double>*
store <2 x double> %211, <2 x double>* %213
%214 = bitcast double* %208 to <2 x double>*
store <2 x double> %212, <2 x double>* %214
br label %215
215: ; preds = %195, %197
br i1 %120, label %247, label %216
216: ; preds = %136, %121, %215
%217 = phi i64 [ %25, %136 ], [ %25, %121 ], [ %115, %215 ]
%218 = sub i64 %8, %217
%219 = xor i64 %217, -1
%220 = and i64 %218, 1
%221 = icmp eq i64 %220, 0
br i1 %221, label %229, label %222
222: ; preds = %216
%223 = getelementptr inbounds double, double* %134, i64 %217
%224 = load double, double* %223
%225 = getelementptr inbounds double, double* %129, i64 %217
%226 = load double, double* %225
%227 = tail call double @llvm.fmuladd.f64(double %135, double %224, double %226)
store double %227, double* %225
%228 = add nuw nsw i64 %217, 1
br label %229
229: ; preds = %222, %216
%230 = phi i64 [ %217, %216 ], [ %228, %222 ]
%231 = icmp eq i64 %219, %13
br i1 %231, label %247, label %232
232: ; preds = %229, %232
%233 = phi i64 [ %245, %232 ], [ %230, %229 ]
%234 = getelementptr inbounds double, double* %134, i64 %233
%235 = load double, double* %234
%236 = getelementptr inbounds double, double* %129, i64 %233
%237 = load double, double* %236
%238 = tail call double @llvm.fmuladd.f64(double %135, double %235, double %237)
store double %238, double* %236
%239 = add nuw nsw i64 %233, 1
%240 = getelementptr inbounds double, double* %134, i64 %239
%241 = load double, double* %240
%242 = getelementptr inbounds double, double* %129, i64 %239
%243 = load double, double* %242
%244 = tail call double @llvm.fmuladd.f64(double %135, double %241, double %243)
store double %244, double* %242
%245 = add nuw nsw i64 %233, 2
%246 = icmp eq i64 %245, %8
br i1 %246, label %247, label %232
247: ; preds = %229, %232, %215
%248 = load double, double* %109
%249 = getelementptr inbounds double, double* %2, i64 %123
%250 = load double, double* %249
%251 = tail call double @llvm.fmuladd.f64(double %135, double %248, double %250)
store double %251, double* %249
%252 = add nuw nsw i64 %123, 1
%253 = icmp eq i64 %252, %8
%254 = add i64 %122, 1
br i1 %253, label %14, label %121
255: ; preds = %280, %284, %259
%256 = icmp sgt i64 %261, 1
%257 = add nsw i64 %261, -1
%258 = add i32 %260, 1
br i1 %256, label %259, label %303
259: ; preds = %19, %255
%260 = phi i32 [ 0, %19 ], [ %258, %255 ]
%261 = phi i64 [ %21, %19 ], [ %257, %255 ]
%262 = phi i64 [ %20, %19 ], [ %263, %255 ]
%263 = add nsw i64 %262, -1
%264 = and i64 %263, 4294967295
%265 = getelementptr inbounds double, double* %2, i64 %264
%266 = load double, double* %265
%267 = getelementptr inbounds double, double* %3, i64 %264
store double %266, double* %267
%268 = icmp slt i64 %261, %20
br i1 %268, label %269, label %255
269: ; preds = %259
%270 = and i32 %260, 1
%271 = icmp eq i32 %270, 0
br i1 %271, label %280, label %272
272: ; preds = %269
%273 = getelementptr inbounds double, double* %1, i64 %262
%274 = load double, double* %273
%275 = getelementptr inbounds double, double* %3, i64 %262
%276 = load double, double* %275
%277 = fneg double %274
%278 = tail call double @llvm.fmuladd.f64(double %277, double %276, double %266)
store double %278, double* %267
%279 = add nsw i64 %262, 1
br label %280
280: ; preds = %272, %269
%281 = phi double [ %266, %269 ], [ %278, %272 ]
%282 = phi i64 [ %262, %269 ], [ %279, %272 ]
%283 = icmp eq i32 %260, 1
br i1 %283, label %255, label %284
284: ; preds = %280, %284
%285 = phi double [ %299, %284 ], [ %281, %280 ]
%286 = phi i64 [ %300, %284 ], [ %282, %280 ]
%287 = getelementptr inbounds double, double* %1, i64 %286
%288 = load double, double* %287
%289 = getelementptr inbounds double, double* %3, i64 %286
%290 = load double, double* %289
%291 = fneg double %288
%292 = tail call double @llvm.fmuladd.f64(double %291, double %290, double %285)
store double %292, double* %267
%293 = add nsw i64 %286, 1
%294 = getelementptr inbounds double, double* %1, i64 %293
%295 = load double, double* %294
%296 = getelementptr inbounds double, double* %3, i64 %293
%297 = load double, double* %296
%298 = fneg double %295
%299 = tail call double @llvm.fmuladd.f64(double %298, double %297, double %292)
store double %299, double* %267
%300 = add nsw i64 %286, 2
%301 = trunc i64 %300 to i32
%302 = icmp eq i32 %301, %0
br i1 %302, label %255, label %284
303: ; preds = %255, %4, %18
ret void
}