; LLVM IR from eyangch/competitive-programming :: CSES/Dynamic_Programming (projects)

; 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.prj = type { i64, i64, i64, i64 }
%struct.si_map = type { %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, 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" }
%class.anon = type { i8 }
%class.anon.0 = type { i8 }

@N = external dso_local global i64, align 8
@s1 = external dso_local global [200000 x %struct.prj], align 16
@s2 = external dso_local global [200000 x %struct.prj], align 16
@sm = external dso_local global %struct.si_map, align 8
@dp = 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 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %class.anon, align 1
  %4 = alloca %class.anon.0, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %8 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = 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 %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %15

15:                                               ; preds = %37, %0
  %16 = load i64, ptr %2, align 8, !tbaa !8
  %17 = load i64, ptr @N, 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) #7
  br label %40

20:                                               ; preds = %15
  %21 = load i64, ptr %2, align 8, !tbaa !8
  %22 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.prj, 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.prj], ptr @s1, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.prj, 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.prj], ptr @s1, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.prj, ptr %30, i32 0, i32 2
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load i64, ptr %2, align 8, !tbaa !8
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.prj, ptr %35, i32 0, i32 3
  store i64 %33, ptr %36, align 8, !tbaa !11
  br label %37

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

40:                                               ; preds = %19
  %41 = load i64, ptr @N, align 8, !tbaa !8
  %42 = getelementptr inbounds %struct.prj, ptr @s1, i64 %41
  %43 = call noundef ptr @_ZSt4copyIP3prjS1_ET0_T_S3_S2_(ptr noundef @s1, ptr noundef %42, ptr noundef @s2)
  %44 = load i64, ptr @N, align 8, !tbaa !8
  %45 = getelementptr inbounds %struct.prj, ptr @s1, i64 %44
  call void @"_ZSt4sortIP3prjZ4mainE3$_0EvT_S3_T0_"(ptr noundef @s1, ptr noundef %45)
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %47 = getelementptr inbounds %struct.prj, ptr @s2, i64 %46
  call void @"_ZSt4sortIP3prjZ4mainE3$_1EvT_S3_T0_"(ptr noundef @s2, ptr noundef %47)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %48

48:                                               ; preds = %106, %40
  %49 = load i64, ptr %7, align 8, !tbaa !8
  %50 = load i64, ptr @N, align 8, !tbaa !8
  %51 = icmp slt i64 %49, %50
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %48
  br label %54

54:                                               ; preds = %70, %53
  %55 = load i64, ptr %5, align 8, !tbaa !8
  %56 = load i64, ptr @N, align 8, !tbaa !8
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %58, label %68

58:                                               ; preds = %54
  %59 = load i64, ptr %5, align 8, !tbaa !8
  %60 = getelementptr inbounds [200000 x %struct.prj], ptr @s2, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.prj, ptr %60, i32 0, i32 1
  %62 = load i64, ptr %61, align 8, !tbaa !15
  %63 = load i64, ptr %7, align 8, !tbaa !8
  %64 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.prj, ptr %64, i32 0, i32 0
  %66 = load i64, ptr %65, align 16, !tbaa !16
  %67 = icmp slt i64 %62, %66
  br label %68

68:                                               ; preds = %58, %54
  %69 = phi i1 [ false, %54 ], [ %67, %58 ]
  br i1 %69, label %70, label %83

70:                                               ; preds = %68
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = getelementptr inbounds [200000 x %struct.prj], ptr @s2, i64 0, i64 %71
  %73 = getelementptr inbounds %struct.prj, ptr %72, i32 0, i32 1
  %74 = load i64, ptr %73, align 8, !tbaa !15
  %75 = load i64, ptr %5, align 8, !tbaa !8
  %76 = getelementptr inbounds [200000 x %struct.prj], ptr @s2, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.prj, ptr %76, i32 0, i32 3
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = getelementptr inbounds [200000 x i64], ptr @dp, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !8
  call void @_ZN6si_map3insExx(ptr noundef nonnull align 8 dereferenceable(48) @sm, i64 noundef %74, i64 noundef %80)
  %81 = load i64, ptr %5, align 8, !tbaa !8
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %5, align 8, !tbaa !8
  br label %54, !llvm.loop !17

83:                                               ; preds = %68
  %84 = load i64, ptr %7, align 8, !tbaa !8
  %85 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.prj, ptr %85, i32 0, i32 2
  %87 = load i64, ptr %86, align 16, !tbaa !18
  %88 = load i64, ptr %7, align 8, !tbaa !8
  %89 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.prj, ptr %89, i32 0, i32 0
  %91 = load i64, ptr %90, align 16, !tbaa !16
  %92 = call noundef i64 @_ZN6si_map3qryEx(ptr noundef nonnull align 8 dereferenceable(48) @sm, i64 noundef %91)
  %93 = add nsw i64 %87, %92
  %94 = load i64, ptr %7, align 8, !tbaa !8
  %95 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %94
  %96 = getelementptr inbounds %struct.prj, ptr %95, i32 0, i32 3
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = getelementptr inbounds [200000 x i64], ptr @dp, i64 0, i64 %97
  store i64 %93, ptr %98, align 8, !tbaa !8
  %99 = load i64, ptr %7, align 8, !tbaa !8
  %100 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.prj, ptr %100, i32 0, i32 3
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = getelementptr inbounds [200000 x i64], ptr @dp, i64 0, i64 %102
  %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) %103)
  %105 = load i64, ptr %104, align 8, !tbaa !8
  store i64 %105, ptr %6, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %83
  %107 = load i64, ptr %7, align 8, !tbaa !8
  %108 = add nsw i64 %107, 1
  store i64 %108, ptr %7, align 8, !tbaa !8
  br label %48, !llvm.loop !19

109:                                              ; preds = %52
  %110 = load i64, ptr %6, align 8, !tbaa !8
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %110)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %113 = load i32, ptr %1, align 4
  ret i32 %113
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 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: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIP3prjS1_ET0_T_S3_S2_(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP3prjZ4mainE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP3prjZ4mainE3$_1EvT_S3_T0_"(ptr noundef, ptr noundef) #5

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

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

; 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #5

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 = { "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 = { 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 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 = { 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 = { 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 24}
!12 = !{!"_ZTS3prj", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !9, i64 8}
!16 = !{!12, !9, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!12, !9, i64 16}
!19 = distinct !{!19, !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"

%struct.prj = type { i64, i64, i64, i64 }
%struct.si_map = type { %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, 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
@s1 = external dso_local global [200000 x %struct.prj], align 16
@s2 = external dso_local global [200000 x %struct.prj], align 16
@sm = external dso_local global %struct.si_map, align 8
@dp = 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 {
  %1 = alloca i64, align 8
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = 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)
  %9 = load i64, ptr @N, align 8, !tbaa !8
  %10 = icmp sgt i64 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %9, %0 ], [ %27, %.lr.ph ]
  %11 = getelementptr inbounds %struct.prj, ptr @s1, i64 %.lcssa
  %12 = tail call noundef ptr @_ZSt4copyIP3prjS1_ET0_T_S3_S2_(ptr noundef nonnull @s1, ptr noundef nonnull %11, ptr noundef nonnull @s2)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = getelementptr inbounds %struct.prj, ptr @s1, i64 %13
  tail call void @"_ZSt4sortIP3prjZ4mainE3$_0EvT_S3_T0_"(ptr noundef nonnull @s1, ptr noundef nonnull %14)
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = getelementptr inbounds %struct.prj, ptr @s2, i64 %15
  tail call void @"_ZSt4sortIP3prjZ4mainE3$_1EvT_S3_T0_"(ptr noundef nonnull @s2, ptr noundef nonnull %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !8
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.preheader, label %._crit_edge32

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02124 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ]
  %19 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %.02124
  %20 = 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) %19)
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = getelementptr inbounds i8, ptr %19, i64 16
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = getelementptr inbounds i8, ptr %19, i64 24
  store i64 %.02124, ptr %25, align 8, !tbaa !11
  %26 = add nuw nsw i64 %.02124, 1
  %27 = load i64, ptr @N, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge, %.critedge
  %29 = phi i64 [ %61, %.critedge ], [ %17, %._crit_edge ]
  %.031 = phi i64 [ %60, %.critedge ], [ 0, %._crit_edge ]
  %.02030 = phi i64 [ %.1.lcssa, %.critedge ], [ 0, %._crit_edge ]
  %30 = icmp slt i64 %.02030, %29
  br i1 %30, label %.lr.ph26, label %.critedge

.lr.ph26:                                         ; preds = %.preheader
  %31 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %.031
  br label %35

._crit_edge32:                                    ; preds = %.critedge, %._crit_edge
  %32 = phi i64 [ 0, %._crit_edge ], [ %59, %.critedge ]
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %32)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

35:                                               ; preds = %.lr.ph26, %41
  %.125 = phi i64 [ %.02030, %.lr.ph26 ], [ %46, %41 ]
  %36 = getelementptr inbounds [200000 x %struct.prj], ptr @s2, i64 0, i64 %.125
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load i64, ptr %37, align 8, !tbaa !15
  %39 = load i64, ptr %31, align 16, !tbaa !16
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %41, label %.critedge

41:                                               ; preds = %35
  %42 = getelementptr inbounds i8, ptr %36, i64 24
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = getelementptr inbounds [200000 x i64], ptr @dp, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !8
  call void @_ZN6si_map3insExx(ptr noundef nonnull align 8 dereferenceable(48) @sm, i64 noundef %38, i64 noundef %45)
  %46 = add nsw i64 %.125, 1
  %47 = load i64, ptr @N, align 8, !tbaa !8
  %48 = icmp slt i64 %46, %47
  br i1 %48, label %35, label %.critedge, !llvm.loop !17

.critedge:                                        ; preds = %35, %41, %.preheader
  %.1.lcssa = phi i64 [ %.02030, %.preheader ], [ %46, %41 ], [ %.125, %35 ]
  %49 = getelementptr inbounds [200000 x %struct.prj], ptr @s1, i64 0, i64 %.031
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = load i64, ptr %50, align 16, !tbaa !18
  %52 = load i64, ptr %49, align 16, !tbaa !16
  %53 = call noundef i64 @_ZN6si_map3qryEx(ptr noundef nonnull align 8 dereferenceable(48) @sm, i64 noundef %52)
  %54 = add nsw i64 %53, %51
  %55 = getelementptr inbounds i8, ptr %49, i64 24
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds [200000 x i64], ptr @dp, i64 0, i64 %56
  store i64 %54, ptr %57, align 8, !tbaa !8
  %58 = 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) %57)
  %59 = load i64, ptr %58, align 8, !tbaa !8
  store i64 %59, ptr %1, align 8, !tbaa !8
  %60 = add nuw nsw i64 %.031, 1
  %61 = load i64, ptr @N, align 8, !tbaa !8
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %.preheader, label %._crit_edge32, !llvm.loop !19
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIP3prjS1_ET0_T_S3_S2_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP3prjZ4mainE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP3prjZ4mainE3$_1EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN6si_map3qryEx(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) 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 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

; 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 #3 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)) #5

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 = { "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 = { 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 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 = { mustprogress 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 = { 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 = { 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 24}
!12 = !{!"_ZTS3prj", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !9, i64 8}
!16 = !{!12, !9, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!12, !9, i64 16}
!19 = distinct !{!19, !14}


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