; LLVM IR from ERGO-Code/HiGHS :: src/util/HighsSort.ll (Z18sortDecreasingHeapiRSt6vectorIdSaIdEERS_IiSaIiEE)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z18sortDecreasingHeapiRSt6vectorIdSaIdEERS_IiSaIiEE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = icmp sle i32 %14, 1
  br i1 %15, label %16, label %17

16:                                               ; preds = %3
  store i32 1, ptr %13, align 4
  br label %157

17:                                               ; preds = %3
  %18 = load ptr, ptr %6, align 8, !tbaa !9
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #2
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp ne i32 %20, 1
  br i1 %21, label %22, label %27

22:                                               ; preds = %17
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sdiv i32 %23, 2
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %7, align 4, !tbaa !5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %26, ptr %8, align 4, !tbaa !5
  br label %29

27:                                               ; preds = %17
  store i32 1, ptr %7, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %28, ptr %8, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %27, %22
  br label %30

30:                                               ; preds = %146, %29
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 1
  br i1 %32, label %33, label %46

33:                                               ; preds = %30
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  store i32 %35, ptr %7, align 4, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #2
  %40 = load double, ptr %39, align 8, !tbaa !11
  store double %40, ptr %12, align 8, !tbaa !11
  %41 = load ptr, ptr %6, align 8, !tbaa !9
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #2
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr %11, align 4, !tbaa !5
  br label %83

46:                                               ; preds = %30
  %47 = load ptr, ptr %5, align 8, !tbaa !9
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %49) #2
  %51 = load double, ptr %50, align 8, !tbaa !11
  store double %51, ptr %12, align 8, !tbaa !11
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %54) #2
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %11, align 4, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef 1) #2
  %59 = load double, ptr %58, align 8, !tbaa !11
  %60 = load ptr, ptr %5, align 8, !tbaa !9
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #2
  store double %59, ptr %63, align 8, !tbaa !11
  %64 = load ptr, ptr %6, align 8, !tbaa !9
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef 1) #2
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = load ptr, ptr %6, align 8, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %69) #2
  store i32 %66, ptr %70, align 4, !tbaa !5
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr %8, align 4, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %82

75:                                               ; preds = %46
  %76 = load double, ptr %12, align 8, !tbaa !11
  %77 = load ptr, ptr %5, align 8, !tbaa !9
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef 1) #2
  store double %76, ptr %78, align 8, !tbaa !11
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !9
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %80, i64 noundef 1) #2
  store i32 %79, ptr %81, align 4, !tbaa !5
  store i32 1, ptr %13, align 4
  br label %157

82:                                               ; preds = %46
  br label %83

83:                                               ; preds = %82, %33
  %84 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %84, ptr %10, align 4, !tbaa !5
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %85, %86
  store i32 %87, ptr %9, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %121, %83
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %92, label %145

92:                                               ; preds = %88
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %96, label %113

96:                                               ; preds = %92
  %97 = load ptr, ptr %5, align 8, !tbaa !9
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef %99) #2
  %101 = load double, ptr %100, align 8, !tbaa !11
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %105) #2
  %107 = load double, ptr %106, align 8, !tbaa !11
  %108 = fcmp ogt double %101, %107
  br i1 %108, label %109, label %112

109:                                              ; preds = %96
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %109, %96
  br label %113

113:                                              ; preds = %112, %92
  %114 = load double, ptr %12, align 8, !tbaa !11
  %115 = load ptr, ptr %5, align 8, !tbaa !9
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %117) #2
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = fcmp ogt double %114, %119
  br i1 %120, label %121, label %144

121:                                              ; preds = %113
  %122 = load ptr, ptr %5, align 8, !tbaa !9
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %122, i64 noundef %124) #2
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = load ptr, ptr %5, align 8, !tbaa !9
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef %129) #2
  store double %126, ptr %130, align 8, !tbaa !11
  %131 = load ptr, ptr %6, align 8, !tbaa !9
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %131, i64 noundef %133) #2
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load ptr, ptr %6, align 8, !tbaa !9
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %136, i64 noundef %138) #2
  store i32 %135, ptr %139, align 4, !tbaa !5
  %140 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %140, ptr %10, align 4, !tbaa !5
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = add nsw i32 %141, %142
  store i32 %143, ptr %9, align 4, !tbaa !5
  br label %88, !llvm.loop !13

144:                                              ; preds = %113
  br label %145

145:                                              ; preds = %144, %88
  br label %146

146:                                              ; preds = %145
  %147 = load double, ptr %12, align 8, !tbaa !11
  %148 = load ptr, ptr %5, align 8, !tbaa !9
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %148, i64 noundef %150) #2
  store double %147, ptr %151, align 8, !tbaa !11
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = load ptr, ptr %6, align 8, !tbaa !9
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %153, i64 noundef %155) #2
  store i32 %152, ptr %156, align 4, !tbaa !5
  br label %30, !llvm.loop !15

157:                                              ; preds = %75, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  ret void
}

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 = { 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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z18sortDecreasingHeapiRSt6vectorIdSaIdEERS_IiSaIiEE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #0 {
  %4 = icmp slt i32 %0, 2
  br i1 %4, label %60, label %select.unfold.preheader

select.unfold.preheader:                          ; preds = %3
  %5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #1
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %.not = icmp eq i32 %6, 1
  %7 = lshr i32 %0, 1
  %8 = add nuw nsw i32 %7, 1
  %spec.select = select i1 %.not, i32 1, i32 %8
  br label %select.unfold

select.unfold:                                    ; preds = %select.unfold.preheader, %._crit_edge
  %.164 = phi i32 [ %.265, %._crit_edge ], [ %spec.select, %select.unfold.preheader ]
  %.162 = phi i32 [ %.2, %._crit_edge ], [ %0, %select.unfold.preheader ]
  %9 = icmp sgt i32 %.164, 1
  br i1 %9, label %10, label %17

10:                                               ; preds = %select.unfold
  %11 = add nsw i32 %.164, -1
  %12 = zext nneg i32 %11 to i64
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %12) #1
  %14 = load double, ptr %13, align 8, !tbaa !9
  %15 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %12) #1
  %16 = load i32, ptr %15, align 4, !tbaa !5
  br label %34

17:                                               ; preds = %select.unfold
  %18 = zext nneg i32 %.162 to i64
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %18) #1
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %18) #1
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #1
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %18) #1
  store double %24, ptr %25, align 8, !tbaa !9
  %26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #1
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %18) #1
  store i32 %27, ptr %28, align 4, !tbaa !5
  %29 = add nsw i32 %.162, -1
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %34

31:                                               ; preds = %17
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #1
  store double %20, ptr %32, align 8, !tbaa !9
  %33 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #1
  store i32 %22, ptr %33, align 4, !tbaa !5
  br label %60

34:                                               ; preds = %17, %10
  %.265 = phi i32 [ %11, %10 ], [ 1, %17 ]
  %.2 = phi i32 [ %.162, %10 ], [ %29, %17 ]
  %.058 = phi i32 [ %16, %10 ], [ %22, %17 ]
  %.0 = phi double [ %14, %10 ], [ %20, %17 ]
  %.06070 = shl nuw nsw i32 %.265, 1
  %.not6871 = icmp sgt i32 %.06070, %.2
  br i1 %.not6871, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %34, %49
  %.06073 = phi i32 [ %.060, %49 ], [ %.06070, %34 ]
  %.05972 = phi i32 [ %.1, %49 ], [ %.265, %34 ]
  %35 = icmp slt i32 %.06073, %.2
  %36 = sext i32 %.06073 to i64
  br i1 %35, label %37, label %.lr.ph._crit_edge

37:                                               ; preds = %.lr.ph
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %36) #1
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = or disjoint i32 %.06073, 1
  %41 = sext i32 %40 to i64
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %41) #1
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = fcmp ogt double %39, %43
  br i1 %44, label %45, label %.lr.ph._crit_edge

45:                                               ; preds = %37
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %37, %45
  %.pre-phi = phi i64 [ %36, %37 ], [ %41, %45 ], [ %36, %.lr.ph ]
  %.1 = phi i32 [ %.06073, %37 ], [ %40, %45 ], [ %.06073, %.lr.ph ]
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.pre-phi) #1
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = fcmp ogt double %.0, %47
  br i1 %48, label %49, label %._crit_edge

49:                                               ; preds = %.lr.ph._crit_edge
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.pre-phi) #1
  %51 = load double, ptr %50, align 8, !tbaa !9
  %52 = sext i32 %.05972 to i64
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %52) #1
  store double %51, ptr %53, align 8, !tbaa !9
  %54 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.pre-phi) #1
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %52) #1
  store i32 %55, ptr %56, align 4, !tbaa !5
  %.060 = shl nsw i32 %.1, 1
  %.not68 = icmp sgt i32 %.060, %.2
  br i1 %.not68, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph._crit_edge, %49, %34
  %.059.lcssa = phi i32 [ %.265, %34 ], [ %.1, %49 ], [ %.05972, %.lr.ph._crit_edge ]
  %57 = sext i32 %.059.lcssa to i64
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %57) #1
  store double %.0, ptr %58, align 8, !tbaa !9
  %59 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %57) #1
  store i32 %.058, ptr %59, align 4, !tbaa !5
  br label %select.unfold, !llvm.loop !13

60:                                               ; preds = %3, %31
  ret void
}

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 = { 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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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