; LLVM IR from bbenligiray/stag :: src/Ellipse.ll (ZN13customEllipse11GetDistanceE3pixRd)

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

%struct.pix = type { i32, i32 }
%class.customEllipse = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, ptr, ptr, ptr, ptr, ptr, ptr }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN13customEllipse11GetDistanceE3pixRd(ptr noundef nonnull align 8 dereferenceable(272) %0, i64 %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #4 align 2 {
  %4 = alloca %struct.pix, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [4 x double], align 16
  %8 = alloca [4 x double], align 16
  %9 = alloca [4 x double], align 16
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca [4 x %struct.pix], align 16
  %13 = alloca %struct.pix, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.pix, align 4
  %17 = alloca %struct.pix, align 4
  store i64 %1, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %19 = getelementptr inbounds %struct.pix, ptr %4, i32 0, i32 0
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = sitofp i32 %20 to double
  %22 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 18
  %23 = load double, ptr %22, align 8, !tbaa !12
  %24 = fsub double %21, %23
  %25 = fptosi double %24 to i32
  %26 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 0
  store i32 %25, ptr %26, align 4, !tbaa !9
  %27 = getelementptr inbounds %struct.pix, ptr %4, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !15
  %29 = sitofp i32 %28 to double
  %30 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 19
  %31 = load double, ptr %30, align 8, !tbaa !16
  %32 = fsub double %29, %31
  %33 = fptosi double %32 to i32
  %34 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 1
  store i32 %33, ptr %34, align 4, !tbaa !15
  %35 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 23
  %36 = load double, ptr %35, align 8, !tbaa !17
  %37 = fcmp une double %36, 0.000000e+00
  br i1 %37, label %38, label %78

38:                                               ; preds = %3
  %39 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 0
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = sitofp i32 %40 to double
  %42 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 23
  %43 = load double, ptr %42, align 8, !tbaa !17
  %44 = fneg double %43
  %45 = call double @cos(double noundef %44) #6
  %46 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !15
  %48 = sitofp i32 %47 to double
  %49 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 23
  %50 = load double, ptr %49, align 8, !tbaa !17
  %51 = fneg double %50
  %52 = call double @sin(double noundef %51) #6
  %53 = fmul double %48, %52
  %54 = fneg double %53
  %55 = call double @llvm.fmuladd.f64(double %41, double %45, double %54)
  store double %55, ptr %10, align 8, !tbaa !18
  %56 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 0
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = sitofp i32 %57 to double
  %59 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 23
  %60 = load double, ptr %59, align 8, !tbaa !17
  %61 = fneg double %60
  %62 = call double @sin(double noundef %61) #6
  %63 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !15
  %65 = sitofp i32 %64 to double
  %66 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 23
  %67 = load double, ptr %66, align 8, !tbaa !17
  %68 = fneg double %67
  %69 = call double @cos(double noundef %68) #6
  %70 = fmul double %65, %69
  %71 = call double @llvm.fmuladd.f64(double %58, double %62, double %70)
  store double %71, ptr %11, align 8, !tbaa !18
  %72 = load double, ptr %10, align 8, !tbaa !18
  %73 = fptosi double %72 to i32
  %74 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 0
  store i32 %73, ptr %74, align 4, !tbaa !9
  %75 = load double, ptr %11, align 8, !tbaa !18
  %76 = fptosi double %75 to i32
  %77 = getelementptr inbounds %struct.pix, ptr %13, i32 0, i32 1
  store i32 %76, ptr %77, align 4, !tbaa !15
  br label %78

78:                                               ; preds = %38, %3
  %79 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 20
  %80 = load double, ptr %79, align 8, !tbaa !19
  %81 = load double, ptr %11, align 8, !tbaa !18
  %82 = fmul double %80, %81
  %83 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 21
  %84 = load double, ptr %83, align 8, !tbaa !20
  %85 = fdiv double %82, %84
  %86 = load double, ptr %10, align 8, !tbaa !18
  %87 = fmul double %85, %86
  %88 = call double @atan(double noundef %87) #6
  %89 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 0
  store double %88, ptr %89, align 16, !tbaa !18
  %90 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 0
  %91 = load double, ptr %90, align 16, !tbaa !18
  %92 = fadd double %91, 1.570700e+00
  %93 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 1
  store double %92, ptr %93, align 8, !tbaa !18
  %94 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 0
  %95 = load double, ptr %94, align 16, !tbaa !18
  %96 = fadd double %95, 0x400921FB53C8D4F1
  %97 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 2
  store double %96, ptr %97, align 16, !tbaa !18
  %98 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 0
  %99 = load double, ptr %98, align 16, !tbaa !18
  %100 = fadd double %99, 4.712300e+00
  %101 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 3
  store double %100, ptr %101, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !21
  br label %102

102:                                              ; preds = %164, %78
  %103 = load i32, ptr %15, align 4, !tbaa !21
  %104 = icmp slt i32 %103, 4
  br i1 %104, label %106, label %105

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

106:                                              ; preds = %102
  %107 = load i32, ptr %15, align 4, !tbaa !21
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !18
  %111 = load double, ptr %10, align 8, !tbaa !18
  %112 = load double, ptr %11, align 8, !tbaa !18
  %113 = call noundef double @_ZN13customEllipse28NewtonRaphsonThetaEstimationEddd(ptr noundef nonnull align 8 dereferenceable(272) %18, double noundef %110, double noundef %111, double noundef %112)
  %114 = load i32, ptr %15, align 4, !tbaa !21
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 %115
  store double %113, ptr %116, align 8, !tbaa !18
  %117 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 20
  %118 = load double, ptr %117, align 8, !tbaa !19
  %119 = load i32, ptr %15, align 4, !tbaa !21
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !18
  %123 = call double @cos(double noundef %122) #6
  %124 = fmul double %118, %123
  %125 = fptosi double %124 to i32
  %126 = load i32, ptr %15, align 4, !tbaa !21
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [4 x %struct.pix], ptr %12, i64 0, i64 %127
  %129 = getelementptr inbounds %struct.pix, ptr %128, i32 0, i32 0
  store i32 %125, ptr %129, align 8, !tbaa !9
  %130 = getelementptr inbounds %class.customEllipse, ptr %18, i32 0, i32 21
  %131 = load double, ptr %130, align 8, !tbaa !20
  %132 = load i32, ptr %15, align 4, !tbaa !21
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 %133
  %135 = load double, ptr %134, align 8, !tbaa !18
  %136 = call double @sin(double noundef %135) #6
  %137 = fmul double %131, %136
  %138 = fptosi double %137 to i32
  %139 = load i32, ptr %15, align 4, !tbaa !21
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [4 x %struct.pix], ptr %12, i64 0, i64 %140
  %142 = getelementptr inbounds %struct.pix, ptr %141, i32 0, i32 1
  store i32 %138, ptr %142, align 4, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !22
  %143 = load i32, ptr %15, align 4, !tbaa !21
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [4 x %struct.pix], ptr %12, i64 0, i64 %144
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %145, i64 8, i1 false), !tbaa.struct !22
  %146 = load i64, ptr %16, align 4
  %147 = load i64, ptr %17, align 4
  %148 = call noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272) %18, i64 %146, i64 %147)
  %149 = load i32, ptr %15, align 4, !tbaa !21
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 %150
  store double %148, ptr %151, align 8, !tbaa !18
  %152 = load i32, ptr %15, align 4, !tbaa !21
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !18
  %156 = load i32, ptr %14, align 4, !tbaa !21
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !18
  %160 = fcmp olt double %155, %159
  br i1 %160, label %161, label %163

161:                                              ; preds = %106
  %162 = load i32, ptr %15, align 4, !tbaa !21
  store i32 %162, ptr %14, align 4, !tbaa !21
  br label %163

163:                                              ; preds = %161, %106
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %15, align 4, !tbaa !21
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %15, align 4, !tbaa !21
  br label %102, !llvm.loop !23

167:                                              ; preds = %105
  %168 = load i32, ptr %14, align 4, !tbaa !21
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 %169
  %171 = load double, ptr %170, align 8, !tbaa !18
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  store double %171, ptr %172, align 8, !tbaa !18
  %173 = load i32, ptr %14, align 4, !tbaa !21
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 %174
  %176 = load double, ptr %175, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  ret double %176
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272), i64, i64) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS3pix", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !14, i64 144}
!13 = !{!"_ZTS13customEllipse", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !11, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!14 = !{!"double", !7, i64 0}
!15 = !{!10, !11, i64 4}
!16 = !{!13, !14, i64 152}
!17 = !{!13, !14, i64 184}
!18 = !{!14, !14, i64 0}
!19 = !{!13, !14, i64 160}
!20 = !{!13, !14, i64 168}
!21 = !{!11, !11, i64 0}
!22 = !{i64 0, i64 4, !21, i64 4, i64 4, !21}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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

; 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 nofree nounwind willreturn memory(write)
declare double @atan(double noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN13customEllipse28NewtonRaphsonThetaEstimationEddd(ptr noundef nonnull align 8 dereferenceable(272), double noundef, double noundef, double noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN13customEllipse11GetDistanceE3pixRd(ptr noundef nonnull align 8 dereferenceable(272) %0, i64 %1, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %2) local_unnamed_addr #2 align 2 {
  %4 = alloca [4 x double], align 16
  %5 = alloca [4 x double], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 144
  %7 = bitcast i64 %1 to <2 x i32>
  %8 = sitofp <2 x i32> %7 to <2 x double>
  %9 = load <2 x double>, ptr %6, align 8, !tbaa !5
  %10 = fsub <2 x double> %8, %9
  %11 = fptosi <2 x double> %10 to <2 x i32>
  %12 = getelementptr inbounds i8, ptr %0, i64 184
  %13 = load double, ptr %12, align 8, !tbaa !9
  %14 = fcmp une double %13, 0.000000e+00
  br i1 %14, label %15, label %41

15:                                               ; preds = %3
  %16 = extractelement <2 x i32> %11, i64 0
  %17 = sitofp i32 %16 to double
  %18 = tail call double @cos(double %13)
  %19 = extractelement <2 x i32> %11, i64 1
  %20 = sitofp i32 %19 to double
  %21 = load double, ptr %12, align 8, !tbaa !9
  %22 = tail call double @sin(double %21)
  %23 = load double, ptr %12, align 8, !tbaa !9
  %24 = tail call double @sin(double %23)
  %25 = fneg double %24
  %26 = load double, ptr %12, align 8, !tbaa !9
  %27 = tail call double @cos(double %26)
  %28 = insertelement <2 x double> poison, double %22, i64 0
  %29 = insertelement <2 x double> %28, double %27, i64 1
  %30 = insertelement <2 x double> poison, double %20, i64 0
  %31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
  %32 = fmul <2 x double> %29, %31
  %33 = insertelement <2 x double> poison, double %17, i64 0
  %34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
  %35 = insertelement <2 x double> poison, double %18, i64 0
  %36 = insertelement <2 x double> %35, double %25, i64 1
  %37 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %36, <2 x double> %32)
  %38 = fptosi <2 x double> %37 to <2 x i32>
  %39 = extractelement <2 x double> %37, i64 0
  %40 = extractelement <2 x double> %37, i64 1
  br label %41

41:                                               ; preds = %15, %3
  %.027 = phi double [ %40, %15 ], [ undef, %3 ]
  %.0 = phi double [ %39, %15 ], [ undef, %3 ]
  %42 = phi <2 x i32> [ %38, %15 ], [ %11, %3 ]
  %43 = getelementptr inbounds i8, ptr %0, i64 160
  %44 = load double, ptr %43, align 8, !tbaa !13
  %45 = fmul double %.027, %44
  %46 = getelementptr inbounds i8, ptr %0, i64 168
  %47 = load double, ptr %46, align 8, !tbaa !14
  %48 = fdiv double %45, %47
  %49 = fmul double %.0, %48
  %50 = tail call double @atan(double noundef %49) #5
  %51 = fadd double %50, 1.570700e+00
  %52 = fadd double %50, 0x400921FB53C8D4F1
  %53 = fadd double %50, 4.712300e+00
  %54 = extractelement <2 x i32> %42, i64 1
  %.sroa.7.0.insert.ext = zext i32 %54 to i64
  %.sroa.7.0.insert.shift = shl nuw i64 %.sroa.7.0.insert.ext, 32
  %55 = extractelement <2 x i32> %42, i64 0
  %.sroa.016.0.insert.ext = zext i32 %55 to i64
  %.sroa.016.0.insert.insert = or disjoint i64 %.sroa.7.0.insert.shift, %.sroa.016.0.insert.ext
  %56 = tail call noundef double @_ZN13customEllipse28NewtonRaphsonThetaEstimationEddd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %50, double noundef %.0, double noundef %.027)
  store double %56, ptr %4, align 16, !tbaa !5
  %57 = load double, ptr %43, align 8, !tbaa !13
  %58 = tail call double @cos(double noundef %56) #5
  %59 = fmul double %57, %58
  %60 = fptosi double %59 to i32
  %.sroa.0.0.insert.ext = zext i32 %60 to i64
  %61 = load double, ptr %46, align 8, !tbaa !14
  %62 = tail call double @sin(double noundef %56) #5
  %63 = fmul double %61, %62
  %64 = fptosi double %63 to i32
  %.sroa.0.4.insert.ext = zext i32 %64 to i64
  %.sroa.0.4.insert.shift = shl nuw i64 %.sroa.0.4.insert.ext, 32
  %.sroa.0.4.insert.insert = or disjoint i64 %.sroa.0.4.insert.shift, %.sroa.0.0.insert.ext
  %65 = tail call noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272) %0, i64 %.sroa.016.0.insert.insert, i64 %.sroa.0.4.insert.insert)
  store double %65, ptr %5, align 16, !tbaa !5
  %66 = tail call noundef double @_ZN13customEllipse28NewtonRaphsonThetaEstimationEddd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %51, double noundef %.0, double noundef %.027)
  %67 = getelementptr inbounds i8, ptr %4, i64 8
  store double %66, ptr %67, align 8, !tbaa !5
  %68 = load double, ptr %43, align 8, !tbaa !13
  %69 = tail call double @cos(double noundef %66) #5
  %70 = fmul double %68, %69
  %71 = fptosi double %70 to i32
  %.sroa.5.8.insert.ext = zext i32 %71 to i64
  %72 = load double, ptr %46, align 8, !tbaa !14
  %73 = tail call double @sin(double noundef %66) #5
  %74 = fmul double %72, %73
  %75 = fptosi double %74 to i32
  %.sroa.5.12.insert.ext = zext i32 %75 to i64
  %.sroa.5.12.insert.shift = shl nuw i64 %.sroa.5.12.insert.ext, 32
  %.sroa.5.12.insert.insert = or disjoint i64 %.sroa.5.12.insert.shift, %.sroa.5.8.insert.ext
  %76 = tail call noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272) %0, i64 %.sroa.016.0.insert.insert, i64 %.sroa.5.12.insert.insert)
  %77 = getelementptr inbounds i8, ptr %5, i64 8
  store double %76, ptr %77, align 8, !tbaa !5
  %78 = fcmp olt double %76, %65
  %.1.1 = zext i1 %78 to i32
  %79 = tail call noundef double @_ZN13customEllipse28NewtonRaphsonThetaEstimationEddd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %52, double noundef %.0, double noundef %.027)
  %80 = getelementptr inbounds i8, ptr %4, i64 16
  store double %79, ptr %80, align 16, !tbaa !5
  %81 = load double, ptr %43, align 8, !tbaa !13
  %82 = tail call double @cos(double noundef %79) #5
  %83 = fmul double %81, %82
  %84 = fptosi double %83 to i32
  %.sroa.8.16.insert.ext = zext i32 %84 to i64
  %85 = load double, ptr %46, align 8, !tbaa !14
  %86 = tail call double @sin(double noundef %79) #5
  %87 = fmul double %85, %86
  %88 = fptosi double %87 to i32
  %.sroa.8.20.insert.ext = zext i32 %88 to i64
  %.sroa.8.20.insert.shift = shl nuw i64 %.sroa.8.20.insert.ext, 32
  %.sroa.8.20.insert.insert = or disjoint i64 %.sroa.8.20.insert.shift, %.sroa.8.16.insert.ext
  %89 = tail call noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272) %0, i64 %.sroa.016.0.insert.insert, i64 %.sroa.8.20.insert.insert)
  %90 = getelementptr inbounds i8, ptr %5, i64 16
  store double %89, ptr %90, align 16, !tbaa !5
  %91 = zext i1 %78 to i64
  %92 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !5
  %94 = fcmp olt double %89, %93
  %.1.2 = select i1 %94, i32 2, i32 %.1.1
  %95 = tail call noundef double @_ZN13customEllipse28NewtonRaphsonThetaEstimationEddd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %53, double noundef %.0, double noundef %.027)
  %96 = getelementptr inbounds i8, ptr %4, i64 24
  store double %95, ptr %96, align 8, !tbaa !5
  %97 = load double, ptr %43, align 8, !tbaa !13
  %98 = tail call double @cos(double noundef %95) #5
  %99 = fmul double %97, %98
  %100 = fptosi double %99 to i32
  %.sroa.11.24.insert.ext = zext i32 %100 to i64
  %101 = load double, ptr %46, align 8, !tbaa !14
  %102 = tail call double @sin(double noundef %95) #5
  %103 = fmul double %101, %102
  %104 = fptosi double %103 to i32
  %.sroa.11.28.insert.ext = zext i32 %104 to i64
  %.sroa.11.28.insert.shift = shl nuw i64 %.sroa.11.28.insert.ext, 32
  %.sroa.11.28.insert.insert = or disjoint i64 %.sroa.11.28.insert.shift, %.sroa.11.24.insert.ext
  %105 = tail call noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272) %0, i64 %.sroa.016.0.insert.insert, i64 %.sroa.11.28.insert.insert)
  %106 = getelementptr inbounds i8, ptr %5, i64 24
  store double %105, ptr %106, align 8, !tbaa !5
  %107 = zext nneg i32 %.1.2 to i64
  %108 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !5
  %110 = fcmp olt double %105, %109
  %111 = zext nneg i32 %.1.2 to i64
  %112 = select i1 %110, i64 3, i64 %111
  %113 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !5
  store double %114, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 %112
  %116 = load double, ptr %115, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  ret double %116
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN13customEllipse16DistanceBwPointsE3pixS0_(ptr noundef nonnull align 8 dereferenceable(272), i64, i64) local_unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 184}
!10 = !{!"_ZTS13customEllipse", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !11, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!10, !6, i64 160}
!14 = !{!10, !6, i64 168}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass