; LLVM IR from bohanwang/libpgo :: src/core/basicAlgorithms (averagingBuffer)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.std::allocator" = type { i8 }
%"class.pgo::BasicAlgorithms::AveragingBuffer" = type <{ ptr, i32, i32, %"class.std::vector", double, i32, [4 x i8] }>

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3pgo15BasicAlgorithms15AveragingBuffer13setBufferSizeEi = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; 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 uwtable
define dso_local void @_ZN3pgo15BasicAlgorithms15AveragingBuffer13setBufferSizeEi(ptr noundef nonnull align 8 dereferenceable(52) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %12 = load ptr, ptr %3, align 8
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %18

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 77, ptr noundef @__PRETTY_FUNCTION__._ZN3pgo15BasicAlgorithms15AveragingBuffer13setBufferSizeEi) #5
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  %19 = load i32, ptr %4, align 4, !tbaa !9
  %20 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 1
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = icmp eq i32 %19, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %18
  br label %113

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %26, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %27 unwind label %37

27:                                               ; preds = %24
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %28 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 5
  %29 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %30 unwind label %41

30:                                               ; preds = %27
  %31 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %31, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %56, %30
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %45, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %59

37:                                               ; preds = %24
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %114

41:                                               ; preds = %95, %27
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %114

45:                                               ; preds = %32
  %46 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !18
  %48 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 1
  %49 = load i32, ptr %48, align 8, !tbaa !11
  %50 = sub nsw i32 %49, 1
  %51 = add nsw i32 %47, %50
  %52 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 1
  %53 = load i32, ptr %52, align 8, !tbaa !11
  %54 = srem i32 %51, %53
  %55 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  store i32 %54, ptr %55, align 4, !tbaa !18
  br label %56

56:                                               ; preds = %45
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %10, align 4, !tbaa !9
  br label %32, !llvm.loop !19

59:                                               ; preds = %36
  %60 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 4
  store double 0.000000e+00, ptr %60, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %92, %59
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %95

66:                                               ; preds = %61
  %67 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 3
  %68 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !18
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %70) #6
  %72 = load double, ptr %71, align 8, !tbaa !22
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %74) #6
  store double %72, ptr %75, align 8, !tbaa !22
  %76 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 3
  %77 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  %78 = load i32, ptr %77, align 4, !tbaa !18
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %79) #6
  %81 = load double, ptr %80, align 8, !tbaa !22
  %82 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 4
  %83 = load double, ptr %82, align 8, !tbaa !21
  %84 = fadd double %83, %81
  store double %84, ptr %82, align 8, !tbaa !21
  %85 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !18
  %87 = add nsw i32 %86, 1
  %88 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 1
  %89 = load i32, ptr %88, align 8, !tbaa !11
  %90 = srem i32 %87, %89
  %91 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  store i32 %90, ptr %91, align 4, !tbaa !18
  br label %92

92:                                               ; preds = %66
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %11, align 4, !tbaa !9
  br label %61, !llvm.loop !23

95:                                               ; preds = %65
  %96 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 3
  %97 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIdSaIdEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %98 unwind label %41

98:                                               ; preds = %95
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = load i32, ptr %4, align 4, !tbaa !9
  %101 = srem i32 %99, %100
  %102 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 2
  store i32 %101, ptr %102, align 4, !tbaa !18
  %103 = load i32, ptr %4, align 4, !tbaa !9
  %104 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 1
  store i32 %103, ptr %104, align 8, !tbaa !11
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 5
  store i32 %105, ptr %106, align 8, !tbaa !24
  %107 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 5
  %108 = load i32, ptr %107, align 8, !tbaa !24
  %109 = sitofp i32 %108 to double
  %110 = getelementptr inbounds %"class.pgo::BasicAlgorithms::AveragingBuffer", ptr %12, i32 0, i32 4
  %111 = load double, ptr %110, align 8, !tbaa !21
  %112 = fdiv double %111, %109
  store double %112, ptr %110, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %113

113:                                              ; preds = %98, %23
  ret void

114:                                              ; preds = %41, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %7, align 8
  %117 = load i32, ptr %8, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { noreturn 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN3pgo15BasicAlgorithms15AveragingBufferE", !10, i64 8, !10, i64 12, !13, i64 16, !17, i64 40, !10, i64 48}
!13 = !{!"_ZTSSt6vectorIdSaIdEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"double", !7, i64 0}
!18 = !{!12, !10, i64 12}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !17, i64 40}
!22 = !{!17, !17, i64 0}
!23 = distinct !{!23, !20}
!24 = !{!12, !10, i64 48}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.std::allocator" = type { i8 }

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3pgo15BasicAlgorithms15AveragingBuffer13setBufferSizeEi = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; 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 #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3pgo15BasicAlgorithms15AveragingBuffer13setBufferSizeEi(ptr noundef nonnull align 8 dereferenceable(52) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  store i32 %1, ptr %3, align 4, !tbaa !5
  %6 = icmp sgt i32 %1, 0
  br i1 %6, label %8, label %7

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 77, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3pgo15BasicAlgorithms15AveragingBuffer13setBufferSizeEi) #5
  unreachable

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !9
  %11 = icmp eq i32 %10, %1
  br i1 %11, label %68, label %12

12:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  %13 = zext nneg i32 %1 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %13, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %14 unwind label %30

14:                                               ; preds = %12
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %.thread

.thread:                                          ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  store double 0.000000e+00, ptr %19, align 8, !tbaa !17
  br label %._crit_edge21

.lr.ph:                                           ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 12
  %21 = load i32, ptr %9, align 8, !tbaa !9
  %.promoted = load i32, ptr %20, align 4, !tbaa !18
  %xtraiter = and i32 %17, 1
  %22 = icmp eq i32 %17, 1
  br i1 %22, label %.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i32 %17, 2147483646
  br label %34

.unr-lcssa:                                       ; preds = %34, %.lr.ph
  %.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %41, %34 ]
  %.unr = phi i32 [ %.promoted, %.lr.ph ], [ %41, %34 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %26, label %.epilog-lcssa

.epilog-lcssa:                                    ; preds = %.unr-lcssa
  %23 = add i32 %.unr, -1
  %24 = add i32 %23, %21
  %25 = srem i32 %24, %21
  br label %26

26:                                               ; preds = %.unr-lcssa, %.epilog-lcssa
  %.lcssa = phi i32 [ %.lcssa.ph, %.unr-lcssa ], [ %25, %.epilog-lcssa ]
  store i32 %.lcssa, ptr %20, align 4, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %0, i64 40
  store double 0.000000e+00, ptr %27, align 8, !tbaa !17
  br i1 %18, label %.lr.ph20, label %._crit_edge21

.lr.ph20:                                         ; preds = %26
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = getelementptr inbounds i8, ptr %0, i64 12
  %wide.trip.count = zext nneg i32 %17 to i64
  %.pre = load i32, ptr %29, align 4, !tbaa !18
  br label %45

30:                                               ; preds = %12
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br label %69

32:                                               ; preds = %._crit_edge21
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %69

34:                                               ; preds = %34, %.lr.ph.new
  %35 = phi i32 [ %.promoted, %.lr.ph.new ], [ %41, %34 ]
  %niter = phi i32 [ 0, %.lr.ph.new ], [ %niter.next.1, %34 ]
  %36 = add i32 %35, -1
  %37 = add i32 %36, %21
  %38 = srem i32 %37, %21
  %39 = add i32 %38, -1
  %40 = add i32 %39, %21
  %41 = srem i32 %40, %21
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.unr-lcssa, label %34, !llvm.loop !19

._crit_edge21:                                    ; preds = %45, %.thread, %26
  %42 = phi ptr [ %19, %.thread ], [ %27, %26 ], [ %27, %45 ]
  %43 = getelementptr inbounds i8, ptr %0, i64 16
  %44 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIdSaIdEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %61 unwind label %32

45:                                               ; preds = %.lr.ph20, %45
  %46 = phi i32 [ %.pre, %.lr.ph20 ], [ %60, %45 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph20 ], [ %indvars.iv.next, %45 ]
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %47) #6
  %49 = load double, ptr %48, align 8, !tbaa !21
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #6
  store double %49, ptr %50, align 8, !tbaa !21
  %51 = load i32, ptr %29, align 4, !tbaa !18
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %52) #6
  %54 = load double, ptr %53, align 8, !tbaa !21
  %55 = load double, ptr %27, align 8, !tbaa !17
  %56 = fadd double %54, %55
  store double %56, ptr %27, align 8, !tbaa !17
  %57 = load i32, ptr %29, align 4, !tbaa !18
  %58 = add nsw i32 %57, 1
  %59 = load i32, ptr %9, align 8, !tbaa !9
  %60 = srem i32 %58, %59
  store i32 %60, ptr %29, align 4, !tbaa !18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond23.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond23.not, label %._crit_edge21, label %45, !llvm.loop !22

61:                                               ; preds = %._crit_edge21
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = srem i32 %17, %62
  %64 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %63, ptr %64, align 4, !tbaa !18
  store i32 %62, ptr %9, align 8, !tbaa !9
  store i32 %17, ptr %15, align 8, !tbaa !23
  %65 = sitofp i32 %17 to double
  %66 = load double, ptr %42, align 8, !tbaa !17
  %67 = fdiv double %66, %65
  store double %67, ptr %42, align 8, !tbaa !17
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %68

68:                                               ; preds = %8, %61
  ret void

69:                                               ; preds = %32, %30
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { noreturn 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN3pgo15BasicAlgorithms15AveragingBufferE", !6, i64 8, !6, i64 12, !11, i64 16, !16, i64 40, !6, i64 48}
!11 = !{!"_ZTSSt6vectorIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!10, !16, i64 40}
!18 = !{!10, !6, i64 12}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!16, !16, i64 0}
!22 = distinct !{!22, !20}
!23 = !{!10, !6, i64 48}


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