; LLVM IR from eyangch/competitive-programming :: CSES/Additional_Problems (new_roads_queries)

; 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"

%"struct.std::pair" = type { i64, i64 }
%struct.DSU = type { [200000 x i64], [200000 x i64], [200000 x %"class.std::vector"], [200000 x %"struct.std::pair"], [200000 x i64] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@E = external dso_local global [200000 x %"struct.std::pair"], align 16
@X = external dso_local global [200000 x %"struct.std::pair"], align 16
@dsu = external dso_local global %struct.DSU, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %15

15:                                               ; preds = %39, %0
  %16 = load i64, ptr %2, align 8, !tbaa !8
  %17 = load i64, ptr @M, align 8, !tbaa !8
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %42

20:                                               ; preds = %15
  %21 = load i64, ptr %2, align 8, !tbaa !8
  %22 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %21
  %23 = getelementptr inbounds %"struct.std::pair", ptr %22, i32 0, i32 0
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %25
  %27 = getelementptr inbounds %"struct.std::pair", ptr %26, i32 0, i32 1
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %29 = load i64, ptr %2, align 8, !tbaa !8
  %30 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %29
  %31 = getelementptr inbounds %"struct.std::pair", ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 16, !tbaa !11
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr %31, align 16, !tbaa !11
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %34
  %36 = getelementptr inbounds %"struct.std::pair", ptr %35, i32 0, i32 1
  %37 = load i64, ptr %36, align 8, !tbaa !13
  %38 = add nsw i64 %37, -1
  store i64 %38, ptr %36, align 8, !tbaa !13
  br label %39

39:                                               ; preds = %20
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %2, align 8, !tbaa !8
  br label %15, !llvm.loop !14

42:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %43

43:                                               ; preds = %67, %42
  %44 = load i64, ptr %3, align 8, !tbaa !8
  %45 = load i64, ptr @Q, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %70

48:                                               ; preds = %43
  %49 = load i64, ptr %3, align 8, !tbaa !8
  %50 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @X, i64 0, i64 %49
  %51 = getelementptr inbounds %"struct.std::pair", ptr %50, i32 0, i32 0
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %51)
  %53 = load i64, ptr %3, align 8, !tbaa !8
  %54 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @X, i64 0, i64 %53
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 1
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %52, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = load i64, ptr %3, align 8, !tbaa !8
  %58 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @X, i64 0, i64 %57
  %59 = getelementptr inbounds %"struct.std::pair", ptr %58, i32 0, i32 0
  %60 = load i64, ptr %59, align 16, !tbaa !11
  %61 = add nsw i64 %60, -1
  store i64 %61, ptr %59, align 16, !tbaa !11
  %62 = load i64, ptr %3, align 8, !tbaa !8
  %63 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @X, i64 0, i64 %62
  %64 = getelementptr inbounds %"struct.std::pair", ptr %63, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !13
  %66 = add nsw i64 %65, -1
  store i64 %66, ptr %64, align 8, !tbaa !13
  br label %67

67:                                               ; preds = %48
  %68 = load i64, ptr %3, align 8, !tbaa !8
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %3, align 8, !tbaa !8
  br label %43, !llvm.loop !16

70:                                               ; preds = %47
  %71 = load i64, ptr @N, align 8, !tbaa !8
  %72 = load i64, ptr @Q, align 8, !tbaa !8
  call void @_ZN3DSU4initExxRA200000_St4pairIxxE(ptr noundef nonnull align 8 dereferenceable(12800000) @dsu, i64 noundef %71, i64 noundef %72, ptr noundef nonnull align 8 dereferenceable(3200000) @X)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %73

73:                                               ; preds = %89, %70
  %74 = load i64, ptr %4, align 8, !tbaa !8
  %75 = load i64, ptr @M, align 8, !tbaa !8
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %92

78:                                               ; preds = %73
  %79 = load i64, ptr %4, align 8, !tbaa !8
  %80 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %79
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 16, !tbaa !11
  %83 = load i64, ptr %4, align 8, !tbaa !8
  %84 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %83
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 1
  %86 = load i64, ptr %85, align 8, !tbaa !13
  %87 = load i64, ptr %4, align 8, !tbaa !8
  %88 = add nsw i64 %87, 1
  call void @_ZN3DSU2unExxx(ptr noundef nonnull align 8 dereferenceable(12800000) @dsu, i64 noundef %82, i64 noundef %86, i64 noundef %88)
  br label %89

89:                                               ; preds = %78
  %90 = load i64, ptr %4, align 8, !tbaa !8
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %4, align 8, !tbaa !8
  br label %73, !llvm.loop !17

92:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %93

93:                                               ; preds = %104, %92
  %94 = load i64, ptr %5, align 8, !tbaa !8
  %95 = load i64, ptr @Q, align 8, !tbaa !8
  %96 = icmp slt i64 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %107

98:                                               ; preds = %93
  %99 = load i64, ptr %5, align 8, !tbaa !8
  %100 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds (%struct.DSU, ptr @dsu, i32 0, i32 4), i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !8
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %102, i8 noundef signext 10)
  br label %104

104:                                              ; preds = %98
  %105 = load i64, ptr %5, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %5, align 8, !tbaa !8
  br label %93, !llvm.loop !18

107:                                              ; preds = %97
  %108 = load i32, ptr %1, align 4
  ret i32 %108
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU4initExxRA200000_St4pairIxxE(ptr noundef nonnull align 8 dereferenceable(12800000), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(3200000)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU2unExxx(ptr noundef nonnull align 8 dereferenceable(12800000), i64 noundef, i64 noundef, i64 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

attributes #0 = { mustprogress norecurse 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 0}
!12 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!13 = !{!12, !9, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


; 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"

%"struct.std::pair" = type { i64, i64 }
%struct.DSU = type { [200000 x i64], [200000 x i64], [200000 x %"class.std::vector"], [200000 x %"struct.std::pair"], [200000 x i64] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@E = external dso_local global [200000 x %"struct.std::pair"], align 16
@X = external dso_local global [200000 x %"struct.std::pair"], align 16
@dsu = external dso_local global %struct.DSU, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %10 = load i64, ptr @M, align 8, !tbaa !8
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader25

.preheader25:                                     ; preds = %.lr.ph, %0
  %12 = load i64, ptr @Q, align 8, !tbaa !8
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph28, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02326 = phi i64 [ %20, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %.02326
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %16 = getelementptr inbounds i8, ptr %14, i64 8
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %18 = load <2 x i64>, ptr %14, align 16, !tbaa !8
  %19 = add nsw <2 x i64> %18, <i64 -1, i64 -1>
  store <2 x i64> %19, ptr %14, align 16, !tbaa !8
  %20 = add nuw nsw i64 %.02326, 1
  %21 = load i64, ptr @M, align 8, !tbaa !8
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %.lr.ph, label %.preheader25, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph28, %.preheader25
  %.lcssa = phi i64 [ %12, %.preheader25 ], [ %33, %.lr.ph28 ]
  %23 = load i64, ptr @N, align 8, !tbaa !8
  tail call void @_ZN3DSU4initExxRA200000_St4pairIxxE(ptr noundef nonnull align 8 dereferenceable(12800000) @dsu, i64 noundef %23, i64 noundef %.lcssa, ptr noundef nonnull align 8 dereferenceable(3200000) @X)
  %24 = load i64, ptr @M, align 8, !tbaa !8
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph31, label %.preheader

.lr.ph28:                                         ; preds = %.preheader25, %.lr.ph28
  %.02227 = phi i64 [ %32, %.lr.ph28 ], [ 0, %.preheader25 ]
  %26 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @X, i64 0, i64 %.02227
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = getelementptr inbounds i8, ptr %26, i64 8
  %29 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load <2 x i64>, ptr %26, align 16, !tbaa !8
  %31 = add nsw <2 x i64> %30, <i64 -1, i64 -1>
  store <2 x i64> %31, ptr %26, align 16, !tbaa !8
  %32 = add nuw nsw i64 %.02227, 1
  %33 = load i64, ptr @Q, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %.lr.ph28, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph31, %._crit_edge
  %35 = load i64, ptr @Q, align 8, !tbaa !8
  %36 = icmp sgt i64 %35, 0
  br i1 %36, label %.lr.ph33, label %._crit_edge34

.lr.ph31:                                         ; preds = %._crit_edge, %.lr.ph31
  %.02129 = phi i64 [ %41, %.lr.ph31 ], [ 0, %._crit_edge ]
  %37 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @E, i64 0, i64 %.02129
  %38 = load i64, ptr %37, align 16, !tbaa !14
  %39 = getelementptr inbounds i8, ptr %37, i64 8
  %40 = load i64, ptr %39, align 8, !tbaa !16
  %41 = add nuw nsw i64 %.02129, 1
  tail call void @_ZN3DSU2unExxx(ptr noundef nonnull align 8 dereferenceable(12800000) @dsu, i64 noundef %38, i64 noundef %40, i64 noundef %41)
  %42 = load i64, ptr @M, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %.lr.ph31, label %.preheader, !llvm.loop !17

._crit_edge34:                                    ; preds = %.lr.ph33, %.preheader
  ret i32 0

.lr.ph33:                                         ; preds = %.preheader, %.lr.ph33
  %.032 = phi i64 [ %48, %.lr.ph33 ], [ 0, %.preheader ]
  %44 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds (i8, ptr @dsu, i64 11200000), i64 0, i64 %.032
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %45)
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %46, i8 noundef signext 10)
  %48 = add nuw nsw i64 %.032, 1
  %49 = load i64, ptr @Q, align 8, !tbaa !8
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %.lr.ph33, label %._crit_edge34, !llvm.loop !18
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU4initExxRA200000_St4pairIxxE(ptr noundef nonnull align 8 dereferenceable(12800000), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(3200000)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU2unExxx(ptr noundef nonnull align 8 dereferenceable(12800000), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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" }

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


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