gelim_double(a, n, b) double *a, *b;
int n;
{
  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,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    124e <gelim_double+0x14e>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    123b <gelim_double+0x13b>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1228 <gelim_double+0x128>
movsd  -0x48(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x38(%rbp),%rax
movslq -0x2c(%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    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11cb <gelim_double+0xcb>
jmp    122d <gelim_double+0x12d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115b <gelim_double+0x5b>
jmp    1240 <gelim_double+0x140>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1116 <gelim_double+0x16>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12f9 <gelim_double+0x1f9>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12e6 <gelim_double+0x1e6>
mov    -0x38(%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    1281 <gelim_double+0x181>
jmp    12eb <gelim_double+0x1eb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1255 <gelim_double+0x155>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jle    13c8 <gelim_double+0x2c8>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    1393 <gelim_double+0x293>
mov    -0x38(%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    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    132e <gelim_double+0x22e>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1302 <gelim_double+0x202>
mov    -0x4(%rbp),%eax
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 i32 @gelim_double(double* %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32 0, i32* %9
br label %15
15: ; preds = %91, %3
%16 = load i32, i32* %9
%17 = load i32, i32* %6
%18 = sub nsw i32 %17, 1
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %94
20: ; preds = %15
%21 = load double*, double** %5
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = mul nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %21, i64 %25
store double* %26, double** %11
%27 = load double*, double** %11
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
store double %31, double* %14
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %34
34: ; preds = %87, %20
%35 = load i32, i32* %8
%36 = load i32, i32* %6
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %90
38: ; preds = %34
%39 = load double*, double** %5
%40 = load i32, i32* %8
%41 = load i32, i32* %6
%42 = mul nsw i32 %40, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %39, i64 %43
store double* %44, double** %11
%45 = load double*, double** %5
%46 = load i32, i32* %9
%47 = load i32, i32* %6
%48 = mul nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %45, i64 %49
store double* %50, double** %12
%51 = load double*, double** %11
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = load double, double* %14
%57 = fdiv double %55, %56
store double %57, double* %13
%58 = load double, double* %13
%59 = load double*, double** %11
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
store double %58, double* %62
%63 = load i32, i32* %9
%64 = add nsw i32 %63, 1
store i32 %64, i32* %10
br label %65
65: ; preds = %83, %38
%66 = load i32, i32* %10
%67 = load i32, i32* %6
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %86
69: ; preds = %65
%70 = load double, double* %13
%71 = load double*, double** %12
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
%76 = load double*, double** %11
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
%80 = load double, double* %79
%81 = fneg double %70
%82 = call double @llvm.fmuladd.f64(double %81, double %75, double %80)
store double %82, double* %79
br label %83
83: ; preds = %69
%84 = load i32, i32* %10
%85 = add nsw i32 %84, 1
store i32 %85, i32* %10
br label %65
86: ; preds = %65
br label %87
87: ; preds = %86
%88 = load i32, i32* %8
%89 = add nsw i32 %88, 1
store i32 %89, i32* %8
br label %34
90: ; preds = %34
br label %91
91: ; preds = %90
%92 = load i32, i32* %9
%93 = add nsw i32 %92, 1
store i32 %93, i32* %9
br label %15
94: ; preds = %15
store i32 1, i32* %8
br label %95
95: ; preds = %132, %94
%96 = load i32, i32* %8
%97 = load i32, i32* %6
%98 = icmp slt i32 %96, %97
br i1 %98, label %99, label %135
99: ; preds = %95
%100 = load double*, double** %5
%101 = load i32, i32* %8
%102 = load i32, i32* %6
%103 = mul nsw i32 %101, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %100, i64 %104
store double* %105, double** %11
store i32 0, i32* %9
br label %106
106: ; preds = %128, %99
%107 = load i32, i32* %9
%108 = load i32, i32* %8
%109 = icmp slt i32 %107, %108
br i1 %109, label %110, label %131
110: ; preds = %106
%111 = load double*, double** %11
%112 = load i32, i32* %9
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %111, i64 %113
%115 = load double, double* %114
%116 = load double*, double** %7
%117 = load i32, i32* %9
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %116, i64 %118
%120 = load double, double* %119
%121 = load double*, double** %7
%122 = load i32, i32* %8
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %121, i64 %123
%125 = load double, double* %124
%126 = fneg double %115
%127 = call double @llvm.fmuladd.f64(double %126, double %120, double %125)
store double %127, double* %124
br label %128
128: ; preds = %110
%129 = load i32, i32* %9
%130 = add nsw i32 %129, 1
store i32 %130, i32* %9
br label %106
131: ; preds = %106
br label %132
132: ; preds = %131
%133 = load i32, i32* %8
%134 = add nsw i32 %133, 1
store i32 %134, i32* %8
br label %95
135: ; preds = %95
%136 = load i32, i32* %6
%137 = sub nsw i32 %136, 1
store i32 %137, i32* %8
br label %138
138: ; preds = %191, %135
%139 = load i32, i32* %8
%140 = icmp sgt i32 %139, -1
br i1 %140, label %141, label %194
141: ; preds = %138
%142 = load double*, double** %5
%143 = load i32, i32* %8
%144 = load i32, i32* %6
%145 = mul nsw i32 %143, %144
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %142, i64 %146
store double* %147, double** %11
%148 = load i32, i32* %6
%149 = sub nsw i32 %148, 1
store i32 %149, i32* %9
br label %150
150: ; preds = %172, %141
%151 = load i32, i32* %9
%152 = load i32, i32* %8
%153 = icmp sgt i32 %151, %152
br i1 %153, label %154, label %175
154: ; preds = %150
%155 = load double*, double** %11
%156 = load i32, i32* %9
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = load double*, double** %7
%161 = load i32, i32* %9
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds double, double* %160, i64 %162
%164 = load double, double* %163
%165 = load double*, double** %7
%166 = load i32, i32* %8
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
%169 = load double, double* %168
%170 = fneg double %159
%171 = call double @llvm.fmuladd.f64(double %170, double %164, double %169)
store double %171, double* %168
br label %172
172: ; preds = %154
%173 = load i32, i32* %9
%174 = add nsw i32 %173, -1
store i32 %174, i32* %9
br label %150
175: ; preds = %150
%176 = load double*, double** %7
%177 = load i32, i32* %8
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %176, i64 %178
%180 = load double, double* %179
%181 = load double*, double** %11
%182 = load i32, i32* %8
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %181, i64 %183
%185 = load double, double* %184
%186 = fdiv double %180, %185
%187 = load double*, double** %7
%188 = load i32, i32* %8
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
store double %186, double* %190
br label %191
191: ; preds = %175
%192 = load i32, i32* %8
%193 = add nsw i32 %192, -1
store i32 %193, i32* %8
br label %138
194: ; preds = %138
%195 = load i32, i32* %4
ret i32 %195
}

LLVM IR (-O2):
define i32 @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 i32 undef
}