; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/莫队算法/莫队算法.ll (ZN5MoDui4workEiSt6vectorINS_5queryESaIS1_EE)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.MoDui::query" = type { i32, i32, i32 }

@_ZN5MoDui6belongE = external dso_local global [110000 x i32], align 16
@_ZN5MoDui3ansE = external dso_local global [110000 x i32], align 16

; 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) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5MoDui4workEiSt6vectorINS_5queryESaIS1_EE(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"struct.MoDui::query", align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %18)
  %20 = fptosi double %19 to i32
  store i32 %20, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sitofp i32 %21 to double
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = sitofp i32 %23 to double
  %25 = fdiv double %22, %24
  %26 = call double @llvm.ceil.f64(double %25)
  %27 = fptosi double %26 to i32
  store i32 %27, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %55, %2
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %58

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = mul nsw i32 %35, %36
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %9, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %51, %33
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = mul nsw i32 %41, %42
  %44 = icmp sle i32 %40, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %39
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %54

46:                                               ; preds = %39
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110000 x i32], ptr @_ZN5MoDui6belongE, i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %46
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %9, align 4, !tbaa !5
  br label %39, !llvm.loop !11

54:                                               ; preds = %45
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %28, !llvm.loop !13

58:                                               ; preds = %32
  %59 = call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %61, ptr %62, align 8
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %64, ptr %66)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr %1, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %67 = load ptr, ptr %14, align 8, !tbaa !9
  %68 = call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %67) #7
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %68, ptr %69, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %70 = load ptr, ptr %14, align 8, !tbaa !9
  %71 = call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #7
  %72 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  br label %73

73:                                               ; preds = %119, %58
  %74 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br i1 %74, label %76, label %75

75:                                               ; preds = %73
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %121

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %77, i64 12, i1 false), !tbaa.struct !14
  br label %78

78:                                               ; preds = %83, %76
  %79 = load i32, ptr %12, align 4, !tbaa !5
  %80 = getelementptr inbounds %"struct.MoDui::query", ptr %17, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !15
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %78
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !5
  call void @_Z3deli(i32 noundef %84)
  br label %78, !llvm.loop !17

86:                                               ; preds = %78
  br label %87

87:                                               ; preds = %92, %86
  %88 = load i32, ptr %12, align 4, !tbaa !5
  %89 = getelementptr inbounds %"struct.MoDui::query", ptr %17, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = icmp sgt i32 %88, %90
  br i1 %91, label %92, label %95

92:                                               ; preds = %87
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %12, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %94)
  br label %87, !llvm.loop !18

95:                                               ; preds = %87
  br label %96

96:                                               ; preds = %101, %95
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = getelementptr inbounds %"struct.MoDui::query", ptr %17, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !19
  %100 = icmp slt i32 %97, %99
  br i1 %100, label %101, label %104

101:                                              ; preds = %96
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %13, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %103)
  br label %96, !llvm.loop !20

104:                                              ; preds = %96
  br label %105

105:                                              ; preds = %110, %104
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = getelementptr inbounds %"struct.MoDui::query", ptr %17, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !19
  %109 = icmp sgt i32 %106, %108
  br i1 %109, label %110, label %113

110:                                              ; preds = %105
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %13, align 4, !tbaa !5
  call void @_Z3deli(i32 noundef %111)
  br label %105, !llvm.loop !21

113:                                              ; preds = %105
  %114 = call noundef i32 @_Z7get_ansv()
  %115 = getelementptr inbounds %"struct.MoDui::query", ptr %17, i32 0, i32 2
  %116 = load i32, ptr %115, align 4, !tbaa !22
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [110000 x i32], ptr @_ZN5MoDui3ansE, i64 0, i64 %117
  store i32 %114, ptr %118, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  br label %119

119:                                              ; preds = %113
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %73

121:                                              ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3deli(i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3addi(i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7get_ansv() #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

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

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

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


; 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.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZN5MoDui6belongE = external dso_local local_unnamed_addr global [110000 x i32], align 16
@_ZN5MoDui3ansE = external dso_local local_unnamed_addr global [110000 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5MoDui4workEiSt6vectorINS_5queryESaIS1_EE(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %0)
  %6 = fptosi double %5 to i32
  %7 = sitofp i32 %0 to double
  %8 = sitofp i32 %6 to double
  %9 = fdiv double %7, %8
  %10 = tail call double @llvm.ceil.f64(double %9)
  %11 = fptosi double %10 to i32
  %.not37 = icmp slt i32 %11, 1
  br i1 %.not37, label %._crit_edge41, label %.lr.ph40.preheader

.lr.ph40.preheader:                               ; preds = %2
  %12 = sext i32 %6 to i64
  %13 = add i32 %6, -1
  %14 = zext i32 %13 to i64
  %15 = add nuw nsw i64 %14, 1
  %min.iters.check = icmp ult i32 %13, 7
  %n.vec = and i64 %15, 8589934584
  %cmp.n = icmp eq i64 %15, %n.vec
  br label %.lr.ph40

._crit_edge41:                                    ; preds = %._crit_edge, %2
  %16 = tail call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %17 = tail call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  tail call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %16, ptr %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %18 = tail call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %18, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %19 = tail call ptr @_ZNSt6vectorIN5MoDui5queryESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %19, ptr %4, align 8
  %20 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br i1 %20, label %.lr.ph58, label %._crit_edge59

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %._crit_edge
  %indvars.iv66 = phi i32 [ %6, %.lr.ph40.preheader ], [ %indvars.iv.next67, %._crit_edge ]
  %indvars.iv = phi i64 [ 0, %.lr.ph40.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.038 = phi i32 [ 1, %.lr.ph40.preheader ], [ %28, %._crit_edge ]
  %21 = add nsw i32 %.038, -1
  %22 = mul nsw i32 %21, %6
  %23 = mul nsw i32 %.038, %6
  %.not32.not35 = icmp slt i32 %22, %23
  br i1 %.not32.not35, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph40
  br i1 %min.iters.check, label %.lr.ph.preheader79, label %vector.ph

.lr.ph.preheader79:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv63.ph = phi i64 [ %indvars.iv, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %ind.end = add i64 %indvars.iv, %n.vec
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.038, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv, %index
  %24 = add nsw i64 %offset.idx, 1
  %25 = getelementptr inbounds [110000 x i32], ptr @_ZN5MoDui6belongE, i64 0, i64 %24
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  store <4 x i32> %broadcast.splat, ptr %25, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %26, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader79

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %.lr.ph40
  %28 = add nuw i32 %.038, 1
  %indvars.iv.next = add i64 %indvars.iv, %12
  %indvars.iv.next67 = add i32 %indvars.iv66, %6
  %exitcond68.not = icmp eq i32 %.038, %11
  br i1 %exitcond68.not, label %._crit_edge41, label %.lr.ph40, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph.preheader79, %.lr.ph
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.lr.ph ], [ %indvars.iv63.ph, %.lr.ph.preheader79 ]
  %indvars.iv.next64 = add nsw i64 %indvars.iv63, 1
  %29 = getelementptr inbounds [110000 x i32], ptr @_ZN5MoDui6belongE, i64 0, i64 %indvars.iv.next64
  store i32 %.038, ptr %29, align 4, !tbaa !5
  %lftr.wideiv = trunc i64 %indvars.iv.next64 to i32
  %exitcond.not = icmp eq i32 %indvars.iv66, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge59:                                    ; preds = %._crit_edge53, %._crit_edge41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void

.lr.ph58:                                         ; preds = %._crit_edge41, %._crit_edge53
  %.02856 = phi i32 [ %.2.lcssa, %._crit_edge53 ], [ 1, %._crit_edge41 ]
  %.02955 = phi i32 [ %.231.lcssa, %._crit_edge53 ], [ 0, %._crit_edge41 ]
  %30 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %.sroa.0.0.copyload = load i32, ptr %30, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %30, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %30, i64 8
  %.sroa.7.0.copyload = load i32, ptr %.sroa.7.0..sroa_idx, align 4, !tbaa !5
  %31 = icmp slt i32 %.02856, %.sroa.0.0.copyload
  br i1 %31, label %.lr.ph44, label %.preheader34

.preheader34:                                     ; preds = %.lr.ph58
  %32 = icmp sgt i32 %.02856, %.sroa.0.0.copyload
  br i1 %32, label %.lr.ph46, label %.preheader33

.lr.ph44:                                         ; preds = %.lr.ph58, %.lr.ph44
  %.142 = phi i32 [ %33, %.lr.ph44 ], [ %.02856, %.lr.ph58 ]
  %33 = add i32 %.142, 1
  call void @_Z3deli(i32 noundef %.142)
  %exitcond69.not = icmp eq i32 %33, %.sroa.0.0.copyload
  br i1 %exitcond69.not, label %.preheader33, label %.lr.ph44, !llvm.loop !15

.preheader33:                                     ; preds = %.lr.ph46, %.lr.ph44, %.preheader34
  %.2.lcssa = phi i32 [ %.02856, %.preheader34 ], [ %.sroa.0.0.copyload, %.lr.ph44 ], [ %.sroa.0.0.copyload, %.lr.ph46 ]
  %34 = icmp slt i32 %.02955, %.sroa.5.0.copyload
  br i1 %34, label %.lr.ph49, label %.preheader

.lr.ph46:                                         ; preds = %.preheader34, %.lr.ph46
  %.245 = phi i32 [ %35, %.lr.ph46 ], [ %.02856, %.preheader34 ]
  %35 = add nsw i32 %.245, -1
  call void @_Z3addi(i32 noundef %35)
  %36 = icmp sgt i32 %35, %.sroa.0.0.copyload
  br i1 %36, label %.lr.ph46, label %.preheader33, !llvm.loop !16

.preheader:                                       ; preds = %.preheader33
  %37 = icmp sgt i32 %.02955, %.sroa.5.0.copyload
  br i1 %37, label %.lr.ph52, label %._crit_edge53

.lr.ph49:                                         ; preds = %.preheader33, %.lr.ph49
  %.13048 = phi i32 [ %38, %.lr.ph49 ], [ %.02955, %.preheader33 ]
  %38 = add nsw i32 %.13048, 1
  call void @_Z3addi(i32 noundef %38)
  %exitcond70.not = icmp eq i32 %38, %.sroa.5.0.copyload
  br i1 %exitcond70.not, label %._crit_edge53, label %.lr.ph49, !llvm.loop !17

.lr.ph52:                                         ; preds = %.preheader, %.lr.ph52
  %.23151 = phi i32 [ %39, %.lr.ph52 ], [ %.02955, %.preheader ]
  %39 = add nsw i32 %.23151, -1
  call void @_Z3deli(i32 noundef %.23151)
  %40 = icmp sgt i32 %39, %.sroa.5.0.copyload
  br i1 %40, label %.lr.ph52, label %._crit_edge53, !llvm.loop !18

._crit_edge53:                                    ; preds = %.lr.ph52, %.lr.ph49, %.preheader
  %.231.lcssa = phi i32 [ %.02955, %.preheader ], [ %.sroa.5.0.copyload, %.lr.ph49 ], [ %.sroa.5.0.copyload, %.lr.ph52 ]
  %41 = call noundef i32 @_Z7get_ansv()
  %42 = sext i32 %.sroa.7.0.copyload to i64
  %43 = getelementptr inbounds [110000 x i32], ptr @_ZN5MoDui3ansE, i64 0, i64 %42
  store i32 %41, ptr %43, align 4, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br i1 %45, label %.lr.ph58, label %._crit_edge59
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3deli(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3addi(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7get_ansv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN5MoDui5queryESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { inlinehint 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 #5 = { 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 #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 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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