void c_sgbsl(double *abd, int lda, int n, int ml, int mu, int *ipvt, double *b,
             int job) {
  register int k, kb, l, la, lb, lm, m, nm1;
  double t;
  m = mu + ml + 1;
  nm1 = n - 1;
  if (job == 0) {
    if (ml != 0) {
      for (k = 1; k <= nm1; k++) {
        lm = ({
          const int _i = (int)(ml);
          const int _j = (int)(n - k);
          _i < _j ? _i : _j;
        });
        l = ipvt[k - 1];
        t = b[l - 1];
        if (l != k) {
          b[l - 1] = b[k - 1];
          b[k - 1] = t;
        }
        c_saxpy(lm, t, &abd[m + 1 - 1 + (k - 1) * lda], &b[k + 1 - 1]);
      }
    }
    for (kb = 1; kb <= n; kb++) {
      k = n + 1 - kb;
      b[k - 1] /= abd[m - 1 + (k - 1) * lda];
      lm = ({
             const int _i = (int)(k);
             const int _j = (int)(m);
             _i < _j ? _i : _j;
           }) -
           1;
      la = m - lm;
      lb = k - lm;
      t = -b[k - 1];
      c_saxpy(lm, t, &abd[la - 1 + (k - 1) * lda], &b[lb - 1]);
    }
  } else {
    for (k = 1; k <= n; k++) {
      lm = ({
             const int _i = (int)(k);
             const int _j = (int)(m);
             _i < _j ? _i : _j;
           }) -
           1;
      la = m - lm;
      lb = k - lm;
      t = c_sdot(lm, &abd[la - 1 + (k - 1) * lda], &b[lb - 1]);
      b[k - 1] = (b[k - 1] - t) / abd[m - 1 + (k - 1) * lda];
    }
    if (ml != 0) {
      for (kb = 1; kb <= nm1; kb++) {
        k = n - kb;
        lm = ({
          const int _i = (int)(ml);
          const int _j = (int)(n - k);
          _i < _j ? _i : _j;
        });
        b[k - 1] += c_sdot(lm, &abd[m + 1 - 1 + (k - 1) * lda], &b[k + 1 - 1]);
        l = ipvt[k - 1];
        if (l != k) {
          t = b[l - 1];
          b[l - 1] = b[k - 1];
          b[k - 1] = t;
        }
      }
    }
  }
  return;
}


x86 assembly (clang, -O0):
<c_sgbsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,0x18(%rbp)
jne    13aa <c_sgbsl+0x28a>
cmpl   $0x0,-0x14(%rbp)
je     1286 <c_sgbsl+0x166>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x40(%rbp),%eax
jg     1281 <c_sgbsl+0x161>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    11a9 <c_sgbsl+0x89>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
jmp    11af <c_sgbsl+0x8f>
mov    -0x50(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     122c <c_sgbsl+0x10c>
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%edi
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rsi
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
sub    $0x1,%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    0x10(%rbp),%rdx
mov    -0x24(%rbp),%eax
add    $0x1,%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x1,%al
call   1040 <c_saxpy@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1177 <c_sgbsl+0x57>
jmp    1286 <c_sgbsl+0x166>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     13a5 <c_sgbsl+0x285>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1301 <c_sgbsl+0x1e1>
mov    -0x58(%rbp),%eax
mov    %eax,-0x80(%rbp)
jmp    1307 <c_sgbsl+0x1e7>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    0x10(%rbp),%rax
mov    -0x24(%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,-0x48(%rbp)
mov    -0x38(%rbp),%edi
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rsi
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    0x10(%rbp),%rdx
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x1,%al
call   1040 <c_saxpy@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    128d <c_sgbsl+0x16d>
jmp    15fc <c_sgbsl+0x4dc>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     14aa <c_sgbsl+0x38a>
mov    -0x24(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    13e3 <c_sgbsl+0x2c3>
mov    -0x64(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    13ec <c_sgbsl+0x2cc>
mov    -0x68(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    0x10(%rbp),%rdx
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x0,%al
call   1030 <c_sdot@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13b1 <c_sgbsl+0x291>
cmpl   $0x0,-0x14(%rbp)
je     15f7 <c_sgbsl+0x4d7>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x40(%rbp),%eax
jg     15f2 <c_sgbsl+0x4d2>
mov    -0x10(%rbp),%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    14f9 <c_sgbsl+0x3d9>
mov    -0x70(%rbp),%eax
mov    %eax,-0x88(%rbp)
jmp    1502 <c_sgbsl+0x3e2>
mov    -0x74(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
sub    $0x1,%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    0x10(%rbp),%rdx
mov    -0x24(%rbp),%eax
add    $0x1,%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x0,%al
call   1030 <c_sdot@plt>
cvtsi2sd %eax,%xmm0
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     15df <c_sgbsl+0x4bf>
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15e4 <c_sgbsl+0x4c4>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    14bb <c_sgbsl+0x39b>
jmp    15f7 <c_sgbsl+0x4d7>
jmp    15fc <c_sgbsl+0x4dc>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sgbsl>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %ecx,%eax
mov    0x80(%rsp),%r14
lea    (%r8,%rax,1),%r15d
add    $0x1,%r15d
add    %ecx,%r8d
cmpl   $0x0,0x88(%rsp)
mov    %rdi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rax,0x28(%rsp)
je     12d2 <c_sgbsl+0x1b2>
test   %edx,%edx
jle    147c <c_sgbsl+0x35c>
mov    %r9,0x20(%rsp)
movslq %esi,%rsi
movslq %r8d,%rax
movslq %r15d,%rbx
lea    0x1(%rdx),%ecx
mov    %rcx,(%rsp)
lea    (%rdi,%rax,8),%rax
mov    %rax,0x18(%rsp)
mov    $0x1,%r13d
mov    %r14,%r12
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rbx,%r13
mov    %r15d,%eax
cmovl  %r13d,%eax
lea    -0x1(%rax),%edi
mov    %ebx,%ecx
sub    %eax,%ecx
movslq %ecx,%rcx
add    %r14,%rcx
mov    0x8(%rsp),%rdx
mov    %rsi,%rbp
lea    (%rdx,%rcx,8),%rsi
mov    %r13d,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
lea    (%r12,%rax,8),%rdx
xor    %eax,%eax
call   1030 <c_sdot@plt>
mov    %rbp,%rsi
mov    0x8(%rsp),%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  -0x8(%r12,%r13,8),%xmm1
subsd  %xmm0,%xmm1
mov    0x18(%rsp),%rax
divsd  (%rax,%r14,8),%xmm1
movsd  %xmm1,-0x8(%r12,%r13,8)
add    $0x1,%r13
add    %rbp,%r14
cmp    %r13,(%rsp)
jne    11a0 <c_sgbsl+0x80>
mov    0x28(%rsp),%rdx
test   %edx,%edx
mov    0x10(%rsp),%rax
je     147c <c_sgbsl+0x35c>
cmp    $0x2,%eax
jl     147c <c_sgbsl+0x35c>
mov    %r12,%r14
mov    %eax,%ebp
movslq %edx,%rax
mov    %rax,(%rsp)
lea    -0x2(%rbp),%rax
imul   %rsi,%rax
add    %rbx,%rax
lea    (%rcx,%rax,8),%r12
shl    $0x3,%rsi
neg    %rsi
lea    -0x8(,%rbp,8),%rbx
ff
add    $0xffffffffffffffff,%rbp
mov    $0x1,%r15d
jmp    127d <c_sgbsl+0x15d>
add    $0x1,%r15
mov    %r13,%rsi
add    %r13,%r12
add    $0xfffffffffffffff8,%rbx
add    $0xffffffffffffffff,%rbp
mov    0x28(%rsp),%rdx
je     147c <c_sgbsl+0x35c>
mov    %rsi,%r13
cmp    (%rsp),%r15
mov    %r15d,%edi
cmovg  %edx,%edi
lea    (%r14,%rbx,1),%rdx
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <c_sdot@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  -0x8(%r14,%rbp,8),%xmm0
movsd  %xmm0,-0x8(%r14,%rbp,8)
mov    0x20(%rsp),%rax
movslq -0x4(%rax,%rbp,4),%rax
cmp    %eax,%ebp
je     1260 <c_sgbsl+0x140>
movsd  -0x8(%r14,%rax,8),%xmm1
movsd  %xmm0,-0x8(%r14,%rax,8)
movsd  %xmm1,-0x8(%r14,%rbp,8)
jmp    1260 <c_sgbsl+0x140>
mov    %r8,0x30(%rsp)
mov    %esi,(%rsp)
mov    %r9,0x20(%rsp)
test   %eax,%eax
je     1395 <c_sgbsl+0x275>
cmpl   $0x2,0x10(%rsp)
jl     1395 <c_sgbsl+0x275>
movslq (%rsp),%rsi
movslq %r15d,%rdx
mov    0x10(%rsp),%ebx
movslq %eax,%rcx
mov    %rcx,0x38(%rsp)
mov    0x8(%rsp),%rcx
lea    (%rcx,%rdx,8),%rbp
shl    $0x3,%rsi
mov    %rsi,0x18(%rsp)
mov    $0x1,%r12d
mov    $0x8,%r13d
mov    %rbx,0x40(%rsp)
jmp    1357 <c_sgbsl+0x237>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
lea    (%r14,%r13,1),%rdx
mov    %rbp,%rsi
mov    $0x1,%al
call   1040 <c_saxpy@plt>
add    0x18(%rsp),%rbp
add    $0x8,%r13
cmp    %r12,0x40(%rsp)
mov    0x28(%rsp),%rax
je     1395 <c_sgbsl+0x275>
add    $0xffffffffffffffff,%rbx
cmp    0x38(%rsp),%rbx
mov    %ebx,%edi
cmovg  %eax,%edi
mov    0x20(%rsp),%rax
mov    -0x4(%rax,%r12,4),%ecx
movslq %ecx,%rax
movsd  -0x8(%r14,%rax,8),%xmm0
cmp    %rcx,%r12
je     1330 <c_sgbsl+0x210>
movsd  -0x8(%r14,%r12,8),%xmm1
movsd  %xmm1,-0x8(%r14,%rax,8)
movsd  %xmm0,-0x8(%r14,%r12,8)
jmp    1330 <c_sgbsl+0x210>
mov    0x10(%rsp),%rdx
test   %edx,%edx
mov    0x8(%rsp),%rsi
mov    (%rsp),%ecx
mov    0x30(%rsp),%rdi
jle    147c <c_sgbsl+0x35c>
lea    0x1(%rdx),%eax
lea    -0x1(%rdx),%ebp
mov    %rbp,0x28(%rsp)
imul   %ebp,%ecx
mov    %edi,%ebp
add    %ecx,%ebp
lea    (%rcx,%rdi,1),%r12d
add    $0x1,%r12d
mov    %edx,%ecx
mov    %rcx,0x20(%rsp)
mov    $0x1,%ecx
sub    %rax,%rcx
mov    %rcx,0x18(%rsp)
xor    %r13d,%r13d
mov    %edx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %r15d,%ebx
mov    %r15d,%eax
cmovl  %ebx,%eax
mov    %edx,%ecx
sub    %eax,%ecx
mov    %r12d,%edx
sub    %eax,%edx
mov    0x28(%rsp),%rax
add    %r13d,%eax
movslq %ebp,%rbp
cltq
movsd  (%r14,%rax,8),%xmm0
divsd  (%rsi,%rbp,8),%xmm0
mov    0x20(%rsp),%rsi
lea    (%rsi,%r13,1),%edi
cmp    %r15d,%edi
cmovge %r15d,%edi
movsd  %xmm0,(%r14,%rax,8)
add    $0xffffffff,%edi
xorpd  0xbc5(%rip),%xmm0
movslq %edx,%rax
mov    0x8(%rsp),%rdx
lea    (%rdx,%rax,8),%rsi
add    %r13d,%ecx
movslq %ecx,%rax
lea    (%r14,%rax,8),%rdx
mov    $0x1,%al
call   1040 <c_saxpy@plt>
mov    (%rsp),%eax
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%rsi
add    $0xffffffff,%ebx
add    $0xffffffffffffffff,%r13
sub    %eax,%r12d
sub    %eax,%ebp
cmp    %r13,0x18(%rsp)
jne    13f0 <c_sgbsl+0x2d0>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @c_sgbsl(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5, double* %6, i32 %7) {
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca double
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
store double* %0, double** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32* %5, i32** %14
store double* %6, double** %15
store i32 %7, i32* %16
%38 = load i32, i32* %13
%39 = load i32, i32* %12
%40 = add nsw i32 %38, %39
%41 = add nsw i32 %40, 1
store i32 %41, i32* %23
%42 = load i32, i32* %11
%43 = sub nsw i32 %42, 1
store i32 %43, i32* %24
%44 = load i32, i32* %16
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %203
46: ; preds = %8
%47 = load i32, i32* %12
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %127
49: ; preds = %46
store i32 1, i32* %17
br label %50
50: ; preds = %123, %49
%51 = load i32, i32* %17
%52 = load i32, i32* %24
%53 = icmp sle i32 %51, %52
br i1 %53, label %54, label %126
54: ; preds = %50
%55 = load i32, i32* %12
store i32 %55, i32* %26
%56 = load i32, i32* %11
%57 = load i32, i32* %17
%58 = sub nsw i32 %56, %57
store i32 %58, i32* %27
%59 = load i32, i32* %26
%60 = load i32, i32* %27
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %64
62: ; preds = %54
%63 = load i32, i32* %26
br label %66
64: ; preds = %54
%65 = load i32, i32* %27
br label %66
66: ; preds = %64, %62
%67 = phi i32 [ %63, %62 ], [ %65, %64 ]
store i32 %67, i32* %28
%68 = load i32, i32* %28
store i32 %68, i32* %22
%69 = load i32*, i32** %14
%70 = load i32, i32* %17
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %69, i64 %72
%74 = load i32, i32* %73
store i32 %74, i32* %19
%75 = load double*, double** %15
%76 = load i32, i32* %19
%77 = sub nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %75, i64 %78
%80 = load double, double* %79
store double %80, double* %25
%81 = load i32, i32* %19
%82 = load i32, i32* %17
%83 = icmp ne i32 %81, %82
br i1 %83, label %84, label %102
84: ; preds = %66
%85 = load double*, double** %15
%86 = load i32, i32* %17
%87 = sub nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %85, i64 %88
%90 = load double, double* %89
%91 = load double*, double** %15
%92 = load i32, i32* %19
%93 = sub nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %91, i64 %94
store double %90, double* %95
%96 = load double, double* %25
%97 = load double*, double** %15
%98 = load i32, i32* %17
%99 = sub nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %97, i64 %100
store double %96, double* %101
br label %102
102: ; preds = %84, %66
%103 = load i32, i32* %22
%104 = load double, double* %25
%105 = load double*, double** %9
%106 = load i32, i32* %23
%107 = add nsw i32 %106, 1
%108 = sub nsw i32 %107, 1
%109 = load i32, i32* %17
%110 = sub nsw i32 %109, 1
%111 = load i32, i32* %10
%112 = mul nsw i32 %110, %111
%113 = add nsw i32 %108, %112
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %105, i64 %114
%116 = load double*, double** %15
%117 = load i32, i32* %17
%118 = add nsw i32 %117, 1
%119 = sub nsw i32 %118, 1
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %116, i64 %120
%122 = call i32 (i32, double, double*, double*, ...) bitcast (i32 (...)* @c_saxpy to i32 (i32, double, double*, double*, ...)*)(i32 %103, double %104, double* %115, double* %121)
br label %123
123: ; preds = %102
%124 = load i32, i32* %17
%125 = add nsw i32 %124, 1
store i32 %125, i32* %17
br label %50
126: ; preds = %50
br label %127
127: ; preds = %126, %46
store i32 1, i32* %18
br label %128
128: ; preds = %199, %127
%129 = load i32, i32* %18
%130 = load i32, i32* %11
%131 = icmp sle i32 %129, %130
br i1 %131, label %132, label %202
132: ; preds = %128
%133 = load i32, i32* %11
%134 = add nsw i32 %133, 1
%135 = load i32, i32* %18
%136 = sub nsw i32 %134, %135
store i32 %136, i32* %17
%137 = load double*, double** %9
%138 = load i32, i32* %23
%139 = sub nsw i32 %138, 1
%140 = load i32, i32* %17
%141 = sub nsw i32 %140, 1
%142 = load i32, i32* %10
%143 = mul nsw i32 %141, %142
%144 = add nsw i32 %139, %143
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %137, i64 %145
%147 = load double, double* %146
%148 = load double*, double** %15
%149 = load i32, i32* %17
%150 = sub nsw i32 %149, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %148, i64 %151
%153 = load double, double* %152
%154 = fdiv double %153, %147
store double %154, double* %152
%155 = load i32, i32* %17
store i32 %155, i32* %29
%156 = load i32, i32* %23
store i32 %156, i32* %30
%157 = load i32, i32* %29
%158 = load i32, i32* %30
%159 = icmp slt i32 %157, %158
br i1 %159, label %160, label %162
160: ; preds = %132
%161 = load i32, i32* %29
br label %164
162: ; preds = %132
%163 = load i32, i32* %30
br label %164
164: ; preds = %162, %160
%165 = phi i32 [ %161, %160 ], [ %163, %162 ]
store i32 %165, i32* %31
%166 = load i32, i32* %31
%167 = sub nsw i32 %166, 1
store i32 %167, i32* %22
%168 = load i32, i32* %23
%169 = load i32, i32* %22
%170 = sub nsw i32 %168, %169
store i32 %170, i32* %20
%171 = load i32, i32* %17
%172 = load i32, i32* %22
%173 = sub nsw i32 %171, %172
store i32 %173, i32* %21
%174 = load double*, double** %15
%175 = load i32, i32* %17
%176 = sub nsw i32 %175, 1
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %174, i64 %177
%179 = load double, double* %178
%180 = fneg double %179
store double %180, double* %25
%181 = load i32, i32* %22
%182 = load double, double* %25
%183 = load double*, double** %9
%184 = load i32, i32* %20
%185 = sub nsw i32 %184, 1
%186 = load i32, i32* %17
%187 = sub nsw i32 %186, 1
%188 = load i32, i32* %10
%189 = mul nsw i32 %187, %188
%190 = add nsw i32 %185, %189
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds double, double* %183, i64 %191
%193 = load double*, double** %15
%194 = load i32, i32* %21
%195 = sub nsw i32 %194, 1
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %193, i64 %196
%198 = call i32 (i32, double, double*, double*, ...) bitcast (i32 (...)* @c_saxpy to i32 (i32, double, double*, double*, ...)*)(i32 %181, double %182, double* %192, double* %197)
br label %199
199: ; preds = %164
%200 = load i32, i32* %18
%201 = add nsw i32 %200, 1
store i32 %201, i32* %18
br label %128
202: ; preds = %128
br label %366
203: ; preds = %8
store i32 1, i32* %17
br label %204
204: ; preds = %271, %203
%205 = load i32, i32* %17
%206 = load i32, i32* %11
%207 = icmp sle i32 %205, %206
br i1 %207, label %208, label %274
208: ; preds = %204
%209 = load i32, i32* %17
store i32 %209, i32* %32
%210 = load i32, i32* %23
store i32 %210, i32* %33
%211 = load i32, i32* %32
%212 = load i32, i32* %33
%213 = icmp slt i32 %211, %212
br i1 %213, label %214, label %216
214: ; preds = %208
%215 = load i32, i32* %32
br label %218
216: ; preds = %208
%217 = load i32, i32* %33
br label %218
218: ; preds = %216, %214
%219 = phi i32 [ %215, %214 ], [ %217, %216 ]
store i32 %219, i32* %34
%220 = load i32, i32* %34
%221 = sub nsw i32 %220, 1
store i32 %221, i32* %22
%222 = load i32, i32* %23
%223 = load i32, i32* %22
%224 = sub nsw i32 %222, %223
store i32 %224, i32* %20
%225 = load i32, i32* %17
%226 = load i32, i32* %22
%227 = sub nsw i32 %225, %226
store i32 %227, i32* %21
%228 = load i32, i32* %22
%229 = load double*, double** %9
%230 = load i32, i32* %20
%231 = sub nsw i32 %230, 1
%232 = load i32, i32* %17
%233 = sub nsw i32 %232, 1
%234 = load i32, i32* %10
%235 = mul nsw i32 %233, %234
%236 = add nsw i32 %231, %235
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds double, double* %229, i64 %237
%239 = load double*, double** %15
%240 = load i32, i32* %21
%241 = sub nsw i32 %240, 1
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %239, i64 %242
%244 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @c_sdot to i32 (i32, double*, double*, ...)*)(i32 %228, double* %238, double* %243)
%245 = sitofp i32 %244 to double
store double %245, double* %25
%246 = load double*, double** %15
%247 = load i32, i32* %17
%248 = sub nsw i32 %247, 1
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds double, double* %246, i64 %249
%251 = load double, double* %250
%252 = load double, double* %25
%253 = fsub double %251, %252
%254 = load double*, double** %9
%255 = load i32, i32* %23
%256 = sub nsw i32 %255, 1
%257 = load i32, i32* %17
%258 = sub nsw i32 %257, 1
%259 = load i32, i32* %10
%260 = mul nsw i32 %258, %259
%261 = add nsw i32 %256, %260
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds double, double* %254, i64 %262
%264 = load double, double* %263
%265 = fdiv double %253, %264
%266 = load double*, double** %15
%267 = load i32, i32* %17
%268 = sub nsw i32 %267, 1
%269 = sext i32 %268 to i64
%270 = getelementptr inbounds double, double* %266, i64 %269
store double %265, double* %270
br label %271
271: ; preds = %218
%272 = load i32, i32* %17
%273 = add nsw i32 %272, 1
store i32 %273, i32* %17
br label %204
274: ; preds = %204
%275 = load i32, i32* %12
%276 = icmp ne i32 %275, 0
br i1 %276, label %277, label %365
277: ; preds = %274
store i32 1, i32* %18
br label %278
278: ; preds = %361, %277
%279 = load i32, i32* %18
%280 = load i32, i32* %24
%281 = icmp sle i32 %279, %280
br i1 %281, label %282, label %364
282: ; preds = %278
%283 = load i32, i32* %11
%284 = load i32, i32* %18
%285 = sub nsw i32 %283, %284
store i32 %285, i32* %17
%286 = load i32, i32* %12
store i32 %286, i32* %35
%287 = load i32, i32* %11
%288 = load i32, i32* %17
%289 = sub nsw i32 %287, %288
store i32 %289, i32* %36
%290 = load i32, i32* %35
%291 = load i32, i32* %36
%292 = icmp slt i32 %290, %291
br i1 %292, label %293, label %295
293: ; preds = %282
%294 = load i32, i32* %35
br label %297
295: ; preds = %282
%296 = load i32, i32* %36
br label %297
297: ; preds = %295, %293
%298 = phi i32 [ %294, %293 ], [ %296, %295 ]
store i32 %298, i32* %37
%299 = load i32, i32* %37
store i32 %299, i32* %22
%300 = load i32, i32* %22
%301 = load double*, double** %9
%302 = load i32, i32* %23
%303 = add nsw i32 %302, 1
%304 = sub nsw i32 %303, 1
%305 = load i32, i32* %17
%306 = sub nsw i32 %305, 1
%307 = load i32, i32* %10
%308 = mul nsw i32 %306, %307
%309 = add nsw i32 %304, %308
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds double, double* %301, i64 %310
%312 = load double*, double** %15
%313 = load i32, i32* %17
%314 = add nsw i32 %313, 1
%315 = sub nsw i32 %314, 1
%316 = sext i32 %315 to i64
%317 = getelementptr inbounds double, double* %312, i64 %316
%318 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @c_sdot to i32 (i32, double*, double*, ...)*)(i32 %300, double* %311, double* %317)
%319 = sitofp i32 %318 to double
%320 = load double*, double** %15
%321 = load i32, i32* %17
%322 = sub nsw i32 %321, 1
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds double, double* %320, i64 %323
%325 = load double, double* %324
%326 = fadd double %325, %319
store double %326, double* %324
%327 = load i32*, i32** %14
%328 = load i32, i32* %17
%329 = sub nsw i32 %328, 1
%330 = sext i32 %329 to i64
%331 = getelementptr inbounds i32, i32* %327, i64 %330
%332 = load i32, i32* %331
store i32 %332, i32* %19
%333 = load i32, i32* %19
%334 = load i32, i32* %17
%335 = icmp ne i32 %333, %334
br i1 %335, label %336, label %360
336: ; preds = %297
%337 = load double*, double** %15
%338 = load i32, i32* %19
%339 = sub nsw i32 %338, 1
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double, double* %337, i64 %340
%342 = load double, double* %341
store double %342, double* %25
%343 = load double*, double** %15
%344 = load i32, i32* %17
%345 = sub nsw i32 %344, 1
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds double, double* %343, i64 %346
%348 = load double, double* %347
%349 = load double*, double** %15
%350 = load i32, i32* %19
%351 = sub nsw i32 %350, 1
%352 = sext i32 %351 to i64
%353 = getelementptr inbounds double, double* %349, i64 %352
store double %348, double* %353
%354 = load double, double* %25
%355 = load double*, double** %15
%356 = load i32, i32* %17
%357 = sub nsw i32 %356, 1
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds double, double* %355, i64 %358
store double %354, double* %359
br label %360
360: ; preds = %336, %297
br label %361
361: ; preds = %360
%362 = load i32, i32* %18
%363 = add nsw i32 %362, 1
store i32 %363, i32* %18
br label %278
364: ; preds = %278
br label %365
365: ; preds = %364, %274
br label %366
366: ; preds = %365, %202
ret void
}

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