double *shrink(double *A, double tau, int nrows, int ncols) {
  int i;
  int info = 0;
  char JOBU = 'A';
  char JOBVT = 'A';
  int LWORK = fmax(fmax(1, 3 * fmin(nrows, ncols) + fmax(nrows, ncols)),
                   5 * fmin(nrows, ncols));
  double *WORK = alloc_array(1, LWORK);
  double *U = alloc_array(nrows, nrows);
  double *VT = alloc_array(ncols, ncols);
  double *S = alloc_array(fmin(nrows, ncols), fmin(nrows, ncols));
  dgesvd_(&JOBU, &JOBVT, &nrows, &ncols, A, &nrows, S, U, &nrows, VT, &ncols,
          WORK, &LWORK, &info);
  for (i = 0; i < fmin(nrows, ncols); i++) {
    S[i] = fmax(0.0, S[i] - tau);
  }
  double *C = alloc_array_z(nrows, ncols);
  C = mm(mm(VT, ncols, ncols, 'n', diag(S, ncols, nrows), ncols, nrows, 'n'),
         ncols, nrows, 'n', U, nrows, nrows, 'n');
  free_array(WORK);
  free_array(U);
  free_array(VT);
  free_array(S);
  return C;
}


x86 assembly (clang, -O0):
<shrink>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rdi,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
mov    %esi,-0x3c(%rbp)
mov    %edx,-0x40(%rbp)
movl   $0x0,-0x48(%rbp)
movb   $0x41,-0x49(%rbp)
movb   $0x41,-0x4a(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm2
cvtsi2sdl -0x40(%rbp),%xmm1
movaps %xmm1,%xmm4
movaps %xmm2,%xmm3
cmpunordsd %xmm3,%xmm3
movaps %xmm3,%xmm0
pand   %xmm4,%xmm0
minsd  %xmm2,%xmm1
pandn  %xmm1,%xmm3
por    %xmm0,%xmm3
cvtsi2sdl -0x3c(%rbp),%xmm4
cvtsi2sdl -0x40(%rbp),%xmm2
movaps %xmm2,%xmm5
movaps %xmm4,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm5,%xmm1
maxsd  %xmm4,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  0xe26(%rip),%xmm1
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
movsd  0xe0e(%rip),%xmm0
maxsd  %xmm0,%xmm3
cvtsi2sdl -0x3c(%rbp),%xmm4
cvtsi2sdl -0x40(%rbp),%xmm2
movaps %xmm2,%xmm5
movaps %xmm4,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm5,%xmm1
minsd  %xmm4,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  0xdd2(%rip),%xmm2
mulsd  %xmm0,%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <alloc_array@plt>
cltq
mov    %rax,-0x58(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    $0x0,%al
call   1030 <alloc_array@plt>
cltq
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    $0x0,%al
call   1030 <alloc_array@plt>
cltq
mov    %rax,-0x68(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm3
cvtsi2sdl -0x40(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm4
cvtsi2sdl -0x40(%rbp),%xmm3
movaps %xmm3,%xmm5
movaps %xmm4,%xmm1
cmpunordsd %xmm1,%xmm1
movaps %xmm1,%xmm2
pand   %xmm5,%xmm2
minsd  %xmm4,%xmm3
pandn  %xmm3,%xmm1
por    %xmm2,%xmm1
mov    $0x2,%al
call   1030 <alloc_array@plt>
cltq
mov    %rax,-0x70(%rbp)
mov    -0x30(%rbp),%r8
mov    -0x70(%rbp),%r13
mov    -0x60(%rbp),%r12
mov    -0x68(%rbp),%r14
mov    -0x58(%rbp),%r11
lea    -0x49(%rbp),%rdi
lea    -0x4a(%rbp),%rsi
lea    -0x3c(%rbp),%r15
lea    -0x40(%rbp),%rbx
lea    -0x50(%rbp),%r10
lea    -0x48(%rbp),%rax
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r15,%r9
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
mov    $0x0,%al
call   1070 <dgesvd_@plt>
movl   $0x0,-0x44(%rbp)
cvtsi2sdl -0x44(%rbp),%xmm1
cvtsi2sdl -0x3c(%rbp),%xmm4
cvtsi2sdl -0x40(%rbp),%xmm3
movaps %xmm3,%xmm5
movaps %xmm4,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm2
pand   %xmm5,%xmm2
minsd  %xmm4,%xmm3
pandn  %xmm3,%xmm0
por    %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    13c4 <shrink+0x264>
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
maxsd  %xmm1,%xmm0
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1359 <shrink+0x1f9>
mov    -0x3c(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    $0x0,%al
call   1060 <alloc_array_z@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    $0x0,%al
call   1050 <diag@plt>
mov    -0x88(%rbp),%rdi
mov    -0x80(%rbp),%esi
mov    -0x7c(%rbp),%edx
mov    %eax,%r8d
mov    -0x40(%rbp),%r9d
mov    -0x3c(%rbp),%eax
mov    $0x6e,%ecx
mov    %eax,(%rsp)
movl   $0x6e,0x8(%rsp)
mov    $0x0,%al
call   1080 <mm@plt>
mov    %eax,%edi
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x60(%rbp),%r8
mov    -0x3c(%rbp),%r9d
mov    -0x3c(%rbp),%eax
mov    $0x6e,%ecx
mov    %eax,(%rsp)
movl   $0x6e,0x8(%rsp)
mov    $0x0,%al
call   1080 <mm@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0x0,%al
call   1040 <free_array@plt>
mov    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1040 <free_array@plt>
mov    -0x68(%rbp),%rdi
mov    $0x0,%al
call   1040 <free_array@plt>
mov    -0x70(%rbp),%rdi
mov    $0x0,%al
call   1040 <free_array@plt>
mov    -0x78(%rbp),%rax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrink>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
movsd  %xmm0,0x20(%rsp)
mov    %rdi,%r13
mov    %esi,0xc(%rsp)
mov    %edx,0x8(%rsp)
movl   $0x0,0x14(%rsp)
movb   $0x41,0x7(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
movb   $0x41,0x6(%rsp)
cvtsi2sd %edx,%xmm1
movapd %xmm0,%xmm2
minsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%rsp)
maxsd  %xmm1,%xmm0
movsd  0xe46(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
maxsd  0xe3e(%rip),%xmm1
movsd  0xe3e(%rip),%xmm0
mulsd  %xmm2,%xmm0
maxsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    %esi,0x10(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <alloc_array@plt>
movslq %eax,%r14
mov    %ebp,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <alloc_array@plt>
movslq %eax,%r15
mov    %ebx,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <alloc_array@plt>
movslq %eax,%r12
movsd  0x18(%rsp),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <alloc_array@plt>
movslq %eax,%rbx
lea    0x14(%rsp),%rbp
lea    0x10(%rsp),%r10
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%rdx
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
mov    %r13,%r8
mov    %rdx,%r9
mov    $0x0,%eax
push   %rbp
push   %r10
push   %r14
push   %rcx
push   %r12
push   %rdx
push   %r15
push   %rbx
call   1070 <dgesvd_@plt>
movsd  0x60(%rsp),%xmm3
add    $0x40,%rsp
mov    0xc(%rsp),%edi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mov    0x8(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
minsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12b3 <shrink+0x153>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm2
subsd  %xmm3,%xmm2
maxsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%rax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
ucomisd %xmm2,%xmm0
ja     1290 <shrink+0x130>
xor    %eax,%eax
call   1060 <alloc_array_z@plt>
mov    0x8(%rsp),%ebp
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <diag@plt>
mov    0x8(%rsp),%r9d
mov    0xc(%rsp),%r10d
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    $0x6e,%ecx
mov    %eax,%r8d
xor    %eax,%eax
push   $0x6e
push   %r10
call   1080 <mm@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %eax,%edi
mov    $0x6e,%ecx
mov    %r15,%r8
mov    %edx,%r9d
xor    %eax,%eax
push   $0x6e
push   %rdx
call   1080 <mm@plt>
add    $0x10,%rsp
movslq %eax,%rbp
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <free_array@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <free_array@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <free_array@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <free_array@plt>
mov    %rbp,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double* @shrink(double* %0, double %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
store double* %0, double** %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %10
store i8 65, i8* %11
store i8 65, i8* %12
%19 = load i32, i32* %7
%20 = sitofp i32 %19 to double
%21 = load i32, i32* %8
%22 = sitofp i32 %21 to double
%23 = call double @llvm.minnum.f64(double %20, double %22)
%24 = load i32, i32* %7
%25 = sitofp i32 %24 to double
%26 = load i32, i32* %8
%27 = sitofp i32 %26 to double
%28 = call double @llvm.maxnum.f64(double %25, double %27)
%29 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %23, double %28)
%30 = call double @llvm.maxnum.f64(double 1.000000e+00, double %29)
%31 = load i32, i32* %7
%32 = sitofp i32 %31 to double
%33 = load i32, i32* %8
%34 = sitofp i32 %33 to double
%35 = call double @llvm.minnum.f64(double %32, double %34)
%36 = fmul double 5.000000e+00, %35
%37 = call double @llvm.maxnum.f64(double %30, double %36)
%38 = fptosi double %37 to i32
store i32 %38, i32* %13
%39 = load i32, i32* %13
%40 = call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array to i32 (i32, i32, ...)*)(i32 1, i32 %39)
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to double*
store double* %42, double** %14
%43 = load i32, i32* %7
%44 = load i32, i32* %7
%45 = call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array to i32 (i32, i32, ...)*)(i32 %43, i32 %44)
%46 = sext i32 %45 to i64
%47 = inttoptr i64 %46 to double*
store double* %47, double** %15
%48 = load i32, i32* %8
%49 = load i32, i32* %8
%50 = call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array to i32 (i32, i32, ...)*)(i32 %48, i32 %49)
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to double*
store double* %52, double** %16
%53 = load i32, i32* %7
%54 = sitofp i32 %53 to double
%55 = load i32, i32* %8
%56 = sitofp i32 %55 to double
%57 = call double @llvm.minnum.f64(double %54, double %56)
%58 = load i32, i32* %7
%59 = sitofp i32 %58 to double
%60 = load i32, i32* %8
%61 = sitofp i32 %60 to double
%62 = call double @llvm.minnum.f64(double %59, double %61)
%63 = call i32 (double, double, ...) bitcast (i32 (...)* @alloc_array to i32 (double, double, ...)*)(double %57, double %62)
%64 = sext i32 %63 to i64
%65 = inttoptr i64 %64 to double*
store double* %65, double** %17
%66 = load double*, double** %5
%67 = load double*, double** %17
%68 = load double*, double** %15
%69 = load double*, double** %16
%70 = load double*, double** %14
%71 = call i32 (i8*, i8*, i32*, i32*, double*, i32*, double*, double*, i32*, double*, i32*, double*, i32*, i32*, ...) bitcast (i32 (...)* @dgesvd_ to i32 (i8*, i8*, i32*, i32*, double*, i32*, double*, double*, i32*, double*, i32*, double*, i32*, i32*, ...)*)(i8* %11, i8* %12, i32* %7, i32* %8, double* %66, i32* %7, double* %67, double* %68, i32* %7, double* %69, i32* %8, double* %70, i32* %13, i32* %10)
store i32 0, i32* %9
br label %72
72: ; preds = %94, %4
%73 = load i32, i32* %9
%74 = sitofp i32 %73 to double
%75 = load i32, i32* %7
%76 = sitofp i32 %75 to double
%77 = load i32, i32* %8
%78 = sitofp i32 %77 to double
%79 = call double @llvm.minnum.f64(double %76, double %78)
%80 = fcmp olt double %74, %79
br i1 %80, label %81, label %97
81: ; preds = %72
%82 = load double*, double** %17
%83 = load i32, i32* %9
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
%86 = load double, double* %85
%87 = load double, double* %6
%88 = fsub double %86, %87
%89 = call double @llvm.maxnum.f64(double 0.000000e+00, double %88)
%90 = load double*, double** %17
%91 = load i32, i32* %9
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %90, i64 %92
store double %89, double* %93
br label %94
94: ; preds = %81
%95 = load i32, i32* %9
%96 = add nsw i32 %95, 1
store i32 %96, i32* %9
br label %72
97: ; preds = %72
%98 = load i32, i32* %7
%99 = load i32, i32* %8
%100 = call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array_z to i32 (i32, i32, ...)*)(i32 %98, i32 %99)
%101 = sext i32 %100 to i64
%102 = inttoptr i64 %101 to double*
store double* %102, double** %18
%103 = load double*, double** %16
%104 = load i32, i32* %8
%105 = load i32, i32* %8
%106 = load double*, double** %17
%107 = load i32, i32* %8
%108 = load i32, i32* %7
%109 = call i32 (double*, i32, i32, ...) bitcast (i32 (...)* @diag to i32 (double*, i32, i32, ...)*)(double* %106, i32 %107, i32 %108)
%110 = load i32, i32* %8
%111 = load i32, i32* %7
%112 = call i32 (double*, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mm to i32 (double*, i32, i32, i32, i32, i32, i32, i32, ...)*)(double* %103, i32 %104, i32 %105, i32 110, i32 %109, i32 %110, i32 %111, i32 110)
%113 = load i32, i32* %8
%114 = load i32, i32* %7
%115 = load double*, double** %15
%116 = load i32, i32* %7
%117 = load i32, i32* %7
%118 = call i32 (i32, i32, i32, i32, double*, i32, i32, i32, ...) bitcast (i32 (...)* @mm to i32 (i32, i32, i32, i32, double*, i32, i32, i32, ...)*)(i32 %112, i32 %113, i32 %114, i32 110, double* %115, i32 %116, i32 %117, i32 110)
%119 = sext i32 %118 to i64
%120 = inttoptr i64 %119 to double*
store double* %120, double** %18
%121 = load double*, double** %14
%122 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %121)
%123 = load double*, double** %15
%124 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %123)
%125 = load double*, double** %16
%126 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %125)
%127 = load double*, double** %17
%128 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %127)
%129 = load double*, double** %18
ret double* %129
}

LLVM IR (-O2):
define double* @shrink(double* %0, double %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
store i32 %2, i32* %5
store i32 %3, i32* %6
%11 = bitcast i32* %7 to i8*
store i32 0, i32* %7
store i8 65, i8* %8
store i8 65, i8* %9
%12 = bitcast i32* %10 to i8*
%13 = sitofp i32 %2 to double
%14 = sitofp i32 %3 to double
%15 = tail call double @llvm.minnum.f64(double %13, double %14)
%16 = tail call double @llvm.maxnum.f64(double %13, double %14)
%17 = tail call double @llvm.fmuladd.f64(double %15, double 3.000000e+00, double %16)
%18 = tail call double @llvm.maxnum.f64(double %17, double 1.000000e+00)
%19 = fmul double %15, 5.000000e+00
%20 = tail call double @llvm.maxnum.f64(double %18, double %19)
%21 = fptosi double %20 to i32
store i32 %21, i32* %10
%22 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array to i32 (i32, i32, ...)*)(i32 1, i32 %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to double*
%25 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array to i32 (i32, i32, ...)*)(i32 %2, i32 %2)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to double*
%28 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array to i32 (i32, i32, ...)*)(i32 %3, i32 %3)
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to double*
%31 = tail call i32 (double, double, ...) bitcast (i32 (...)* @alloc_array to i32 (double, double, ...)*)(double %15, double %15)
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to double*
%34 = call i32 (i8*, i8*, i32*, i32*, double*, i32*, double*, double*, i32*, double*, i32*, double*, i32*, i32*, ...) bitcast (i32 (...)* @dgesvd_ to i32 (i8*, i8*, i32*, i32*, double*, i32*, double*, double*, i32*, double*, i32*, double*, i32*, i32*, ...)*)(i8* %8, i8* %9, i32* %5, i32* %6, double* %0, i32* %5, double* %33, double* %27, i32* %5, double* %30, i32* %6, double* %24, i32* %10, i32* %7)
%35 = load i32, i32* %5
%36 = sitofp i32 %35 to double
%37 = load i32, i32* %6
%38 = sitofp i32 %37 to double
%39 = call double @llvm.minnum.f64(double %36, double %38)
%40 = fcmp ogt double %39, 0.000000e+00
br i1 %40, label %41, label %51
41: ; preds = %4, %41
%42 = phi i64 [ %47, %41 ], [ 0, %4 ]
%43 = getelementptr inbounds double, double* %33, i64 %42
%44 = load double, double* %43
%45 = fsub double %44, %1
%46 = call double @llvm.maxnum.f64(double %45, double 0.000000e+00)
store double %46, double* %43
%47 = add nuw i64 %42, 1
%48 = trunc i64 %47 to i32
%49 = sitofp i32 %48 to double
%50 = fcmp ogt double %39, %49
br i1 %50, label %41, label %51
51: ; preds = %41, %4
%52 = call i32 (i32, i32, ...) bitcast (i32 (...)* @alloc_array_z to i32 (i32, i32, ...)*)(i32 %35, i32 %37)
%53 = load i32, i32* %6
%54 = load i32, i32* %5
%55 = call i32 (double*, i32, i32, ...) bitcast (i32 (...)* @diag to i32 (double*, i32, i32, ...)*)(double* %33, i32 %53, i32 %54)
%56 = load i32, i32* %6
%57 = load i32, i32* %5
%58 = call i32 (double*, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mm to i32 (double*, i32, i32, i32, i32, i32, i32, i32, ...)*)(double* %30, i32 %53, i32 %53, i32 110, i32 %55, i32 %56, i32 %57, i32 110)
%59 = load i32, i32* %6
%60 = load i32, i32* %5
%61 = call i32 (i32, i32, i32, i32, double*, i32, i32, i32, ...) bitcast (i32 (...)* @mm to i32 (i32, i32, i32, i32, double*, i32, i32, i32, ...)*)(i32 %58, i32 %59, i32 %60, i32 110, double* %27, i32 %60, i32 %60, i32 110)
%62 = sext i32 %61 to i64
%63 = inttoptr i64 %62 to double*
%64 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %24)
%65 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %27)
%66 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %30)
%67 = call i32 (double*, ...) bitcast (i32 (...)* @free_array to i32 (double*, ...)*)(double* %33)
ret double* %63
}