; LLVM IR from tangjz/acm-icpc :: self_training/2015-01-26 (N)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_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 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.0" = type { %"struct.std::pair", i32 }

@Hash = external dso_local global %"class.std::map", align 8
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@minx = external dso_local global i32, align 4
@maxx = external dso_local global i32, align 4
@xx = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i8, align 1
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %13

13:                                               ; preds = %90, %0
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr @t, align 4, !tbaa !5
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %96

17:                                               ; preds = %13
  call void @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #6
  store i32 2147483647, ptr @minx, align 4, !tbaa !5
  %18 = load i32, ptr @minx, align 4, !tbaa !5
  %19 = sub nsw i32 0, %18
  store i32 %19, ptr @maxx, align 4, !tbaa !5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %48, %17
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = shl i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = shl i32 %30, 1
  store i32 %31, ptr %4, align 4, !tbaa !5
  %32 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %32, ptr %5, align 4
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr @minx, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %39, label %41

39:                                               ; preds = %26
  %40 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %40, ptr @minx, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %39, %26
  %42 = load i32, ptr @maxx, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  %46 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %46, ptr @maxx, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %45, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

51:                                               ; preds = %25
  %52 = load i32, ptr @minx, align 4, !tbaa !5
  %53 = load i32, ptr @maxx, align 4, !tbaa !5
  %54 = add nsw i32 %52, %53
  store i32 %54, ptr @xx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 0, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %55 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #6
  %56 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %7, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %57 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #6
  %58 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %57, ptr %58, align 8
  br label %59

59:                                               ; preds = %87, %51
  %60 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %60, label %62, label %61

61:                                               ; preds = %59
  store i32 7, ptr %9, align 4
  br label %89

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %63 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %64 = getelementptr inbounds %"struct.std::pair.0", ptr %63, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %64, i64 8, i1 false)
  %65 = load i32, ptr @xx, align 4, !tbaa !5
  %66 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = sub nsw i32 %65, %67
  %69 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  store i32 %68, ptr %69, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %70 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE4findERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %71 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  %72 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %72, label %80, label %73

73:                                               ; preds = %62
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %77 = getelementptr inbounds %"struct.std::pair.0", ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !15
  %79 = icmp ne i32 %75, %78
  br label %80

80:                                               ; preds = %73, %62
  %81 = phi i1 [ true, %62 ], [ %79, %73 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br i1 %81, label %82, label %83

82:                                               ; preds = %80
  store i8 1, ptr %6, align 1, !tbaa !11
  store i32 7, ptr %9, align 4
  br label %84

83:                                               ; preds = %80
  store i32 0, ptr %9, align 4
  br label %84

84:                                               ; preds = %83, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %85 = load i32, ptr %9, align 4
  switch i32 %85, label %89 [
    i32 0, label %86
  ]

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %59, !llvm.loop !17

89:                                               ; preds = %84, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %90

90:                                               ; preds = %89
  %91 = load i8, ptr %6, align 1, !tbaa !11, !range !18, !noundef !19
  %92 = trunc i8 %91 to i1
  %93 = zext i1 %92 to i64
  %94 = select i1 %92, ptr @.str.2, ptr @.str.3
  %95 = call i32 @puts(ptr noundef %94)
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %13, !llvm.loop !20

96:                                               ; preds = %13
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

declare i32 @puts(ptr noundef) #1

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSSt4pairIKS_IiiEiE", !14, i64 0, !6, i64 8}
!17 = distinct !{!17, !10}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_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 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@Hash = external dso_local global %"class.std::map", align 8
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@minx = external dso_local local_unnamed_addr global i32, align 4
@maxx = external dso_local local_unnamed_addr global i32, align 4
@xx = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %9 = load i32, ptr @t, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @t, align 4, !tbaa !5
  %.not17 = icmp eq i32 %9, 0
  br i1 %.not17, label %._crit_edge20, label %.lr.ph19

.lr.ph19:                                         ; preds = %0, %.loopexit
  call void @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #5
  store i32 2147483647, ptr @minx, align 4, !tbaa !5
  store i32 -2147483647, ptr @maxx, align 4, !tbaa !5
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %.lr.ph19.._crit_edge_crit_edge

.lr.ph19.._crit_edge_crit_edge:                   ; preds = %.lr.ph19
  %.pre = load i32, ptr @minx, align 4, !tbaa !5
  %.pre21 = load i32, ptr @maxx, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %38, %.lr.ph19.._crit_edge_crit_edge
  %14 = phi i32 [ %.pre21, %.lr.ph19.._crit_edge_crit_edge ], [ %39, %38 ]
  %15 = phi i32 [ %.pre, %.lr.ph19.._crit_edge_crit_edge ], [ %34, %38 ]
  %16 = add nsw i32 %14, %15
  store i32 %16, ptr @xx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %17 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #5
  store ptr %17, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %18 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #5
  store ptr %18, ptr %5, align 8
  %19 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %19, label %.lr.ph14, label %.loopexit

.lr.ph:                                           ; preds = %.lr.ph19, %38
  %.0512 = phi i32 [ %40, %38 ], [ 0, %.lr.ph19 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = shl i32 %21, 1
  store i32 %22, ptr %1, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = shl i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  %25 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %25, ptr %3, align 8
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = load i32, ptr @minx, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %.lr.ph
  store i32 %29, ptr @minx, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %32, %.lr.ph
  %34 = phi i32 [ %29, %32 ], [ %30, %.lr.ph ]
  %35 = load i32, ptr @maxx, align 4, !tbaa !5
  %36 = icmp slt i32 %35, %29
  br i1 %36, label %37, label %38

37:                                               ; preds = %33
  store i32 %29, ptr @maxx, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %37, %33
  %39 = phi i32 [ %29, %37 ], [ %35, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %40 = add nuw nsw i32 %.0512, 1
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph14:                                         ; preds = %._crit_edge, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %43 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %44 = load i64, ptr %43, align 4
  store i64 %44, ptr %6, align 8
  %45 = load i32, ptr @xx, align 4, !tbaa !5
  %46 = trunc i64 %44 to i32
  %47 = sub nsw i32 %45, %46
  store i32 %47, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %48 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE4findERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store ptr %48, ptr %7, align 8
  %49 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %49, label %.thread, label %50

.thread:                                          ; preds = %.lr.ph14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %.loopexit

50:                                               ; preds = %.lr.ph14
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load i32, ptr %54, align 4, !tbaa !13
  %.not8 = icmp eq i32 %52, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br i1 %.not8, label %56, label %.loopexit

56:                                               ; preds = %50
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %58 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %58, label %.lr.ph14, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %50, %56, %._crit_edge, %.thread
  %59 = phi ptr [ @.str.2, %.thread ], [ @.str.3, %._crit_edge ], [ @.str.2, %50 ], [ @.str.3, %56 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %60 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %59)
  %61 = load i32, ptr @t, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %61, 0
  br i1 %.not, label %._crit_edge20, label %.lr.ph19, !llvm.loop !16

._crit_edge20:                                    ; preds = %.loopexit, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1

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 = { nofree 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !6, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTSSt4pairIKS_IiiEiE", !12, i64 0, !6, i64 8}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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