; LLVM IR from TheAlgorithms/C-Plus-Plus :: math/lcm_sum.ll (ZN4math6lcmSumERKt)

; 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<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN4math6lcmSumERKt(ptr noundef nonnull align 2 dereferenceable(2) %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %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 %"class.std::vector", align 8
  %10 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #3
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = load i16, ptr %11, align 2, !tbaa !11
  %13 = zext i16 %12 to i32
  %14 = add nsw i32 %13, 1
  %15 = sext i32 %14 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  call void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #3
  invoke void @_ZNSt6vectorImSaImEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %16 unwind label %36

16:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #3
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = load i16, ptr %17, align 2, !tbaa !11
  %19 = zext i16 %18 to i32
  %20 = add nsw i32 %19, 1
  %21 = sext i32 %20 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  call void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #3
  invoke void @_ZNSt6vectorImSaImEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %22 unwind label %40

22:                                               ; preds = %16
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  store i64 1, ptr %3, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %33, %22
  %24 = load i64, ptr %3, align 8, !tbaa !9
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = load i16, ptr %25, align 2, !tbaa !11
  %27 = zext i16 %26 to i64
  %28 = icmp ule i64 %24, %27
  br i1 %28, label %29, label %44

29:                                               ; preds = %23
  %30 = load i64, ptr %3, align 8, !tbaa !9
  %31 = load i64, ptr %3, align 8, !tbaa !9
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %31) #3
  store i64 %30, ptr %32, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %29
  %34 = load i64, ptr %3, align 8, !tbaa !9
  %35 = add i64 %34, 1
  store i64 %35, ptr %3, align 8, !tbaa !9
  br label %23, !llvm.loop !13

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

40:                                               ; preds = %16
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %7, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %8, align 4
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  br label %135

44:                                               ; preds = %23
  store i64 2, ptr %3, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %87, %44
  %46 = load i64, ptr %3, align 8, !tbaa !9
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = load i16, ptr %47, align 2, !tbaa !11
  %49 = zext i16 %48 to i64
  %50 = icmp ule i64 %46, %49
  br i1 %50, label %51, label %90

51:                                               ; preds = %45
  %52 = load i64, ptr %3, align 8, !tbaa !9
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %52) #3
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = load i64, ptr %3, align 8, !tbaa !9
  %56 = icmp eq i64 %54, %55
  br i1 %56, label %57, label %86

57:                                               ; preds = %51
  %58 = load i64, ptr %3, align 8, !tbaa !9
  store i64 %58, ptr %4, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %81, %57
  %60 = load i64, ptr %4, align 8, !tbaa !9
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = load i16, ptr %61, align 2, !tbaa !11
  %63 = zext i16 %62 to i64
  %64 = icmp ule i64 %60, %63
  br i1 %64, label %65, label %85

65:                                               ; preds = %59
  %66 = load i64, ptr %4, align 8, !tbaa !9
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %66) #3
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load i64, ptr %3, align 8, !tbaa !9
  %70 = udiv i64 %68, %69
  %71 = load i64, ptr %4, align 8, !tbaa !9
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %71) #3
  store i64 %70, ptr %72, align 8, !tbaa !9
  %73 = load i64, ptr %4, align 8, !tbaa !9
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %73) #3
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = load i64, ptr %3, align 8, !tbaa !9
  %77 = sub i64 %76, 1
  %78 = mul i64 %75, %77
  %79 = load i64, ptr %4, align 8, !tbaa !9
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %79) #3
  store i64 %78, ptr %80, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %65
  %82 = load i64, ptr %3, align 8, !tbaa !9
  %83 = load i64, ptr %4, align 8, !tbaa !9
  %84 = add i64 %83, %82
  store i64 %84, ptr %4, align 8, !tbaa !9
  br label %59, !llvm.loop !15

85:                                               ; preds = %59
  br label %86

86:                                               ; preds = %85, %51
  br label %87

87:                                               ; preds = %86
  %88 = load i64, ptr %3, align 8, !tbaa !9
  %89 = add i64 %88, 1
  store i64 %89, ptr %3, align 8, !tbaa !9
  br label %45, !llvm.loop !16

90:                                               ; preds = %45
  store i64 1, ptr %3, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %120, %90
  %92 = load i64, ptr %3, align 8, !tbaa !9
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = load i16, ptr %93, align 2, !tbaa !11
  %95 = zext i16 %94 to i64
  %96 = icmp ule i64 %92, %95
  br i1 %96, label %97, label %123

97:                                               ; preds = %91
  %98 = load i64, ptr %3, align 8, !tbaa !9
  store i64 %98, ptr %4, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %115, %97
  %100 = load i64, ptr %4, align 8, !tbaa !9
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = load i16, ptr %101, align 2, !tbaa !11
  %103 = zext i16 %102 to i64
  %104 = icmp ule i64 %100, %103
  br i1 %104, label %105, label %119

105:                                              ; preds = %99
  %106 = load i64, ptr %3, align 8, !tbaa !9
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %106) #3
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = load i64, ptr %3, align 8, !tbaa !9
  %110 = mul i64 %108, %109
  %111 = load i64, ptr %4, align 8, !tbaa !9
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %111) #3
  %113 = load i64, ptr %112, align 8, !tbaa !9
  %114 = add i64 %113, %110
  store i64 %114, ptr %112, align 8, !tbaa !9
  br label %115

115:                                              ; preds = %105
  %116 = load i64, ptr %3, align 8, !tbaa !9
  %117 = load i64, ptr %4, align 8, !tbaa !9
  %118 = add i64 %117, %116
  store i64 %118, ptr %4, align 8, !tbaa !9
  br label %99, !llvm.loop !17

119:                                              ; preds = %99
  br label %120

120:                                              ; preds = %119
  %121 = load i64, ptr %3, align 8, !tbaa !9
  %122 = add i64 %121, 1
  store i64 %122, ptr %3, align 8, !tbaa !9
  br label %91, !llvm.loop !18

123:                                              ; preds = %91
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = load i16, ptr %124, align 2, !tbaa !11
  %126 = zext i16 %125 to i64
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %126) #3
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = add i64 %128, 1
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = load i16, ptr %130, align 2, !tbaa !11
  %132 = zext i16 %131 to i64
  %133 = mul i64 %129, %132
  %134 = udiv i64 %133, 2
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i64 %134

135:                                              ; preds = %40, %36
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %7, align 8
  %138 = load i32, ptr %8, align 4
  %139 = insertvalue { ptr, i32 } poison, ptr %137, 0
  %140 = insertvalue { ptr, i32 } %139, i32 %138, 1
  resume { ptr, i32 } %140
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i64 0, -9223372036854775808) i64 @_ZN4math6lcmSumERKt(ptr nocapture noundef nonnull readonly align 2 dereferenceable(2) %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #3
  %6 = load i16, ptr %0, align 2, !tbaa !5
  %7 = zext i16 %6 to i64
  %8 = add nuw nsw i64 %7, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #3
  call void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  invoke void @_ZNSt6vectorImSaImEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %9 unwind label %20

9:                                                ; preds = %1
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  %10 = load i16, ptr %0, align 2, !tbaa !5
  %11 = zext i16 %10 to i64
  %12 = add nuw nsw i64 %11, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_ZNSaImEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  invoke void @_ZNSt6vectorImSaImEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %13 unwind label %22

13:                                               ; preds = %9
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  %14 = load i16, ptr %0, align 2, !tbaa !5
  %.not50 = icmp eq i16 %14, 0
  br i1 %.not50, label %.preheader49..preheader47_crit_edge, label %.lr.ph

.preheader49:                                     ; preds = %.lr.ph
  %.not4355 = icmp ult i16 %18, 2
  br i1 %.not4355, label %.preheader49..preheader47_crit_edge, label %.lr.ph58

.preheader49..preheader47_crit_edge:              ; preds = %13, %.preheader49
  %15 = phi i16 [ %18, %.preheader49 ], [ 0, %13 ]
  %.pre = zext nneg i16 %15 to i64
  br label %.preheader47

.lr.ph:                                           ; preds = %13, %.lr.ph
  %.03951 = phi i64 [ %17, %.lr.ph ], [ 1, %13 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03951) #3
  store i64 %.03951, ptr %16, align 8, !tbaa !9
  %17 = add nuw nsw i64 %.03951, 1
  %18 = load i16, ptr %0, align 2, !tbaa !5
  %19 = zext i16 %18 to i64
  %.not.not = icmp ult i64 %.03951, %19
  br i1 %.not.not, label %.lr.ph, label %.preheader49, !llvm.loop !11

20:                                               ; preds = %1
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  br label %65

22:                                               ; preds = %9
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorImED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  br label %65

.preheader47:                                     ; preds = %.loopexit, %.preheader49..preheader47_crit_edge
  %.pre-phi68 = phi i64 [ %.pre, %.preheader49..preheader47_crit_edge ], [ %.pre-phi67, %.loopexit ]
  %24 = phi i16 [ %15, %.preheader49..preheader47_crit_edge ], [ %43, %.loopexit ]
  %.not4462 = icmp eq i16 %24, 0
  br i1 %.not4462, label %._crit_edge64, label %.preheader

.lr.ph58:                                         ; preds = %.preheader49, %.loopexit
  %.14056 = phi i64 [ %44, %.loopexit ], [ 2, %.preheader49 ]
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.14056) #3
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = icmp ne i64 %26, %.14056
  %28 = load i16, ptr %0, align 2
  %29 = zext i16 %28 to i64
  %.not4652 = icmp ugt i64 %.14056, %29
  %or.cond = select i1 %27, i1 true, i1 %.not4652
  br i1 %or.cond, label %.loopexit, label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph58
  %30 = add nsw i64 %.14056, -1
  br label %31

31:                                               ; preds = %.lr.ph54, %31
  %.03853 = phi i64 [ %.14056, %.lr.ph54 ], [ %40, %31 ]
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03853) #3
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = udiv i64 %33, %.14056
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03853) #3
  store i64 %34, ptr %35, align 8, !tbaa !9
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03853) #3
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %38 = mul i64 %37, %30
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03853) #3
  store i64 %38, ptr %39, align 8, !tbaa !9
  %40 = add nuw nsw i64 %.03853, %.14056
  %41 = load i16, ptr %0, align 2, !tbaa !5
  %42 = zext i16 %41 to i64
  %.not46 = icmp ugt i64 %40, %42
  br i1 %.not46, label %.loopexit, label %31, !llvm.loop !13

.loopexit:                                        ; preds = %31, %.lr.ph58
  %.pre-phi67 = phi i64 [ %29, %.lr.ph58 ], [ %42, %31 ]
  %43 = phi i16 [ %28, %.lr.ph58 ], [ %41, %31 ]
  %44 = add nuw nsw i64 %.14056, 1
  %.not43.not = icmp ult i64 %.14056, %.pre-phi67
  br i1 %.not43.not, label %.lr.ph58, label %.preheader47, !llvm.loop !14

.preheader:                                       ; preds = %.preheader47, %._crit_edge
  %45 = phi i16 [ %56, %._crit_edge ], [ %24, %.preheader47 ]
  %.263 = phi i64 [ %57, %._crit_edge ], [ 1, %.preheader47 ]
  %46 = zext i16 %45 to i64
  %.not4559 = icmp ugt i64 %.263, %46
  br i1 %.not4559, label %._crit_edge, label %.lr.ph61

.lr.ph61:                                         ; preds = %.preheader, %.lr.ph61
  %.160 = phi i64 [ %53, %.lr.ph61 ], [ %.263, %.preheader ]
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.263) #3
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = mul i64 %48, %.263
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.160) #3
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = add i64 %51, %49
  store i64 %52, ptr %50, align 8, !tbaa !9
  %53 = add nuw nsw i64 %.160, %.263
  %54 = load i16, ptr %0, align 2, !tbaa !5
  %55 = zext i16 %54 to i64
  %.not45 = icmp ugt i64 %53, %55
  br i1 %.not45, label %._crit_edge, label %.lr.ph61, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph61, %.preheader
  %.pre-phi = phi i64 [ %46, %.preheader ], [ %55, %.lr.ph61 ]
  %56 = phi i16 [ %45, %.preheader ], [ %54, %.lr.ph61 ]
  %57 = add nuw nsw i64 %.263, 1
  %.not44.not = icmp ult i64 %.263, %.pre-phi
  br i1 %.not44.not, label %.preheader, label %._crit_edge64, !llvm.loop !16

._crit_edge64:                                    ; preds = %._crit_edge, %.preheader47
  %.lcssa = phi i64 [ %.pre-phi68, %.preheader47 ], [ %.pre-phi, %._crit_edge ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.lcssa) #3
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = add i64 %59, 1
  %61 = load i16, ptr %0, align 2, !tbaa !5
  %62 = zext i16 %61 to i64
  %63 = mul i64 %60, %62
  %64 = lshr i64 %63, 1
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #3
  ret i64 %64

65:                                               ; preds = %22, %20
  %.pn = phi { ptr, i32 } [ %23, %22 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #3
  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) #1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

!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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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