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

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

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D12ShapeLibrary11createPrismEiff(ptr dead_on_unwind noalias writable sret(%"class.P3D::Polyhedron") align 8 %0, i32 noundef %1, float noundef %2, float noundef %3) #1 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 %"class.P3D::EditableMesh", align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  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 24, ptr %9) #6
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = mul nsw i32 %21, 2
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  %25 = mul nsw i32 %24, 4
  call void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %22, i32 noundef %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %71, %4
  %27 = load i32, ptr %10, align 4, !tbaa !5
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %83

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %32 = load i32, ptr %10, align 4, !tbaa !5
  %33 = sitofp i32 %32 to float
  %34 = invoke noundef float @_ZN3P3D2piIfEET_v()
          to label %35 unwind label %74

35:                                               ; preds = %31
  %36 = fmul float %33, %34
  %37 = fmul float %36, 2.000000e+00
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sitofp i32 %38 to float
  %40 = fdiv float %37, %39
  store float %40, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %41 = load float, ptr %8, align 4, !tbaa !9
  %42 = fdiv float %41, 2.000000e+00
  store float %42, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %43 = load float, ptr %11, align 4, !tbaa !9
  %44 = fpext float %43 to double
  %45 = call double @cos(double noundef %44) #6
  %46 = load float, ptr %7, align 4, !tbaa !9
  %47 = fpext float %46 to double
  %48 = fmul double %45, %47
  %49 = fptrunc double %48 to float
  store float %49, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %50 = load float, ptr %11, align 4, !tbaa !9
  %51 = fpext float %50 to double
  %52 = call double @sin(double noundef %51) #6
  %53 = load float, ptr %7, align 4, !tbaa !9
  %54 = fpext float %53 to double
  %55 = fmul double %52, %54
  %56 = fptrunc double %55 to float
  store float %56, ptr %16, align 4, !tbaa !9
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = mul nsw i32 %57, 2
  %59 = load float, ptr %15, align 4, !tbaa !9
  %60 = load float, ptr %16, align 4, !tbaa !9
  %61 = load float, ptr %14, align 4, !tbaa !9
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %58, float noundef %59, float noundef %60, float noundef %61)
          to label %62 unwind label %78

62:                                               ; preds = %35
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = mul nsw i32 %63, 2
  %65 = add nsw i32 %64, 1
  %66 = load float, ptr %15, align 4, !tbaa !9
  %67 = load float, ptr %16, align 4, !tbaa !9
  %68 = load float, ptr %14, align 4, !tbaa !9
  %69 = fneg float %68
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %65, float noundef %66, float noundef %67, float noundef %69)
          to label %70 unwind label %78

70:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %10, align 4, !tbaa !5
  br label %26, !llvm.loop !11

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

78:                                               ; preds = %62, %35
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %82

82:                                               ; preds = %78, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %163

83:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %113, %83
  %85 = load i32, ptr %17, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %120

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %90 = load i32, ptr %17, align 4, !tbaa !5
  %91 = mul nsw i32 %90, 2
  store i32 %91, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %92 = load i32, ptr %17, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = srem i32 %93, %94
  %96 = mul nsw i32 %95, 2
  store i32 %96, ptr %19, align 4, !tbaa !5
  %97 = load i32, ptr %17, align 4, !tbaa !5
  %98 = mul nsw i32 %97, 2
  %99 = load i32, ptr %18, align 4, !tbaa !5
  %100 = load i32, ptr %18, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  %102 = load i32, ptr %19, align 4, !tbaa !5
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %98, i32 noundef %99, i32 noundef %101, i32 noundef %102)
          to label %103 unwind label %116

103:                                              ; preds = %89
  %104 = load i32, ptr %17, align 4, !tbaa !5
  %105 = mul nsw i32 %104, 2
  %106 = add nsw i32 %105, 1
  %107 = load i32, ptr %19, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  %109 = load i32, ptr %19, align 4, !tbaa !5
  %110 = load i32, ptr %18, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %106, i32 noundef %108, i32 noundef %109, i32 noundef %111)
          to label %112 unwind label %116

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

113:                                              ; preds = %112
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %17, align 4, !tbaa !5
  br label %84, !llvm.loop !13

116:                                              ; preds = %103, %89
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %12, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %163

120:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %155, %120
  %122 = load i32, ptr %20, align 4, !tbaa !5
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 2
  %125 = icmp slt i32 %122, %124
  br i1 %125, label %127, label %126

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

127:                                              ; preds = %121
  %128 = load i32, ptr %20, align 4, !tbaa !5
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = mul nsw i32 %129, 2
  %131 = add nsw i32 %128, %130
  %132 = load i32, ptr %20, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  %134 = mul nsw i32 %133, 2
  %135 = load i32, ptr %20, align 4, !tbaa !5
  %136 = add nsw i32 %135, 2
  %137 = mul nsw i32 %136, 2
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %131, i32 noundef 0, i32 noundef %134, i32 noundef %137)
          to label %138 unwind label %158

138:                                              ; preds = %127
  %139 = load i32, ptr %20, align 4, !tbaa !5
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 2
  %142 = add nsw i32 %139, %141
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = mul nsw i32 %143, 2
  %145 = add nsw i32 %142, %144
  %146 = load i32, ptr %20, align 4, !tbaa !5
  %147 = add nsw i32 %146, 2
  %148 = mul nsw i32 %147, 2
  %149 = add nsw i32 %148, 1
  %150 = load i32, ptr %20, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  %152 = mul nsw i32 %151, 2
  %153 = add nsw i32 %152, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %145, i32 noundef 1, i32 noundef %149, i32 noundef %153)
          to label %154 unwind label %158

154:                                              ; preds = %138
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %20, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %20, align 4, !tbaa !5
  br label %121, !llvm.loop !14

158:                                              ; preds = %138, %127
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %12, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %163

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

163:                                              ; preds = %158, %116, %82
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %164

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; 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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 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 #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 = { 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}
!14 = distinct !{!14, !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.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" }

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D12ShapeLibrary11createPrismEiff(ptr dead_on_unwind noalias writable sret(%"class.P3D::Polyhedron") align 8 %0, i32 noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.P3D::EditableMesh", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  %6 = shl nsw i32 %1, 1
  %7 = shl i32 %1, 2
  %8 = add i32 %7, -4
  call void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %6, i32 noundef %8)
  %9 = icmp sgt i32 %1, 0
  br i1 %9, label %.lr.ph, label %.preheader54

.lr.ph:                                           ; preds = %4
  %10 = uitofp nneg i32 %1 to float
  %11 = fmul float %3, 5.000000e-01
  %12 = fpext float %2 to double
  %13 = fneg float %11
  br label %14

.preheader54:                                     ; preds = %30, %4
  %smax = call i32 @llvm.smax.i32(i32 %1, i32 0)
  br label %34

14:                                               ; preds = %.lr.ph, %30
  %.04755 = phi i32 [ 0, %.lr.ph ], [ %31, %30 ]
  %15 = uitofp nneg i32 %.04755 to float
  %16 = call noundef float @_ZN3P3D2piIfEET_v()
  %17 = fmul float %16, %15
  %18 = fmul float %17, 2.000000e+00
  %19 = fdiv float %18, %10
  %20 = fpext float %19 to double
  %21 = call double @cos(double noundef %20) #8
  %22 = fmul double %21, %12
  %23 = fptrunc double %22 to float
  %24 = call double @sin(double noundef %20) #8
  %25 = fmul double %24, %12
  %26 = fptrunc double %25 to float
  %27 = shl nuw nsw i32 %.04755, 1
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %27, float noundef %23, float noundef %26, float noundef %11)
          to label %28 unwind label %32

28:                                               ; preds = %14
  %29 = or disjoint i32 %27, 1
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %29, float noundef %23, float noundef %26, float noundef %13)
          to label %30 unwind label %32

30:                                               ; preds = %28
  %31 = add nuw nsw i32 %.04755, 1
  %exitcond.not = icmp eq i32 %31, %1
  br i1 %exitcond.not, label %.preheader54, label %14, !llvm.loop !5

32:                                               ; preds = %28, %14
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %61

34:                                               ; preds = %.preheader54, %43
  %.049 = phi i32 [ %39, %43 ], [ 0, %.preheader54 ]
  %exitcond56.not = icmp eq i32 %.049, %smax
  br i1 %exitcond56.not, label %.preheader, label %37

.preheader:                                       ; preds = %34
  %35 = add nsw i32 %1, -2
  %36 = add i32 %6, %35
  %smax57 = call i32 @llvm.smax.i32(i32 %35, i32 0)
  br label %47

37:                                               ; preds = %34
  %38 = shl nuw nsw i32 %.049, 1
  %39 = add nuw i32 %.049, 1
  %40 = srem i32 %39, %1
  %41 = shl nuw nsw i32 %40, 1
  %42 = or disjoint i32 %38, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %38, i32 noundef %38, i32 noundef %42, i32 noundef %41)
          to label %43 unwind label %45

43:                                               ; preds = %37
  %44 = or disjoint i32 %41, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %42, i32 noundef %44, i32 noundef %41, i32 noundef %42)
          to label %34 unwind label %45, !llvm.loop !7

45:                                               ; preds = %43, %37
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %61

47:                                               ; preds = %.preheader, %55
  %.0 = phi i32 [ %51, %55 ], [ 0, %.preheader ]
  %exitcond58.not = icmp eq i32 %.0, %smax57
  br i1 %exitcond58.not, label %48, label %49

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

49:                                               ; preds = %47
  %50 = add nsw i32 %.0, %6
  %51 = add nuw i32 %.0, 1
  %52 = shl nuw nsw i32 %51, 1
  %53 = shl nuw i32 %.0, 1
  %54 = add i32 %53, 4
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %50, i32 noundef 0, i32 noundef %52, i32 noundef %54)
          to label %55 unwind label %59

55:                                               ; preds = %49
  %56 = add i32 %36, %.0
  %57 = add i32 %53, 5
  %58 = or disjoint i32 %52, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %56, i32 noundef 1, i32 noundef %57, i32 noundef %58)
          to label %47 unwind label %59, !llvm.loop !8

59:                                               ; preds = %55, %49
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %61

61:                                               ; preds = %59, %45, %32
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %46, %45 ], [ %60, %59 ]
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

; 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 = { 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 #2 = { "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 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 #4 = { 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 #5 = { 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 #6 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


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