void sgesl(a, lda, n, ipvt, b, job) double *a, *b;
int lda, n, *ipvt, job;
{
  int k, kb, l, nm1;
  double t;
  nm1 = n - 1;
  if (job == 0) {
    if (nm1 >= 1) {
      for (k = 1; k <= nm1; k++) {
        l = ipvt[k - 1];
        t = b[l];
        if (l != (k - 1)) {
          b[l] = b[k - 1];
          b[k - 1] = t;
        }
        saxpy(n - k, t, (a + lda * k + k - 1), lda, (b + k), 1);
      }
    }
    for (kb = 1; kb <= n; kb++) {
      k = n + 1 - kb;
      b[k - 1] = b[k - 1] / a[(k - 1) * lda + k - 1];
      t = -b[k - 1];
      saxpy(k - 1, t, (a + k - 1), lda, b, 1);
    }
    return;
  }
  for (k = 1; k <= n; k++) {
    t = sdot(k - 1, (a + k - 1), lda, b, 1);
    b[k - 1] = (b[k - 1] - t) / a[(k - 1) * lda + k - 1];
  }
  if (nm1 > 0) {
    for (kb = 1; kb <= nm1; kb++) {
      k = n - kb;
      b[k - 1] = b[k - 1] + sdot(n - k, (a + k * lda + k - 1), lda, b + k, 1);
      l = ipvt[k - 1];
      if (l != (k - 1)) {
        t = b[l];
        b[l] = b[k - 1];
        b[k - 1] = t;
      }
    }
  }
}


x86 assembly (clang, -O0):
<sgesl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    130c <sgesl+0x1ec>
cmpl   $0x1,-0x34(%rbp)
jl     123a <sgesl+0x11a>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1235 <sgesl+0x115>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11da <sgesl+0xba>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%edi
sub    -0x28(%rbp),%edi
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
imul   -0x28(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    $0x1,%r8d
mov    $0x1,%al
call   1030 <saxpy@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1162 <sgesl+0x42>
jmp    123a <sgesl+0x11a>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1307 <sgesl+0x1e7>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%edi
sub    $0x1,%edi
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rsi
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
mov    $0x1,%al
call   1030 <saxpy@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1241 <sgesl+0x121>
jmp    14d0 <sgesl+0x3b0>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     13a8 <sgesl+0x288>
mov    -0x28(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%rsi
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
mov    $0x0,%al
call   1040 <sdot@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1313 <sgesl+0x1f3>
cmpl   $0x0,-0x34(%rbp)
jle    14d0 <sgesl+0x3b0>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     14cb <sgesl+0x3ab>
mov    -0x10(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%edi
sub    -0x28(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    $0x1,%r8d
mov    $0x0,%al
call   1040 <sdot@plt>
movsd  -0x48(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     14b8 <sgesl+0x398>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14bd <sgesl+0x39d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13b9 <sgesl+0x299>
jmp    14d0 <sgesl+0x3b0>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgesl>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r15
mov    %rcx,0x20(%rsp)
test   %r9d,%r9d
mov    %rsi,%rax
mov    %rsi,(%rsp)
je     1286 <sgesl+0x166>
test   %edx,%edx
jle    13a8 <sgesl+0x288>
mov    %rdx,0x10(%rsp)
mov    %edx,%r8d
lea    0x1(%rsi),%eax
mov    %eax,0x8(%rsp)
xor    %ebx,%ebx
xor    %ebp,%ebp
mov    %rdi,%r12
mov    %rdi,%r13
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r13,%rsi
mov    (%rsp),%rdx
mov    %r15,%rcx
mov    %r8,%r14
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <sdot@plt>
mov    %r14,%r8
mov    (%rsp),%rdx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%r15,%rbx,8),%xmm1
subsd  %xmm0,%xmm1
movslq %ebp,%rbp
divsd  (%r12,%rbp,8),%xmm1
movsd  %xmm1,(%r15,%rbx,8)
add    $0x8,%r13
add    0x8(%rsp),%ebp
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1170 <sgesl+0x50>
cmpl   $0x2,0x10(%rsp)
jl     13a8 <sgesl+0x288>
movslq %edx,%rcx
lea    -0x1(%r8),%r13
mov    %r13,%rax
imul   %rcx,%rax
add    %r8,%rax
lea    (%r12,%rax,8),%r14
add    $0xfffffffffffffff0,%r14
mov    %rcx,%r12
shl    $0x3,%r12
xor    $0xfffffffffffffff8,%r12
lea    -0x8(,%r8,8),%rbx
ff
mov    $0x1,%ebp
jmp    1228 <sgesl+0x108>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
add    %r12,%r14
add    $0xfffffffffffffff8,%rbx
add    $0xffffffffffffffff,%r13
mov    (%rsp),%rdx
je     13a8 <sgesl+0x288>
movsd  -0x8(%r15,%r13,8),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    (%r15,%rbx,1),%rcx
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <sdot@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,-0x8(%r15,%r13,8)
mov    0x20(%rsp),%rax
movslq -0x4(%rax,%r13,4),%rax
lea    -0x1(%r13),%ecx
cmp    %eax,%ecx
je     1210 <sgesl+0xf0>
movsd  (%r15,%rax,8),%xmm1
movsd  %xmm0,(%r15,%rax,8)
movsd  %xmm1,-0x8(%r15,%r13,8)
jmp    1210 <sgesl+0xf0>
mov    %rdi,0x18(%rsp)
mov    %rdx,0x10(%rsp)
cmp    $0x2,%edx
jl     132a <sgesl+0x20a>
movslq (%rsp),%rax
mov    0x10(%rsp),%rcx
mov    %ecx,%r14d
lea    -0x1(%rcx),%ebx
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,8),%r13
lea    0x8(,%rax,8),%rax
mov    %rax,0x8(%rsp)
add    $0xffffffffffffffff,%r14
mov    $0x8,%ebp
xor    %r12d,%r12d
jmp    12ff <sgesl+0x1df>
nopl   0x0(%rax)
lea    (%r15,%rbp,1),%rcx
mov    %ebx,%edi
mov    %r13,%rsi
mov    (%rsp),%rdx
mov    $0x1,%r8d
mov    $0x1,%al
call   1030 <saxpy@plt>
add    $0xffffffff,%ebx
add    0x8(%rsp),%r13
add    $0x1,%r12
add    $0x8,%rbp
cmp    %r12,%r14
je     132a <sgesl+0x20a>
mov    0x20(%rsp),%rax
mov    (%rax,%r12,4),%ecx
movslq %ecx,%rax
movsd  (%r15,%rax,8),%xmm0
cmp    %rcx,%r12
je     12d0 <sgesl+0x1b0>
movsd  (%r15,%r12,8),%xmm1
movsd  %xmm1,(%r15,%rax,8)
movsd  %xmm0,(%r15,%r12,8)
jmp    12d0 <sgesl+0x1b0>
mov    0x10(%rsp),%rdx
test   %edx,%edx
mov    (%rsp),%rcx
mov    0x18(%rsp),%r13
jle    13a8 <sgesl+0x288>
mov    %edx,%ebx
lea    -0x8(%r13),%r14
lea    -0x1(%rdx),%eax
imul   %ecx,%eax
lea    (%rdx,%rax,1),%ebp
add    $0xffffffff,%ebp
mov    %ecx,%r12d
not    %r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rbx),%eax
movslq %eax,%rdi
movsd  (%r15,%rdi,8),%xmm0
movslq %ebp,%rbp
divsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,(%r15,%rdi,8)
xorpd  0xc7c(%rip),%xmm0
movslq %ebx,%rax
lea    (%r14,%rax,8),%rsi
mov    (%rsp),%rdx
mov    %r15,%rcx
mov    $0x1,%r8d
mov    $0x1,%al
call   1030 <saxpy@plt>
add    %r12d,%ebp
add    $0xffffffffffffffff,%rbx
jne    1360 <sgesl+0x240>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sgesl(double* %0, i32 %1, i32 %2, i32* nocapture %3, double* %4, i32 %5) {
%7 = icmp eq i32 %5, 0
br i1 %7, label %14, label %8
8: ; preds = %6
%9 = icmp slt i32 %2, 1
br i1 %9, label %122, label %10
10: ; preds = %8
%11 = add nuw i32 %2, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds double, double* %0, i64 -1
br label %69
14: ; preds = %6
%15 = icmp sgt i32 %2, 1
br i1 %15, label %16, label %43
16: ; preds = %14
%17 = sext i32 %1 to i64
%18 = zext i32 %2 to i64
%19 = getelementptr inbounds double, double* %0, i64 -1
br label %20
20: ; preds = %16, %33
%21 = phi i64 [ 1, %16 ], [ %41, %33 ]
%22 = add nsw i64 %21, -1
%23 = getelementptr inbounds i32, i32* %3, i64 %22
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %4, i64 %25
%27 = load double, double* %26
%28 = zext i32 %24 to i64
%29 = icmp eq i64 %22, %28
br i1 %29, label %33, label %30
30: ; preds = %20
%31 = getelementptr inbounds double, double* %4, i64 %22
%32 = load double, double* %31
store double %32, double* %26
store double %27, double* %31
br label %33
33: ; preds = %30, %20
%34 = mul nsw i64 %21, %17
%35 = getelementptr inbounds double, double* %19, i64 %34
%36 = getelementptr inbounds double, double* %35, i64 %21
%37 = getelementptr inbounds double, double* %4, i64 %21
%38 = trunc i64 %21 to i32
%39 = sub i32 %2, %38
%40 = tail call i32 (i32, double, double*, i32, double*, i32, ...) bitcast (i32 (...)* @saxpy to i32 (i32, double, double*, i32, double*, i32, ...)*)(i32 %39, double %27, double* %36, i32 %1, double* %37, i32 1)
%41 = add nuw nsw i64 %21, 1
%42 = icmp eq i64 %41, %18
br i1 %42, label %43, label %20
43: ; preds = %33, %14
%44 = icmp slt i32 %2, 1
br i1 %44, label %122, label %45
45: ; preds = %43
%46 = add nuw nsw i32 %2, 1
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds double, double* %0, i64 -1
br label %49
49: ; preds = %45, %49
%50 = phi i64 [ 1, %45 ], [ %67, %49 ]
%51 = trunc i64 %50 to i32
%52 = sub i32 %46, %51
%53 = add i32 %52, -1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %4, i64 %54
%56 = load double, double* %55
%57 = mul nsw i32 %53, %1
%58 = add i32 %53, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %0, i64 %59
%61 = load double, double* %60
%62 = fdiv double %56, %61
store double %62, double* %55
%63 = fneg double %62
%64 = sext i32 %52 to i64
%65 = getelementptr inbounds double, double* %48, i64 %64
%66 = tail call i32 (i32, double, double*, i32, double*, i32, ...) bitcast (i32 (...)* @saxpy to i32 (i32, double, double*, i32, double*, i32, ...)*)(i32 %53, double %63, double* %65, i32 %1, double* %4, i32 1)
%67 = add nuw nsw i64 %50, 1
%68 = icmp eq i64 %67, %47
br i1 %68, label %122, label %49
69: ; preds = %10, %69
%70 = phi i64 [ 1, %10 ], [ %88, %69 ]
%71 = trunc i64 %70 to i32
%72 = add nsw i64 %70, -1
%73 = getelementptr inbounds double, double* %13, i64 %70
%74 = trunc i64 %72 to i32
%75 = tail call i32 (i32, double*, i32, double*, i32, ...) bitcast (i32 (...)* @sdot to i32 (i32, double*, i32, double*, i32, ...)*)(i32 %74, double* %73, i32 %1, double* %4, i32 1)
%76 = sitofp i32 %75 to double
%77 = getelementptr inbounds double, double* %4, i64 %72
%78 = load double, double* %77
%79 = fsub double %78, %76
%80 = add nsw i32 %71, -1
%81 = trunc i64 %72 to i32
%82 = mul i32 %81, %1
%83 = add i32 %80, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %0, i64 %84
%86 = load double, double* %85
%87 = fdiv double %79, %86
store double %87, double* %77
%88 = add nuw nsw i64 %70, 1
%89 = icmp eq i64 %88, %12
br i1 %89, label %90, label %69
90: ; preds = %69
%91 = icmp sgt i32 %2, 1
br i1 %91, label %92, label %122
92: ; preds = %90
%93 = zext i32 %2 to i64
%94 = sext i32 %1 to i64
%95 = zext i32 %2 to i64
%96 = getelementptr inbounds double, double* %0, i64 -1
br label %97
97: ; preds = %92, %119
%98 = phi i64 [ 1, %92 ], [ %120, %119 ]
%99 = sub nsw i64 %93, %98
%100 = add nsw i64 %99, -1
%101 = getelementptr inbounds double, double* %4, i64 %100
%102 = load double, double* %101
%103 = mul nsw i64 %99, %94
%104 = getelementptr inbounds double, double* %96, i64 %103
%105 = getelementptr inbounds double, double* %104, i64 %99
%106 = getelementptr inbounds double, double* %4, i64 %99
%107 = trunc i64 %98 to i32
%108 = tail call i32 (i32, double*, i32, double*, i32, ...) bitcast (i32 (...)* @sdot to i32 (i32, double*, i32, double*, i32, ...)*)(i32 %107, double* %105, i32 %1, double* %106, i32 1)
%109 = sitofp i32 %108 to double
%110 = fadd double %102, %109
store double %110, double* %101
%111 = getelementptr inbounds i32, i32* %3, i64 %100
%112 = load i32, i32* %111
%113 = trunc i64 %100 to i32
%114 = icmp eq i32 %112, %113
br i1 %114, label %119, label %115
115: ; preds = %97
%116 = sext i32 %112 to i64
%117 = getelementptr inbounds double, double* %4, i64 %116
%118 = load double, double* %117
store double %110, double* %117
store double %118, double* %101
br label %119
119: ; preds = %97, %115
%120 = add nuw nsw i64 %98, 1
%121 = icmp eq i64 %120, %95
br i1 %121, label %122, label %97
122: ; preds = %119, %49, %8, %43, %90
ret void
}