; LLVM IR from upupming/algorithm :: acwing/算法基础课/第五讲 动态规划/线性DP/896. 最长上升子序列 II_RMQ解法 (main)

; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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
@a = external dso_local global [100010 x i64], align 16
@b = external dso_local global [100010 x i64], align 16
@len = external dso_local global [100010 x i64], align 16
@mp = external dso_local global %"class.std::unordered_map", 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 noundef i64 @_Z3askx(i64 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: 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)) #2

; 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 @_Z3addix(i32 noundef, i64 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 i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %26, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = load i64, ptr @n, align 8, !tbaa !9
  %19 = icmp sle i64 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %15
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %23
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %24)
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !11

29:                                               ; preds = %20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @b, ptr align 16 @a, i64 800080, i1 false)
  %30 = load i64, ptr @n, align 8, !tbaa !9
  %31 = getelementptr inbounds i64, ptr @b, i64 %30
  %32 = getelementptr inbounds i64, ptr %31, i64 1
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef getelementptr inbounds (i64, ptr @b, i64 1), ptr noundef %32)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %58, %29
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = load i64, ptr @n, align 8, !tbaa !9
  %37 = icmp sle i64 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %5, align 4, !tbaa !5
  %45 = call noundef i64 @_ZNKSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %46 = icmp ne i64 %45, 0
  %47 = xor i1 %46, true
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br i1 %47, label %48, label %57

48:                                               ; preds = %39
  %49 = load i64, ptr %3, align 8, !tbaa !9
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = trunc i64 %54 to i32
  store i32 %55, ptr %6, align 4, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEEixEOi(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %50, ptr %56, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %57

57:                                               ; preds = %48, %39
  br label %58

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

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

62:                                               ; preds = %96, %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = load i64, ptr @n, align 8, !tbaa !9
  %66 = icmp sle i64 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %99

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 1, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = trunc i64 %72 to i32
  store i32 %73, ptr %10, align 4, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEEixEOi(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = sub nsw i64 %75, 1
  %77 = call noundef i64 @_Z3askx(i64 noundef %76)
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %9, align 8, !tbaa !9
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i64], ptr @len, i64 0, i64 %82
  store i64 %80, ptr %83, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %11, align 4, !tbaa !5
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEEixEOi(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = trunc i64 %90 to i32
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100010 x i64], ptr @len, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !9
  call void @_Z3addix(i32 noundef %91, i64 noundef %95)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %96

96:                                               ; preds = %68
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %7, align 4, !tbaa !5
  br label %62, !llvm.loop !14

99:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %112, %99
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = load i64, ptr @n, align 8, !tbaa !9
  %104 = icmp sle i64 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %115

106:                                              ; preds = %100
  %107 = load i32, ptr %13, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100010 x i64], ptr @len, i64 0, i64 %108
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %109)
  %111 = load i64, ptr %110, align 8, !tbaa !9
  store i64 %111, ptr %12, align 8, !tbaa !9
  br label %112

112:                                              ; preds = %106
  %113 = load i32, ptr %13, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %13, align 4, !tbaa !5
  br label %100, !llvm.loop !15

115:                                              ; preds = %105
  %116 = load i64, ptr %12, align 8, !tbaa !9
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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

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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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
@a = external dso_local global [100010 x i64], align 16
@b = external dso_local global [100010 x i64], align 16
@len = external dso_local global [100010 x i64], align 16
@mp = external dso_local global %"class.std::unordered_map", 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 noundef i64 @_Z3askx(i64 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: 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 #2

; 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 @_Z3addix(i32 noundef, i64 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 i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %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 !5
  %.not29 = icmp slt i64 %9, 1
  br i1 %.not29, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %9, %0 ], [ %15, %.lr.ph ]
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(800080) @b, ptr noundef nonnull align 16 dereferenceable(800080) @a, i64 800080, i1 false)
  %10 = getelementptr inbounds i64, ptr @b, i64 %.lcssa
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 8), ptr noundef nonnull %11)
  %12 = load i64, ptr @n, align 8, !tbaa !5
  %.not2531 = icmp slt i64 %12, 1
  br i1 %.not2531, label %._crit_edge39.thread, label %.lr.ph35

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %13 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv
  %14 = 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) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i64, ptr @n, align 8, !tbaa !5
  %.not.not = icmp sgt i64 %15, %indvars.iv
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %26
  %16 = icmp slt i64 %27, 1
  br i1 %16, label %._crit_edge39.thread, label %.lr.ph38

.lr.ph35:                                         ; preds = %._crit_edge, %26
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %26 ], [ 1, %._crit_edge ]
  %.01932 = phi i64 [ %.1, %26 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %17 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %indvars.iv47
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %1, align 4, !tbaa !11
  %20 = call noundef i64 @_ZNKSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.not28 = icmp eq i64 %20, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br i1 %.not28, label %21, label %26

21:                                               ; preds = %.lr.ph35
  %22 = add nsw i64 %.01932, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %23 = load i64, ptr %17, align 8, !tbaa !5
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %2, align 4, !tbaa !11
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEEixEOi(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %22, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %26

26:                                               ; preds = %.lr.ph35, %21
  %.1 = phi i64 [ %22, %21 ], [ %.01932, %.lr.ph35 ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %27 = load i64, ptr @n, align 8, !tbaa !5
  %.not25.not = icmp sgt i64 %27, %indvars.iv47
  br i1 %.not25.not, label %.lr.ph35, label %.preheader, !llvm.loop !13

._crit_edge39.thread:                             ; preds = %.preheader, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %._crit_edge44

._crit_edge39:                                    ; preds = %.lr.ph38
  %28 = icmp slt i64 %46, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  br i1 %28, label %._crit_edge44, label %.lr.ph43

.lr.ph38:                                         ; preds = %.preheader, %.lr.ph38
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %.lr.ph38 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %29 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv50
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = trunc i64 %30 to i32
  store i32 %31, ptr %5, align 4, !tbaa !11
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEEixEOi(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = add nsw i64 %33, -1
  %35 = call noundef i64 @_Z3askx(i64 noundef %34)
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %4, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds [100010 x i64], ptr @len, i64 0, i64 %indvars.iv50
  store i64 %38, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %40 = load i64, ptr %29, align 8, !tbaa !5
  %41 = trunc i64 %40 to i32
  store i32 %41, ptr %6, align 4, !tbaa !11
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEEixEOi(ptr noundef nonnull align 8 dereferenceable(56) @mp, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = trunc i64 %43 to i32
  %45 = load i64, ptr %39, align 8, !tbaa !5
  call void @_Z3addix(i32 noundef %44, i64 noundef %45)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %46 = load i64, ptr @n, align 8, !tbaa !5
  %.not26.not = icmp sgt i64 %46, %indvars.iv50
  br i1 %.not26.not, label %.lr.ph38, label %._crit_edge39, !llvm.loop !14

._crit_edge44:                                    ; preds = %.lr.ph43, %._crit_edge39.thread, %._crit_edge39
  %47 = phi i64 [ 0, %._crit_edge39 ], [ 0, %._crit_edge39.thread ], [ %52, %.lr.ph43 ]
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %47)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  ret i32 0

.lr.ph43:                                         ; preds = %._crit_edge39, %.lr.ph43
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %.lr.ph43 ], [ 1, %._crit_edge39 ]
  %50 = getelementptr inbounds [100010 x i64], ptr @len, i64 0, i64 %indvars.iv53
  %51 = 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) %50)
  %52 = load i64, ptr %51, align 8, !tbaa !5
  store i64 %52, ptr %7, align 8, !tbaa !5
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %53 = load i64, ptr @n, align 8, !tbaa !5
  %.not27.not = icmp sgt i64 %53, %indvars.iv53
  br i1 %.not27.not, label %.lr.ph43, label %._crit_edge44, !llvm.loop !15
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_mapIixSt4hashIiESt8equal_toIiESaISt4pairIKixEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

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

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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !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 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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