; LLVM IR from thekyria/elabtsaot2 :: emulator_hw/hardware_model/atom.ll (ZNK9elabtsaot4Atom20getMinMaxAchievableREv)

; 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.elabtsaot::Atom" = type { %"class.elabtsaot::Node", %"class.std::vector", %"class.std::vector", %"class.std::vector.0" }
%"class.elabtsaot::Node" = type { double, double, double, double, i8, i8, i8, i8, double, double, double, double, i8, i8, i8, i8, [4 x i8], %"class.elabtsaot::Potentiometer", %"class.elabtsaot::Potentiometer", %"class.elabtsaot::Potentiometer", %"class.elabtsaot::Potentiometer" }
%"class.elabtsaot::Potentiometer" = type <{ ptr, double, double, i32, [4 x i8], double, i32, i32, i8, i8, [6 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<elabtsaot::EmulatorBranch, std::allocator<elabtsaot::EmulatorBranch>>::_Vector_impl" }
%"struct.std::_Vector_base<elabtsaot::EmulatorBranch, std::allocator<elabtsaot::EmulatorBranch>>::_Vector_impl" = type { %"struct.std::_Vector_base<elabtsaot::EmulatorBranch, std::allocator<elabtsaot::EmulatorBranch>>::_Vector_impl_data" }
%"struct.std::_Vector_base<elabtsaot::EmulatorBranch, std::allocator<elabtsaot::EmulatorBranch>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>

; 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 i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK9elabtsaot4Atom20getMinMaxAchievableREv(ptr noundef nonnull align 8 dereferenceable(392) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %6 = call noundef double @_ZNSt14numeric_limitsIdE3maxEv() #4
  store double %6, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 0, ptr %4, align 8, !tbaa !11
  br label %7

7:                                                ; preds = %67, %1
  %8 = load i64, ptr %4, align 8, !tbaa !11
  %9 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 3
  %10 = call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %9) #4
  %11 = icmp ne i64 %8, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %70

13:                                               ; preds = %7
  %14 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 3
  %15 = load i64, ptr %4, align 8, !tbaa !11
  %16 = call noundef zeroext i1 @_ZNKSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %14, i64 noundef %15)
  br i1 %16, label %17, label %66

17:                                               ; preds = %13
  %18 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 1
  %19 = load i64, ptr %4, align 8, !tbaa !11
  %20 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %19) #4
  %21 = call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %20)
  %22 = load double, ptr %3, align 8, !tbaa !9
  %23 = fcmp olt double %21, %22
  br i1 %23, label %24, label %29

24:                                               ; preds = %17
  %25 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 1
  %26 = load i64, ptr %4, align 8, !tbaa !11
  %27 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %26) #4
  %28 = call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %27)
  store double %28, ptr %3, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %24, %17
  %30 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 1
  %31 = load i64, ptr %4, align 8, !tbaa !11
  %32 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %31) #4
  %33 = call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %32)
  %34 = load double, ptr %3, align 8, !tbaa !9
  %35 = fcmp olt double %33, %34
  br i1 %35, label %36, label %41

36:                                               ; preds = %29
  %37 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 1
  %38 = load i64, ptr %4, align 8, !tbaa !11
  %39 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %38) #4
  %40 = call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %39)
  store double %40, ptr %3, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %36, %29
  %42 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 2
  %43 = load i64, ptr %4, align 8, !tbaa !11
  %44 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %43) #4
  %45 = call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %44)
  %46 = load double, ptr %3, align 8, !tbaa !9
  %47 = fcmp olt double %45, %46
  br i1 %47, label %48, label %53

48:                                               ; preds = %41
  %49 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 2
  %50 = load i64, ptr %4, align 8, !tbaa !11
  %51 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %50) #4
  %52 = call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %51)
  store double %52, ptr %3, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %48, %41
  %54 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 2
  %55 = load i64, ptr %4, align 8, !tbaa !11
  %56 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %55) #4
  %57 = call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %56)
  %58 = load double, ptr %3, align 8, !tbaa !9
  %59 = fcmp olt double %57, %58
  br i1 %59, label %60, label %65

60:                                               ; preds = %53
  %61 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 2
  %62 = load i64, ptr %4, align 8, !tbaa !11
  %63 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %62) #4
  %64 = call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %63)
  store double %64, ptr %3, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %60, %53
  br label %66

66:                                               ; preds = %65, %13
  br label %67

67:                                               ; preds = %66
  %68 = load i64, ptr %4, align 8, !tbaa !11
  %69 = add i64 %68, 1
  store i64 %69, ptr %4, align 8, !tbaa !11
  br label %7, !llvm.loop !13

70:                                               ; preds = %12
  %71 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %72 = call noundef double @_ZNK9elabtsaot4Node24real_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %71)
  %73 = load double, ptr %3, align 8, !tbaa !9
  %74 = fcmp olt double %72, %73
  br i1 %74, label %75, label %78

75:                                               ; preds = %70
  %76 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %77 = call noundef double @_ZNK9elabtsaot4Node24real_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %76)
  store double %77, ptr %3, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %75, %70
  %79 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %80 = call noundef double @_ZNK9elabtsaot4Node27real_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %79)
  %81 = load double, ptr %3, align 8, !tbaa !9
  %82 = fcmp olt double %80, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %78
  %84 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %85 = call noundef double @_ZNK9elabtsaot4Node27real_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %84)
  store double %85, ptr %3, align 8, !tbaa !9
  br label %86

86:                                               ; preds = %83, %78
  %87 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %88 = call noundef double @_ZNK9elabtsaot4Node24imag_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %87)
  %89 = load double, ptr %3, align 8, !tbaa !9
  %90 = fcmp olt double %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %93 = call noundef double @_ZNK9elabtsaot4Node24imag_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %92)
  store double %93, ptr %3, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %91, %86
  %95 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %96 = call noundef double @_ZNK9elabtsaot4Node27imag_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %95)
  %97 = load double, ptr %3, align 8, !tbaa !9
  %98 = fcmp olt double %96, %97
  br i1 %98, label %99, label %102

99:                                               ; preds = %94
  %100 = getelementptr inbounds %"class.elabtsaot::Atom", ptr %5, i32 0, i32 0
  %101 = call noundef double @_ZNK9elabtsaot4Node27imag_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %100)
  store double %101, ptr %3, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %99, %94
  %103 = load double, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret double %103
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE3maxEv() #1 align 2

declare noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120)) #3

declare noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120)) #3

declare noundef double @_ZNK9elabtsaot4Node24real_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) #3

declare noundef double @_ZNK9elabtsaot4Node27real_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) #3

declare noundef double @_ZNK9elabtsaot4Node24imag_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) #3

declare noundef double @_ZNK9elabtsaot4Node27imag_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) #3

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

!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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK9elabtsaot4Atom20getMinMaxAchievableREv(ptr noundef nonnull align 8 dereferenceable(392) %0) local_unnamed_addr #1 align 2 {
  %2 = tail call noundef double @_ZNSt14numeric_limitsIdE3maxEv() #3
  %3 = getelementptr inbounds i8, ptr %0, i64 352
  %4 = tail call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %3) #3
  %.not21 = icmp eq i64 %4, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 304
  %6 = getelementptr inbounds i8, ptr %0, i64 328
  br label %9

._crit_edge:                                      ; preds = %39, %1
  %.020.lcssa = phi double [ %2, %1 ], [ %.4, %39 ]
  %7 = tail call noundef double @_ZNK9elabtsaot4Node24real_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  %8 = fcmp olt double %7, %.020.lcssa
  br i1 %8, label %42, label %44

9:                                                ; preds = %.lr.ph, %39
  %.023 = phi i64 [ 0, %.lr.ph ], [ %40, %39 ]
  %.02022 = phi double [ %2, %.lr.ph ], [ %.4, %39 ]
  %10 = tail call noundef zeroext i1 @_ZNKSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %.023)
  br i1 %10, label %11, label %39

11:                                               ; preds = %9
  %12 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.023) #3
  %13 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %12)
  %14 = fcmp olt double %13, %.02022
  br i1 %14, label %15, label %18

15:                                               ; preds = %11
  %16 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.023) #3
  %17 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %16)
  br label %18

18:                                               ; preds = %15, %11
  %.1 = phi double [ %17, %15 ], [ %.02022, %11 ]
  %19 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.023) #3
  %20 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %19)
  %21 = fcmp olt double %20, %.1
  br i1 %21, label %22, label %25

22:                                               ; preds = %18
  %23 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.023) #3
  %24 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %23)
  br label %25

25:                                               ; preds = %22, %18
  %.2 = phi double [ %24, %22 ], [ %.1, %18 ]
  %26 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.023) #3
  %27 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %26)
  %28 = fcmp olt double %27, %.2
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  %30 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.023) #3
  %31 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %30)
  br label %32

32:                                               ; preds = %29, %25
  %.3 = phi double [ %31, %29 ], [ %.2, %25 ]
  %33 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.023) #3
  %34 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %33)
  %35 = fcmp olt double %34, %.3
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN9elabtsaot14EmulatorBranchESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.023) #3
  %38 = tail call noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120) %37)
  br label %39

39:                                               ; preds = %9, %36, %32
  %.4 = phi double [ %38, %36 ], [ %.3, %32 ], [ %.02022, %9 ]
  %40 = add i64 %.023, 1
  %41 = tail call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %3) #3
  %.not = icmp eq i64 %40, %41
  br i1 %.not, label %._crit_edge, label %9, !llvm.loop !5

42:                                               ; preds = %._crit_edge
  %43 = tail call noundef double @_ZNK9elabtsaot4Node24real_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  br label %44

44:                                               ; preds = %42, %._crit_edge
  %.5 = phi double [ %43, %42 ], [ %.020.lcssa, %._crit_edge ]
  %45 = tail call noundef double @_ZNK9elabtsaot4Node27real_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  %46 = fcmp olt double %45, %.5
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = tail call noundef double @_ZNK9elabtsaot4Node27real_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  br label %49

49:                                               ; preds = %47, %44
  %.6 = phi double [ %48, %47 ], [ %.5, %44 ]
  %50 = tail call noundef double @_ZNK9elabtsaot4Node24imag_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  %51 = fcmp olt double %50, %.6
  br i1 %51, label %52, label %54

52:                                               ; preds = %49
  %53 = tail call noundef double @_ZNK9elabtsaot4Node24imag_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  br label %54

54:                                               ; preds = %52, %49
  %.7 = phi double [ %53, %52 ], [ %.6, %49 ]
  %55 = tail call noundef double @_ZNK9elabtsaot4Node27imag_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  %56 = fcmp olt double %55, %.7
  br i1 %56, label %57, label %59

57:                                               ; preds = %54
  %58 = tail call noundef double @_ZNK9elabtsaot4Node27imag_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  br label %59

59:                                               ; preds = %57, %54
  %.8 = phi double [ %58, %57 ], [ %.7, %54 ]
  ret double %.8
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE3maxEv() local_unnamed_addr #0 align 2

declare noundef double @_ZNK9elabtsaot14EmulatorBranch16pot_near_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

declare noundef double @_ZNK9elabtsaot14EmulatorBranch15pot_far_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

declare noundef double @_ZNK9elabtsaot4Node24real_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #2

declare noundef double @_ZNK9elabtsaot4Node27real_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #2

declare noundef double @_ZNK9elabtsaot4Node24imag_pot_current_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #2

declare noundef double @_ZNK9elabtsaot4Node27imag_pot_resistance_getRMaxEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #2

attributes #0 = { 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 #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 = { 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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass