; LLVM IR from microsoft/Multiverso :: src/net/allreduce_engine.ll (ZN10multiverso15AllreduceEngine9AllreduceEPciiS1_PFvPKcS1_iE)

; 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.multiverso::AllreduceEngine" = type <{ i32, i32, ptr, %"class.multiverso::BruckMap", %"class.multiverso::RecursiveHalvingMap", ptr, ptr, ptr, i32, [4 x i8] }>
%"class.multiverso::BruckMap" = type { i32, %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.multiverso::RecursiveHalvingMap" = type { i32, i32, i32, %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector" }

; 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 uwtable
define dso_local void @_ZN10multiverso15AllreduceEngine9AllreduceEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #1 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = load i32, ptr %10, align 4, !tbaa !9
  %20 = sdiv i32 %18, %19
  store i32 %20, ptr %13, align 4, !tbaa !9
  %21 = load i32, ptr %13, align 4, !tbaa !9
  %22 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp slt i32 %21, %23
  br i1 %24, label %28, label %25

25:                                               ; preds = %6
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 4096
  br i1 %27, label %28, label %34

28:                                               ; preds = %25, %6
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN10multiverso15AllreduceEngine20AllreduceByAllGatherEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %17, ptr noundef %29, i32 noundef %30, i32 noundef %31, ptr noundef %32, ptr noundef %33)
  store i32 1, ptr %14, align 4
  br label %146

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  %35 = load i32, ptr %13, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = add nsw i32 %35, %37
  %39 = sub nsw i32 %38, 1
  %40 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !11
  %42 = sdiv i32 %39, %41
  store i32 %42, ptr %15, align 4, !tbaa !9
  %43 = load i32, ptr %15, align 4, !tbaa !9
  %44 = icmp slt i32 %43, 1
  br i1 %44, label %45, label %46

45:                                               ; preds = %34
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %45, %34
  %47 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  %49 = getelementptr inbounds i32, ptr %48, i64 0
  store i32 0, ptr %49, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %109, %46
  %51 = load i32, ptr %16, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !11
  %54 = sub nsw i32 %53, 1
  %55 = icmp slt i32 %51, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %50
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  br label %112

57:                                               ; preds = %50
  %58 = load i32, ptr %15, align 4, !tbaa !9
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = mul nsw i32 %58, %59
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %63 = load ptr, ptr %62, align 8, !tbaa !20
  %64 = load i32, ptr %16, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = sub nsw i32 %61, %67
  %69 = icmp slt i32 %60, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %57
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = mul nsw i32 %71, %72
  br label %83

74:                                               ; preds = %57
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  %78 = load i32, ptr %16, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr %77, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = sub nsw i32 %75, %81
  br label %83

83:                                               ; preds = %74, %70
  %84 = phi i32 [ %73, %70 ], [ %82, %74 ]
  %85 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 6
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  %87 = load i32, ptr %16, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  store i32 %84, ptr %89, align 4, !tbaa !9
  %90 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %91 = load ptr, ptr %90, align 8, !tbaa !20
  %92 = load i32, ptr %16, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %91, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 6
  %97 = load ptr, ptr %96, align 8, !tbaa !21
  %98 = load i32, ptr %16, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = add nsw i32 %95, %101
  %103 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %104 = load ptr, ptr %103, align 8, !tbaa !20
  %105 = load i32, ptr %16, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %104, i64 %107
  store i32 %102, ptr %108, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %83
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %16, align 4, !tbaa !9
  br label %50, !llvm.loop !22

112:                                              ; preds = %56
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %115 = load ptr, ptr %114, align 8, !tbaa !20
  %116 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 0
  %117 = load i32, ptr %116, align 8, !tbaa !11
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %115, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = sub nsw i32 %113, %121
  %123 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 6
  %124 = load ptr, ptr %123, align 8, !tbaa !21
  %125 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 0
  %126 = load i32, ptr %125, align 8, !tbaa !11
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %124, i64 %128
  store i32 %122, ptr %129, align 4, !tbaa !9
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = load i32, ptr %10, align 4, !tbaa !9
  %133 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %134 = load ptr, ptr %133, align 8, !tbaa !20
  %135 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 6
  %136 = load ptr, ptr %135, align 8, !tbaa !21
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN10multiverso15AllreduceEngine13ReduceScatterEPciiPiS2_S1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %17, ptr noundef %130, i32 noundef %131, i32 noundef %132, ptr noundef %134, ptr noundef %136, ptr noundef %137, ptr noundef %138)
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 5
  %142 = load ptr, ptr %141, align 8, !tbaa !20
  %143 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %17, i32 0, i32 6
  %144 = load ptr, ptr %143, align 8, !tbaa !21
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN10multiverso15AllreduceEngine9AllgatherEPciPiS2_S1_(ptr noundef nonnull align 8 dereferenceable(236) %17, ptr noundef %139, i32 noundef %140, ptr noundef %142, ptr noundef %144, ptr noundef %145)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  store i32 0, ptr %14, align 4
  br label %146

146:                                              ; preds = %112, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  %147 = load i32, ptr %14, align 4
  switch i32 %147, label %149 [
    i32 0, label %148
    i32 1, label %148
  ]

148:                                              ; preds = %146, %146
  ret void

149:                                              ; preds = %146
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10multiverso15AllreduceEngine20AllreduceByAllGatherEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236), ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10multiverso15AllreduceEngine13ReduceScatterEPciiPiS2_S1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236), ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10multiverso15AllreduceEngine9AllgatherEPciPiS2_S1_(ptr noundef nonnull align 8 dereferenceable(236), ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 0}
!12 = !{!"_ZTSN10multiverso15AllreduceEngineE", !10, i64 0, !10, i64 4, !6, i64 8, !13, i64 16, !18, i64 72, !6, i64 208, !6, i64 216, !6, i64 224, !10, i64 232}
!13 = !{!"_ZTSN10multiverso8BruckMapE", !10, i64 0, !14, i64 8, !14, i64 32}
!14 = !{!"_ZTSSt6vectorIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSN10multiverso19RecursiveHalvingMapE", !10, i64 0, !19, i64 4, !10, i64 8, !14, i64 16, !14, i64 40, !14, i64 64, !14, i64 88, !14, i64 112}
!19 = !{!"_ZTSN10multiverso24RecursiveHalvingNodeTypeE", !7, i64 0}
!20 = !{!12, !6, i64 208}
!21 = !{!12, !6, i64 216}
!22 = distinct !{!22, !23}
!23 = !{!"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 uwtable
define dso_local void @_ZN10multiverso15AllreduceEngine9AllreduceEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 align 2 {
  %7 = sdiv i32 %2, %3
  %8 = load i32, ptr %0, align 8, !tbaa !5
  %9 = icmp slt i32 %7, %8
  %10 = icmp slt i32 %2, 4096
  %or.cond = or i1 %10, %9
  br i1 %or.cond, label %11, label %12

11:                                               ; preds = %6
  tail call void @_ZN10multiverso15AllreduceEngine20AllreduceByAllGatherEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5)
  br label %53

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %0, i64 208
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  store i32 0, ptr %14, align 4, !tbaa !19
  %15 = load i32, ptr %0, align 8, !tbaa !5
  %16 = icmp sgt i32 %15, 1
  br i1 %16, label %.lver.check, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %12
  %17 = add nsw i32 %15, -1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 216
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !20
  %.pre44 = sext i32 %17 to i64
  br label %._crit_edge

.lver.check:                                      ; preds = %12
  %18 = add i32 %7, -1
  %19 = add i32 %18, %8
  %20 = sdiv i32 %19, %8
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %20, i32 1)
  %21 = mul nsw i32 %spec.store.select, %3
  %22 = getelementptr inbounds i8, ptr %0, i64 216
  %23 = load ptr, ptr %22, align 8, !tbaa !20
  %scevgep = getelementptr i8, ptr %23, i64 8589934584
  %scevgep45 = getelementptr i8, ptr %14, i64 8589934588
  %bound0 = icmp ult ptr %23, %scevgep45
  %bound1 = icmp ult ptr %14, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.ph.lver.orig, label %.ph

.ph.lver.orig:                                    ; preds = %.lver.check, %.ph.lver.orig
  %24 = phi i32 [ %29, %.ph.lver.orig ], [ 0, %.lver.check ]
  %indvars.iv.lver.orig = phi i64 [ %indvars.iv.next.lver.orig, %.ph.lver.orig ], [ 0, %.lver.check ]
  %25 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.lver.orig
  %26 = sub nsw i32 %2, %24
  %..lver.orig = tail call i32 @llvm.smin.i32(i32 %21, i32 %26)
  %27 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv.lver.orig
  store i32 %..lver.orig, ptr %27, align 4, !tbaa !19
  %28 = load i32, ptr %25, align 4, !tbaa !19
  %29 = add nsw i32 %28, %..lver.orig
  %indvars.iv.next.lver.orig = add nuw nsw i64 %indvars.iv.lver.orig, 1
  %30 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next.lver.orig
  store i32 %29, ptr %30, align 4, !tbaa !19
  %31 = load i32, ptr %0, align 8, !tbaa !5
  %32 = add nsw i32 %31, -1
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next.lver.orig, %33
  br i1 %34, label %.ph.lver.orig, label %._crit_edge, !llvm.loop !21

.ph:                                              ; preds = %.lver.check
  %load_initial = load i32, ptr %14, align 4
  br label %43

._crit_edge:                                      ; preds = %43, %.ph.lver.orig, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre44, %.._crit_edge_crit_edge ], [ %33, %.ph.lver.orig ], [ %51, %43 ]
  %35 = phi ptr [ %.pre, %.._crit_edge_crit_edge ], [ %23, %.ph.lver.orig ], [ %23, %43 ]
  %36 = getelementptr inbounds i32, ptr %14, i64 %.pre-phi
  %37 = load i32, ptr %36, align 4, !tbaa !19
  %38 = sub nsw i32 %2, %37
  %39 = getelementptr inbounds i8, ptr %0, i64 216
  %40 = getelementptr inbounds i32, ptr %35, i64 %.pre-phi
  store i32 %38, ptr %40, align 4, !tbaa !19
  tail call void @_ZN10multiverso15AllreduceEngine13ReduceScatterEPciiPiS2_S1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %14, ptr noundef %35, ptr noundef %4, ptr noundef %5)
  %41 = load ptr, ptr %13, align 8, !tbaa !18
  %42 = load ptr, ptr %39, align 8, !tbaa !20
  tail call void @_ZN10multiverso15AllreduceEngine9AllgatherEPciPiS2_S1_(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %4, i32 noundef %2, ptr noundef %41, ptr noundef %42, ptr noundef %4)
  br label %53

43:                                               ; preds = %.ph, %43
  %store_forwarded = phi i32 [ %load_initial, %.ph ], [ %47, %43 ]
  %44 = phi i32 [ 0, %.ph ], [ %47, %43 ]
  %indvars.iv = phi i64 [ 0, %.ph ], [ %indvars.iv.next, %43 ]
  %45 = sub nsw i32 %2, %44
  %. = tail call i32 @llvm.smin.i32(i32 %21, i32 %45)
  %46 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv
  store i32 %., ptr %46, align 4, !tbaa !19
  %47 = add nsw i32 %store_forwarded, %.
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next
  store i32 %47, ptr %48, align 4, !tbaa !19
  %49 = load i32, ptr %0, align 8, !tbaa !5
  %50 = add nsw i32 %49, -1
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next, %51
  br i1 %52, label %43, label %._crit_edge, !llvm.loop !21

53:                                               ; preds = %._crit_edge, %11
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10multiverso15AllreduceEngine20AllreduceByAllGatherEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236), ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10multiverso15AllreduceEngine13ReduceScatterEPciiPiS2_S1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236), ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10multiverso15AllreduceEngine9AllgatherEPciPiS2_S1_(ptr noundef nonnull align 8 dereferenceable(236), ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #1

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 speculatable willreturn memory(none) }

!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, !7, i64 0}
!6 = !{!"_ZTSN10multiverso15AllreduceEngineE", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !16, i64 72, !10, i64 208, !10, i64 216, !10, i64 224, !7, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN10multiverso8BruckMapE", !7, i64 0, !12, i64 8, !12, i64 32}
!12 = !{!"_ZTSSt6vectorIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!16 = !{!"_ZTSN10multiverso19RecursiveHalvingMapE", !7, i64 0, !17, i64 4, !7, i64 8, !12, i64 16, !12, i64 40, !12, i64 64, !12, i64 88, !12, i64 112}
!17 = !{!"_ZTSN10multiverso24RecursiveHalvingNodeTypeE", !8, i64 0}
!18 = !{!6, !10, i64 208}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !10, i64 216}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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