; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Geometry (GeometryBuilder)

; 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.imp::Vec" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr.0" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.imp::Geometry" = type <{ %"class.imp::Object", i32, [4 x i8], %"class.std::vector.3", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.8", i8, i8, i8, i8, [4 x i8] }>
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<imp::Vec<2, float>, std::allocator<imp::Vec<2, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Vec<2, float>, std::allocator<imp::Vec<2, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Vec<2, float>, std::allocator<imp::Vec<2, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Vec<2, float>, std::allocator<imp::Vec<2, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi3EfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec") align 8, ptr noundef nonnull align 8 dereferenceable(36), float noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36), float noundef) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp15GeometryBuilder22cylindricNormalInterpoERSt10shared_ptrINS_8GeometryEE(ptr noundef nonnull align 8 dereferenceable(16) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.imp::Vec3", align 8
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.imp::Vec3", align 8
  %10 = alloca %"class.imp::Vec3", align 8
  %11 = alloca %"class.imp::Vec", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %105, %1
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  %16 = getelementptr inbounds %"class.imp::Geometry", ptr %15, i32 0, i32 4
  %17 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %18 = trunc i64 %17 to i32
  %19 = icmp slt i32 %13, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %109

21:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 40, ptr %4) #5
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #5
  %24 = getelementptr inbounds %"class.imp::Geometry", ptr %23, i32 0, i32 6
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %26) #5
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %4, ptr noundef nonnull align 8 dereferenceable(36) %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %28 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef 1)
          to label %29 unwind label %76

29:                                               ; preds = %21
  %30 = load float, ptr %28, align 4, !tbaa !11
  store float %30, ptr %5, align 4, !tbaa !11
  %31 = load float, ptr %5, align 4, !tbaa !11
  %32 = invoke noundef float @_ZSt3absf(float noundef %31)
          to label %33 unwind label %76

33:                                               ; preds = %29
  %34 = fpext float %32 to double
  %35 = fcmp ole double %34, 1.000000e-03
  br i1 %35, label %36, label %104

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef 0)
          to label %38 unwind label %80

38:                                               ; preds = %36
  %39 = load float, ptr %37, align 4, !tbaa !11
  %40 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef 0)
          to label %41 unwind label %80

41:                                               ; preds = %38
  %42 = load float, ptr %40, align 4, !tbaa !11
  %43 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef 2)
          to label %44 unwind label %80

44:                                               ; preds = %41
  %45 = load float, ptr %43, align 4, !tbaa !11
  %46 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef 2)
          to label %47 unwind label %80

47:                                               ; preds = %44
  %48 = load float, ptr %46, align 4, !tbaa !11
  %49 = fmul float %45, %48
  %50 = call float @llvm.fmuladd.f32(float %39, float %42, float %49)
  %51 = invoke noundef float @_ZSt4sqrtf(float noundef %50)
          to label %52 unwind label %80

52:                                               ; preds = %47
  store float %51, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #5
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %53) #5
  %55 = getelementptr inbounds %"class.imp::Geometry", ptr %54, i32 0, i32 4
  %56 = load i32, ptr %3, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57) #5
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %9, ptr noundef nonnull align 8 dereferenceable(36) %58) #5
  %59 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef 1)
          to label %60 unwind label %84

60:                                               ; preds = %52
  store float 0.000000e+00, ptr %59, align 4, !tbaa !11
  %61 = invoke noundef float @_ZN3imp3VecILi3EfE9normalizeEv(ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %62 unwind label %84

62:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #5
  %63 = load float, ptr %8, align 4, !tbaa !11
  invoke void @_ZNK3imp3VecILi3EfEmlEf(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %11, ptr noundef nonnull align 8 dereferenceable(36) %9, float noundef %63)
          to label %64 unwind label %88

64:                                               ; preds = %62
  invoke void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36) %10, ptr noundef nonnull align 8 dereferenceable(36) %11, float noundef 1.000000e+00)
          to label %65 unwind label %92

65:                                               ; preds = %64
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #5
  %66 = load float, ptr %5, align 4, !tbaa !11
  %67 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %10, i32 noundef 1)
          to label %68 unwind label %97

68:                                               ; preds = %65
  store float %66, ptr %67, align 4, !tbaa !11
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %69) #5
  %71 = getelementptr inbounds %"class.imp::Geometry", ptr %70, i32 0, i32 6
  %72 = load i32, ptr %3, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %73) #5
  %75 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZN3imp4Vec3aSERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %74, ptr noundef nonnull align 8 dereferenceable(36) %10) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %10) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %104

76:                                               ; preds = %29, %21
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  br label %108

80:                                               ; preds = %47, %44, %41, %38, %36
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %6, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %7, align 4
  br label %103

84:                                               ; preds = %60, %52
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %6, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %7, align 4
  br label %102

88:                                               ; preds = %62
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %6, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %7, align 4
  br label %96

92:                                               ; preds = %64
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %6, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %7, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #5
  br label %96

96:                                               ; preds = %92, %88
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #5
  br label %101

97:                                               ; preds = %65
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %6, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %7, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %10) #5
  br label %101

101:                                              ; preds = %97, %96
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #5
  br label %102

102:                                              ; preds = %101, %84
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #5
  br label %103

103:                                              ; preds = %102, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %108

104:                                              ; preds = %68, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #5
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %3, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %3, align 4, !tbaa !9
  br label %12, !llvm.loop !13

108:                                              ; preds = %103, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %110

109:                                              ; preds = %20
  ret void

110:                                              ; preds = %108
  %111 = load ptr, ptr %6, align 8
  %112 = load i32, ptr %7, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN3imp3VecILi3EfE9normalizeEv(ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(36) ptr @_ZN3imp4Vec3aSERKS0_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) #2 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 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 #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 = { 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 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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.imp::Vec" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr.0" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

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

; 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 uwtable
declare dso_local void @_ZNK3imp3VecILi3EfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec") align 8, ptr noundef nonnull align 8 dereferenceable(36), float noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36), float noundef) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp15GeometryBuilder22cylindricNormalInterpoERSt10shared_ptrINS_8GeometryEE(ptr noundef nonnull align 8 dereferenceable(16) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.imp::Vec3", align 8
  %3 = alloca %"class.imp::Vec3", align 8
  %4 = alloca %"class.imp::Vec3", align 8
  %5 = alloca %"class.imp::Vec", align 8
  %6 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %7 = getelementptr inbounds i8, ptr %6, i64 56
  %8 = tail call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %9 = trunc i64 %8 to i32
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %52, %1
  ret void

.lr.ph:                                           ; preds = %1, %52
  %indvars.iv = phi i64 [ %indvars.iv.next, %52 ], [ 0, %1 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #5
  %11 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %12 = getelementptr inbounds i8, ptr %11, i64 104
  %13 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv) #5
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %2, ptr noundef nonnull align 8 dereferenceable(36) %13) #5
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %2, i32 noundef 1)
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = call noundef float @_ZSt3absf(float noundef %15)
  %17 = fpext float %16 to double
  %18 = fcmp ugt double %17, 1.000000e-03
  br i1 %18, label %52, label %19

19:                                               ; preds = %.lr.ph
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %2, i32 noundef 0)
  %21 = load float, ptr %20, align 4, !tbaa !5
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %2, i32 noundef 0)
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %2, i32 noundef 2)
  %25 = load float, ptr %24, align 4, !tbaa !5
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %2, i32 noundef 2)
  %27 = load float, ptr %26, align 4, !tbaa !5
  %28 = fmul float %25, %27
  %29 = call float @llvm.fmuladd.f32(float %21, float %23, float %28)
  %30 = call noundef float @_ZSt4sqrtf(float noundef %29)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #5
  %31 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %32 = getelementptr inbounds i8, ptr %31, i64 56
  %33 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %indvars.iv) #5
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %3, ptr noundef nonnull align 8 dereferenceable(36) %33) #5
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %3, i32 noundef 1)
  store float 0.000000e+00, ptr %34, align 4, !tbaa !5
  %35 = invoke noundef float @_ZN3imp3VecILi3EfE9normalizeEv(ptr noundef nonnull align 8 dereferenceable(36) %3)
          to label %36 unwind label %44

36:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #5
  invoke void @_ZNK3imp3VecILi3EfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %5, ptr noundef nonnull align 8 dereferenceable(36) %3, float noundef %30)
          to label %37 unwind label %46

37:                                               ; preds = %36
  invoke void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36) %4, ptr noundef nonnull align 8 dereferenceable(36) %5, float noundef 1.000000e+00)
          to label %38 unwind label %48

38:                                               ; preds = %37
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi3EfEixEj(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef 1)
  store float %15, ptr %39, align 4, !tbaa !5
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %41 = getelementptr inbounds i8, ptr %40, i64 104
  %42 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %indvars.iv) #5
  %43 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZN3imp4Vec3aSERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %42, ptr noundef nonnull align 8 dereferenceable(36) %4) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  br label %52

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

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %50

48:                                               ; preds = %37
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #5
  br label %50

50:                                               ; preds = %48, %46
  %.pn = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  br label %51

51:                                               ; preds = %50, %44
  %.pn.pn = phi { ptr, i32 } [ %.pn, %50 ], [ %45, %44 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn.pn

52:                                               ; preds = %38, %.lr.ph
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %54 = getelementptr inbounds i8, ptr %53, i64 56
  %55 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #5
  %sext = shl i64 %55, 32
  %56 = ashr exact i64 %sext, 32
  %57 = icmp slt i64 %indvars.iv.next, %56
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !9
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN3imp3VecILi3EfE9normalizeEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(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(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(36) ptr @_ZN3imp4Vec3aSERKS0_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #2 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 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 #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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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