; LLVM IR from eyangch/competitive-programming :: Codeforces/1549 (d)

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

@st = external dso_local global ptr, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [200000 x i64], align 16
@p = external dso_local global [200000 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 norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %17 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 33600016) #9
  invoke void @_ZN6sparseC2Ev(ptr noundef nonnull align 8 dereferenceable(33600016) %17)
          to label %18 unwind label %30

18:                                               ; preds = %0
  store ptr %17, ptr @st, align 8, !tbaa !8
  br label %19

19:                                               ; preds = %110, %18
  %20 = load i64, ptr @T, align 8, !tbaa !11
  %21 = add nsw i64 %20, -1
  store i64 %21, ptr @T, align 8, !tbaa !11
  %22 = icmp ne i64 %20, 0
  br i1 %22, label %23, label %115

23:                                               ; preds = %19
  %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) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #10
  store i64 0, ptr %4, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %38, %23
  %26 = load i64, ptr %4, align 8, !tbaa !11
  %27 = load i64, ptr @N, align 8, !tbaa !11
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %34, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #10
  br label %41

30:                                               ; preds = %0
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %2, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %3, align 4
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 33600016) #11
  br label %117

34:                                               ; preds = %25
  %35 = load i64, ptr %4, align 8, !tbaa !11
  %36 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %35
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %36)
  br label %38

38:                                               ; preds = %34
  %39 = load i64, ptr %4, align 8, !tbaa !11
  %40 = add nsw i64 %39, 1
  store i64 %40, ptr %4, align 8, !tbaa !11
  br label %25, !llvm.loop !13

41:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #10
  store i64 0, ptr %5, align 8, !tbaa !11
  br label %42

42:                                               ; preds = %60, %41
  %43 = load i64, ptr %5, align 8, !tbaa !11
  %44 = load i64, ptr @N, align 8, !tbaa !11
  %45 = sub nsw i64 %44, 1
  %46 = icmp slt i64 %43, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  br label %63

48:                                               ; preds = %42
  %49 = load i64, ptr %5, align 8, !tbaa !11
  %50 = add nsw i64 %49, 1
  %51 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = load i64, ptr %5, align 8, !tbaa !11
  %54 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = sub nsw i64 %52, %55
  %57 = call noundef i64 @_ZSt3absx(i64 noundef %56)
  %58 = load i64, ptr %5, align 8, !tbaa !11
  %59 = getelementptr inbounds [200000 x i64], ptr @p, i64 0, i64 %58
  store i64 %57, ptr %59, align 8, !tbaa !11
  br label %60

60:                                               ; preds = %48
  %61 = load i64, ptr %5, align 8, !tbaa !11
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %5, align 8, !tbaa !11
  br label %42, !llvm.loop !15

63:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  store i64 0, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  store i64 0, ptr %7, align 8, !tbaa !11
  %64 = load ptr, ptr @st, align 8, !tbaa !8
  %65 = load i64, ptr @N, align 8, !tbaa !11
  %66 = sub nsw i64 %65, 1
  call void @_ZN6sparse4initExRA200000_x(ptr noundef nonnull align 8 dereferenceable(33600016) %64, i64 noundef %66, ptr noundef nonnull align 8 dereferenceable(1600000) @p)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %67

67:                                               ; preds = %107, %63
  %68 = load i64, ptr %8, align 8, !tbaa !11
  %69 = load i64, ptr @N, align 8, !tbaa !11
  %70 = sub nsw i64 %69, 1
  %71 = icmp slt i64 %68, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %110

73:                                               ; preds = %67
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %75 = load i64, ptr %74, align 8, !tbaa !11
  store i64 %75, ptr %7, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %90, %73
  %77 = load i64, ptr %7, align 8, !tbaa !11
  %78 = load i64, ptr @N, align 8, !tbaa !11
  %79 = sub nsw i64 %78, 2
  %80 = icmp slt i64 %77, %79
  br i1 %80, label %81, label %88

81:                                               ; preds = %76
  %82 = load ptr, ptr @st, align 8, !tbaa !8
  %83 = load i64, ptr %8, align 8, !tbaa !11
  %84 = load i64, ptr %7, align 8, !tbaa !11
  %85 = add nsw i64 %84, 1
  %86 = call noundef i64 @_ZN6sparse3qryExx(ptr noundef nonnull align 8 dereferenceable(33600016) %82, i64 noundef %83, i64 noundef %85)
  %87 = icmp sgt i64 %86, 1
  br label %88

88:                                               ; preds = %81, %76
  %89 = phi i1 [ false, %76 ], [ %87, %81 ]
  br i1 %89, label %90, label %93

90:                                               ; preds = %88
  %91 = load i64, ptr %7, align 8, !tbaa !11
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %7, align 8, !tbaa !11
  br label %76, !llvm.loop !16

93:                                               ; preds = %88
  %94 = load ptr, ptr @st, align 8, !tbaa !8
  %95 = load i64, ptr %8, align 8, !tbaa !11
  %96 = load i64, ptr %7, align 8, !tbaa !11
  %97 = call noundef i64 @_ZN6sparse3qryExx(ptr noundef nonnull align 8 dereferenceable(33600016) %94, i64 noundef %95, i64 noundef %96)
  %98 = icmp sgt i64 %97, 1
  br i1 %98, label %99, label %106

99:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %100 = load i64, ptr %7, align 8, !tbaa !11
  %101 = load i64, ptr %8, align 8, !tbaa !11
  %102 = sub nsw i64 %100, %101
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %9, align 8, !tbaa !11
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %105 = load i64, ptr %104, align 8, !tbaa !11
  store i64 %105, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  br label %106

106:                                              ; preds = %99, %93
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %8, align 8, !tbaa !11
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %8, align 8, !tbaa !11
  br label %67, !llvm.loop !17

110:                                              ; preds = %72
  %111 = load i64, ptr %6, align 8, !tbaa !11
  %112 = add nsw i64 %111, 1
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %112)
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %113, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  br label %19, !llvm.loop !18

115:                                              ; preds = %19
  %116 = load i32, ptr %1, align 4
  ret i32 %116

117:                                              ; preds = %30
  %118 = load ptr, ptr %2, align 8
  %119 = load i32, ptr %3, align 4
  %120 = insertvalue { ptr, i32 } poison, ptr %118, 0
  %121 = insertvalue { ptr, i32 } %120, i32 %119, 1
  resume { ptr, i32 } %121
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6sparseC2Ev(ptr noundef nonnull align 8 dereferenceable(33600016)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #7

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN6sparse3qryExx(ptr noundef nonnull align 8 dereferenceable(33600016), i64 noundef, i64 noundef) #1 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) #8

; 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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { builtin 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 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

@st = external dso_local local_unnamed_addr global ptr, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [200000 x i64], align 16
@p = external dso_local global [200000 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = 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) @T)
  %12 = tail call noalias noundef nonnull dereferenceable(33600016) ptr @_Znwm(i64 noundef 33600016) #8
  tail call void @_ZN6sparseC2Ev(ptr noundef nonnull align 8 dereferenceable(33600016) %12)
  store ptr %12, ptr @st, align 8, !tbaa !8
  %13 = load i64, ptr @T, align 8, !tbaa !11
  %14 = add nsw i64 %13, -1
  store i64 %14, ptr @T, align 8, !tbaa !11
  %.not22 = icmp eq i64 %13, 0
  br i1 %.not22, label %._crit_edge25, label %.lr.ph24

.lr.ph24:                                         ; preds = %0, %._crit_edge21
  %15 = 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)
  %16 = load i64, ptr @N, align 8, !tbaa !11
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %.preheader.thread

.preheader.thread:                                ; preds = %.lr.ph24
  %18 = add nsw i64 %16, -1
  br label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %19 = add nsw i64 %24, -1
  %20 = icmp sgt i64 %24, 1
  br i1 %20, label %.lr.ph14, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph24, %.lr.ph
  %.0912 = phi i64 [ %23, %.lr.ph ], [ 0, %.lr.ph24 ]
  %21 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %.0912
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = add nuw nsw i64 %.0912, 1
  %24 = load i64, ptr @N, align 8, !tbaa !11
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph14, %.preheader.thread, %.preheader
  %.lcssa = phi i64 [ %19, %.preheader ], [ %18, %.preheader.thread ], [ %38, %.lr.ph14 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  store i64 0, ptr %1, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store i64 0, ptr %2, align 8, !tbaa !11
  %26 = load ptr, ptr @st, align 8, !tbaa !8
  call void @_ZN6sparse4initExRA200000_x(ptr noundef nonnull align 8 dereferenceable(33600016) %26, i64 noundef %.lcssa, ptr noundef nonnull align 8 dereferenceable(1600000) @p)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store i64 0, ptr %3, align 8, !tbaa !11
  %27 = load i64, ptr @N, align 8, !tbaa !11
  %28 = icmp sgt i64 %27, 1
  br i1 %28, label %.lr.ph20, label %._crit_edge21

.lr.ph14:                                         ; preds = %.preheader, %.lr.ph14
  %.013 = phi i64 [ %29, %.lr.ph14 ], [ 0, %.preheader ]
  %29 = add nuw nsw i64 %.013, 1
  %30 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %.013
  %33 = load i64, ptr %32, align 8, !tbaa !11
  %34 = sub nsw i64 %31, %33
  %35 = call noundef i64 @_ZSt3absx(i64 noundef %34)
  %36 = getelementptr inbounds [200000 x i64], ptr @p, i64 0, i64 %.013
  store i64 %35, ptr %36, align 8, !tbaa !11
  %37 = load i64, ptr @N, align 8, !tbaa !11
  %38 = add nsw i64 %37, -1
  %39 = icmp slt i64 %29, %38
  br i1 %39, label %.lr.ph14, label %._crit_edge, !llvm.loop !15

._crit_edge21:                                    ; preds = %73, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %40 = load i64, ptr %1, align 8, !tbaa !11
  %41 = add nsw i64 %40, 1
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %42, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  %44 = load i64, ptr @T, align 8, !tbaa !11
  %45 = add nsw i64 %44, -1
  store i64 %45, ptr @T, align 8, !tbaa !11
  %.not = icmp eq i64 %44, 0
  br i1 %.not, label %._crit_edge25, label %.lr.ph24, !llvm.loop !16

.lr.ph20:                                         ; preds = %._crit_edge, %73
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %47 = load i64, ptr %46, align 8, !tbaa !11
  store i64 %47, ptr %2, align 8, !tbaa !11
  %48 = load i64, ptr @N, align 8, !tbaa !11
  %49 = add nsw i64 %48, -2
  %50 = icmp slt i64 %47, %49
  br i1 %50, label %.lr.ph17, label %.critedge

.lr.ph17:                                         ; preds = %.lr.ph20, %56
  %storemerge1115 = phi i64 [ %57, %56 ], [ %47, %.lr.ph20 ]
  %51 = load ptr, ptr @st, align 8, !tbaa !8
  %52 = load i64, ptr %3, align 8, !tbaa !11
  %53 = add nsw i64 %storemerge1115, 1
  %54 = call noundef i64 @_ZN6sparse3qryExx(ptr noundef nonnull align 8 dereferenceable(33600016) %51, i64 noundef %52, i64 noundef %53)
  %55 = icmp sgt i64 %54, 1
  %.pre.pre = load i64, ptr %2, align 8, !tbaa !11
  br i1 %55, label %56, label %.critedge

56:                                               ; preds = %.lr.ph17
  %57 = add nsw i64 %.pre.pre, 1
  store i64 %57, ptr %2, align 8, !tbaa !11
  %58 = load i64, ptr @N, align 8, !tbaa !11
  %59 = add nsw i64 %58, -2
  %60 = icmp slt i64 %57, %59
  br i1 %60, label %.lr.ph17, label %.critedge, !llvm.loop !17

.critedge:                                        ; preds = %.lr.ph17, %56, %.lr.ph20
  %61 = phi i64 [ %47, %.lr.ph20 ], [ %.pre.pre, %.lr.ph17 ], [ %57, %56 ]
  %62 = load ptr, ptr @st, align 8, !tbaa !8
  %63 = load i64, ptr %3, align 8, !tbaa !11
  %64 = call noundef i64 @_ZN6sparse3qryExx(ptr noundef nonnull align 8 dereferenceable(33600016) %62, i64 noundef %63, i64 noundef %61)
  %65 = icmp sgt i64 %64, 1
  br i1 %65, label %66, label %73

66:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %67 = load i64, ptr %2, align 8, !tbaa !11
  %68 = load i64, ptr %3, align 8, !tbaa !11
  %69 = add i64 %67, 1
  %70 = sub i64 %69, %68
  store i64 %70, ptr %4, align 8, !tbaa !11
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %72 = load i64, ptr %71, align 8, !tbaa !11
  store i64 %72, ptr %1, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %73

73:                                               ; preds = %.critedge, %66
  %74 = load i64, ptr %3, align 8, !tbaa !11
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %3, align 8, !tbaa !11
  %76 = load i64, ptr @N, align 8, !tbaa !11
  %77 = add nsw i64 %76, -1
  %78 = icmp slt i64 %75, %77
  br i1 %78, label %.lr.ph20, label %._crit_edge21, !llvm.loop !18

._crit_edge25:                                    ; preds = %._crit_edge21, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6sparseC2Ev(ptr noundef nonnull align 8 dereferenceable(33600016)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN6sparse3qryExx(ptr noundef nonnull align 8 dereferenceable(33600016), i64 noundef, i64 noundef) local_unnamed_addr #1 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 #7

; 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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { 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 #8 = { builtin allocsize(0) }
attributes #9 = { 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 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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