; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan/794.ll (Z5solvev)

; 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::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 i32, align 4
@q = external dso_local global i32, align 4
@L = external dso_local global [200020 x i32], align 16
@R = external dso_local global [200020 x i32], align 16
@tr1 = external dso_local global [200020 x i64], align 16
@tr2 = external dso_local global [200020 x i64], align 16
@val = external dso_local global [200020 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6modifyixPx(i32 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5queryiPx(i32 noundef, ptr 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 uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %25, %0
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %19 = 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)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %21, i32 noundef %22)
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %23, i32 noundef %24)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %25

25:                                               ; preds = %18
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %1, align 4, !tbaa !5
  br label %13, !llvm.loop !9

28:                                               ; preds = %17
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %57, %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %36 = load i64, ptr %5, align 8, !tbaa !11
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %38
  store i64 %36, ptr %39, align 8, !tbaa !11
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i64, ptr %5, align 8, !tbaa !11
  call void @_Z6modifyixPx(i32 noundef %43, i64 noundef %44, ptr noundef @tr1)
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i64, ptr %5, align 8, !tbaa !11
  call void @_Z6modifyixPx(i32 noundef %48, i64 noundef %49, ptr noundef @tr2)
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200020 x i32], ptr @R, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = load i64, ptr %5, align 8, !tbaa !11
  %56 = sub nsw i64 0, %55
  call void @_Z6modifyixPx(i32 noundef %54, i64 noundef %56, ptr noundef @tr2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %57

57:                                               ; preds = %34
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !13

60:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %133, %60
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr @q, align 4, !tbaa !5
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %136

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %109

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = load i64, ptr %9, align 8, !tbaa !11
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !11
  %82 = sub nsw i64 %77, %81
  call void @_Z6modifyixPx(i32 noundef %76, i64 noundef %82, ptr noundef @tr1)
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i64, ptr %9, align 8, !tbaa !11
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !11
  %92 = sub nsw i64 %87, %91
  call void @_Z6modifyixPx(i32 noundef %86, i64 noundef %92, ptr noundef @tr2)
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200020 x i32], ptr @R, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  %98 = load i64, ptr %9, align 8, !tbaa !11
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = sub nsw i64 %98, %102
  %104 = sub nsw i64 0, %103
  call void @_Z6modifyixPx(i32 noundef %97, i64 noundef %104, ptr noundef @tr2)
  %105 = load i64, ptr %9, align 8, !tbaa !11
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %107
  store i64 %105, ptr %108, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %132

109:                                              ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %110 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [200020 x i32], ptr @R, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = call noundef i64 @_Z5queryiPx(i32 noundef %114, ptr noundef @tr1)
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sub nsw i32 %119, 1
  %121 = call noundef i64 @_Z5queryiPx(i32 noundef %120, ptr noundef @tr1)
  %122 = sub nsw i64 %115, %121
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %123, i8 noundef signext 32)
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = call noundef i64 @_Z5queryiPx(i32 noundef %128, ptr noundef @tr2)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %129)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %130, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %132

132:                                              ; preds = %109, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %6, align 4, !tbaa !5
  br label %61, !llvm.loop !14

136:                                              ; preds = %65
  ret void
}

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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" }
attributes #5 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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::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 i32, align 4
@q = external dso_local global i32, align 4
@L = external dso_local local_unnamed_addr global [200020 x i32], align 16
@R = external dso_local local_unnamed_addr global [200020 x i32], align 16
@tr1 = external dso_local global [200020 x i64], align 16
@tr2 = external dso_local global [200020 x i64], align 16
@val = external dso_local local_unnamed_addr global [200020 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6modifyixPx(i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5queryiPx(i32 noundef, ptr 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 uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @q)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 1
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 0)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not14 = icmp slt i32 %12, 1
  br i1 %.not14, label %.preheader, label %.lr.ph17

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01113 = phi i32 [ %19, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %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) %1)
  %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) %2)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %15, i32 noundef %16)
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %17, i32 noundef %18)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %19 = add nuw nsw i32 %.01113, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %.lr.ph17, %._crit_edge
  %22 = load i32, ptr @q, align 4, !tbaa !5
  %.not1218 = icmp slt i32 %22, 1
  br i1 %.not1218, label %._crit_edge21, label %.lr.ph20

.lr.ph17:                                         ; preds = %._crit_edge, %.lr.ph17
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph17 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %24 = load i64, ptr %3, align 8, !tbaa !11
  %25 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %indvars.iv
  store i64 %24, ptr %25, align 8, !tbaa !11
  %26 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %indvars.iv
  %27 = load i32, ptr %26, align 4, !tbaa !5
  call void @_Z6modifyixPx(i32 noundef %27, i64 noundef %24, ptr noundef nonnull @tr1)
  %28 = load i32, ptr %26, align 4, !tbaa !5
  %29 = load i64, ptr %3, align 8, !tbaa !11
  call void @_Z6modifyixPx(i32 noundef %28, i64 noundef %29, ptr noundef nonnull @tr2)
  %30 = getelementptr inbounds [200020 x i32], ptr @R, i64 0, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  %33 = load i64, ptr %3, align 8, !tbaa !11
  %34 = sub nsw i64 0, %33
  call void @_Z6modifyixPx(i32 noundef %32, i64 noundef %34, ptr noundef nonnull @tr2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %.not.not = icmp slt i64 %indvars.iv, %36
  br i1 %.not.not, label %.lr.ph17, label %.preheader, !llvm.loop !13

._crit_edge21:                                    ; preds = %94, %.preheader
  ret void

.lr.ph20:                                         ; preds = %.preheader, %94
  %.019 = phi i32 [ %95, %94 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %37 = 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)
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %71

40:                                               ; preds = %.lr.ph20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i64, ptr %6, align 8, !tbaa !11
  %48 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %44
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = sub nsw i64 %47, %49
  call void @_Z6modifyixPx(i32 noundef %46, i64 noundef %50, ptr noundef nonnull @tr1)
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i64, ptr %6, align 8, !tbaa !11
  %56 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %52
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = sub nsw i64 %55, %57
  call void @_Z6modifyixPx(i32 noundef %54, i64 noundef %58, ptr noundef nonnull @tr2)
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [200020 x i32], ptr @R, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = load i64, ptr %6, align 8, !tbaa !11
  %65 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %60
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %.neg = sub nsw i64 %66, %64
  call void @_Z6modifyixPx(i32 noundef %63, i64 noundef %.neg, ptr noundef nonnull @tr2)
  %67 = load i64, ptr %6, align 8, !tbaa !11
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200020 x i64], ptr @val, i64 0, i64 %69
  store i64 %67, ptr %70, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %94

71:                                               ; preds = %.lr.ph20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200020 x i32], ptr @R, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = call noundef i64 @_Z5queryiPx(i32 noundef %76, ptr noundef nonnull @tr1)
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, -1
  %83 = call noundef i64 @_Z5queryiPx(i32 noundef %82, ptr noundef nonnull @tr1)
  %84 = sub nsw i64 %77, %83
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %84)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %85, i8 noundef signext 32)
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200020 x i32], ptr @L, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = call noundef i64 @_Z5queryiPx(i32 noundef %90, ptr noundef nonnull @tr2)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %91)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %92, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %94

94:                                               ; preds = %71, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %95 = add nuw nsw i32 %.019, 1
  %96 = load i32, ptr @q, align 4, !tbaa !5
  %.not12.not = icmp slt i32 %.019, %96
  br i1 %.not12.not, label %.lr.ph20, label %._crit_edge21, !llvm.loop !14
}

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 #3

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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" }
attributes #5 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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