; LLVM IR from brpapa/algorithms :: solutions/uri (2658)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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.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" }

@tree = external dso_local global [300300 x [9 x i32]], align 16
@lazy = external dso_local global [300300 x i32], align 16
@ansQuery = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10rangeQueryiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11rangeUpdateiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %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 i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.memset.p0.i64(ptr align 16 @tree, i8 0, i64 10810800, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @lazy, i8 0, i64 1201200, i1 false)
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sub nsw i32 %14, 1
  call void @_Z5buildiii(i32 noundef 0, i32 noundef 0, i32 noundef %15)
  br label %16

16:                                               ; preds = %48, %0
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %3, align 4, !tbaa !5
  %19 = icmp ne i32 %17, 0
  br i1 %19, label %20, label %54

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z10rangeQueryiiiii(i32 noundef 0, i32 noundef 0, i32 noundef %24, i32 noundef %25, i32 noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 -1, 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 8, ptr %8, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %45, %20
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = icmp sge i32 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %48

31:                                               ; preds = %27
  %32 = load i32, ptr %8, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef %33) #7
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = icmp sgt i32 %35, %36
  br i1 %37, label %38, label %44

38:                                               ; preds = %31
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef %40) #7
  %42 = load i32, ptr %41, align 4, !tbaa !5
  store i32 %42, ptr %6, align 4, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %43, ptr %7, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %38, %31
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr %8, align 4, !tbaa !5
  br label %27, !llvm.loop !9

48:                                               ; preds = %30
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z11rangeUpdateiiiiii(i32 noundef 0, i32 noundef 0, i32 noundef %50, i32 noundef %51, i32 noundef %52, i32 noundef %53)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %16, !llvm.loop !11

54:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %85, %54
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %88

60:                                               ; preds = %55
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z10rangeQueryiiiii(i32 noundef 0, i32 noundef 0, i32 noundef %62, i32 noundef %63, i32 noundef %64)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %80, %60
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = icmp slt i32 %66, 9
  br i1 %67, label %69, label %68

68:                                               ; preds = %65
  store i32 10, ptr %10, align 4
  br label %83

69:                                               ; preds = %65
  %70 = load i32, ptr %11, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef %71) #7
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %79

75:                                               ; preds = %69
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %76)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 10, ptr %10, align 4
  br label %83

79:                                               ; preds = %69
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %11, align 4, !tbaa !5
  br label %65, !llvm.loop !12

83:                                               ; preds = %75, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %9, align 4, !tbaa !5
  br label %55, !llvm.loop !13

88:                                               ; preds = %59
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %89 = load i32, ptr %1, align 4
  ret i32 %89
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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.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" }

@tree = external dso_local local_unnamed_addr global [300300 x [9 x i32]], align 16
@lazy = external dso_local local_unnamed_addr global [300300 x i32], align 16
@ansQuery = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10rangeQueryiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11rangeUpdateiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10810800) @tree, i8 0, i64 10810800, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1201200) @lazy, i8 0, i64 1201200, i1 false)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  call void @_Z5buildiii(i32 noundef 0, i32 noundef 0, i32 noundef %8)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr %2, align 4, !tbaa !5
  %.not27 = icmp eq i32 %9, 0
  br i1 %.not27, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %80, %0
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph30, label %._crit_edge

.lr.ph:                                           ; preds = %0, %80
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = add nsw i32 %15, -1
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z10rangeQueryiiiii(i32 noundef 0, i32 noundef 0, i32 noundef %16, i32 noundef %17, i32 noundef %18)
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 8) #7
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, -1
  br i1 %21, label %22, label %25

22:                                               ; preds = %.lr.ph
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 8) #7
  %24 = load i32, ptr %23, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %.lr.ph, %22
  %.120 = phi i32 [ %24, %22 ], [ -1, %.lr.ph ]
  %.1 = phi i32 [ 8, %22 ], [ -1, %.lr.ph ]
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 7) #7
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, %.120
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 7) #7
  %31 = load i32, ptr %30, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %29, %25
  %.120.1 = phi i32 [ %31, %29 ], [ %.120, %25 ]
  %.1.1 = phi i32 [ 7, %29 ], [ %.1, %25 ]
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 6) #7
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, %.120.1
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 6) #7
  %38 = load i32, ptr %37, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %36, %32
  %.120.2 = phi i32 [ %38, %36 ], [ %.120.1, %32 ]
  %.1.2 = phi i32 [ 6, %36 ], [ %.1.1, %32 ]
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 5) #7
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, %.120.2
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 5) #7
  %45 = load i32, ptr %44, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %43, %39
  %.120.3 = phi i32 [ %45, %43 ], [ %.120.2, %39 ]
  %.1.3 = phi i32 [ 5, %43 ], [ %.1.2, %39 ]
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 4) #7
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, %.120.3
  br i1 %49, label %50, label %53

50:                                               ; preds = %46
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 4) #7
  %52 = load i32, ptr %51, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %50, %46
  %.120.4 = phi i32 [ %52, %50 ], [ %.120.3, %46 ]
  %.1.4 = phi i32 [ 4, %50 ], [ %.1.3, %46 ]
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 3) #7
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, %.120.4
  br i1 %56, label %57, label %60

57:                                               ; preds = %53
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 3) #7
  %59 = load i32, ptr %58, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %57, %53
  %.120.5 = phi i32 [ %59, %57 ], [ %.120.4, %53 ]
  %.1.5 = phi i32 [ 3, %57 ], [ %.1.4, %53 ]
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 2) #7
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, %.120.5
  br i1 %63, label %64, label %67

64:                                               ; preds = %60
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 2) #7
  %66 = load i32, ptr %65, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %64, %60
  %.120.6 = phi i32 [ %66, %64 ], [ %.120.5, %60 ]
  %.1.6 = phi i32 [ 2, %64 ], [ %.1.5, %60 ]
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 1) #7
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp sgt i32 %69, %.120.6
  br i1 %70, label %71, label %74

71:                                               ; preds = %67
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 1) #7
  %73 = load i32, ptr %72, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %71, %67
  %.120.7 = phi i32 [ %73, %71 ], [ %.120.6, %67 ]
  %.1.7 = phi i32 [ 1, %71 ], [ %.1.6, %67 ]
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 0) #7
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = icmp sgt i32 %76, %.120.7
  br i1 %77, label %78, label %80

78:                                               ; preds = %74
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 0) #7
  br label %80

80:                                               ; preds = %78, %74
  %.1.8 = phi i32 [ 0, %78 ], [ %.1.7, %74 ]
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = add nsw i32 %81, -1
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z11rangeUpdateiiiiii(i32 noundef 0, i32 noundef 0, i32 noundef %82, i32 noundef %83, i32 noundef %84, i32 noundef %.1.8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %85, 0
  br i1 %.not, label %.preheader, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph30:                                         ; preds = %.preheader, %.loopexit
  %87 = phi i32 [ %119, %.loopexit ], [ %11, %.preheader ]
  %.01629 = phi i32 [ %118, %.loopexit ], [ 0, %.preheader ]
  %88 = add nsw i32 %87, -1
  call void @_Z10rangeQueryiiiii(i32 noundef 0, i32 noundef 0, i32 noundef %88, i32 noundef %.01629, i32 noundef %.01629)
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 0) #7
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %.not22 = icmp eq i32 %90, 0
  br i1 %.not22, label %94, label %91

91:                                               ; preds = %115, %112, %109, %106, %103, %100, %97, %94, %.lr.ph30
  %.028.lcssa.wide = phi i32 [ 0, %.lr.ph30 ], [ 1, %94 ], [ 2, %97 ], [ 3, %100 ], [ 4, %103 ], [ 5, %106 ], [ 6, %109 ], [ 7, %112 ], [ 8, %115 ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.028.lcssa.wide)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.loopexit

94:                                               ; preds = %.lr.ph30
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 1) #7
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %.not22.1 = icmp eq i32 %96, 0
  br i1 %.not22.1, label %97, label %91

97:                                               ; preds = %94
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 2) #7
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %.not22.2 = icmp eq i32 %99, 0
  br i1 %.not22.2, label %100, label %91

100:                                              ; preds = %97
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 3) #7
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %.not22.3 = icmp eq i32 %102, 0
  br i1 %.not22.3, label %103, label %91

103:                                              ; preds = %100
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 4) #7
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %.not22.4 = icmp eq i32 %105, 0
  br i1 %.not22.4, label %106, label %91

106:                                              ; preds = %103
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 5) #7
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %.not22.5 = icmp eq i32 %108, 0
  br i1 %.not22.5, label %109, label %91

109:                                              ; preds = %106
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 6) #7
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %.not22.6 = icmp eq i32 %111, 0
  br i1 %.not22.6, label %112, label %91

112:                                              ; preds = %109
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 7) #7
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %.not22.7 = icmp eq i32 %114, 0
  br i1 %.not22.7, label %115, label %91

115:                                              ; preds = %112
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ansQuery, i64 noundef 8) #7
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %.not22.8 = icmp eq i32 %117, 0
  br i1 %.not22.8, label %.loopexit, label %91

.loopexit:                                        ; preds = %115, %91
  %118 = add nuw nsw i32 %.01629, 1
  %119 = load i32, ptr %1, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %.lr.ph30, label %._crit_edge, !llvm.loop !11
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass