#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ blasDAXPY(int, double, double *, int, double *, int);
int /*<<< orphan*/ blasDSWAP(int, double *, int, double *, int);
double sqrt(double);
int linpackDCHDC(double a[], int lda, int p, double work[], int ipvt[]) {
  int info, j, jp, k, l, maxl, pl, pu;
  double maxdia, temp;
  pl = 1;
  pu = 0;
  info = p;
  for (k = 1; k <= p; k++) {
    maxdia = a[k - 1 + (k - 1) * lda];
    maxl = k;
    if (pl <= k && k < pu) {
      for (l = k + 1; l <= pu; l++) {
        if (maxdia < a[l - 1 + (l - 1) * lda]) {
          maxdia = a[l - 1 + (l - 1) * lda];
          maxl = l;
        }
      }
    }
    if (maxdia <= 0.0) {
      info = k - 1;
      return (info);
    }
    if (k != maxl) {
      blasDSWAP(k - 1, a + 0 + (k - 1) * lda, 1, a + 0 + (maxl - 1) * lda, 1);
      a[maxl - 1 + (maxl - 1) * lda] = a[k - 1 + (k - 1) * lda];
      a[k - 1 + (k - 1) * lda] = maxdia;
      jp = ipvt[maxl - 1];
      ipvt[maxl - 1] = ipvt[k - 1];
      ipvt[k - 1] = jp;
    }
    work[k - 1] = sqrt(a[k - 1 + (k - 1) * lda]);
    a[k - 1 + (k - 1) * lda] = work[k - 1];
    for (j = k + 1; j <= p; j++) {
      if (k != maxl) {
        if (j < maxl) {
          temp = a[k - 1 + (j - 1) * lda];
          a[k - 1 + (j - 1) * lda] = a[j - 1 + (maxl - 1) * lda];
          a[j - 1 + (maxl - 1) * lda] = temp;
        } else if (maxl < j) {
          temp = a[k - 1 + (j - 1) * lda];
          a[k - 1 + (j - 1) * lda] = a[maxl - 1 + (j - 1) * lda];
          a[maxl - 1 + (j - 1) * lda] = temp;
        }
      }
      a[k - 1 + (j - 1) * lda] = a[k - 1 + (j - 1) * lda] / work[k - 1];
      work[j - 1] = a[k - 1 + (j - 1) * lda];
      temp = -a[k - 1 + (j - 1) * lda];
      blasDAXPY(j - k, temp, work + k, 1, a + k + (j - 1) * lda, 1);
    }
  }
  return (info);
}


x86 assembly (clang, -O0):
<linpackDCHDC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     161e <linpackDCHDC+0x4ee>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     1235 <linpackDCHDC+0x105>
mov    -0x38(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1235 <linpackDCHDC+0x105>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     1230 <linpackDCHDC+0x100>
movsd  -0x50(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x3c(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    121d <linpackDCHDC+0xed>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x3c(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1222 <linpackDCHDC+0xf2>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11bb <linpackDCHDC+0x8b>
jmp    1235 <linpackDCHDC+0x105>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jb     1257 <linpackDCHDC+0x127>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1624 <linpackDCHDC+0x4f4>
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
je     134a <linpackDCHDC+0x21a>
mov    -0x38(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rcx
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    $0x1,%r8d
mov    %r8d,%edx
call   1030 <blasDSWAP@plt>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x40(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%edx
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1050 <sqrt@plt>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     160b <linpackDCHDC+0x4db>
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
je     14fb <linpackDCHDC+0x3cb>
mov    -0x30(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1463 <linpackDCHDC+0x333>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x40(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x40(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14f6 <linpackDCHDC+0x3c6>
mov    -0x40(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    14f1 <linpackDCHDC+0x3c1>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14f6 <linpackDCHDC+0x3c6>
jmp    14fb <linpackDCHDC+0x3cb>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%edx
sub    $0x1,%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%edi
sub    -0x38(%rbp),%edi
movsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rcx
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    $0x1,%r8d
mov    %r8d,%edx
call   1040 <blasDAXPY@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13b8 <linpackDCHDC+0x288>
jmp    1610 <linpackDCHDC+0x4e0>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1165 <linpackDCHDC+0x35>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linpackDCHDC>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edx,%eax
test   %edx,%edx
jle    12e9 <linpackDCHDC+0x1c9>
mov    %rcx,%rbp
mov    %rdi,%r14
movslq %esi,%rcx
lea    0x1(%rax),%edx
mov    %rdx,0x38(%rsp)
mov    %eax,%edx
mov    %rdx,0x30(%rsp)
shl    $0x3,%rcx
lea    0x8(%rdi),%rdx
mov    %rdx,0x8(%rsp)
lea    -0x8(%rbp),%rdx
mov    %rdx,0x28(%rsp)
mov    %rax,0x20(%rsp)
lea    -0x1(%rax),%edx
movl   $0x2,(%rsp)
mov    $0x1,%r13d
xorpd  %xmm1,%xmm1
movapd 0xe79(%rip),%xmm2
mov    %rbp,0x18(%rsp)
mov    %esi,0x4(%rsp)
mov    %rcx,0x10(%rsp)
mov    %rdi,0x40(%rsp)
jmp    11cb <linpackDCHDC+0xab>
nopl   0x0(%rax)
addl   $0x1,(%rsp)
addq   $0x8,0x8(%rsp)
add    $0xffffffffffffffff,%rdx
mov    0x48(%rsp),%r13
cmp    0x38(%rsp),%r13
mov    0x4(%rsp),%esi
mov    0x40(%rsp),%r14
xorpd  %xmm1,%xmm1
je     12db <linpackDCHDC+0x1bb>
lea    -0x1(%r13),%eax
imul   %esi,%eax
cltq
lea    (%rax,%r13,1),%rbx
add    $0xffffffffffffffff,%rbx
movsd  (%r14,%rbx,8),%xmm0
ucomisd %xmm0,%xmm1
jae    12e2 <linpackDCHDC+0x1c2>
ucomisd %xmm1,%xmm0
jb     1200 <linpackDCHDC+0xe0>
sqrtsd %xmm0,%xmm0
jmp    121d <linpackDCHDC+0xfd>
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rbp
call   1040 <sqrt@plt>
movapd 0xdf0(%rip),%xmm2
mov    %rbp,%rdx
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%rbp
movsd  %xmm0,-0x8(%rbp,%r13,8)
movsd  %xmm0,(%r14,%rbx,8)
lea    0x1(%r13),%rax
mov    %rax,0x48(%rsp)
cmp    0x30(%rsp),%r13
jae    11a0 <linpackDCHDC+0x80>
movslq (%rsp),%rax
lea    -0x1(%rax),%r14
imul   %rcx,%r14
mov    0x28(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0x50(%rsp)
lea    0x0(,%r13,8),%r15
add    %rbp,%r15
mov    0x8(%rsp),%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%r12,%r14,1),%rcx
movsd  -0x8(%r12,%r14,1),%xmm0
divsd  -0x8(%rbp,%r13,8),%xmm0
movsd  %xmm0,-0x8(%r12,%r14,1)
mov    0x50(%rsp),%rax
movsd  %xmm0,(%rax,%rbx,8)
movsd  -0x8(%r12,%r14,1),%xmm0
xorpd  %xmm2,%xmm0
add    $0x1,%rbx
mov    %ebx,%edi
mov    %r15,%rsi
mov    %rdx,%rbp
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <blasDAXPY@plt>
movapd 0xd3e(%rip),%xmm2
mov    %rbp,%rdx
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%rbp
add    %rcx,%r12
cmp    %ebx,%edx
jne    1270 <linpackDCHDC+0x150>
jmp    11a0 <linpackDCHDC+0x80>
mov    0x20(%rsp),%rax
jmp    12e9 <linpackDCHDC+0x1c9>
add    $0xffffffffffffffff,%r13
mov    %r13d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @linpackDCHDC(double* %0, i32 %1, i32 %2, double* %3, i32* nocapture readnone %4) {
%6 = icmp slt i32 %2, 1
br i1 %6, label %57, label %7
7: ; preds = %5
%8 = sext i32 %1 to i64
%9 = add nuw i32 %2, 1
%10 = zext i32 %2 to i64
%11 = zext i32 %9 to i64
br label %15
12: ; preds = %36, %28
%13 = add nuw i32 %17, 1
%14 = icmp eq i64 %31, %11
br i1 %14, label %57, label %15
15: ; preds = %7, %12
%16 = phi i64 [ 1, %7 ], [ %31, %12 ]
%17 = phi i32 [ 2, %7 ], [ %13, %12 ]
%18 = trunc i64 %16 to i32
%19 = sext i32 %17 to i64
%20 = add nsw i64 %16, -1
%21 = add nsw i32 %18, -1
%22 = mul nsw i32 %21, %1
%23 = sext i32 %22 to i64
%24 = add nsw i64 %20, %23
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = load double, double* %25
%27 = fcmp ugt double %26, 0.000000e+00
br i1 %27, label %28, label %55
28: ; preds = %15
%29 = tail call double @sqrt(double %26)
%30 = getelementptr inbounds double, double* %3, i64 %20
store double %29, double* %30
store double %29, double* %25
%31 = add nuw nsw i64 %16, 1
%32 = icmp ult i64 %16, %10
br i1 %32, label %33, label %12
33: ; preds = %28
%34 = getelementptr inbounds double, double* %3, i64 %16
%35 = getelementptr inbounds double, double* %0, i64 %16
br label %36
36: ; preds = %33, %36
%37 = phi i64 [ %19, %33 ], [ %52, %36 ]
%38 = add nsw i64 %37, -1
%39 = mul nsw i64 %38, %8
%40 = add nsw i64 %39, %20
%41 = getelementptr inbounds double, double* %0, i64 %40
%42 = load double, double* %41
%43 = load double, double* %30
%44 = fdiv double %42, %43
store double %44, double* %41
%45 = getelementptr inbounds double, double* %3, i64 %38
store double %44, double* %45
%46 = load double, double* %41
%47 = fneg double %46
%48 = sub nuw nsw i64 %37, %16
%49 = getelementptr inbounds double, double* %35, i64 %39
%50 = trunc i64 %48 to i32
%51 = tail call i32 @blasDAXPY(i32 %50, double %47, double* %34, i32 1, double* %49, i32 1)
%52 = add nsw i64 %37, 1
%53 = trunc i64 %52 to i32
%54 = icmp eq i32 %9, %53
br i1 %54, label %12, label %36
55: ; preds = %15
%56 = trunc i64 %20 to i32
br label %57
57: ; preds = %12, %55, %5
%58 = phi i32 [ %2, %5 ], [ %56, %55 ], [ %2, %12 ]
ret i32 %58
}