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

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local 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) #3 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
  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
  %16 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 0
  %19 = load i32, ptr %18, align 8, !tbaa !11
  %20 = mul nsw i32 %17, %19
  store i32 %20, ptr %13, align 4, !tbaa !9
  %21 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 5
  %22 = load ptr, ptr %21, align 8, !tbaa !20
  %23 = getelementptr inbounds i32, ptr %22, i64 0
  store i32 0, ptr %23, align 4, !tbaa !9
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 6
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %27 = getelementptr inbounds i32, ptr %26, i64 0
  store i32 %24, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %61, %6
  %29 = load i32, ptr %14, align 4, !tbaa !9
  %30 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %64

34:                                               ; preds = %28
  %35 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 5
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %37 = load i32, ptr %14, align 4, !tbaa !9
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %36, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %42 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 6
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = sub nsw i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %43, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = add nsw i32 %41, %48
  %50 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 5
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  %52 = load i32, ptr %14, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  store i32 %49, ptr %54, align 4, !tbaa !9
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 6
  %57 = load ptr, ptr %56, align 8, !tbaa !21
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %57, i64 %59
  store i32 %55, ptr %60, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %34
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %14, align 4, !tbaa !9
  br label %28, !llvm.loop !22

64:                                               ; preds = %33
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !11
  %68 = mul nsw i32 %65, %67
  %69 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 8
  %70 = load i32, ptr %69, align 8, !tbaa !24
  %71 = icmp sgt i32 %68, %70
  br i1 %71, label %72, label %88

72:                                               ; preds = %64
  %73 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 7
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %75 = icmp eq ptr %74, null
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @_ZdaPv(ptr noundef %74) #6
  br label %77

77:                                               ; preds = %76, %72
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !11
  %81 = mul nsw i32 %78, %80
  %82 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 8
  store i32 %81, ptr %82, align 8, !tbaa !24
  %83 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 8
  %84 = load i32, ptr %83, align 8, !tbaa !24
  %85 = sext i32 %84 to i64
  %86 = call noalias noundef nonnull ptr @_Znam(i64 noundef %85) #7
  %87 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 7
  store ptr %86, ptr %87, align 8, !tbaa !25
  br label %88

88:                                               ; preds = %77, %64
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 5
  %92 = load ptr, ptr %91, align 8, !tbaa !20
  %93 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 6
  %94 = load ptr, ptr %93, align 8, !tbaa !21
  %95 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 7
  %96 = load ptr, ptr %95, align 8, !tbaa !25
  call void @_ZN10multiverso15AllreduceEngine9AllgatherEPciPiS2_S1_(ptr noundef nonnull align 8 dereferenceable(236) %16, ptr noundef %89, i32 noundef %90, ptr noundef %92, ptr noundef %94, ptr noundef %96)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %124, %88
  %98 = load i32, ptr %15, align 4, !tbaa !9
  %99 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 0
  %100 = load i32, ptr %99, align 8, !tbaa !11
  %101 = icmp slt i32 %98, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %127

103:                                              ; preds = %97
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 7
  %106 = load ptr, ptr %105, align 8, !tbaa !25
  %107 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 5
  %108 = load ptr, ptr %107, align 8, !tbaa !20
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %108, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i8, ptr %106, i64 %113
  %115 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 7
  %116 = load ptr, ptr %115, align 8, !tbaa !25
  %117 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 5
  %118 = load ptr, ptr %117, align 8, !tbaa !20
  %119 = getelementptr inbounds i32, ptr %118, i64 0
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i8, ptr %116, i64 %121
  %123 = load i32, ptr %9, align 4, !tbaa !9
  call void %104(ptr noundef %114, ptr noundef %122, i32 noundef %123)
  br label %124

124:                                              ; preds = %103
  %125 = load i32, ptr %15, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %15, align 4, !tbaa !9
  br label %97, !llvm.loop !26

127:                                              ; preds = %102
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = getelementptr inbounds %"class.multiverso::AllreduceEngine", ptr %16, i32 0, i32 7
  %130 = load ptr, ptr %129, align 8, !tbaa !25
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %128, ptr align 1 %130, i64 %132, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { nobuiltin 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { builtin nounwind }
attributes #7 = { builtin allocsize(0) }

!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"}
!24 = !{!12, !10, i64 232}
!25 = !{!12, !6, i64 224}
!26 = distinct !{!26, !23}


; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10multiverso15AllreduceEngine20AllreduceByAllGatherEPciiS1_PFvPKcS1_iE(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef readonly %5) local_unnamed_addr #2 align 2 {
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = mul nsw i32 %7, %2
  %9 = getelementptr inbounds i8, ptr %0, i64 208
  %10 = load ptr, ptr %9, align 8, !tbaa !18
  store i32 0, ptr %10, align 4, !tbaa !19
  %11 = getelementptr inbounds i8, ptr %0, i64 216
  %12 = load ptr, ptr %11, align 8, !tbaa !20
  store i32 %2, ptr %12, align 4, !tbaa !19
  %13 = load i32, ptr %0, align 8, !tbaa !5
  %14 = icmp sgt i32 %13, 1
  br i1 %14, label %.lr.ph.lver.check, label %._crit_edge

.lr.ph.lver.check:                                ; preds = %6
  %invariant.gep = getelementptr i8, ptr %10, i64 -4
  %scevgep = getelementptr i8, ptr %10, i64 8589934588
  %scevgep41 = getelementptr i8, ptr %12, i64 4
  %scevgep42 = getelementptr i8, ptr %12, i64 8589934588
  %bound0 = icmp ult ptr %10, %scevgep42
  %bound1 = icmp ult ptr %scevgep41, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.lver.orig, label %.lr.ph.ph

.lr.ph.lver.orig:                                 ; preds = %.lr.ph.lver.check, %.lr.ph.lver.orig
  %indvars.iv.lver.orig = phi i64 [ %indvars.iv.next.lver.orig, %.lr.ph.lver.orig ], [ 1, %.lr.ph.lver.check ]
  %gep.lver.orig = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.lver.orig
  %15 = load i32, ptr %gep.lver.orig, align 4, !tbaa !19
  %16 = add nsw i32 %15, %2
  %17 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.lver.orig
  store i32 %16, ptr %17, align 4, !tbaa !19
  %18 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv.lver.orig
  store i32 %2, ptr %18, align 4, !tbaa !19
  %indvars.iv.next.lver.orig = add nuw nsw i64 %indvars.iv.lver.orig, 1
  %19 = load i32, ptr %0, align 8, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next.lver.orig, %20
  br i1 %21, label %.lr.ph.lver.orig, label %._crit_edge, !llvm.loop !21

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

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph.lver.orig, %6
  %.lcssa = phi i32 [ %13, %6 ], [ %19, %.lr.ph.lver.orig ], [ %31, %.lr.ph ]
  %22 = mul nsw i32 %.lcssa, %2
  %23 = getelementptr inbounds i8, ptr %0, i64 232
  %24 = load i32, ptr %23, align 8, !tbaa !23
  %25 = icmp sgt i32 %22, %24
  %26 = getelementptr inbounds i8, ptr %0, i64 224
  %27 = load ptr, ptr %26, align 8, !tbaa !24
  br i1 %25, label %34, label %._crit_edge._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.ph, %.lr.ph
  %store_forwarded = phi i32 [ %load_initial, %.lr.ph.ph ], [ %28, %.lr.ph ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.ph ], [ %indvars.iv.next, %.lr.ph ]
  %28 = add nsw i32 %store_forwarded, %2
  %29 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv
  store i32 %28, ptr %29, align 4, !tbaa !19
  %30 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  store i32 %2, ptr %30, align 4, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %0, align 8, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !21

34:                                               ; preds = %._crit_edge
  %35 = icmp eq ptr %27, null
  br i1 %35, label %37, label %36

36:                                               ; preds = %34
  tail call void @_ZdaPv(ptr noundef nonnull %27) #4
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  %.pre33.pre = load ptr, ptr %9, align 8, !tbaa !18
  %.pre34.pre = load ptr, ptr %11, align 8, !tbaa !20
  %.pre38 = mul nsw i32 %.pre, %2
  br label %37

37:                                               ; preds = %36, %34
  %.pre-phi = phi i32 [ %.pre38, %36 ], [ %22, %34 ]
  %.pre34 = phi ptr [ %.pre34.pre, %36 ], [ %12, %34 ]
  %.pre33 = phi ptr [ %.pre33.pre, %36 ], [ %10, %34 ]
  store i32 %.pre-phi, ptr %23, align 8, !tbaa !23
  %38 = sext i32 %.pre-phi to i64
  %39 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %38) #5
  store ptr %39, ptr %26, align 8, !tbaa !24
  br label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge, %37
  %40 = phi ptr [ %39, %37 ], [ %27, %._crit_edge ]
  %41 = phi ptr [ %.pre34, %37 ], [ %12, %._crit_edge ]
  %42 = phi ptr [ %.pre33, %37 ], [ %10, %._crit_edge ]
  %43 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @_ZN10multiverso15AllreduceEngine9AllgatherEPciPiS2_S1_(ptr noundef nonnull align 8 dereferenceable(236) %0, ptr noundef %1, i32 noundef %8, ptr noundef %42, ptr noundef %41, ptr noundef %40)
  %44 = load i32, ptr %0, align 8, !tbaa !5
  %45 = icmp sgt i32 %44, 1
  br i1 %45, label %.lr.ph26, label %._crit_edge27

._crit_edge27:                                    ; preds = %.lr.ph26, %._crit_edge._crit_edge
  %46 = load ptr, ptr %43, align 8, !tbaa !24
  %47 = sext i32 %2 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %4, ptr align 1 %46, i64 %47, i1 false)
  ret void

.lr.ph26:                                         ; preds = %._crit_edge._crit_edge, %.lr.ph26
  %indvars.iv30 = phi i64 [ %indvars.iv.next31, %.lr.ph26 ], [ 1, %._crit_edge._crit_edge ]
  %48 = load ptr, ptr %43, align 8, !tbaa !24
  %49 = load ptr, ptr %9, align 8, !tbaa !18
  %50 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv30
  %51 = load i32, ptr %50, align 4, !tbaa !19
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %48, i64 %52
  %54 = load i32, ptr %49, align 4, !tbaa !19
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %48, i64 %55
  tail call void %5(ptr noundef %53, ptr noundef %56, i32 noundef %2)
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %57 = load i32, ptr %0, align 8, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next31, %58
  br i1 %59, label %.lr.ph26, label %._crit_edge27, !llvm.loop !25
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin 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 #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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { builtin nounwind }
attributes #5 = { builtin allocsize(0) }

!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"}
!23 = !{!6, !7, i64 232}
!24 = !{!6, !10, i64 224}
!25 = distinct !{!25, !22}


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