; LLVM IR from aspuru-guzik-group/qtorch :: nlopt-2.4.2/stogo/tools.ll (ZN4TBox12IntersectionERK7RVectorS2_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"

%class.RVector = type { i32, ptr }
%class.VBox = type { %class.RVector, %class.RVector }

declare void @_ZN7RVectorC1Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7RVectorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4VBox6GetDimEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

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

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

declare void @_Z4axpydRK7RVectorS1_(double noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4TBox12IntersectionERK7RVectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.RVector, align 8
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %21 = call noundef i32 @_ZN4VBox6GetDimEv(ptr noundef nonnull align 8 dereferenceable(32) %20)
  store i32 %21, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %22 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN7RVectorC1Ei(ptr noundef nonnull align 8 dereferenceable(16) %10, i32 noundef %22)
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  store i8 0, ptr %11, align 1, !tbaa !11
  br label %23

23:                                               ; preds = %164, %4
  %24 = load i32, ptr %12, align 4, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %27, label %32

27:                                               ; preds = %23
  %28 = load i8, ptr %11, align 1, !tbaa !11, !range !13, !noundef !14
  %29 = trunc i8 %28 to i1
  %30 = zext i1 %29 to i32
  %31 = icmp eq i32 %30, 0
  br label %32

32:                                               ; preds = %27, %23
  %33 = phi i1 [ false, %23 ], [ %31, %27 ]
  br i1 %33, label %34, label %167

34:                                               ; preds = %32
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %35, i32 noundef %36)
          to label %38 unwind label %51

38:                                               ; preds = %34
  %39 = load double, ptr %37, align 8, !tbaa !15
  %40 = fcmp oeq double %39, 0.000000e+00
  br i1 %40, label %41, label %55

41:                                               ; preds = %38
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %42, i32 noundef %43)
          to label %45 unwind label %51

45:                                               ; preds = %41
  %46 = load double, ptr %44, align 8, !tbaa !15
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %47, i32 noundef %48)
          to label %50 unwind label %51

50:                                               ; preds = %45
  store double %46, ptr %49, align 8, !tbaa !15
  br label %167

51:                                               ; preds = %154, %149, %147, %133, %129, %121, %117, %111, %105, %101, %85, %79, %74, %68, %62, %45, %41, %34
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %18, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @_ZN7RVectorD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %170

55:                                               ; preds = %38
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %161, %55
  %57 = load i32, ptr %14, align 4, !tbaa !9
  %58 = icmp sle i32 %57, 2
  br i1 %58, label %59, label %164

59:                                               ; preds = %56
  %60 = load i32, ptr %14, align 4, !tbaa !9
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %68

62:                                               ; preds = %59
  %63 = getelementptr inbounds %class.VBox, ptr %20, i32 0, i32 0
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %63, i32 noundef %64)
          to label %66 unwind label %51

66:                                               ; preds = %62
  %67 = load double, ptr %65, align 8, !tbaa !15
  store double %67, ptr %16, align 8, !tbaa !15
  br label %74

68:                                               ; preds = %59
  %69 = getelementptr inbounds %class.VBox, ptr %20, i32 0, i32 1
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %69, i32 noundef %70)
          to label %72 unwind label %51

72:                                               ; preds = %68
  %73 = load double, ptr %71, align 8, !tbaa !15
  store double %73, ptr %16, align 8, !tbaa !15
  br label %74

74:                                               ; preds = %72, %66
  %75 = load double, ptr %16, align 8, !tbaa !15
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %76, i32 noundef %77)
          to label %79 unwind label %51

79:                                               ; preds = %74
  %80 = load double, ptr %78, align 8, !tbaa !15
  %81 = fsub double %75, %80
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %82, i32 noundef %83)
          to label %85 unwind label %51

85:                                               ; preds = %79
  %86 = load double, ptr %84, align 8, !tbaa !15
  %87 = fdiv double %81, %86
  store double %87, ptr %17, align 8, !tbaa !15
  %88 = load double, ptr %16, align 8, !tbaa !15
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %89, i32 noundef %90)
          to label %92 unwind label %51

92:                                               ; preds = %85
  store double %88, ptr %91, align 8, !tbaa !15
  store i32 1, ptr %15, align 4, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %144, %92
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %147

97:                                               ; preds = %93
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = icmp ne i32 %98, %99
  br i1 %100, label %101, label %143

101:                                              ; preds = %97
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %102, i32 noundef %103)
          to label %105 unwind label %51

105:                                              ; preds = %101
  %106 = load double, ptr %104, align 8, !tbaa !15
  %107 = load double, ptr %17, align 8, !tbaa !15
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %108, i32 noundef %109)
          to label %111 unwind label %51

111:                                              ; preds = %105
  %112 = load double, ptr %110, align 8, !tbaa !15
  %113 = call double @llvm.fmuladd.f64(double %107, double %112, double %106)
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %114, i32 noundef %115)
          to label %117 unwind label %51

117:                                              ; preds = %111
  store double %113, ptr %116, align 8, !tbaa !15
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %118, i32 noundef %119)
          to label %121 unwind label %51

121:                                              ; preds = %117
  %122 = load double, ptr %120, align 8, !tbaa !15
  %123 = getelementptr inbounds %class.VBox, ptr %20, i32 0, i32 0
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %123, i32 noundef %124)
          to label %126 unwind label %51

126:                                              ; preds = %121
  %127 = load double, ptr %125, align 8, !tbaa !15
  %128 = fcmp olt double %122, %127
  br i1 %128, label %141, label %129

129:                                              ; preds = %126
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %130, i32 noundef %131)
          to label %133 unwind label %51

133:                                              ; preds = %129
  %134 = load double, ptr %132, align 8, !tbaa !15
  %135 = getelementptr inbounds %class.VBox, ptr %20, i32 0, i32 1
  %136 = load i32, ptr %13, align 4, !tbaa !9
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %135, i32 noundef %136)
          to label %138 unwind label %51

138:                                              ; preds = %133
  %139 = load double, ptr %137, align 8, !tbaa !15
  %140 = fcmp ogt double %134, %139
  br i1 %140, label %141, label %142

141:                                              ; preds = %138, %126
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %147

142:                                              ; preds = %138
  br label %143

143:                                              ; preds = %142, %97
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %13, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %13, align 4, !tbaa !9
  br label %93, !llvm.loop !17

147:                                              ; preds = %141, %93
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_Z4copyRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16) %148, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %149 unwind label %51

149:                                              ; preds = %147
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_Z4axpydRK7RVectorS1_(double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(16) %150, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %151 unwind label %51

151:                                              ; preds = %149
  %152 = load i32, ptr %15, align 4, !tbaa !9
  %153 = icmp eq i32 %152, 1
  br i1 %153, label %154, label %160

154:                                              ; preds = %151
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = invoke noundef double @_Z3dotRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %155)
          to label %157 unwind label %51

157:                                              ; preds = %154
  %158 = fcmp ogt double %156, 0.000000e+00
  br i1 %158, label %159, label %160

159:                                              ; preds = %157
  store i8 1, ptr %11, align 1, !tbaa !11
  br label %164

160:                                              ; preds = %157, %151
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %14, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %14, align 4, !tbaa !9
  br label %56, !llvm.loop !19

164:                                              ; preds = %159, %56
  %165 = load i32, ptr %12, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %12, align 4, !tbaa !9
  br label %23, !llvm.loop !20

167:                                              ; preds = %50, %32
  %168 = load i8, ptr %11, align 1, !tbaa !11, !range !13, !noundef !14
  %169 = trunc i8 %168 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @_ZN7RVectorD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret i1 %169

170:                                              ; preds = %51
  %171 = load ptr, ptr %18, align 8
  %172 = load i32, ptr %19, align 4
  %173 = insertvalue { ptr, i32 } poison, ptr %171, 0
  %174 = insertvalue { ptr, i32 } %173, i32 %172, 1
  resume { ptr, i32 } %174
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare void @_Z4copyRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

declare noundef double @_Z3dotRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

attributes #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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


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

%class.RVector = type { i32, ptr }

declare void @_ZN7RVectorC1Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7RVectorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4VBox6GetDimEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

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

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

declare void @_Z4axpydRK7RVectorS1_(double noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4TBox12IntersectionERK7RVectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.RVector, align 8
  %6 = tail call noundef i32 @_ZN4VBox6GetDimEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN7RVectorC1Ei(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %6)
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  br label %9

9:                                                ; preds = %.split70.us.us, %.lr.ph
  %.04972.us = phi i32 [ 0, %.lr.ph ], [ %83, %.split70.us.us ]
  %10 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.04972.us)
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = fcmp oeq double %11, 0.000000e+00
  br i1 %12, label %.split76.us, label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %9
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.04972.us)
  %.051.us.us.pre = load double, ptr %13, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.04972.us)
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = fsub double %.051.us.us.pre, %15
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.04972.us)
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = fdiv double %16, %18
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.04972.us)
  store double %.051.us.us.pre, ptr %20, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %81, %.lr.ph.us.us
  %.not5563.us.us = phi i1 [ true, %.lr.ph.us.us ], [ %.not55.us.us, %81 ]
  %.05062.us.us = phi i32 [ 0, %.lr.ph.us.us ], [ %82, %81 ]
  %.not.us.us = icmp eq i32 %.05062.us.us, %.04972.us
  br i1 %.not.us.us, label %81, label %22

22:                                               ; preds = %21
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.05062.us.us)
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.05062.us.us)
  %26 = load double, ptr %25, align 8, !tbaa !5
  %27 = call double @llvm.fmuladd.f64(double %19, double %26, double %24)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.05062.us.us)
  store double %27, ptr %28, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.05062.us.us)
  %30 = load double, ptr %29, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.05062.us.us)
  %32 = load double, ptr %31, align 8, !tbaa !5
  %33 = fcmp olt double %30, %32
  br i1 %33, label %._crit_edge.us.us, label %34

34:                                               ; preds = %22
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.05062.us.us)
  %36 = load double, ptr %35, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %.05062.us.us)
  %38 = load double, ptr %37, align 8, !tbaa !5
  %39 = fcmp ogt double %36, %38
  br i1 %39, label %._crit_edge.us.us, label %81

._crit_edge.us.us:                                ; preds = %81, %34, %22
  %.not55.lcssa.us.us = phi i1 [ %.not5563.us.us, %22 ], [ %.not5563.us.us, %34 ], [ %.not55.us.us, %81 ]
  invoke void @_Z4copyRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %40 unwind label %.split.us.split.us

40:                                               ; preds = %._crit_edge.us.us
  invoke void @_Z4axpydRK7RVectorS1_(double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %41 unwind label %.split.us.split.us

41:                                               ; preds = %40
  br i1 %.not55.lcssa.us.us, label %.lr.ph.us.us.1, label %42

42:                                               ; preds = %41
  %43 = invoke noundef double @_Z3dotRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %44 unwind label %.split.us.split.us

44:                                               ; preds = %42
  %45 = fcmp ogt double %43, 0.000000e+00
  br i1 %45, label %.loopexit, label %.lr.ph.us.us.1

.lr.ph.us.us.1:                                   ; preds = %44, %41
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %.04972.us)
  %.051.us.us.1.pre = load double, ptr %46, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.04972.us)
  %48 = load double, ptr %47, align 8, !tbaa !5
  %49 = fsub double %.051.us.us.1.pre, %48
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.04972.us)
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = fdiv double %49, %51
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.04972.us)
  store double %.051.us.us.1.pre, ptr %53, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %73, %.lr.ph.us.us.1
  %.not5563.us.us.1 = phi i1 [ true, %.lr.ph.us.us.1 ], [ %.not55.us.us.1, %73 ]
  %.05062.us.us.1 = phi i32 [ 0, %.lr.ph.us.us.1 ], [ %74, %73 ]
  %.not.us.us.1 = icmp eq i32 %.05062.us.us.1, %.04972.us
  br i1 %.not.us.us.1, label %73, label %55

55:                                               ; preds = %54
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.05062.us.us.1)
  %57 = load double, ptr %56, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.05062.us.us.1)
  %59 = load double, ptr %58, align 8, !tbaa !5
  %60 = call double @llvm.fmuladd.f64(double %52, double %59, double %57)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.05062.us.us.1)
  store double %60, ptr %61, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.05062.us.us.1)
  %63 = load double, ptr %62, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.05062.us.us.1)
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = fcmp olt double %63, %65
  br i1 %66, label %._crit_edge.us.us.1, label %67

67:                                               ; preds = %55
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.05062.us.us.1)
  %69 = load double, ptr %68, align 8, !tbaa !5
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %.05062.us.us.1)
  %71 = load double, ptr %70, align 8, !tbaa !5
  %72 = fcmp ogt double %69, %71
  br i1 %72, label %._crit_edge.us.us.1, label %73

73:                                               ; preds = %67, %54
  %74 = add nuw nsw i32 %.05062.us.us.1, 1
  %.not55.us.us.1 = icmp slt i32 %74, %6
  %exitcond.1.not = icmp eq i32 %74, %6
  br i1 %exitcond.1.not, label %._crit_edge.us.us.1, label %54, !llvm.loop !9

._crit_edge.us.us.1:                              ; preds = %73, %67, %55
  %.not55.lcssa.us.us.1 = phi i1 [ %.not5563.us.us.1, %55 ], [ %.not5563.us.us.1, %67 ], [ %.not55.us.us.1, %73 ]
  invoke void @_Z4copyRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %75 unwind label %.split.us.split.us

75:                                               ; preds = %._crit_edge.us.us.1
  invoke void @_Z4axpydRK7RVectorS1_(double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %76 unwind label %.split.us.split.us

76:                                               ; preds = %75
  br i1 %.not55.lcssa.us.us.1, label %.split70.us.us, label %77

77:                                               ; preds = %76
  %78 = invoke noundef double @_Z3dotRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %79 unwind label %.split.us.split.us

79:                                               ; preds = %77
  %80 = fcmp ogt double %78, 0.000000e+00
  br i1 %80, label %.loopexit, label %.split70.us.us

81:                                               ; preds = %34, %21
  %82 = add nuw nsw i32 %.05062.us.us, 1
  %.not55.us.us = icmp slt i32 %82, %6
  %exitcond.not = icmp eq i32 %82, %6
  br i1 %exitcond.not, label %._crit_edge.us.us, label %21, !llvm.loop !9

.split70.us.us:                                   ; preds = %76, %79
  %83 = add nuw nsw i32 %.04972.us, 1
  %84 = icmp slt i32 %83, %6
  br i1 %84, label %9, label %.loopexit, !llvm.loop !11

.split.us.split.us:                               ; preds = %77, %75, %._crit_edge.us.us.1, %42, %40, %._crit_edge.us.us
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7RVectorD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  resume { ptr, i32 } %85

.split76.us:                                      ; preds = %9
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.04972.us)
  %87 = load double, ptr %86, align 8, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7RVectorclEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.04972.us)
  store double %87, ptr %88, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %79, %44, %.split70.us.us, %4, %.split76.us
  %.058 = phi i1 [ false, %.split76.us ], [ false, %4 ], [ true, %79 ], [ true, %44 ], [ false, %.split70.us.us ]
  call void @_ZN7RVectorD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  ret i1 %.058
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare void @_Z4copyRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare noundef double @_Z3dotRK7RVectorS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

attributes #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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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