; LLVM IR from vectozavr/3dzavr :: engine/components/physics (RigidObject)

; 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.Vec3D = type { %"struct.std::array.3" }
%"struct.std::array.3" = type { [3 x double] }
%"struct.std::pair.31" = type { %"class.std::vector.33", i64 }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl" }
%"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl" = type { %"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.FaceNormal = type { %class.Vec3D, double }
%struct.SupportPoint = type { %class.Vec3D, %class.Vec3D, %class.Vec3D }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE3maxEv() #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5Vec3D3dotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Vec3DC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec3DmiERKS_(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec3D5crossERKS_(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11RigidObject14getFaceNormalsERKSt6vectorI12SupportPointSaIS1_EERKS0_ImSaImEE(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.31") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::vector.33", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca double, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %class.Vec3D, align 8
  %17 = alloca %class.Vec3D, align 8
  %18 = alloca %class.Vec3D, align 8
  %19 = alloca %class.Vec3D, align 8
  %20 = alloca double, align 8
  %21 = alloca %struct.FaceNormal, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @_ZNSt6vectorI10FaceNormalSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %24 = udiv i64 %23, 3
  invoke void @_ZNSt6vectorI10FaceNormalSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %24)
          to label %25 unwind label %33

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %26 = call noundef double @_ZNSt14numeric_limitsIdE3maxEv() #5
  store double %26, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %112, %25
  %28 = load i64, ptr %12, align 8, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  %31 = icmp ult i64 %28, %30
  br i1 %31, label %37, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %117

33:                                               ; preds = %3
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %8, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %9, align 4
  br label %124

37:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i64, ptr %12, align 8, !tbaa !9
  %41 = add i64 %40, 0
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %41) #5
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %43) #5
  %45 = getelementptr inbounds %struct.SupportPoint, ptr %44, i32 0, i32 2
  store ptr %45, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load i64, ptr %12, align 8, !tbaa !9
  %49 = add i64 %48, 1
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %49) #5
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %51) #5
  %53 = getelementptr inbounds %struct.SupportPoint, ptr %52, i32 0, i32 2
  store ptr %53, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load i64, ptr %12, align 8, !tbaa !9
  %57 = add i64 %56, 2
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57) #5
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %59) #5
  %61 = getelementptr inbounds %struct.SupportPoint, ptr %60, i32 0, i32 2
  store ptr %61, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZNK5Vec3DmiERKS_(ptr dead_on_unwind writable sret(%class.Vec3D) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %63)
          to label %64 unwind label %80

64:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #5
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZNK5Vec3DmiERKS_(ptr dead_on_unwind writable sret(%class.Vec3D) align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 8 dereferenceable(24) %66)
          to label %67 unwind label %84

67:                                               ; preds = %64
  invoke void @_ZNK5Vec3D5crossERKS_(ptr dead_on_unwind writable sret(%class.Vec3D) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %68 unwind label %84

68:                                               ; preds = %67
  invoke void @_ZNK5Vec3D10normalizedEv(ptr dead_on_unwind writable sret(%class.Vec3D) align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %69 unwind label %84

69:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = invoke noundef double @_ZNK5Vec3D3dotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %70)
          to label %72 unwind label %89

72:                                               ; preds = %69
  store double %71, ptr %20, align 8, !tbaa !11
  %73 = load double, ptr %20, align 8, !tbaa !11
  %74 = fcmp olt double %73, 0.000000e+00
  br i1 %74, label %75, label %93

75:                                               ; preds = %72
  %76 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Vec3DmLEd(ptr noundef nonnull align 8 dereferenceable(24) %16, double noundef -1.000000e+00)
          to label %77 unwind label %89

77:                                               ; preds = %75
  %78 = load double, ptr %20, align 8, !tbaa !11
  %79 = fmul double %78, -1.000000e+00
  store double %79, ptr %20, align 8, !tbaa !11
  br label %93

80:                                               ; preds = %37
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %8, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %9, align 4
  br label %88

84:                                               ; preds = %68, %67, %64
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %8, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  br label %88

88:                                               ; preds = %84, %80
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  br label %116

89:                                               ; preds = %75, %69
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %8, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %9, align 4
  br label %115

93:                                               ; preds = %77, %72
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #5
  %94 = getelementptr inbounds %struct.FaceNormal, ptr %21, i32 0, i32 0
  invoke void @_ZN5Vec3DC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %94, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %95 unwind label %107

95:                                               ; preds = %93
  %96 = getelementptr inbounds %struct.FaceNormal, ptr %21, i32 0, i32 1
  %97 = load double, ptr %20, align 8, !tbaa !11
  store double %97, ptr %96, align 8, !tbaa !13
  %98 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI10FaceNormalSaIS0_EE12emplace_backIJS0_EEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %99 unwind label %107

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  %100 = load double, ptr %20, align 8, !tbaa !11
  %101 = load double, ptr %11, align 8, !tbaa !11
  %102 = fcmp olt double %100, %101
  br i1 %102, label %103, label %111

103:                                              ; preds = %99
  %104 = load i64, ptr %12, align 8, !tbaa !9
  %105 = udiv i64 %104, 3
  store i64 %105, ptr %10, align 8, !tbaa !9
  %106 = load double, ptr %20, align 8, !tbaa !11
  store double %106, ptr %11, align 8, !tbaa !11
  br label %111

107:                                              ; preds = %95, %93
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %8, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  br label %115

111:                                              ; preds = %103, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %112

112:                                              ; preds = %111
  %113 = load i64, ptr %12, align 8, !tbaa !9
  %114 = add i64 %113, 3
  store i64 %114, ptr %12, align 8, !tbaa !9
  br label %27, !llvm.loop !17

115:                                              ; preds = %107, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %116

116:                                              ; preds = %115, %88
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %123

117:                                              ; preds = %32
  invoke void @_ZNSt4pairISt6vectorI10FaceNormalSaIS1_EEmEC2IRS3_RmTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS9_SA_EEEbE4typeELb1EEEOS9_OSA_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %118 unwind label %119

118:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @_ZNSt6vectorI10FaceNormalSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

119:                                              ; preds = %117
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %8, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %9, align 4
  br label %123

123:                                              ; preds = %119, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %124

124:                                              ; preds = %123, %33
  call void @_ZNSt6vectorI10FaceNormalSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %8, align 8
  %127 = load i32, ptr %9, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI10FaceNormalSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec3D10normalizedEv(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Vec3DmLEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI10FaceNormalSaIS0_EE12emplace_backIJS0_EEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairISt6vectorI10FaceNormalSaIS1_EEmEC2IRS3_RmTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS9_SA_EEEbE4typeELb1EEEOS9_OSA_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 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 #4 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !12, i64 24}
!14 = !{!"_ZTS10FaceNormal", !15, i64 0, !12, i64 24}
!15 = !{!"_ZTS5Vec3D", !16, i64 0}
!16 = !{!"_ZTSSt5arrayIdLm3EE", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; 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.Vec3D = type { %"struct.std::array.3" }
%"struct.std::array.3" = type { [3 x double] }
%"struct.std::pair.31" = type { %"class.std::vector.33", i64 }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl" }
%"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl" = type { %"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FaceNormal, std::allocator<FaceNormal>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.FaceNormal = type { %class.Vec3D, double }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE3maxEv() local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5Vec3D3dotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Vec3DC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec3DmiERKS_(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec3D5crossERKS_(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11RigidObject14getFaceNormalsERKSt6vectorI12SupportPointSaIS1_EERKS0_ImSaImEE(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.31") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.33", align 8
  %5 = alloca i64, align 8
  %6 = alloca %class.Vec3D, align 8
  %7 = alloca %class.Vec3D, align 8
  %8 = alloca %class.Vec3D, align 8
  %9 = alloca %class.Vec3D, align 8
  %10 = alloca %struct.FaceNormal, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorI10FaceNormalSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %11 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %12 = udiv i64 %11, 3
  invoke void @_ZNSt6vectorI10FaceNormalSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %12)
          to label %13 unwind label %17

13:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  %14 = call noundef double @_ZNSt14numeric_limitsIdE3maxEv() #5
  %15 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %.not = icmp eq i64 %15, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %13
  %16 = getelementptr inbounds i8, ptr %10, i64 24
  br label %19

._crit_edge:                                      ; preds = %60, %13
  invoke void @_ZNSt4pairISt6vectorI10FaceNormalSaIS1_EEmEC2IRS3_RmTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS9_SA_EEEbE4typeELb1EEEOS9_OSA_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %65 unwind label %66

17:                                               ; preds = %3
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %69

19:                                               ; preds = %.lr.ph, %60
  %.03244 = phi double [ %14, %.lr.ph ], [ %.133, %60 ]
  %.03443 = phi i64 [ 0, %.lr.ph ], [ %61, %60 ]
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03443) #5
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %21) #5
  %23 = getelementptr inbounds i8, ptr %22, i64 48
  %24 = add nuw i64 %.03443, 1
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %24) #5
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %26) #5
  %28 = getelementptr inbounds i8, ptr %27, i64 48
  %29 = add i64 %.03443, 2
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %29) #5
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %31) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  invoke void @_ZNK5Vec3DmiERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vec3D) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %33 unwind label %44

33:                                               ; preds = %19
  %34 = getelementptr inbounds i8, ptr %32, i64 48
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  invoke void @_ZNK5Vec3DmiERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vec3D) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %35 unwind label %46

35:                                               ; preds = %33
  invoke void @_ZNK5Vec3D5crossERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vec3D) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %36 unwind label %46

36:                                               ; preds = %35
  invoke void @_ZNK5Vec3D10normalizedEv(ptr dead_on_unwind nonnull writable sret(%class.Vec3D) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %37 unwind label %46

37:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %38 = invoke noundef double @_ZNK5Vec3D3dotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %39 unwind label %49

39:                                               ; preds = %37
  %40 = fcmp olt double %38, 0.000000e+00
  br i1 %40, label %41, label %51

41:                                               ; preds = %39
  %42 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Vec3DmLEd(ptr noundef nonnull align 8 dereferenceable(24) %6, double noundef -1.000000e+00)
  %43 = fneg double %38
  br label %51

44:                                               ; preds = %19
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %48

46:                                               ; preds = %36, %35, %33
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %48

48:                                               ; preds = %46, %44
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %64

49:                                               ; preds = %37
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %64

51:                                               ; preds = %41, %39
  %.0 = phi double [ %43, %41 ], [ %38, %39 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  invoke void @_ZN5Vec3DC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %52 unwind label %58

52:                                               ; preds = %51
  store double %.0, ptr %16, align 8, !tbaa !9
  %53 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI10FaceNormalSaIS0_EE12emplace_backIJS0_EEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %54 unwind label %58

54:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  %55 = fcmp olt double %.0, %.03244
  br i1 %55, label %56, label %60

56:                                               ; preds = %54
  %57 = udiv i64 %.03443, 3
  store i64 %57, ptr %5, align 8, !tbaa !5
  br label %60

58:                                               ; preds = %52, %51
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %64

60:                                               ; preds = %56, %54
  %.133 = phi double [ %.0, %56 ], [ %.03244, %54 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %61 = add i64 %.03443, 3
  %62 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %63 = icmp ult i64 %61, %62
  br i1 %63, label %19, label %._crit_edge, !llvm.loop !14

64:                                               ; preds = %49, %58, %48
  %.pn38.pn = phi { ptr, i32 } [ %.pn, %48 ], [ %59, %58 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %68

65:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt6vectorI10FaceNormalSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

66:                                               ; preds = %._crit_edge
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %68

68:                                               ; preds = %66, %64
  %.pn38.pn.pn = phi { ptr, i32 } [ %.pn38.pn, %64 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %69

69:                                               ; preds = %68, %17
  %.pn38.pn.pn.pn = phi { ptr, i32 } [ %.pn38.pn.pn, %68 ], [ %18, %17 ]
  call void @_ZNSt6vectorI10FaceNormalSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn38.pn.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI10FaceNormalSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorI12SupportPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec3D10normalizedEv(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Vec3DmLEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI10FaceNormalSaIS0_EE12emplace_backIJS0_EEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairISt6vectorI10FaceNormalSaIS1_EEmEC2IRS3_RmTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS9_SA_EEEbE4typeELb1EEEOS9_OSA_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 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 #4 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 24}
!10 = !{!"_ZTS10FaceNormal", !11, i64 0, !13, i64 24}
!11 = !{!"_ZTS5Vec3D", !12, i64 0}
!12 = !{!"_ZTSSt5arrayIdLm3EE", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass