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

; 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

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

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

29:                                               ; preds = %84, %6
  %30 = load i32, ptr %14, align 4, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %91

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %35 = load i32, ptr %14, align 4, !tbaa !5
  %36 = sitofp i32 %35 to float
  %37 = invoke noundef float @_ZN3P3D2piIfEET_v()
          to label %38 unwind label %87

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

63:                                               ; preds = %38
  %64 = load i32, ptr %14, align 4, !tbaa !5
  %65 = mul nsw i32 %64, 2
  %66 = add nsw i32 %65, 1
  %67 = load float, ptr %15, align 4, !tbaa !9
  %68 = fpext float %67 to double
  %69 = call double @cos(double noundef %68) #6
  %70 = load float, ptr %9, align 4, !tbaa !9
  %71 = fpext float %70 to double
  %72 = fmul double %69, %71
  %73 = fptrunc double %72 to float
  %74 = load float, ptr %10, align 4, !tbaa !9
  %75 = fdiv float %74, 2.000000e+00
  %76 = load float, ptr %15, align 4, !tbaa !9
  %77 = fpext float %76 to double
  %78 = call double @sin(double noundef %77) #6
  %79 = load float, ptr %9, align 4, !tbaa !9
  %80 = fpext float %79 to double
  %81 = fmul double %78, %80
  %82 = fptrunc double %81 to float
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %66, float noundef %73, float noundef %75, float noundef %82)
          to label %83 unwind label %87

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

84:                                               ; preds = %83
  %85 = load i32, ptr %14, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %14, align 4, !tbaa !5
  br label %29, !llvm.loop !11

87:                                               ; preds = %63, %38, %34
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %16, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %196

91:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = mul nsw i32 %92, 2
  store i32 %93, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = mul nsw i32 %94, 2
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %19, align 4, !tbaa !5
  %97 = load i32, ptr %18, align 4, !tbaa !5
  %98 = load float, ptr %10, align 4, !tbaa !9
  %99 = fneg float %98
  %100 = fdiv float %99, 2.000000e+00
  %101 = load float, ptr %12, align 4, !tbaa !9
  %102 = fsub float %100, %101
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %97, float noundef 0.000000e+00, float noundef %102, float noundef 0.000000e+00)
          to label %103 unwind label %115

103:                                              ; preds = %91
  %104 = load i32, ptr %19, align 4, !tbaa !5
  %105 = load float, ptr %10, align 4, !tbaa !9
  %106 = fdiv float %105, 2.000000e+00
  %107 = load float, ptr %11, align 4, !tbaa !9
  %108 = fadd float %106, %107
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %104, float noundef 0.000000e+00, float noundef %108, float noundef 0.000000e+00)
          to label %109 unwind label %115

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

110:                                              ; preds = %143, %109
  %111 = load i32, ptr %20, align 4, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %119, label %114

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

115:                                              ; preds = %103, %91
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %16, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %17, align 4
  br label %195

119:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %120 = load i32, ptr %20, align 4, !tbaa !5
  %121 = mul nsw i32 %120, 2
  store i32 %121, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %122 = load i32, ptr %20, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = srem i32 %123, %124
  %126 = mul nsw i32 %125, 2
  store i32 %126, ptr %22, align 4, !tbaa !5
  %127 = load i32, ptr %20, align 4, !tbaa !5
  %128 = mul nsw i32 %127, 2
  %129 = load i32, ptr %21, align 4, !tbaa !5
  %130 = load i32, ptr %21, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  %132 = load i32, ptr %22, align 4, !tbaa !5
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %128, i32 noundef %129, i32 noundef %131, i32 noundef %132)
          to label %133 unwind label %146

133:                                              ; preds = %119
  %134 = load i32, ptr %20, align 4, !tbaa !5
  %135 = mul nsw i32 %134, 2
  %136 = add nsw i32 %135, 1
  %137 = load i32, ptr %22, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  %139 = load i32, ptr %22, align 4, !tbaa !5
  %140 = load i32, ptr %21, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %136, i32 noundef %138, i32 noundef %139, i32 noundef %141)
          to label %142 unwind label %146

142:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %20, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %20, align 4, !tbaa !5
  br label %110, !llvm.loop !13

146:                                              ; preds = %133, %119
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %16, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %17, align 4
  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 %195

150:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %187, %150
  %152 = load i32, ptr %23, align 4, !tbaa !5
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %194

156:                                              ; preds = %151
  %157 = load i32, ptr %23, align 4, !tbaa !5
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = mul nsw i32 %158, 2
  %160 = add nsw i32 %157, %159
  %161 = load i32, ptr %18, align 4, !tbaa !5
  %162 = load i32, ptr %23, align 4, !tbaa !5
  %163 = mul nsw i32 %162, 2
  %164 = load i32, ptr %23, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = srem i32 %165, %166
  %168 = mul nsw i32 %167, 2
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %160, i32 noundef %161, i32 noundef %163, i32 noundef %168)
          to label %169 unwind label %190

169:                                              ; preds = %156
  %170 = load i32, ptr %23, align 4, !tbaa !5
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = add nsw i32 %170, %171
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = mul nsw i32 %173, 2
  %175 = add nsw i32 %172, %174
  %176 = load i32, ptr %19, align 4, !tbaa !5
  %177 = load i32, ptr %23, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  %179 = load i32, ptr %8, align 4, !tbaa !5
  %180 = srem i32 %178, %179
  %181 = mul nsw i32 %180, 2
  %182 = add nsw i32 %181, 1
  %183 = load i32, ptr %23, align 4, !tbaa !5
  %184 = mul nsw i32 %183, 2
  %185 = add nsw i32 %184, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %175, i32 noundef %176, i32 noundef %182, i32 noundef %185)
          to label %186 unwind label %190

186:                                              ; preds = %169
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %23, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %23, align 4, !tbaa !5
  br label %151, !llvm.loop !14

190:                                              ; preds = %169, %156
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %16, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %195

194:                                              ; preds = %155
  call void @_ZN3P3D10PolyhedronC1EONS_13MeshPrototypeE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #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

195:                                              ; preds = %190, %146, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %196

196:                                              ; preds = %195, %87
  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 %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %16, align 8
  %199 = load i32, ptr %17, align 4
  %200 = insertvalue { ptr, i32 } poison, ptr %198, 0
  %201 = insertvalue { ptr, i32 } %200, i32 %199, 1
  resume { ptr, i32 } %201
}

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 = !{!"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

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

declare void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef, i32 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
define dso_local void @_ZN3P3D12ShapeLibrary17createPointyPrismEiffff(ptr dead_on_unwind noalias writable sret(%"class.P3D::Polyhedron") align 8 %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4, float 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 = shl nsw i32 %1, 1
  %9 = add nsw i32 %8, 2
  %10 = shl nsw i32 %1, 2
  call void @_ZN3P3D12EditableMeshC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %9, i32 noundef %10)
  %11 = icmp sgt i32 %1, 0
  br i1 %11, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %6
  %.pre = fmul float %3, -5.000000e-01
  br label %._crit_edge

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

._crit_edge:                                      ; preds = %40, %.._crit_edge_crit_edge
  %.pre-phi = phi float [ %.pre, %.._crit_edge_crit_edge ], [ %14, %40 ]
  %16 = or disjoint i32 %8, 1
  %17 = fsub float %.pre-phi, %5
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %8, float noundef 0.000000e+00, float noundef %17, float noundef 0.000000e+00)
          to label %44 unwind label %48

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

32:                                               ; preds = %18
  %33 = or disjoint i32 %24, 1
  %34 = call double @cos(double noundef %25) #8
  %35 = fmul double %34, %13
  %36 = fptrunc double %35 to float
  %37 = call double @sin(double noundef %25) #8
  %38 = fmul double %37, %13
  %39 = fptrunc double %38 to float
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %33, float noundef %36, float noundef %15, float noundef %39)
          to label %40 unwind label %42

40:                                               ; preds = %32
  %41 = add nuw nsw i32 %.05869, 1
  %exitcond.not = icmp eq i32 %41, %1
  br i1 %exitcond.not, label %._crit_edge, label %18, !llvm.loop !5

42:                                               ; preds = %32, %18
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %74

44:                                               ; preds = %._crit_edge
  %45 = fmul float %3, 5.000000e-01
  %46 = fadd float %45, %4
  invoke void @_ZN3P3D12EditableMesh9setVertexEifff(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %16, float noundef 0.000000e+00, float noundef %46, float noundef 0.000000e+00)
          to label %.preheader68.preheader unwind label %48

.preheader68.preheader:                           ; preds = %44
  %smax = call i32 @llvm.smax.i32(i32 %1, i32 0)
  br label %.preheader68

.preheader68:                                     ; preds = %.preheader68.preheader, %56
  %.060 = phi i32 [ %52, %56 ], [ 0, %.preheader68.preheader ]
  %exitcond70.not = icmp eq i32 %.060, %smax
  br i1 %exitcond70.not, label %.preheader, label %50

.preheader:                                       ; preds = %.preheader68
  %47 = mul i32 %1, 3
  br label %60

48:                                               ; preds = %44, %._crit_edge
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %74

50:                                               ; preds = %.preheader68
  %51 = shl nuw nsw i32 %.060, 1
  %52 = add nuw i32 %.060, 1
  %53 = srem i32 %52, %1
  %54 = shl nuw nsw i32 %53, 1
  %55 = or disjoint i32 %51, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %51, i32 noundef %51, i32 noundef %55, i32 noundef %54)
          to label %56 unwind label %58

56:                                               ; preds = %50
  %57 = or disjoint i32 %54, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %55, i32 noundef %57, i32 noundef %54, i32 noundef %55)
          to label %.preheader68 unwind label %58, !llvm.loop !7

58:                                               ; preds = %56, %50
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %74

60:                                               ; preds = %.preheader, %68
  %.0 = phi i32 [ %65, %68 ], [ 0, %.preheader ]
  %exitcond71.not = icmp eq i32 %.0, %smax
  br i1 %exitcond71.not, label %61, label %62

61:                                               ; preds = %60
  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

62:                                               ; preds = %60
  %63 = add nsw i32 %.0, %8
  %64 = shl nuw nsw i32 %.0, 1
  %65 = add nuw i32 %.0, 1
  %66 = srem i32 %65, %1
  %67 = shl nuw nsw i32 %66, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %63, i32 noundef %8, i32 noundef %64, i32 noundef %67)
          to label %68 unwind label %72

68:                                               ; preds = %62
  %69 = add i32 %47, %.0
  %70 = or disjoint i32 %67, 1
  %71 = or disjoint i32 %64, 1
  invoke void @_ZN3P3D12EditableMesh11setTriangleEiiii(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %69, i32 noundef %16, i32 noundef %70, i32 noundef %71)
          to label %60 unwind label %72, !llvm.loop !8

72:                                               ; preds = %68, %62
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %74

74:                                               ; preds = %48, %58, %72, %42
  %.pn66 = phi { ptr, i32 } [ %43, %42 ], [ %59, %58 ], [ %73, %72 ], [ %49, %48 ]
  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 } %.pn66
}

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


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