void gelim_double(double *a, int n, double *b) {
  int i, j, jj;
  double *pa, *paj;
  double f, pivot;
  for (j = 0; j < n - 1; j++) {
    pa = a + j * n;
    pivot = pa[j];
    for (i = j + 1; i < n; i++) {
      pa = a + i * n;
      paj = a + j * n;
      f = pa[j] / pivot;
      pa[j] = f;
      for (jj = j + 1; jj < n; jj++)
        pa[jj] -= f * paj[jj];
    }
  }
  for (i = 1; i < n; i++) {
    pa = a + i * n;
    for (j = 0; j < i; j++)
      b[i] -= pa[j] * b[j];
  }
  for (i = n - 1; i > -1; i--) {
    pa = a + i * n;
    for (j = n - 1; j > i; j--)
      b[i] -= pa[j] * b[j];
    b[i] = b[i] / pa[i];
  }
}


x86 assembly (clang, -O0):
<gelim_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    124e <gelim_double+0x14e>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    123b <gelim_double+0x13b>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1228 <gelim_double+0x128>
movsd  -0x40(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x30(%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    11cb <gelim_double+0xcb>
jmp    122d <gelim_double+0x12d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115b <gelim_double+0x5b>
jmp    1240 <gelim_double+0x140>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <gelim_double+0x16>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12f9 <gelim_double+0x1f9>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12e6 <gelim_double+0x1e6>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%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    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1281 <gelim_double+0x181>
jmp    12eb <gelim_double+0x1eb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1255 <gelim_double+0x155>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jle    13c8 <gelim_double+0x2c8>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1393 <gelim_double+0x293>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%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    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    132e <gelim_double+0x22e>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1302 <gelim_double+0x202>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gelim_double>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r15
lea    -0x1(%rsi),%ecx
mov    %esi,%r10d
mov    %ecx,%r11d
cmp    $0x2,%esi
jl     158b <gelim_double+0x48b>
mov    %rsi,-0x48(%rsp)
lea    0x1(%r10),%rax
mov    %rax,0x18(%rsp)
lea    0x0(,%r10,8),%rax
mov    %rax,-0x58(%rsp)
lea    0x8(,%r10,8),%rax
mov    %rax,-0x68(%rsp)
lea    (%r10,%r10,1),%rax
mov    %rax,-0x38(%rsp)
lea    0x8(%r15),%rax
mov    %rax,-0x40(%rsp)
mov    %r10,%rax
neg    %rax
mov    %rax,0x30(%rsp)
lea    (%r15,%r10,8),%rax
add    $0x38,%rax
mov    %rax,-0x70(%rsp)
lea    0x38(%r15),%rbx
lea    -0x5(%r10),%rax
mov    %rax,-0x78(%rsp)
lea    (%r15,%r10,8),%rax
add    $0x8,%rax
mov    %rax,-0x80(%rsp)
mov    $0x1,%edi
xor    %r14d,%r14d
movapd 0xe60(%rip),%xmm8
mov    %r15,%r8
mov    %r11,-0x30(%rsp)
jmp    11e7 <gelim_double+0xe7>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdi
mov    -0x68(%rsp),%rax
add    %rax,-0x70(%rsp)
add    %rax,%rbx
addq   $0xffffffffffffffff,-0x78(%rsp)
mov    -0x58(%rsp),%rax
add    %rax,-0x80(%rsp)
add    %rax,%r8
mov    -0x30(%rsp),%r11
mov    -0x28(%rsp),%r14
cmp    %r11,%r14
je     14bb <gelim_double+0x3bb>
lea    0x1(%r14),%rax
mov    %rax,-0x28(%rsp)
cmp    %r10,%rax
jae    11b0 <gelim_double+0xb0>
mov    -0x78(%rsp),%rax
shr    $0x2,%rax
add    $0x1,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,-0x20(%rsp)
mov    %r14,%rbp
not    %rbp
lea    (%r10,%rbp,1),%rax
add    $0xfffffffffffffffc,%rax
add    %r10,%rbp
mov    %rax,(%rsp)
shr    $0x2,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rsp)
mov    -0x68(%rsp),%rsi
imul   %r14,%rsi
mov    %r14,%rcx
imul   %r10,%rcx
mov    -0x38(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x10(%rsp)
mov    -0x40(%rsp),%rax
mov    %rsi,0x28(%rsp)
add    %rsi,%rax
mov    %rax,0x8(%rsp)
lea    (%rcx,%r10,1),%rsi
lea    (%r15,%rsi,8),%rax
mov    %rax,0x20(%rsp)
lea    (%r15,%rcx,8),%rax
mov    %rax,-0x60(%rsp)
movsd  (%rax,%r14,8),%xmm1
mov    %rbp,-0x50(%rsp)
and    $0xfffffffffffffffc,%rbp
mov    %rdi,%r11
mov    %rbp,-0x10(%rsp)
lea    (%rdi,%rbp,1),%rax
mov    %rax,-0x18(%rsp)
mov    -0x80(%rsp),%rbp
mov    -0x70(%rsp),%r13
xor    %r9d,%r9d
jmp    12cc <gelim_double+0x1cc>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r11
add    $0x1,%r9
mov    -0x58(%rsp),%rax
add    %rax,%r13
add    %rax,%rbp
cmp    %r10,%r11
je     11b0 <gelim_double+0xb0>
mov    %r11,%rcx
imul   %r10,%rcx
lea    (%r15,%rcx,8),%r12
movsd  (%r12,%r14,8),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%r12,%r14,8)
xorpd  %xmm8,%xmm2
mov    %rdi,%rcx
cmpq   $0x4,-0x50(%rsp)
jb     1440 <gelim_double+0x340>
mov    %r9,%rcx
imul   %r10,%rcx
mov    0x18(%rsp),%rax
lea    (%rax,%rcx,1),%rsi
lea    (%r15,%rsi,8),%rsi
add    0x28(%rsp),%rsi
cmp    0x20(%rsp),%rsi
jae    1332 <gelim_double+0x232>
add    0x10(%rsp),%rcx
lea    (%r15,%rcx,8),%rsi
mov    %rdi,%rcx
cmp    %rsi,0x8(%rsp)
jb     1440 <gelim_double+0x340>
mov    %r15,%rax
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
cmpq   $0x4,(%rsp)
jae    134c <gelim_double+0x24c>
xor    %r15d,%r15d
jmp    13dd <gelim_double+0x2dd>
mov    -0x20(%rsp),%rsi
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd -0x30(%rbx,%r15,8),%xmm4
movupd -0x20(%rbx,%r15,8),%xmm5
mulpd  %xmm3,%xmm4
movupd -0x30(%r13,%r15,8),%xmm6
addpd  %xmm4,%xmm6
movupd -0x20(%r13,%r15,8),%xmm4
movupd -0x10(%r13,%r15,8),%xmm7
movupd 0x0(%r13,%r15,8),%xmm0
mulpd  %xmm3,%xmm5
addpd  %xmm4,%xmm5
movupd %xmm6,-0x30(%r13,%r15,8)
movupd %xmm5,-0x20(%r13,%r15,8)
movupd -0x10(%rbx,%r15,8),%xmm4
movupd (%rbx,%r15,8),%xmm5
mulpd  %xmm3,%xmm4
addpd  %xmm7,%xmm4
mulpd  %xmm3,%xmm5
addpd  %xmm0,%xmm5
movupd %xmm4,-0x10(%r13,%r15,8)
movupd %xmm5,0x0(%r13,%r15,8)
add    $0x8,%r15
add    $0xfffffffffffffffe,%rsi
jne    1360 <gelim_double+0x260>
testb  $0x1,-0x8(%rsp)
je     1423 <gelim_double+0x323>
add    %rdi,%r15
mov    -0x60(%rsp),%rcx
movupd (%rcx,%r15,8),%xmm0
movupd 0x10(%rcx,%r15,8),%xmm4
movupd (%r12,%r15,8),%xmm5
movupd 0x10(%r12,%r15,8),%xmm6
mulpd  %xmm3,%xmm0
addpd  %xmm5,%xmm0
mulpd  %xmm3,%xmm4
addpd  %xmm6,%xmm4
movupd %xmm0,(%r12,%r15,8)
movupd %xmm4,0x10(%r12,%r15,8)
mov    -0x18(%rsp),%rcx
mov    -0x10(%rsp),%rsi
cmp    %rsi,-0x50(%rsp)
mov    %rax,%r15
je     12b0 <gelim_double+0x1b0>
nopl   0x0(%rax,%rax,1)
mov    %r10d,%eax
sub    %ecx,%eax
mov    %rcx,%rsi
test   $0x1,%al
je     146a <gelim_double+0x36a>
mov    -0x60(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm0
addsd  (%r12,%rcx,8),%xmm0
movsd  %xmm0,(%r12,%rcx,8)
lea    0x1(%rcx),%rsi
not    %rcx
cmp    0x30(%rsp),%rcx
je     12b0 <gelim_double+0x1b0>
nopl   0x0(%rax,%rax,1)
movsd  (%r8,%rsi,8),%xmm0
mulsd  %xmm2,%xmm0
addsd  -0x8(%rbp,%rsi,8),%xmm0
movsd  %xmm0,-0x8(%rbp,%rsi,8)
movsd  0x8(%r8,%rsi,8),%xmm0
mulsd  %xmm2,%xmm0
addsd  0x0(%rbp,%rsi,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rsi,8)
add    $0x2,%rsi
cmp    %rsi,%r10
jne    1480 <gelim_double+0x380>
jmp    12b0 <gelim_double+0x1b0>
mov    -0x48(%rsp),%rsi
cmp    $0x2,%esi
jl     158b <gelim_double+0x48b>
lea    (%r15,%r10,8),%rcx
add    $0x8,%rcx
lea    0x0(,%r10,8),%r8
mov    $0x1,%ebp
xor    %r9d,%r9d
jmp    1504 <gelim_double+0x404>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbp
add    $0x1,%r9
add    %r8,%rcx
cmp    %r10,%rbp
je     158b <gelim_double+0x48b>
movsd  (%rdx,%rbp,8),%xmm0
test   %r9,%r9
je     1560 <gelim_double+0x460>
mov    %rbp,%rax
and    $0xfffffffffffffffe,%rax
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rcx,%rbx,8),%xmm1
mulsd  (%rdx,%rbx,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rbp,8)
movsd  (%rcx,%rbx,8),%xmm1
mulsd  0x8(%rdx,%rbx,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rbp,8)
add    $0x2,%rbx
cmp    %rbx,%rax
jne    1520 <gelim_double+0x420>
test   $0x1,%bpl
je     14f0 <gelim_double+0x3f0>
jmp    1568 <gelim_double+0x468>
nopl   0x0(%rax)
xor    %ebx,%ebx
test   $0x1,%bpl
je     14f0 <gelim_double+0x3f0>
mov    %rbp,%rax
imul   %r10,%rax
lea    (%r15,%rax,8),%rax
movsd  (%rax,%rbx,8),%xmm1
mulsd  (%rdx,%rbx,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rbp,8)
jmp    14f0 <gelim_double+0x3f0>
test   %esi,%esi
jle    1621 <gelim_double+0x521>
lea    -0x1(%r10),%r8
mov    %r10,%rax
imul   %r10,%rax
lea    (%r15,%rax,8),%rbx
add    $0xfffffffffffffff8,%rbx
lea    0x0(,%r10,8),%r9
neg    %r9
mov    %r8,%rcx
jmp    15dd <gelim_double+0x4dd>
cs nopw 0x0(%rax,%rax,1)
lea    (%r15,%rsi,8),%rax
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
lea    -0x1(%rcx),%rax
add    %r9,%rbx
test   %rcx,%rcx
mov    %rax,%rcx
jle    1621 <gelim_double+0x521>
mov    %rcx,%rsi
imul   %r10,%rsi
movsd  (%rdx,%rcx,8),%xmm0
cmp    %r11,%rcx
jge    15c0 <gelim_double+0x4c0>
mov    %rbx,%rax
mov    %r8,%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rax),%xmm1
mulsd  (%rdx,%rbp,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
add    $0xffffffffffffffff,%rbp
add    $0xfffffffffffffff8,%rax
cmp    %rcx,%rbp
jg     1600 <gelim_double+0x500>
jmp    15c0 <gelim_double+0x4c0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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