; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnflow/polygon/polygon.ll (ZNK8Triangle22snapOffPrsDrainSpontNREv)

; 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.ElemModel = type { ptr, double, double, ptr, ptr, double, ptr, i8, i8, i8, i8, i32, double, double, double, double, double, double, double, %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair" = type { double, double }
%class.VoidElem = type { %class.ElemModel, double, double, double, double }
%class.Polygon = type { %class.VoidElem, i32, %"class.std::vector.16", ptr, ptr, i16, i8, double }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.LayerApex = type { %class.Apex, i32, ptr, double, ptr, double }
%class.Apex = type { ptr, i8, double, double, ptr, i32, double, double, double, double, i8, i8, i8, i8, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, double }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Apex6existsEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK8Triangle25snapOffPrsDrainFromCornerERbi(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK8Triangle22snapOffPrsDrainSpontNREv(ptr noundef nonnull align 8 dereferenceable(248) %0) unnamed_addr #4 align 2 {
  %2 = alloca double, align 8
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %13 = getelementptr inbounds %class.ElemModel, ptr %12, i32 0, i32 4
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = call noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984) %14)
  store double %15, ptr %4, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %16 = load double, ptr %4, align 8, !tbaa !15
  %17 = getelementptr inbounds %class.VoidElem, ptr %12, i32 0, i32 4
  %18 = load double, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef 0) #5
  %21 = load double, ptr %20, align 8, !tbaa !15
  %22 = fsub double %18, %21
  %23 = call double @cos(double noundef %22) #5
  %24 = fmul double %16, %23
  %25 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #5
  %27 = load double, ptr %26, align 8, !tbaa !15
  %28 = call double @sin(double noundef %27) #5
  %29 = getelementptr inbounds %class.ElemModel, ptr %12, i32 0, i32 5
  %30 = load double, ptr %29, align 8, !tbaa !18
  %31 = fmul double %28, %30
  %32 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef 0) #5
  %34 = load double, ptr %33, align 8, !tbaa !15
  %35 = call double @tan(double noundef %34) #5
  %36 = fdiv double 1.000000e+00, %35
  %37 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef 2) #5
  %39 = load double, ptr %38, align 8, !tbaa !15
  %40 = call double @tan(double noundef %39) #5
  %41 = fdiv double 1.000000e+00, %40
  %42 = fadd double %36, %41
  %43 = fmul double %31, %42
  %44 = fdiv double %24, %43
  store double %44, ptr %5, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %45 = load double, ptr %4, align 8, !tbaa !15
  %46 = getelementptr inbounds %class.ElemModel, ptr %12, i32 0, i32 5
  %47 = load double, ptr %46, align 8, !tbaa !18
  %48 = fdiv double %45, %47
  %49 = getelementptr inbounds %class.VoidElem, ptr %12, i32 0, i32 4
  %50 = load double, ptr %49, align 8, !tbaa !16
  %51 = call double @cos(double noundef %50) #5
  %52 = getelementptr inbounds %class.VoidElem, ptr %12, i32 0, i32 4
  %53 = load double, ptr %52, align 8, !tbaa !16
  %54 = call double @sin(double noundef %53) #5
  %55 = fmul double 2.000000e+00, %54
  %56 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef 0) #5
  %58 = load double, ptr %57, align 8, !tbaa !15
  %59 = call double @tan(double noundef %58) #5
  %60 = fdiv double 1.000000e+00, %59
  %61 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef 1) #5
  %63 = load double, ptr %62, align 8, !tbaa !15
  %64 = call double @tan(double noundef %63) #5
  %65 = fdiv double 1.000000e+00, %64
  %66 = fadd double %60, %65
  %67 = fdiv double %55, %66
  %68 = fadd double %51, %67
  %69 = fmul double %48, %68
  store double %69, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 0, ptr %7, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 0, ptr %8, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %70 = call noundef double @_ZNK8Triangle25snapOffPrsDrainFromCornerERbi(ptr noundef nonnull align 8 dereferenceable(248) %12, ptr noundef nonnull align 1 dereferenceable(1) %7, i32 noundef 2)
  store double %70, ptr %9, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %71 = call noundef double @_ZNK8Triangle25snapOffPrsDrainFromCornerERbi(ptr noundef nonnull align 8 dereferenceable(248) %12, ptr noundef nonnull align 1 dereferenceable(1) %8, i32 noundef 1)
  store double %71, ptr %10, align 8, !tbaa !15
  %72 = load i8, ptr %7, align 1, !tbaa !19, !range !20, !noundef !21
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %82

74:                                               ; preds = %1
  %75 = load i8, ptr %8, align 1, !tbaa !19, !range !20, !noundef !21
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %82

77:                                               ; preds = %74
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %78)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %79)
  %81 = load double, ptr %80, align 8, !tbaa !15
  store double %81, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %116

82:                                               ; preds = %74, %1
  %83 = load i8, ptr %7, align 1, !tbaa !19, !range !20, !noundef !21
  %84 = trunc i8 %83 to i1
  br i1 %84, label %85, label %89

85:                                               ; preds = %82
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %86)
  %88 = load double, ptr %87, align 8, !tbaa !15
  store double %88, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %116

89:                                               ; preds = %82
  %90 = load i8, ptr %8, align 1, !tbaa !19, !range !20, !noundef !21
  %91 = trunc i8 %90 to i1
  br i1 %91, label %92, label %96

92:                                               ; preds = %89
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %95 = load double, ptr %94, align 8, !tbaa !15
  store double %95, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %116

96:                                               ; preds = %89
  %97 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !22
  %99 = getelementptr inbounds %class.LayerApex, ptr %98, i64 1
  %100 = call noundef zeroext i1 @_ZNK4Apex6existsEv(ptr noundef nonnull align 8 dereferenceable(104) %99)
  br i1 %100, label %101, label %114

101:                                              ; preds = %96
  %102 = getelementptr inbounds %class.VoidElem, ptr %12, i32 0, i32 4
  %103 = load double, ptr %102, align 8, !tbaa !16
  %104 = load double, ptr @_ZN9ElemModel2PIE, align 8, !tbaa !15
  %105 = fdiv double %104, 2.000000e+00
  %106 = getelementptr inbounds %class.Polygon, ptr %12, i32 0, i32 2
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %106, i64 noundef 0) #5
  %108 = load double, ptr %107, align 8, !tbaa !15
  %109 = fadd double %105, %108
  %110 = fcmp ogt double %103, %109
  br i1 %110, label %111, label %114

111:                                              ; preds = %101
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %113 = load double, ptr %112, align 8, !tbaa !15
  store double %113, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %116

114:                                              ; preds = %101, %96
  %115 = load double, ptr %5, align 8, !tbaa !15
  store double %115, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %116

116:                                              ; preds = %114, %111, %92, %85, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %117 = load double, ptr %2, align 8
  ret double %117
}

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 = { 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 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"_ZTS9ElemModel", !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !12, i64 56, !12, i64 57, !12, i64 58, !12, i64 59, !13, i64 60, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !14, i64 120, !14, i64 136}
!11 = !{!"double", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt4pairIddE", !11, i64 0, !11, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 176}
!17 = !{!"_ZTS8VoidElem", !10, i64 0, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176}
!18 = !{!10, !11, i64 40}
!19 = !{!12, !12, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !6, i64 224}
!23 = !{!"_ZTS7Polygon", !17, i64 0, !13, i64 184, !24, i64 192, !6, i64 216, !6, i64 224, !28, i64 232, !7, i64 234, !11, i64 240}
!24 = !{!"_ZTSSt6vectorIdSaIdEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"short", !7, i64 0}


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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Apex6existsEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; 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 @tan(double noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK8Triangle22snapOffPrsDrainSpontNREv(ptr noundef nonnull align 8 dereferenceable(248) %0) unnamed_addr #4 align 2 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984) %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %11 = getelementptr inbounds i8, ptr %0, i64 176
  %12 = load double, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %0, i64 192
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #5
  %15 = load double, ptr %14, align 8, !tbaa !16
  %16 = fsub double %12, %15
  %17 = tail call double @cos(double noundef %16) #5
  %18 = fmul double %10, %17
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #5
  %20 = load double, ptr %19, align 8, !tbaa !16
  %21 = tail call double @sin(double noundef %20) #5
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = load double, ptr %22, align 8, !tbaa !17
  %24 = fmul double %21, %23
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #5
  %26 = load double, ptr %25, align 8, !tbaa !16
  %27 = tail call double @tan(double noundef %26) #5
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 2) #5
  %29 = load double, ptr %28, align 8, !tbaa !16
  %30 = tail call double @tan(double noundef %29) #5
  %31 = insertelement <2 x double> poison, double %27, i64 0
  %32 = insertelement <2 x double> %31, double %30, i64 1
  %33 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %32
  %shift = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %34 = fadd <2 x double> %33, %shift
  %35 = extractelement <2 x double> %34, i64 0
  %36 = fmul double %24, %35
  %37 = fdiv double %18, %36
  store double %37, ptr %2, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %38 = load <2 x double>, ptr %22, align 8
  %39 = load double, ptr %11, align 8, !tbaa !14
  %40 = tail call double @cos(double noundef %39) #5
  %41 = load double, ptr %11, align 8, !tbaa !14
  %42 = tail call double @sin(double noundef %41) #5
  %43 = fmul double %42, 2.000000e+00
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #5
  %45 = load double, ptr %44, align 8, !tbaa !16
  %46 = tail call double @tan(double noundef %45) #5
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 1) #5
  %48 = load double, ptr %47, align 8, !tbaa !16
  %49 = tail call double @tan(double noundef %48) #5
  %50 = insertelement <2 x double> poison, double %46, i64 0
  %51 = insertelement <2 x double> %50, double %49, i64 1
  %52 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %51
  %shift4 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %53 = fadd <2 x double> %52, %shift4
  %54 = insertelement <2 x double> poison, double %10, i64 0
  %55 = insertelement <2 x double> %54, double %43, i64 1
  %56 = shufflevector <2 x double> %38, <2 x double> %53, <2 x i32> <i32 0, i32 2>
  %57 = fdiv <2 x double> %55, %56
  %58 = extractelement <2 x double> %57, i64 1
  %59 = fadd double %40, %58
  %60 = extractelement <2 x double> %57, i64 0
  %61 = fmul double %60, %59
  store double %61, ptr %3, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  store i8 0, ptr %4, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  store i8 0, ptr %5, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %62 = call noundef double @_ZNK8Triangle25snapOffPrsDrainFromCornerERbi(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef 2)
  store double %62, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %63 = call noundef double @_ZNK8Triangle25snapOffPrsDrainFromCornerERbi(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull align 1 dereferenceable(1) %5, i32 noundef 1)
  store double %63, ptr %7, align 8, !tbaa !16
  %64 = load i8, ptr %4, align 1, !tbaa !18, !range !19, !noundef !20
  %65 = trunc nuw i8 %64 to i1
  %66 = load i8, ptr %5, align 1, !tbaa !18, !range !19, !noundef !20
  %67 = trunc nuw i8 %66 to i1
  br i1 %65, label %68, label %73

68:                                               ; preds = %1
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %69)
  br i1 %67, label %71, label %92

71:                                               ; preds = %68
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %70)
  br label %92

73:                                               ; preds = %1
  br i1 %67, label %74, label %77

74:                                               ; preds = %73
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %75)
  br label %92

77:                                               ; preds = %73
  %78 = getelementptr inbounds i8, ptr %0, i64 224
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = getelementptr inbounds i8, ptr %79, i64 144
  %81 = call noundef zeroext i1 @_ZNK4Apex6existsEv(ptr noundef nonnull align 8 dereferenceable(104) %80)
  br i1 %81, label %82, label %92

82:                                               ; preds = %77
  %83 = load double, ptr %11, align 8, !tbaa !14
  %84 = load double, ptr @_ZN9ElemModel2PIE, align 8, !tbaa !16
  %85 = fmul double %84, 5.000000e-01
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #5
  %87 = load double, ptr %86, align 8, !tbaa !16
  %88 = fadd double %85, %87
  %89 = fcmp ogt double %83, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %82
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %2)
  br label %92

92:                                               ; preds = %68, %77, %82, %90, %74, %71
  %.0.in = phi ptr [ %72, %71 ], [ %76, %74 ], [ %91, %90 ], [ %2, %82 ], [ %2, %77 ], [ %70, %68 ]
  %.0 = load double, ptr %.0.in, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret double %.0
}

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 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 = { 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 #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, !10, i64 32}
!6 = !{!"_ZTS9ElemModel", !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !11, i64 56, !11, i64 57, !11, i64 58, !11, i64 59, !12, i64 60, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !13, i64 120, !13, i64 136}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSSt4pairIddE", !7, i64 0, !7, i64 8}
!14 = !{!15, !7, i64 176}
!15 = !{!"_ZTS8VoidElem", !6, i64 0, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !7, i64 40}
!18 = !{!11, !11, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !10, i64 224}
!22 = !{!"_ZTS7Polygon", !15, i64 0, !12, i64 184, !23, i64 192, !10, i64 216, !10, i64 224, !27, i64 232, !8, i64 234, !7, i64 240}
!23 = !{!"_ZTSSt6vectorIdSaIdEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!27 = !{!"short", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass