; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Grid.ll (ZN6R2Grid24ConnectedComponentFilterEdddddd)

; 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"

%class.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6R2Grid19ConnectedComponentsEdiPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(208), double noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid24ConnectedComponentFilterEdddddd(ptr noundef nonnull align 8 dereferenceable(208) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6) #4 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store double %1, ptr %9, align 8, !tbaa !9
  store double %2, ptr %10, align 8, !tbaa !9
  store double %3, ptr %11, align 8, !tbaa !9
  store double %4, ptr %12, align 8, !tbaa !9
  store double %5, ptr %13, align 8, !tbaa !9
  store double %6, ptr %14, align 8, !tbaa !9
  %26 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %27 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %29, i64 4)
  %31 = extractvalue { i64, i1 } %30, 1
  %32 = extractvalue { i64, i1 } %30, 0
  %33 = select i1 %31, i64 -1, i64 %32
  %34 = call noalias noundef nonnull ptr @_Znam(i64 noundef %33) #6
  store ptr %34, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %35 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %37, i64 4)
  %39 = extractvalue { i64, i1 } %38, 1
  %40 = extractvalue { i64, i1 } %38, 0
  %41 = select i1 %39, i64 -1, i64 %40
  %42 = call noalias noundef nonnull ptr @_Znam(i64 noundef %41) #6
  store ptr %42, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %43 = load double, ptr %9, align 8, !tbaa !9
  %44 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = load ptr, ptr %16, align 8, !tbaa !5
  %48 = call noundef i32 @_ZN6R2Grid19ConnectedComponentsEdiPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(208) %26, double noundef %43, i32 noundef %45, ptr noundef null, ptr noundef %46, ptr noundef %47)
  store i32 %48, ptr %17, align 4, !tbaa !17
  %49 = load double, ptr %12, align 8, !tbaa !9
  %50 = fcmp une double %49, -9.870000e+02
  br i1 %50, label %51, label %88

51:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !17
  br label %52

52:                                               ; preds = %84, %51
  %53 = load i32, ptr %18, align 4, !tbaa !17
  %54 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %87

58:                                               ; preds = %52
  %59 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !18
  %61 = load i32, ptr %18, align 4, !tbaa !17
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !9
  %65 = fcmp oeq double %64, -3.210000e+02
  br i1 %65, label %66, label %67

66:                                               ; preds = %58
  br label %84

67:                                               ; preds = %58
  %68 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = load i32, ptr %18, align 4, !tbaa !17
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %69, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = load double, ptr %9, align 8, !tbaa !9
  %75 = fcmp olt double %73, %74
  br i1 %75, label %76, label %83

76:                                               ; preds = %67
  %77 = load double, ptr %12, align 8, !tbaa !9
  %78 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = load i32, ptr %18, align 4, !tbaa !17
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  store double %77, ptr %82, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %76, %67
  br label %84

84:                                               ; preds = %83, %66
  %85 = load i32, ptr %18, align 4, !tbaa !17
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %18, align 4, !tbaa !17
  br label %52, !llvm.loop !19

87:                                               ; preds = %57
  br label %88

88:                                               ; preds = %87, %7
  %89 = load double, ptr %13, align 8, !tbaa !9
  %90 = fcmp une double %89, -9.870000e+02
  br i1 %90, label %91, label %139

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !17
  br label %92

92:                                               ; preds = %135, %91
  %93 = load i32, ptr %19, align 4, !tbaa !17
  %94 = load i32, ptr %17, align 4, !tbaa !17
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %138

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %98 = load ptr, ptr %15, align 8, !tbaa !5
  %99 = load i32, ptr %19, align 4, !tbaa !17
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !17
  store i32 %102, ptr %21, align 4, !tbaa !17
  %103 = load i32, ptr %21, align 4, !tbaa !17
  %104 = sitofp i32 %103 to double
  %105 = load double, ptr %10, align 8, !tbaa !9
  %106 = fcmp olt double %104, %105
  br i1 %106, label %107, label %134

107:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !17
  br label %108

108:                                              ; preds = %130, %107
  %109 = load i32, ptr %22, align 4, !tbaa !17
  %110 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %111 = load i32, ptr %110, align 4, !tbaa !11
  %112 = icmp slt i32 %109, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %108
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %133

114:                                              ; preds = %108
  %115 = load ptr, ptr %16, align 8, !tbaa !5
  %116 = load i32, ptr %22, align 4, !tbaa !17
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !17
  %120 = load i32, ptr %19, align 4, !tbaa !17
  %121 = icmp eq i32 %119, %120
  br i1 %121, label %122, label %129

122:                                              ; preds = %114
  %123 = load double, ptr %13, align 8, !tbaa !9
  %124 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %125 = load ptr, ptr %124, align 8, !tbaa !18
  %126 = load i32, ptr %22, align 4, !tbaa !17
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds double, ptr %125, i64 %127
  store double %123, ptr %128, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %122, %114
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %22, align 4, !tbaa !17
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %22, align 4, !tbaa !17
  br label %108, !llvm.loop !21

133:                                              ; preds = %113
  br label %134

134:                                              ; preds = %133, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %19, align 4, !tbaa !17
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %19, align 4, !tbaa !17
  br label %92, !llvm.loop !22

138:                                              ; preds = %96
  br label %139

139:                                              ; preds = %138, %88
  %140 = load double, ptr %14, align 8, !tbaa !9
  %141 = fcmp une double %140, -9.870000e+02
  br i1 %141, label %142, label %190

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !17
  br label %143

143:                                              ; preds = %186, %142
  %144 = load i32, ptr %23, align 4, !tbaa !17
  %145 = load i32, ptr %17, align 4, !tbaa !17
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 11, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %189

148:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = load i32, ptr %23, align 4, !tbaa !17
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %149, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !17
  store i32 %153, ptr %24, align 4, !tbaa !17
  %154 = load i32, ptr %24, align 4, !tbaa !17
  %155 = sitofp i32 %154 to double
  %156 = load double, ptr %11, align 8, !tbaa !9
  %157 = fcmp ogt double %155, %156
  br i1 %157, label %158, label %185

158:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !17
  br label %159

159:                                              ; preds = %181, %158
  %160 = load i32, ptr %25, align 4, !tbaa !17
  %161 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 6
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = icmp slt i32 %160, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %159
  store i32 14, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %184

165:                                              ; preds = %159
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  %167 = load i32, ptr %25, align 4, !tbaa !17
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr %166, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !17
  %171 = load i32, ptr %23, align 4, !tbaa !17
  %172 = icmp eq i32 %170, %171
  br i1 %172, label %173, label %180

173:                                              ; preds = %165
  %174 = load double, ptr %14, align 8, !tbaa !9
  %175 = getelementptr inbounds %class.R2Grid, ptr %26, i32 0, i32 3
  %176 = load ptr, ptr %175, align 8, !tbaa !18
  %177 = load i32, ptr %25, align 4, !tbaa !17
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  store double %174, ptr %179, align 8, !tbaa !9
  br label %180

180:                                              ; preds = %173, %165
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %25, align 4, !tbaa !17
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %25, align 4, !tbaa !17
  br label %159, !llvm.loop !23

184:                                              ; preds = %164
  br label %185

185:                                              ; preds = %184, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %23, align 4, !tbaa !17
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %23, align 4, !tbaa !17
  br label %143, !llvm.loop !24

189:                                              ; preds = %147
  br label %190

190:                                              ; preds = %189, %139
  %191 = load ptr, ptr %16, align 8, !tbaa !5
  %192 = icmp eq ptr %191, null
  br i1 %192, label %194, label %193

193:                                              ; preds = %190
  call void @_ZdaPv(ptr noundef %191) #7
  br label %194

194:                                              ; preds = %193, %190
  %195 = load ptr, ptr %15, align 8, !tbaa !5
  %196 = icmp eq ptr %195, null
  br i1 %196, label %198, label %197

197:                                              ; preds = %194
  call void @_ZdaPv(ptr noundef %195) #7
  br label %198

198:                                              ; preds = %197, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { 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, !16, i64 204}
!12 = !{!"_ZTS6R2Grid", !13, i64 0, !13, i64 88, !10, i64 176, !6, i64 184, !7, i64 192, !16, i64 200, !16, i64 204}
!13 = !{!"_ZTS8R2Affine", !14, i64 0, !15, i64 8, !16, i64 80}
!14 = !{!"_ZTS16R2Transformation"}
!15 = !{!"_ZTS8R3Matrix", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!12, !6, i64 184}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}


; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6R2Grid19ConnectedComponentsEdiPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(208), double noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid24ConnectedComponentFilterEdddddd(ptr noundef nonnull align 8 dereferenceable(208) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6) local_unnamed_addr #2 align 2 {
  %8 = getelementptr inbounds i8, ptr %0, i64 204
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = icmp slt i32 %9, 0
  %12 = shl nsw i64 %10, 2
  %13 = select i1 %11, i64 -1, i64 %12
  %14 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #3
  %15 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #3
  %16 = tail call noundef i32 @_ZN6R2Grid19ConnectedComponentsEdiPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(208) %0, double noundef %1, i32 noundef %9, ptr noundef null, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %17 = fcmp une double %4, -9.870000e+02
  br i1 %17, label %.preheader57, label %.loopexit58

.preheader57:                                     ; preds = %7
  %18 = load i32, ptr %8, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %.loopexit58

.lr.ph:                                           ; preds = %.preheader57
  %20 = getelementptr inbounds i8, ptr %0, i64 184
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  %wide.trip.count = zext nneg i32 %18 to i64
  %min.iters.check = icmp ult i32 %18, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %1, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue103, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue103 ]
  %22 = or disjoint i64 %index, 2
  %23 = getelementptr inbounds double, ptr %21, i64 %index
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %wide.load = load <2 x double>, ptr %23, align 8, !tbaa !16
  %wide.load97 = load <2 x double>, ptr %24, align 8, !tbaa !16
  %25 = fcmp une <2 x double> %wide.load, <double -3.210000e+02, double -3.210000e+02>
  %26 = fcmp une <2 x double> %wide.load97, <double -3.210000e+02, double -3.210000e+02>
  %27 = fcmp olt <2 x double> %wide.load, %broadcast.splat
  %28 = fcmp olt <2 x double> %wide.load97, %broadcast.splat
  %29 = and <2 x i1> %25, %27
  %30 = and <2 x i1> %26, %28
  %31 = extractelement <2 x i1> %29, i64 0
  br i1 %31, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %32 = getelementptr inbounds double, ptr %21, i64 %index
  store double %4, ptr %32, align 8, !tbaa !16
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %33 = extractelement <2 x i1> %29, i64 1
  br i1 %33, label %pred.store.if98, label %pred.store.continue99

pred.store.if98:                                  ; preds = %pred.store.continue
  %34 = or disjoint i64 %index, 1
  %35 = getelementptr inbounds double, ptr %21, i64 %34
  store double %4, ptr %35, align 8, !tbaa !16
  br label %pred.store.continue99

pred.store.continue99:                            ; preds = %pred.store.if98, %pred.store.continue
  %36 = extractelement <2 x i1> %30, i64 0
  br i1 %36, label %pred.store.if100, label %pred.store.continue101

pred.store.if100:                                 ; preds = %pred.store.continue99
  %37 = getelementptr inbounds double, ptr %21, i64 %22
  store double %4, ptr %37, align 8, !tbaa !16
  br label %pred.store.continue101

pred.store.continue101:                           ; preds = %pred.store.if100, %pred.store.continue99
  %38 = extractelement <2 x i1> %30, i64 1
  br i1 %38, label %pred.store.if102, label %pred.store.continue103

pred.store.if102:                                 ; preds = %pred.store.continue101
  %39 = or disjoint i64 %index, 3
  %40 = getelementptr inbounds double, ptr %21, i64 %39
  store double %4, ptr %40, align 8, !tbaa !16
  br label %pred.store.continue103

pred.store.continue103:                           ; preds = %pred.store.if102, %pred.store.continue101
  %index.next = add nuw i64 %index, 4
  %41 = icmp eq i64 %index.next, %n.vec
  br i1 %41, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %pred.store.continue103
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit58, label %scalar.ph.preheader

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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %47
  %indvars.iv = phi i64 [ %indvars.iv.next, %47 ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %42 = getelementptr inbounds double, ptr %21, i64 %indvars.iv
  %43 = load double, ptr %42, align 8, !tbaa !16
  %44 = fcmp une double %43, -3.210000e+02
  %45 = fcmp olt double %43, %1
  %or.cond = and i1 %44, %45
  br i1 %or.cond, label %46, label %47

46:                                               ; preds = %scalar.ph
  store double %4, ptr %42, align 8, !tbaa !16
  br label %47

47:                                               ; preds = %46, %scalar.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit58, label %scalar.ph, !llvm.loop !21

.loopexit58:                                      ; preds = %47, %middle.block, %.preheader57, %7
  %48 = fcmp une double %5, -9.870000e+02
  %49 = icmp sgt i32 %16, 0
  %or.cond71 = and i1 %48, %49
  br i1 %or.cond71, label %.lr.ph64, label %.loopexit56

.lr.ph64:                                         ; preds = %.loopexit58
  %50 = load i32, ptr %8, align 4
  %.fr73 = freeze i32 %50
  %51 = icmp sgt i32 %.fr73, 0
  %52 = getelementptr inbounds i8, ptr %0, i64 184
  br i1 %51, label %.lr.ph64.split.us.preheader, label %.loopexit56

.lr.ph64.split.us.preheader:                      ; preds = %.lr.ph64
  %wide.trip.count85 = zext nneg i32 %16 to i64
  %wide.trip.count80 = zext nneg i32 %.fr73 to i64
  %xtraiter = and i64 %wide.trip.count80, 1
  %53 = icmp eq i32 %.fr73, 1
  %unroll_iter = and i64 %wide.trip.count80, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph64.split.us

.lr.ph64.split.us:                                ; preds = %.lr.ph64.split.us.preheader, %..loopexit54_crit_edge.us
  %indvars.iv82 = phi i64 [ 0, %.lr.ph64.split.us.preheader ], [ %indvars.iv.next83, %..loopexit54_crit_edge.us ]
  %54 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv82
  %55 = load i32, ptr %54, align 4, !tbaa !22
  %56 = sitofp i32 %55 to double
  %57 = fcmp olt double %56, %2
  br i1 %57, label %.preheader53.us, label %..loopexit54_crit_edge.us

..loopexit54_crit_edge.us.loopexit.unr-lcssa:     ; preds = %77, %.preheader53.us
  %indvars.iv77.unr = phi i64 [ 0, %.preheader53.us ], [ %indvars.iv.next78.1, %77 ]
  br i1 %lcmp.mod.not, label %..loopexit54_crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %..loopexit54_crit_edge.us.loopexit.unr-lcssa
  %58 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv77.unr
  %59 = load i32, ptr %58, align 4, !tbaa !22
  %60 = zext i32 %59 to i64
  %61 = icmp eq i64 %indvars.iv82, %60
  br i1 %61, label %62, label %..loopexit54_crit_edge.us

62:                                               ; preds = %.epil.preheader
  %63 = getelementptr inbounds double, ptr %78, i64 %indvars.iv77.unr
  store double %5, ptr %63, align 8, !tbaa !16
  br label %..loopexit54_crit_edge.us

..loopexit54_crit_edge.us:                        ; preds = %..loopexit54_crit_edge.us.loopexit.unr-lcssa, %62, %.epil.preheader, %.lr.ph64.split.us
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
  br i1 %exitcond86.not, label %.loopexit56, label %.lr.ph64.split.us, !llvm.loop !23

.preheader53.us.new:                              ; preds = %.preheader53.us, %77
  %indvars.iv77 = phi i64 [ %indvars.iv.next78.1, %77 ], [ 0, %.preheader53.us ]
  %niter = phi i64 [ %niter.next.1, %77 ], [ 0, %.preheader53.us ]
  %64 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv77
  %65 = load i32, ptr %64, align 4, !tbaa !22
  %66 = zext i32 %65 to i64
  %67 = icmp eq i64 %indvars.iv82, %66
  br i1 %67, label %68, label %70

68:                                               ; preds = %.preheader53.us.new
  %69 = getelementptr inbounds double, ptr %78, i64 %indvars.iv77
  store double %5, ptr %69, align 8, !tbaa !16
  br label %70

70:                                               ; preds = %68, %.preheader53.us.new
  %indvars.iv.next78 = or disjoint i64 %indvars.iv77, 1
  %71 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next78
  %72 = load i32, ptr %71, align 4, !tbaa !22
  %73 = zext i32 %72 to i64
  %74 = icmp eq i64 %indvars.iv82, %73
  br i1 %74, label %75, label %77

75:                                               ; preds = %70
  %76 = getelementptr inbounds double, ptr %78, i64 %indvars.iv.next78
  store double %5, ptr %76, align 8, !tbaa !16
  br label %77

77:                                               ; preds = %75, %70
  %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %..loopexit54_crit_edge.us.loopexit.unr-lcssa, label %.preheader53.us.new, !llvm.loop !24

.preheader53.us:                                  ; preds = %.lr.ph64.split.us
  %78 = load ptr, ptr %52, align 8
  br i1 %53, label %..loopexit54_crit_edge.us.loopexit.unr-lcssa, label %.preheader53.us.new

.loopexit56:                                      ; preds = %..loopexit54_crit_edge.us, %.lr.ph64, %.loopexit58
  %79 = fcmp une double %6, -9.870000e+02
  %or.cond72 = and i1 %79, %49
  br i1 %or.cond72, label %.lr.ph69, label %.loopexit52

.lr.ph69:                                         ; preds = %.loopexit56
  %80 = load i32, ptr %8, align 4
  %.fr = freeze i32 %80
  %81 = icmp sgt i32 %.fr, 0
  %82 = getelementptr inbounds i8, ptr %0, i64 184
  br i1 %81, label %.lr.ph69.split.us.preheader, label %.loopexit52

.lr.ph69.split.us.preheader:                      ; preds = %.lr.ph69
  %wide.trip.count95 = zext nneg i32 %16 to i64
  %wide.trip.count90 = zext nneg i32 %.fr to i64
  %xtraiter105 = and i64 %wide.trip.count90, 1
  %83 = icmp eq i32 %.fr, 1
  %unroll_iter107 = and i64 %wide.trip.count90, 2147483646
  %lcmp.mod106.not = icmp eq i64 %xtraiter105, 0
  br label %.lr.ph69.split.us

.lr.ph69.split.us:                                ; preds = %.lr.ph69.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv92 = phi i64 [ 0, %.lr.ph69.split.us.preheader ], [ %indvars.iv.next93, %..loopexit_crit_edge.us ]
  %84 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv92
  %85 = load i32, ptr %84, align 4, !tbaa !22
  %86 = sitofp i32 %85 to double
  %87 = fcmp ogt double %86, %3
  br i1 %87, label %.preheader.us, label %..loopexit_crit_edge.us

..loopexit_crit_edge.us.loopexit.unr-lcssa:       ; preds = %107, %.preheader.us
  %indvars.iv87.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next88.1, %107 ]
  br i1 %lcmp.mod106.not, label %..loopexit_crit_edge.us, label %.epil.preheader104

.epil.preheader104:                               ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa
  %88 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv87.unr
  %89 = load i32, ptr %88, align 4, !tbaa !22
  %90 = zext i32 %89 to i64
  %91 = icmp eq i64 %indvars.iv92, %90
  br i1 %91, label %92, label %..loopexit_crit_edge.us

92:                                               ; preds = %.epil.preheader104
  %93 = getelementptr inbounds double, ptr %108, i64 %indvars.iv87.unr
  store double %6, ptr %93, align 8, !tbaa !16
  br label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa, %92, %.epil.preheader104, %.lr.ph69.split.us
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count95
  br i1 %exitcond96.not, label %.loopexit52, label %.lr.ph69.split.us, !llvm.loop !25

.preheader.us.new:                                ; preds = %.preheader.us, %107
  %indvars.iv87 = phi i64 [ %indvars.iv.next88.1, %107 ], [ 0, %.preheader.us ]
  %niter108 = phi i64 [ %niter108.next.1, %107 ], [ 0, %.preheader.us ]
  %94 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv87
  %95 = load i32, ptr %94, align 4, !tbaa !22
  %96 = zext i32 %95 to i64
  %97 = icmp eq i64 %indvars.iv92, %96
  br i1 %97, label %98, label %100

98:                                               ; preds = %.preheader.us.new
  %99 = getelementptr inbounds double, ptr %108, i64 %indvars.iv87
  store double %6, ptr %99, align 8, !tbaa !16
  br label %100

100:                                              ; preds = %98, %.preheader.us.new
  %indvars.iv.next88 = or disjoint i64 %indvars.iv87, 1
  %101 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next88
  %102 = load i32, ptr %101, align 4, !tbaa !22
  %103 = zext i32 %102 to i64
  %104 = icmp eq i64 %indvars.iv92, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %100
  %106 = getelementptr inbounds double, ptr %108, i64 %indvars.iv.next88
  store double %6, ptr %106, align 8, !tbaa !16
  br label %107

107:                                              ; preds = %105, %100
  %indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87, 2
  %niter108.next.1 = add i64 %niter108, 2
  %niter108.ncmp.1 = icmp eq i64 %niter108.next.1, %unroll_iter107
  br i1 %niter108.ncmp.1, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.preheader.us.new, !llvm.loop !26

.preheader.us:                                    ; preds = %.lr.ph69.split.us
  %108 = load ptr, ptr %82, align 8
  br i1 %83, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.preheader.us.new

.loopexit52:                                      ; preds = %..loopexit_crit_edge.us, %.lr.ph69, %.loopexit56
  tail call void @_ZdaPv(ptr noundef nonnull %15) #4
  tail call void @_ZdaPv(ptr noundef nonnull %14) #4
  ret void
}

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { builtin allocsize(0) }
attributes #4 = { 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, !12, i64 204}
!6 = !{!"_ZTS6R2Grid", !7, i64 0, !7, i64 88, !13, i64 176, !14, i64 184, !10, i64 192, !12, i64 200, !12, i64 204}
!7 = !{!"_ZTS8R2Affine", !8, i64 0, !9, i64 8, !12, i64 80}
!8 = !{!"_ZTS16R2Transformation"}
!9 = !{!"_ZTS8R3Matrix", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"double", !10, i64 0}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!6, !14, i64 184}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18, !20, !19}
!22 = !{!12, !12, i64 0}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass