; LLVM IR from sympiler/nasoq :: src/QP/qp_utils.ll (ZN5nasoq19constraint_sat_normEPNS_12sympiler_CSCES1_PdS2_S2_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.nasoq::sympiler_CSC" = type { i64, i64, i64, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN5nasoq19constraint_sat_normEPNS_12sympiler_CSCES1_PdS2_S2_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #5 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %17, i32 0, i32 0
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %20, i32 0, i32 0
  %22 = load i64, ptr %21, align 8, !tbaa !11
  %23 = add i64 %19, %22
  %24 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %23, i64 8)
  %25 = extractvalue { i64, i1 } %24, 1
  %26 = extractvalue { i64, i1 } %24, 0
  %27 = select i1 %25, i64 -1, i64 %26
  %28 = call noalias noundef nonnull ptr @_Znam(i64 noundef %27) #9
  call void @llvm.memset.p0.i64(ptr align 8 %28, i8 0, i64 %27, i1 false)
  store ptr %28, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %29, i32 0, i32 0
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = trunc i64 %31 to i32
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %33, i32 0, i32 1
  %35 = load i64, ptr %34, align 8, !tbaa !15
  %36 = trunc i64 %35 to i32
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %40, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %43, i32 0, i32 6
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = call noundef i32 @_ZN5nasoq14spmv_csc_smallEiiPiS0_PdS1_S1_(i32 noundef %32, i32 noundef %36, ptr noundef %39, ptr noundef %42, ptr noundef %45, ptr noundef %46, ptr noundef %47)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !19
  br label %49

49:                                               ; preds = %80, %5
  %50 = load i32, ptr %13, align 4, !tbaa !19
  %51 = sext i32 %50 to i64
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %52, i32 0, i32 0
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = icmp ult i64 %51, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %83

57:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load i32, ptr %13, align 4, !tbaa !19
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = load i32, ptr %13, align 4, !tbaa !19
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds double, ptr %63, i64 %65
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = fsub double %62, %67
  store double %68, ptr %14, align 8, !tbaa !9
  %69 = load double, ptr %14, align 8, !tbaa !9
  %70 = fcmp olt double %69, 0.000000e+00
  br i1 %70, label %71, label %72

71:                                               ; preds = %57
  br label %74

72:                                               ; preds = %57
  %73 = load double, ptr %14, align 8, !tbaa !9
  br label %74

74:                                               ; preds = %72, %71
  %75 = phi double [ 0.000000e+00, %71 ], [ %73, %72 ]
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = load i32, ptr %13, align 4, !tbaa !19
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds double, ptr %76, i64 %78
  store double %75, ptr %79, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %80

80:                                               ; preds = %74
  %81 = load i32, ptr %13, align 4, !tbaa !19
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %13, align 4, !tbaa !19
  br label %49, !llvm.loop !20

83:                                               ; preds = %56
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = trunc i64 %86 to i32
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = call noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef %87, i32 noundef 1, ptr noundef %88, i32 noundef 0)
  store double %89, ptr %11, align 8, !tbaa !9
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %90, i32 0, i32 0
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = icmp ugt i64 %92, 0
  br i1 %93, label %94, label %151

94:                                               ; preds = %83
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %95, i32 0, i32 0
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = trunc i64 %97 to i32
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %99, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !15
  %102 = trunc i64 %101 to i32
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %103, i32 0, i32 3
  %105 = load ptr, ptr %104, align 8, !tbaa !16
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %106, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !17
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %109, i32 0, i32 6
  %111 = load ptr, ptr %110, align 8, !tbaa !18
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = call noundef i32 @_ZN5nasoq14spmv_csc_smallEiiPiS0_PdS1_S1_(i32 noundef %98, i32 noundef %102, ptr noundef %105, ptr noundef %108, ptr noundef %111, ptr noundef %112, ptr noundef %113)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !19
  br label %115

115:                                              ; preds = %139, %94
  %116 = load i32, ptr %15, align 4, !tbaa !19
  %117 = sext i32 %116 to i64
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %118, i32 0, i32 0
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = icmp ult i64 %117, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %142

123:                                              ; preds = %115
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  %125 = load i32, ptr %15, align 4, !tbaa !19
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds double, ptr %124, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load i32, ptr %15, align 4, !tbaa !19
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = fsub double %128, %133
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  %136 = load i32, ptr %15, align 4, !tbaa !19
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds double, ptr %135, i64 %137
  store double %134, ptr %138, align 8, !tbaa !9
  br label %139

139:                                              ; preds = %123
  %140 = load i32, ptr %15, align 4, !tbaa !19
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %15, align 4, !tbaa !19
  br label %115, !llvm.loop !22

142:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.nasoq::sympiler_CSC", ptr %143, i32 0, i32 0
  %145 = load i64, ptr %144, align 8, !tbaa !11
  %146 = trunc i64 %145 to i32
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  %148 = call noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef %146, i32 noundef 1, ptr noundef %147, i32 noundef 0)
  store double %148, ptr %16, align 8, !tbaa !9
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %150 = load double, ptr %149, align 8, !tbaa !9
  store double %150, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %151

151:                                              ; preds = %142, %83
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = icmp eq ptr %152, null
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  call void @_ZdaPv(ptr noundef %152) #10
  br label %155

155:                                              ; preds = %154, %151
  %156 = load double, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret double %156
}

declare noundef i32 @_ZN5nasoq14spmv_csc_smallEiiPiS0_PdS1_S1_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #6

declare noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef, i32 noundef, ptr noundef, i32 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN5nasoq12sympiler_CSCE", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !14, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !14, i64 84}
!13 = !{!"long", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !13, i64 8}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !6, i64 32}
!18 = !{!12, !6, i64 48}
!19 = !{!14, !14, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN5nasoq19constraint_sat_normEPNS_12sympiler_CSCES1_PdS2_S2_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr noundef %4) local_unnamed_addr #4 {
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %8 = load i64, ptr %0, align 8, !tbaa !5
  %9 = load i64, ptr %1, align 8, !tbaa !5
  %10 = add i64 %9, %8
  %11 = icmp ugt i64 %10, 2305843009213693951
  %12 = shl i64 %10, 3
  %13 = select i1 %11, i64 -1, i64 %12
  %14 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #8
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %14, i8 0, i64 %13, i1 false)
  %15 = trunc i64 %8 to i32
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i64, ptr %16, align 8, !tbaa !12
  %18 = trunc i64 %17 to i32
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %0, i64 48
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = tail call noundef i32 @_ZN5nasoq14spmv_csc_smallEiiPiS0_PdS1_S1_(i32 noundef %15, i32 noundef %18, ptr noundef %20, ptr noundef %22, ptr noundef %24, ptr noundef %4, ptr noundef nonnull %14)
  %26 = load i64, ptr %0, align 8, !tbaa !5
  %.not53 = icmp eq i64 %26, 0
  br i1 %.not53, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %5
  %min.iters.check = icmp ult i64 %26, 4
  br i1 %min.iters.check, label %.lr.ph.preheader79, label %vector.ph

.lr.ph.preheader79:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %26, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %27 = getelementptr inbounds double, ptr %14, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <2 x double>, ptr %27, align 8, !tbaa !16
  %wide.load60 = load <2 x double>, ptr %28, align 8, !tbaa !16
  %29 = getelementptr inbounds double, ptr %2, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load61 = load <2 x double>, ptr %29, align 8, !tbaa !16
  %wide.load62 = load <2 x double>, ptr %30, align 8, !tbaa !16
  %31 = fsub <2 x double> %wide.load, %wide.load61
  %32 = fsub <2 x double> %wide.load60, %wide.load62
  %33 = fcmp olt <2 x double> %31, zeroinitializer
  %34 = fcmp olt <2 x double> %32, zeroinitializer
  %35 = select <2 x i1> %33, <2 x double> zeroinitializer, <2 x double> %31
  %36 = select <2 x i1> %34, <2 x double> zeroinitializer, <2 x double> %32
  store <2 x double> %35, ptr %27, align 8, !tbaa !16
  store <2 x double> %36, ptr %28, align 8, !tbaa !16
  %index.next = add nuw i64 %index, 4
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader79

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %5
  %38 = trunc i64 %26 to i32
  %39 = tail call noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef %38, i32 noundef 1, ptr noundef nonnull %14, i32 noundef 0)
  store double %39, ptr %6, align 8, !tbaa !16
  %40 = load i64, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %40, 0
  br i1 %.not, label %77, label %48

.lr.ph:                                           ; preds = %.lr.ph.preheader79, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader79 ]
  %41 = getelementptr inbounds double, ptr %14, i64 %indvars.iv
  %42 = load double, ptr %41, align 8, !tbaa !16
  %43 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  %44 = load double, ptr %43, align 8, !tbaa !16
  %45 = fsub double %42, %44
  %46 = fcmp olt double %45, 0.000000e+00
  %47 = select i1 %46, double 0.000000e+00, double %45
  store double %47, ptr %41, align 8, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %26
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

48:                                               ; preds = %._crit_edge
  %49 = trunc i64 %40 to i32
  %50 = getelementptr inbounds i8, ptr %1, i64 8
  %51 = load i64, ptr %50, align 8, !tbaa !12
  %52 = trunc i64 %51 to i32
  %53 = getelementptr inbounds i8, ptr %1, i64 24
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  %55 = getelementptr inbounds i8, ptr %1, i64 32
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %1, i64 48
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = tail call noundef i32 @_ZN5nasoq14spmv_csc_smallEiiPiS0_PdS1_S1_(i32 noundef %49, i32 noundef %52, ptr noundef %54, ptr noundef %56, ptr noundef %58, ptr noundef %4, ptr noundef nonnull %14)
  %60 = load i64, ptr %1, align 8, !tbaa !5
  %.not54 = icmp eq i64 %60, 0
  br i1 %.not54, label %._crit_edge51, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %48
  %min.iters.check65 = icmp ult i64 %60, 4
  br i1 %min.iters.check65, label %.lr.ph50.preheader78, label %vector.ph66

.lr.ph50.preheader78:                             ; preds = %middle.block63, %.lr.ph50.preheader
  %indvars.iv56.ph = phi i64 [ 0, %.lr.ph50.preheader ], [ %n.vec68, %middle.block63 ]
  br label %.lr.ph50

vector.ph66:                                      ; preds = %.lr.ph50.preheader
  %n.vec68 = and i64 %60, -4
  br label %vector.body70

vector.body70:                                    ; preds = %vector.body70, %vector.ph66
  %index71 = phi i64 [ 0, %vector.ph66 ], [ %index.next76, %vector.body70 ]
  %61 = getelementptr inbounds double, ptr %14, i64 %index71
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load72 = load <2 x double>, ptr %61, align 8, !tbaa !16
  %wide.load73 = load <2 x double>, ptr %62, align 8, !tbaa !16
  %63 = getelementptr inbounds double, ptr %3, i64 %index71
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load74 = load <2 x double>, ptr %63, align 8, !tbaa !16
  %wide.load75 = load <2 x double>, ptr %64, align 8, !tbaa !16
  %65 = fsub <2 x double> %wide.load72, %wide.load74
  %66 = fsub <2 x double> %wide.load73, %wide.load75
  store <2 x double> %65, ptr %61, align 8, !tbaa !16
  store <2 x double> %66, ptr %62, align 8, !tbaa !16
  %index.next76 = add nuw i64 %index71, 4
  %67 = icmp eq i64 %index.next76, %n.vec68
  br i1 %67, label %middle.block63, label %vector.body70, !llvm.loop !23

middle.block63:                                   ; preds = %vector.body70
  %cmp.n77 = icmp eq i64 %60, %n.vec68
  br i1 %cmp.n77, label %._crit_edge51, label %.lr.ph50.preheader78

._crit_edge51:                                    ; preds = %.lr.ph50, %middle.block63, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %68 = trunc i64 %60 to i32
  %69 = tail call noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef %68, i32 noundef 1, ptr noundef nonnull %14, i32 noundef 0)
  store double %69, ptr %7, align 8, !tbaa !16
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %71 = load double, ptr %70, align 8, !tbaa !16
  store double %71, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %77

.lr.ph50:                                         ; preds = %.lr.ph50.preheader78, %.lr.ph50
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph50 ], [ %indvars.iv56.ph, %.lr.ph50.preheader78 ]
  %72 = getelementptr inbounds double, ptr %14, i64 %indvars.iv56
  %73 = load double, ptr %72, align 8, !tbaa !16
  %74 = getelementptr inbounds double, ptr %3, i64 %indvars.iv56
  %75 = load double, ptr %74, align 8, !tbaa !16
  %76 = fsub double %73, %75
  store double %76, ptr %72, align 8, !tbaa !16
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next57, %60
  br i1 %exitcond59.not, label %._crit_edge51, label %.lr.ph50, !llvm.loop !24

77:                                               ; preds = %._crit_edge, %._crit_edge51
  call void @_ZdaPv(ptr noundef nonnull %14) #9
  %78 = load double, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret double %78
}

declare noundef i32 @_ZN5nasoq14spmv_csc_smallEiiPiS0_PdS1_S1_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN5nasoq12sympiler_CSCE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !10, i64 24}
!14 = !{!6, !10, i64 32}
!15 = !{!6, !10, i64 48}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = distinct !{!18, !19, !20, !21}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !19, !21, !20}
!23 = distinct !{!23, !19, !20, !21}
!24 = distinct !{!24, !19, !21, !20}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass