; LLVM IR from ThePhysicsGuys/Physics3D :: Physics3D/geometry (shapeLibrary)

; 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.P3D::Polyhedron" = type { %"class.P3D::TriangleMesh" }
%"class.P3D::TriangleMesh" = type { %"class.P3D::MeshPrototype" }
%"class.P3D::MeshPrototype" = type { %"class.P3D::UniqueAlignedPointer", %"class.P3D::UniqueAlignedPointer.2", i32, i32 }
%"class.P3D::UniqueAlignedPointer" = type { ptr }
%"class.P3D::UniqueAlignedPointer.2" = type { ptr }
%"class.P3D::EditableMesh" = type { %"class.P3D::MeshPrototype" }
%"struct.P3D::Vector.3" = type { %union.anon.4 }
%union.anon.4 = type { [2 x float] }
%struct.anon.5 = type { float, float }

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

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

declare void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: nounwind
declare double @sin(double noundef) #3

declare void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, float noundef, float noundef, float noundef) #1

; Function Attrs: nounwind
declare void @_ZN3P3D10PolyhedronC1EONS_13MeshPrototypeE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3P3D12ShapeLibraryL18createTriangleRingEiiiRNS_12EditableMeshEi(i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D12ShapeLibrary19createRevolvedShapeEfPNS_6VectorIfLm2EEEifi(ptr dead_on_unwind noalias writable sret(%"class.P3D::Polyhedron") align 8 %0, float noundef %1, ptr noundef %2, i32 noundef %3, float noundef %4, i32 noundef %5) #5 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.P3D::EditableMesh", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %7, align 8
  store float %1, ptr %8, align 4, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !11
  store float %4, ptr %11, align 4, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  %26 = load i32, ptr %12, align 4, !tbaa !11
  %27 = load i32, ptr %10, align 4, !tbaa !11
  %28 = mul nsw i32 %26, %27
  %29 = add nsw i32 %28, 2
  %30 = load i32, ptr %12, align 4, !tbaa !11
  %31 = mul nsw i32 %30, 2
  %32 = load i32, ptr %10, align 4, !tbaa !11
  %33 = mul nsw i32 %31, %32
  call void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %29, i32 noundef %33)
  %34 = load float, ptr %8, align 4, !tbaa !5
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %34)
          to label %35 unwind label %48

35:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %36 = load i32, ptr %12, align 4, !tbaa !11
  %37 = load i32, ptr %10, align 4, !tbaa !11
  %38 = mul nsw i32 %36, %37
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %16, align 4, !tbaa !11
  %40 = load i32, ptr %16, align 4, !tbaa !11
  %41 = load float, ptr %11, align 4, !tbaa !5
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %40, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %41)
          to label %42 unwind label %52

42:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %121, %42
  %44 = load i32, ptr %17, align 4, !tbaa !11
  %45 = load i32, ptr %12, align 4, !tbaa !11
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %56, label %47

47:                                               ; preds = %43
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %125

48:                                               ; preds = %6
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %14, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %15, align 4
  br label %176

52:                                               ; preds = %159, %125, %35
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %14, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %15, align 4
  br label %175

56:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %57 = invoke noundef float @_ZN3P3D2piIfEET_v()
          to label %58 unwind label %79

58:                                               ; preds = %56
  %59 = fmul float 2.000000e+00, %57
  %60 = load i32, ptr %17, align 4, !tbaa !11
  %61 = sitofp i32 %60 to float
  %62 = fmul float %59, %61
  %63 = load i32, ptr %12, align 4, !tbaa !11
  %64 = sitofp i32 %63 to float
  %65 = fdiv float %62, %64
  store float %65, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %66 = load float, ptr %19, align 4, !tbaa !5
  %67 = fpext float %66 to double
  %68 = call double @sin(double noundef %67) #6
  %69 = fptrunc double %68 to float
  store float %69, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %70 = load float, ptr %19, align 4, !tbaa !5
  %71 = fpext float %70 to double
  %72 = call double @cos(double noundef %71) #6
  %73 = fptrunc double %72 to float
  store float %73, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %113, %58
  %75 = load i32, ptr %22, align 4, !tbaa !11
  %76 = load i32, ptr %10, align 4, !tbaa !11
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %83, label %78

78:                                               ; preds = %74
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %120

79:                                               ; preds = %56
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %14, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %15, align 4
  br label %124

83:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %84 = load ptr, ptr %9, align 8, !tbaa !9
  %85 = load i32, ptr %22, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %"struct.P3D::Vector.3", ptr %84, i64 %86
  %88 = getelementptr inbounds %"struct.P3D::Vector.3", ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds %struct.anon.5, ptr %88, i32 0, i32 0
  %90 = load float, ptr %89, align 4, !tbaa !13
  store float %90, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %91 = load ptr, ptr %9, align 8, !tbaa !9
  %92 = load i32, ptr %22, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %"struct.P3D::Vector.3", ptr %91, i64 %93
  %95 = getelementptr inbounds %"struct.P3D::Vector.3", ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.anon.5, ptr %95, i32 0, i32 1
  %97 = load float, ptr %96, align 4, !tbaa !13
  store float %97, ptr %24, align 4, !tbaa !5
  %98 = load i32, ptr %22, align 4, !tbaa !11
  %99 = load i32, ptr %12, align 4, !tbaa !11
  %100 = mul nsw i32 %98, %99
  %101 = load i32, ptr %17, align 4, !tbaa !11
  %102 = add nsw i32 %100, %101
  %103 = add nsw i32 %102, 1
  %104 = load float, ptr %20, align 4, !tbaa !5
  %105 = fneg float %104
  %106 = load float, ptr %24, align 4, !tbaa !5
  %107 = fmul float %105, %106
  %108 = load float, ptr %21, align 4, !tbaa !5
  %109 = load float, ptr %24, align 4, !tbaa !5
  %110 = fmul float %108, %109
  %111 = load float, ptr %23, align 4, !tbaa !5
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %103, float noundef %107, float noundef %110, float noundef %111)
          to label %112 unwind label %116

112:                                              ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %22, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %22, align 4, !tbaa !11
  br label %74, !llvm.loop !14

116:                                              ; preds = %83
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %14, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %124

120:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %17, align 4, !tbaa !11
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %17, align 4, !tbaa !11
  br label %43, !llvm.loop !16

124:                                              ; preds = %116, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %175

125:                                              ; preds = %47
  %126 = load i32, ptr %12, align 4, !tbaa !11
  invoke void @_ZN3P3D12ShapeLibraryL25createTriangleConeReverseEiiiRNS_12EditableMeshEi(i32 noundef 0, i32 noundef 1, i32 noundef %126, ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %127 unwind label %52

127:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %128

128:                                              ; preds = %152, %127
  %129 = load i32, ptr %25, align 4, !tbaa !11
  %130 = load i32, ptr %10, align 4, !tbaa !11
  %131 = sub nsw i32 %130, 1
  %132 = icmp slt i32 %129, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %128
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %159

134:                                              ; preds = %128
  %135 = load i32, ptr %12, align 4, !tbaa !11
  %136 = load i32, ptr %25, align 4, !tbaa !11
  %137 = mul nsw i32 %135, %136
  %138 = add nsw i32 1, %137
  %139 = load i32, ptr %12, align 4, !tbaa !11
  %140 = load i32, ptr %25, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  %142 = mul nsw i32 %139, %141
  %143 = add nsw i32 1, %142
  %144 = load i32, ptr %12, align 4, !tbaa !11
  %145 = load i32, ptr %12, align 4, !tbaa !11
  %146 = load i32, ptr %12, align 4, !tbaa !11
  %147 = mul nsw i32 2, %146
  %148 = load i32, ptr %25, align 4, !tbaa !11
  %149 = mul nsw i32 %147, %148
  %150 = add nsw i32 %145, %149
  invoke void @_ZN3P3D12ShapeLibraryL18createTriangleRingEiiiRNS_12EditableMeshEi(i32 noundef %138, i32 noundef %143, i32 noundef %144, ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %150)
          to label %151 unwind label %155

151:                                              ; preds = %134
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %25, align 4, !tbaa !11
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %25, align 4, !tbaa !11
  br label %128, !llvm.loop !17

155:                                              ; preds = %134
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %14, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %175

159:                                              ; preds = %133
  %160 = load i32, ptr %16, align 4, !tbaa !11
  %161 = load i32, ptr %12, align 4, !tbaa !11
  %162 = load i32, ptr %10, align 4, !tbaa !11
  %163 = sub nsw i32 %162, 1
  %164 = mul nsw i32 %161, %163
  %165 = add nsw i32 1, %164
  %166 = load i32, ptr %12, align 4, !tbaa !11
  %167 = load i32, ptr %12, align 4, !tbaa !11
  %168 = load i32, ptr %12, align 4, !tbaa !11
  %169 = mul nsw i32 2, %168
  %170 = load i32, ptr %10, align 4, !tbaa !11
  %171 = sub nsw i32 %170, 1
  %172 = mul nsw i32 %169, %171
  %173 = add nsw i32 %167, %172
  invoke void @_ZN3P3D12ShapeLibraryL18createTriangleConeEiiiRNS_12EditableMeshEi(i32 noundef %160, i32 noundef %165, i32 noundef %166, ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %173)
          to label %174 unwind label %52

174:                                              ; preds = %159
  call void @_ZN3P3D10PolyhedronC1EONS_13MeshPrototypeE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  ret void

175:                                              ; preds = %155, %124, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %176

176:                                              ; preds = %175, %48
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr %14, align 8
  %179 = load i32, ptr %15, align 4
  %180 = insertvalue { ptr, i32 } poison, ptr %178, 0
  %181 = insertvalue { ptr, i32 } %180, i32 %179, 1
  resume { ptr, i32 } %181
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3P3D12ShapeLibraryL25createTriangleConeReverseEiiiRNS_12EditableMeshEi(i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3P3D12ShapeLibraryL18createTriangleConeEiiiRNS_12EditableMeshEi(i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


; 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.P3D::Polyhedron" = type { %"class.P3D::TriangleMesh" }
%"class.P3D::TriangleMesh" = type { %"class.P3D::MeshPrototype" }
%"class.P3D::MeshPrototype" = type { %"class.P3D::UniqueAlignedPointer", %"class.P3D::UniqueAlignedPointer.2", i32, i32 }
%"class.P3D::UniqueAlignedPointer" = type { ptr }
%"class.P3D::UniqueAlignedPointer.2" = type { ptr }
%"class.P3D::EditableMesh" = type { %"class.P3D::MeshPrototype" }
%"struct.P3D::Vector.3" = type { %union.anon.4 }
%union.anon.4 = type { [2 x float] }

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

declare void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN3P3D10PolyhedronC1EONS_13MeshPrototypeE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3P3D12ShapeLibraryL18createTriangleRingEiiiRNS_12EditableMeshEi(i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D12ShapeLibrary19createRevolvedShapeEfPNS_6VectorIfLm2EEEifi(ptr dead_on_unwind noalias writable sret(%"class.P3D::Polyhedron") align 8 %0, float noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, float noundef %4, i32 noundef %5) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.P3D::EditableMesh", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  %8 = mul nsw i32 %5, %3
  %9 = add nsw i32 %8, 2
  %10 = shl nsw i32 %5, 1
  %11 = mul nsw i32 %10, %3
  call void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %9, i32 noundef %11)
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 0, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %1)
          to label %12 unwind label %42

12:                                               ; preds = %6
  %13 = add nsw i32 %8, 1
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %13, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %4)
          to label %.preheader61 unwind label %44

.preheader61:                                     ; preds = %12
  %14 = icmp sgt i32 %5, 0
  br i1 %14, label %.lr.ph65, label %._crit_edge66

.lr.ph65:                                         ; preds = %.preheader61
  %15 = uitofp nneg i32 %5 to float
  %16 = icmp sgt i32 %3, 0
  br i1 %16, label %.lr.ph.us.preheader, label %.lr.ph65.split

.lr.ph.us.preheader:                              ; preds = %.lr.ph65
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %.05564.us = phi i32 [ %27, %._crit_edge.us ], [ 0, %.lr.ph.us.preheader ]
  %17 = call noundef float @_ZN3P3D2piIfEET_v()
  %18 = fmul float %17, 2.000000e+00
  %19 = uitofp nneg i32 %.05564.us to float
  %20 = fmul float %18, %19
  %21 = fdiv float %20, %15
  %22 = fpext float %21 to double
  %23 = call double @sin(double noundef %22) #8
  %24 = fptrunc double %23 to float
  %25 = call double @cos(double noundef %22) #8
  %26 = fptrunc double %25 to float
  %27 = add nuw nsw i32 %.05564.us, 1
  %28 = fneg float %24
  br label %29

29:                                               ; preds = %.lr.ph.us, %39
  %indvars.iv = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next, %39 ]
  %30 = getelementptr inbounds %"struct.P3D::Vector.3", ptr %2, i64 %indvars.iv
  %31 = load float, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %30, i64 4
  %33 = load float, ptr %32, align 4, !tbaa !5
  %34 = trunc i64 %indvars.iv to i32
  %35 = mul i32 %34, %5
  %36 = add i32 %27, %35
  %37 = fmul float %33, %28
  %38 = fmul float %33, %26
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %36, float noundef %37, float noundef %38, float noundef %31)
          to label %39 unwind label %.split.us

39:                                               ; preds = %29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond69.not, label %._crit_edge.us, label %29, !llvm.loop !8

._crit_edge.us:                                   ; preds = %39
  %exitcond70.not = icmp eq i32 %27, %5
  br i1 %exitcond70.not, label %._crit_edge66, label %.lr.ph.us, !llvm.loop !10

.split.us:                                        ; preds = %29
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %72

._crit_edge66:                                    ; preds = %.lr.ph65.split, %._crit_edge.us, %.preheader61
  invoke void @_ZN3P3D12ShapeLibraryL25createTriangleConeReverseEiiiRNS_12EditableMeshEi(i32 noundef 0, i32 noundef 1, i32 noundef %5, ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 0)
          to label %.preheader unwind label %44

.preheader:                                       ; preds = %._crit_edge66
  %41 = add nsw i32 %3, -1
  %smax = call i32 @llvm.smax.i32(i32 %41, i32 0)
  br label %55

42:                                               ; preds = %6
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %72

44:                                               ; preds = %56, %._crit_edge66, %12
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %72

.lr.ph65.split:                                   ; preds = %.lr.ph65, %.lr.ph65.split
  %.05564 = phi i32 [ %54, %.lr.ph65.split ], [ 0, %.lr.ph65 ]
  %46 = call noundef float @_ZN3P3D2piIfEET_v()
  %47 = fmul float %46, 2.000000e+00
  %48 = uitofp nneg i32 %.05564 to float
  %49 = fmul float %47, %48
  %50 = fdiv float %49, %15
  %51 = fpext float %50 to double
  %52 = call double @sin(double noundef %51) #8
  %53 = call double @cos(double noundef %51) #8
  %54 = add nuw nsw i32 %.05564, 1
  %exitcond.not = icmp eq i32 %54, %5
  br i1 %exitcond.not, label %._crit_edge66, label %.lr.ph65.split, !llvm.loop !10

55:                                               ; preds = %.preheader, %61
  %.0 = phi i32 [ %64, %61 ], [ 0, %.preheader ]
  %exitcond71.not = icmp eq i32 %.0, %smax
  br i1 %exitcond71.not, label %56, label %61

56:                                               ; preds = %55
  %57 = mul nsw i32 %41, %5
  %58 = add nsw i32 %57, 1
  %59 = mul nsw i32 %10, %41
  %60 = add nsw i32 %59, %5
  invoke void @_ZN3P3D12ShapeLibraryL18createTriangleConeEiiiRNS_12EditableMeshEi(i32 noundef %13, i32 noundef %58, i32 noundef %5, ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %60)
          to label %71 unwind label %44

61:                                               ; preds = %55
  %62 = mul nsw i32 %.0, %5
  %63 = add nsw i32 %62, 1
  %64 = add nuw i32 %.0, 1
  %65 = mul nsw i32 %64, %5
  %66 = add nsw i32 %65, 1
  %67 = mul nsw i32 %.0, %10
  %68 = add nsw i32 %67, %5
  invoke void @_ZN3P3D12ShapeLibraryL18createTriangleRingEiiiRNS_12EditableMeshEi(i32 noundef %63, i32 noundef %66, i32 noundef %5, ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %68)
          to label %55 unwind label %69, !llvm.loop !11

69:                                               ; preds = %61
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %72

71:                                               ; preds = %56
  call void @_ZN3P3D10PolyhedronC1EONS_13MeshPrototypeE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  ret void

72:                                               ; preds = %44, %.split.us, %69, %42
  %.pn.pn = phi { ptr, i32 } [ %43, %42 ], [ %40, %.split.us ], [ %70, %69 ], [ %45, %44 ]
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3P3D12ShapeLibraryL25createTriangleConeReverseEiiiRNS_12EditableMeshEi(i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3P3D12ShapeLibraryL18createTriangleConeEiiiRNS_12EditableMeshEi(i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 nofree nounwind willreturn memory(write) "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass