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

; 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::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"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.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"struct.imp::CircleSampler" = type { %"class.imp::Vec3", %"class.imp::Vec3", float, i32, %"class.std::vector" }
%"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.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.imp::Vec" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>

@_ZN3imp4Vec31YE = external global %"class.imp::Vec3", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec3") align 8, ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) #1 align 2

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 @_ZN3imp4Vec3C2Ef(ptr noundef nonnull align 8 dereferenceable(36), float noundef) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp13cylinder_sideESt10shared_ptrINS_8GeometryEERKNS_13CircleSamplerES5_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(112)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp8Geometry6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8) #3 align 2

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

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

declare void @_ZN3imp8Geometry12setPrimitiveENS0_9PrimitiveE(ptr noundef nonnull align 8 dereferenceable(156), i32 noundef) #4

declare void @_ZN3imp8Geometry14generateColorsERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(156), ptr noundef nonnull align 8 dereferenceable(36)) #4

declare void @_ZN3imp8Geometry15generateNormalsENS0_13NormalGenModeE(ptr noundef nonnull align 8 dereferenceable(156), i32 noundef) #4

declare void @_ZN3imp8Geometry17generateTexCoordsENS0_10TexGenModeEf(ptr noundef nonnull align 8 dereferenceable(156), i32 noundef, float noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp15GeometryBuilder11createTorusEiff(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8 %0, i32 noundef %1, float noundef %2, float noundef %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"struct.imp::CircleSampler", align 8
  %10 = alloca %"class.imp::Vec3", align 8
  %11 = alloca %"class.imp::Vec3", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::vector.13", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.imp::Vec3", align 8
  %19 = alloca %"class.imp::Vec", align 8
  %20 = alloca %"class.imp::Vec3", align 8
  %21 = alloca %"class.imp::Vec3", align 8
  %22 = alloca %"struct.imp::CircleSampler", align 8
  %23 = alloca %"class.imp::Vec3", align 8
  %24 = alloca %"class.imp::Vec3", align 8
  %25 = alloca i1, align 1
  %26 = alloca i32, align 4
  %27 = alloca %"class.std::shared_ptr", align 8
  %28 = alloca %"class.imp::Vec3", align 8
  store ptr %0, ptr %5, align 8
  store i32 %1, ptr %6, align 4, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 112, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #5
  call void @_ZN3imp4Vec3C2Ef(ptr noundef nonnull align 8 dereferenceable(36) %10, float noundef 0.000000e+00)
  %29 = load float, ptr %7, align 4, !tbaa !9
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %11, ptr noundef nonnull align 8 dereferenceable(36) @_ZN3imp4Vec31YE) #5
  %30 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZN3imp13CircleSamplerC2ERKNS_4Vec3EfS1_i(ptr noundef nonnull align 8 dereferenceable(112) %9, ptr noundef nonnull align 8 dereferenceable(36) %10, float noundef %29, ptr noundef %11, i32 noundef %30)
          to label %31 unwind label %41

31:                                               ; preds = %4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #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 @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  call void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  store i32 %33, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 2
  store i32 %35, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %62, %31
  %37 = load i32, ptr %17, align 4, !tbaa !5
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %45, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %104

41:                                               ; preds = %4
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %12, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %13, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %10) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #5
  br label %161

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #5
  %46 = load i32, ptr %17, align 4, !tbaa !5
  invoke void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind writable sret(%"class.imp::Vec3") align 8 %20, ptr noundef nonnull align 8 dereferenceable(112) %9, i32 noundef %46)
          to label %47 unwind label %65

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 40, ptr %21) #5
  %48 = load i32, ptr %16, align 4, !tbaa !5
  invoke void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind writable sret(%"class.imp::Vec3") align 8 %21, ptr noundef nonnull align 8 dereferenceable(112) %9, i32 noundef %48)
          to label %49 unwind label %69

49:                                               ; preds = %47
  invoke void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %19, ptr noundef nonnull align 8 dereferenceable(36) %20, ptr noundef nonnull align 8 dereferenceable(36) %21)
          to label %50 unwind label %73

50:                                               ; preds = %49
  invoke void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36) %18, ptr noundef nonnull align 8 dereferenceable(36) %19, float noundef 1.000000e+00)
          to label %51 unwind label %77

51:                                               ; preds = %50
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %19) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %21) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %20) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #5
  %52 = invoke noundef float @_ZN3imp3VecILi3EfE9normalizeEv(ptr noundef nonnull align 8 dereferenceable(36) %18)
          to label %53 unwind label %84

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 112, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #5
  %54 = load i32, ptr %15, align 4, !tbaa !5
  invoke void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind writable sret(%"class.imp::Vec3") align 8 %23, ptr noundef nonnull align 8 dereferenceable(112) %9, i32 noundef %54)
          to label %55 unwind label %88

55:                                               ; preds = %53
  %56 = load float, ptr %8, align 4, !tbaa !9
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %24, ptr noundef nonnull align 8 dereferenceable(36) %18) #5
  %57 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZN3imp13CircleSamplerC2ERKNS_4Vec3EfS1_i(ptr noundef nonnull align 8 dereferenceable(112) %22, ptr noundef nonnull align 8 dereferenceable(36) %23, float noundef %56, ptr noundef %24, i32 noundef %57)
          to label %58 unwind label %92

58:                                               ; preds = %55
  invoke void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(112) %22)
          to label %59 unwind label %96

59:                                               ; preds = %58
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %22) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %24) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %23) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %22) #5
  %60 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %60, ptr %16, align 4, !tbaa !5
  %61 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %61, ptr %15, align 4, !tbaa !5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %18) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  br label %62

62:                                               ; preds = %59
  %63 = load i32, ptr %17, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %17, align 4, !tbaa !5
  br label %36, !llvm.loop !11

65:                                               ; preds = %45
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %12, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %13, align 4
  br label %83

69:                                               ; preds = %47
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %12, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %13, align 4
  br label %82

73:                                               ; preds = %49
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %12, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %13, align 4
  br label %81

77:                                               ; preds = %50
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %12, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %13, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %19) #5
  br label %81

81:                                               ; preds = %77, %73
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %21) #5
  br label %82

82:                                               ; preds = %81, %69
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %20) #5
  br label %83

83:                                               ; preds = %82, %65
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #5
  br label %103

84:                                               ; preds = %51
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %12, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %13, align 4
  br label %102

88:                                               ; preds = %53
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %12, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %13, align 4
  br label %101

92:                                               ; preds = %55
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %12, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %13, align 4
  br label %100

96:                                               ; preds = %58
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %12, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %13, align 4
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %22) #5
  br label %100

100:                                              ; preds = %96, %92
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %24) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %23) #5
  br label %101

101:                                              ; preds = %100, %88
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %22) #5
  br label %102

102:                                              ; preds = %101, %84
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %18) #5
  br label %103

103:                                              ; preds = %102, %83
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %160

104:                                              ; preds = %40
  store i1 false, ptr %25, align 1
  invoke void @_ZN3imp8Geometry6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0)
          to label %105 unwind label %113

105:                                              ; preds = %104
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  store i32 %107, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %126, %105
  %109 = load i32, ptr %26, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %117, label %112

112:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %133

113:                                              ; preds = %104
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %12, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %13, align 4
  br label %160

117:                                              ; preds = %108
  call void @_ZNSt10shared_ptrIN3imp8GeometryEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  %118 = load i32, ptr %15, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %119) #5
  %121 = load i32, ptr %26, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %122) #5
  invoke void @_ZN3imp13cylinder_sideESt10shared_ptrINS_8GeometryEERKNS_13CircleSamplerES5_(ptr noundef %27, ptr noundef nonnull align 8 dereferenceable(112) %120, ptr noundef nonnull align 8 dereferenceable(112) %123)
          to label %124 unwind label %129

124:                                              ; preds = %117
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  %125 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %125, ptr %15, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %124
  %127 = load i32, ptr %26, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %26, align 4, !tbaa !5
  br label %108, !llvm.loop !13

129:                                              ; preds = %117
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %12, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %13, align 4
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %159

133:                                              ; preds = %112
  %134 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  invoke void @_ZN3imp8Geometry12setPrimitiveENS0_9PrimitiveE(ptr noundef nonnull align 8 dereferenceable(156) %134, i32 noundef 0)
          to label %135 unwind label %144

135:                                              ; preds = %133
  %136 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %28) #5
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %28, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
          to label %137 unwind label %148

137:                                              ; preds = %135
  invoke void @_ZN3imp8Geometry14generateColorsERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(156) %136, ptr noundef nonnull align 8 dereferenceable(36) %28)
          to label %138 unwind label %152

138:                                              ; preds = %137
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %28) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %28) #5
  %139 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  invoke void @_ZN3imp8Geometry15generateNormalsENS0_13NormalGenModeE(ptr noundef nonnull align 8 dereferenceable(156) %139, i32 noundef 2)
          to label %140 unwind label %144

140:                                              ; preds = %138
  %141 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  invoke void @_ZN3imp8Geometry17generateTexCoordsENS0_10TexGenModeEf(ptr noundef nonnull align 8 dereferenceable(156) %141, i32 noundef 2, float noundef 1.000000e+00)
          to label %142 unwind label %144

142:                                              ; preds = %140
  store i1 true, ptr %25, align 1
  %143 = load i1, ptr %25, align 1
  br i1 %143, label %158, label %157

144:                                              ; preds = %140, %138, %133
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %12, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %13, align 4
  br label %159

148:                                              ; preds = %135
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %12, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %13, align 4
  br label %156

152:                                              ; preds = %137
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %12, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %13, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %28) #5
  br label %156

156:                                              ; preds = %152, %148
  call void @llvm.lifetime.end.p0(i64 40, ptr %28) #5
  br label %159

157:                                              ; preds = %142
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  br label %158

158:                                              ; preds = %157, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %9) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %9) #5
  ret void

159:                                              ; preds = %156, %144, %129
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  br label %160

160:                                              ; preds = %159, %113, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %9) #5
  br label %161

161:                                              ; preds = %160, %41
  call void @llvm.lifetime.end.p0(i64 112, ptr %9) #5
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %12, align 8
  %164 = load i32, ptr %13, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"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.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"struct.imp::CircleSampler" = type { %"class.imp::Vec3", %"class.imp::Vec3", float, i32, %"class.std::vector" }
%"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.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::CircleSampler, std::allocator<imp::CircleSampler>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.imp::Vec" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>

@_ZN3imp4Vec31YE = external global %"class.imp::Vec3", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec3") align 8, ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) local_unnamed_addr #1 align 2

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 @_ZN3imp4Vec3C2Ef(ptr noundef nonnull align 8 dereferenceable(36), float noundef) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp13cylinder_sideESt10shared_ptrINS_8GeometryEERKNS_13CircleSamplerES5_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp8Geometry6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8) local_unnamed_addr #3 align 2

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

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

declare void @_ZN3imp8Geometry12setPrimitiveENS0_9PrimitiveE(ptr noundef nonnull align 8 dereferenceable(156), i32 noundef) local_unnamed_addr #4

declare void @_ZN3imp8Geometry14generateColorsERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(156), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #4

declare void @_ZN3imp8Geometry15generateNormalsENS0_13NormalGenModeE(ptr noundef nonnull align 8 dereferenceable(156), i32 noundef) local_unnamed_addr #4

declare void @_ZN3imp8Geometry17generateTexCoordsENS0_10TexGenModeEf(ptr noundef nonnull align 8 dereferenceable(156), i32 noundef, float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp15GeometryBuilder11createTorusEiff(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8 %0, i32 noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"struct.imp::CircleSampler", align 8
  %6 = alloca %"class.imp::Vec3", align 8
  %7 = alloca %"class.imp::Vec3", align 8
  %8 = alloca %"class.std::vector.13", align 8
  %9 = alloca %"class.imp::Vec3", align 8
  %10 = alloca %"class.imp::Vec", align 8
  %11 = alloca %"class.imp::Vec3", align 8
  %12 = alloca %"class.imp::Vec3", align 8
  %13 = alloca %"struct.imp::CircleSampler", align 8
  %14 = alloca %"class.imp::Vec3", align 8
  %15 = alloca %"class.imp::Vec3", align 8
  %16 = alloca %"class.std::shared_ptr", align 8
  %17 = alloca %"class.imp::Vec3", align 8
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  call void @_ZN3imp4Vec3C2Ef(ptr noundef nonnull align 8 dereferenceable(36) %6, float noundef 0.000000e+00)
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %7, ptr noundef nonnull align 8 dereferenceable(36) @_ZN3imp4Vec31YE) #5
  invoke void @_ZN3imp13CircleSamplerC2ERKNS_4Vec3EfS1_i(ptr noundef nonnull align 8 dereferenceable(112) %5, ptr noundef nonnull align 8 dereferenceable(36) %6, float noundef %2, ptr noundef nonnull %7, i32 noundef %1)
          to label %18 unwind label %22

18:                                               ; preds = %4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %7) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %19 = add nsw i32 %1, -1
  %20 = icmp sgt i32 %1, 0
  br i1 %20, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %18
  %21 = add nsw i32 %1, -2
  br label %.lr.ph

._crit_edge:                                      ; preds = %28, %18
  invoke void @_ZN3imp8Geometry6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %._crit_edge
  br i1 %20, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph51

22:                                               ; preds = %4
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %7) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  br label %68

.lr.ph:                                           ; preds = %.lr.ph.preheader, %28
  %.02348 = phi i32 [ %29, %28 ], [ 0, %.lr.ph.preheader ]
  %.02447 = phi i32 [ %.02546, %28 ], [ %21, %.lr.ph.preheader ]
  %.02546 = phi i32 [ %.02348, %28 ], [ %19, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #5
  call void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec3") align 8 %11, ptr noundef nonnull align 8 dereferenceable(112) %5, i32 noundef %.02348)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #5
  call void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec3") align 8 %12, ptr noundef nonnull align 8 dereferenceable(112) %5, i32 noundef %.02447)
  call void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %10, ptr noundef nonnull align 8 dereferenceable(36) %11, ptr noundef nonnull align 8 dereferenceable(36) %12)
  invoke void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36) %9, ptr noundef nonnull align 8 dereferenceable(36) %10, float noundef 1.000000e+00)
          to label %24 unwind label %30

24:                                               ; preds = %.lr.ph
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %10) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %12) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #5
  %25 = invoke noundef float @_ZN3imp3VecILi3EfE9normalizeEv(ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %26 unwind label %32

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %14) #5
  call void @_ZNK3imp13CircleSamplerixEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec3") align 8 %14, ptr noundef nonnull align 8 dereferenceable(112) %5, i32 noundef %.02546)
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %15, ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  invoke void @_ZN3imp13CircleSamplerC2ERKNS_4Vec3EfS1_i(ptr noundef nonnull align 8 dereferenceable(112) %13, ptr noundef nonnull align 8 dereferenceable(36) %14, float noundef %3, ptr noundef nonnull %15, i32 noundef %1)
          to label %27 unwind label %34

27:                                               ; preds = %26
  invoke void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(112) %13)
          to label %28 unwind label %36

28:                                               ; preds = %27
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %13) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %15) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %14) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %13) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #5
  %29 = add nuw nsw i32 %.02348, 1
  %exitcond.not = icmp eq i32 %29, %1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

30:                                               ; preds = %.lr.ph
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %10) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %12) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #5
  br label %40

32:                                               ; preds = %24
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %39

34:                                               ; preds = %26
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %27
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %13) #5
  br label %38

38:                                               ; preds = %36, %34
  %.pn40 = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %15) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %14) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %13) #5
  br label %39

39:                                               ; preds = %38, %32
  %.pn40.pn = phi { ptr, i32 } [ %.pn40, %38 ], [ %33, %32 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  br label %40

40:                                               ; preds = %39, %30
  %.pn40.pn.pn = phi { ptr, i32 } [ %.pn40.pn, %39 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #5
  br label %67

._crit_edge52:                                    ; preds = %47, %.preheader
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  invoke void @_ZN3imp8Geometry12setPrimitiveENS0_9PrimitiveE(ptr noundef nonnull align 8 dereferenceable(156) %41, i32 noundef 0)
          to label %51 unwind label %58

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

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %47
  %indvars.iv = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next, %47 ]
  %.149 = phi i32 [ %19, %.lr.ph51.preheader ], [ %48, %47 ]
  call void @_ZNSt10shared_ptrIN3imp8GeometryEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  %44 = sext i32 %.149 to i64
  %45 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %44) #5
  %46 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv) #5
  invoke void @_ZN3imp13cylinder_sideESt10shared_ptrINS_8GeometryEERKNS_13CircleSamplerES5_(ptr noundef nonnull %16, ptr noundef nonnull align 8 dereferenceable(112) %45, ptr noundef nonnull align 8 dereferenceable(112) %46)
          to label %47 unwind label %49

47:                                               ; preds = %.lr.ph51
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = trunc nuw nsw i64 %indvars.iv to i32
  %exitcond54.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond54.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !7

49:                                               ; preds = %.lr.ph51
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  br label %66

51:                                               ; preds = %._crit_edge52
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %17) #5
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %17, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
          to label %53 unwind label %60

53:                                               ; preds = %51
  invoke void @_ZN3imp8Geometry14generateColorsERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(156) %52, ptr noundef nonnull align 8 dereferenceable(36) %17)
          to label %54 unwind label %62

54:                                               ; preds = %53
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %17) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %17) #5
  %55 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  invoke void @_ZN3imp8Geometry15generateNormalsENS0_13NormalGenModeE(ptr noundef nonnull align 8 dereferenceable(156) %55, i32 noundef 2)
          to label %56 unwind label %58

56:                                               ; preds = %54
  %57 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  invoke void @_ZN3imp8Geometry17generateTexCoordsENS0_10TexGenModeEf(ptr noundef nonnull align 8 dereferenceable(156) %57, i32 noundef 2, float noundef 1.000000e+00)
          to label %65 unwind label %58

58:                                               ; preds = %56, %54, %._crit_edge52
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %66

60:                                               ; preds = %51
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %64

62:                                               ; preds = %53
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %17) #5
  br label %64

64:                                               ; preds = %62, %60
  %.pn = phi { ptr, i32 } [ %63, %62 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %17) #5
  br label %66

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

66:                                               ; preds = %64, %58, %49
  %.pn38 = phi { ptr, i32 } [ %50, %49 ], [ %59, %58 ], [ %.pn, %64 ]
  call void @_ZNSt12__shared_ptrIN3imp8GeometryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  br label %67

67:                                               ; preds = %66, %42, %40
  %.pn40.pn.pn.pn = phi { ptr, i32 } [ %.pn40.pn.pn, %40 ], [ %.pn38, %66 ], [ %43, %42 ]
  call void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN3imp13CircleSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %5) #5
  br label %68

68:                                               ; preds = %67, %22
  %.pn40.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn40.pn.pn.pn, %67 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn40.pn.pn.pn.pn
}

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

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

; 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 uwtable
declare dso_local void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3imp13CircleSamplerESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 = { "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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


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