; LLVM IR from DionysiosB/CodeForces :: 0200-0299 (204B-LittleElephantAndCards)

; 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<long, std::pair<const long, std::pair<long, long>>, std::_Select1st<std::pair<const long, std::pair<long, long>>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, std::pair<long, long>>, std::_Select1st<std::pair<const long, std::pair<long, long>>>, std::less<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 }
%"struct.std::pair.2" = type { i64, %"struct.std::pair" }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.4" = type { i64, %"struct.std::pair" }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::map", align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.2", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair.0", align 8
  %15 = alloca %"struct.std::pair.2", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.0", align 8
  %20 = alloca i8, align 1
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %24 = alloca i64, align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #5
  call void @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %98, %0
  %28 = load i64, ptr %4, align 8, !tbaa !5
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %102

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %33 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6, ptr noundef %7)
          to label %34 unwind label %49

34:                                               ; preds = %32
  %35 = invoke noundef i64 @_ZNKSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %36 unwind label %49

36:                                               ; preds = %34
  %37 = icmp ugt i64 %35, 0
  br i1 %37, label %38, label %53

38:                                               ; preds = %36
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %40 unwind label %49

40:                                               ; preds = %38
  %41 = getelementptr inbounds %"struct.std::pair", ptr %39, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %41, align 8, !tbaa !9
  %44 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %45 unwind label %49

45:                                               ; preds = %40
  %46 = getelementptr inbounds %"struct.std::pair", ptr %44, i32 0, i32 1
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %46, align 8, !tbaa !11
  br label %66

49:                                               ; preds = %75, %71, %40, %38, %34, %32
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %8, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %9, align 4
  br label %101

53:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !12
  invoke void @_ZNSt4pairIllEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %54 unwind label %62

54:                                               ; preds = %53
  invoke void @_ZNSt4pairIlS_IllEEC2IRlS0_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %55 unwind label %62

55:                                               ; preds = %54
  %56 = invoke { ptr, i8 } @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE6insertIS0_IlS1_EEENSt9enable_ifIXsr16is_constructibleIS5_T_EE5valueES0_ISt17_Rb_tree_iteratorIS5_EbEE4typeEOSB_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %57 unwind label %62

57:                                               ; preds = %55
  %58 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %59 = extractvalue { ptr, i8 } %56, 0
  store ptr %59, ptr %58, align 8
  %60 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %61 = extractvalue { ptr, i8 } %56, 1
  store i8 %61, ptr %60, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %66

62:                                               ; preds = %55, %54, %53
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %8, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %101

66:                                               ; preds = %57, %45
  %67 = load i64, ptr %6, align 8, !tbaa !5
  %68 = load i64, ptr %7, align 8, !tbaa !5
  %69 = icmp eq i64 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %66
  store i32 4, ptr %5, align 4
  br label %95

71:                                               ; preds = %66
  %72 = invoke noundef i64 @_ZNKSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %73 unwind label %49

73:                                               ; preds = %71
  %74 = icmp ugt i64 %72, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %73
  %76 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %77 unwind label %49

77:                                               ; preds = %75
  %78 = getelementptr inbounds %"struct.std::pair", ptr %76, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %78, align 8, !tbaa !9
  br label %94

81:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !12
  invoke void @_ZNSt4pairIllEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %82 unwind label %90

82:                                               ; preds = %81
  invoke void @_ZNSt4pairIlS_IllEEC2IRlS0_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %83 unwind label %90

83:                                               ; preds = %82
  %84 = invoke { ptr, i8 } @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE6insertIS0_IlS1_EEENSt9enable_ifIXsr16is_constructibleIS5_T_EE5valueES0_ISt17_Rb_tree_iteratorIS5_EbEE4typeEOSB_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %85 unwind label %90

85:                                               ; preds = %83
  %86 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %87 = extractvalue { ptr, i8 } %84, 0
  store ptr %87, ptr %86, align 8
  %88 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %89 = extractvalue { ptr, i8 } %84, 1
  store i8 %89, ptr %88, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %94

90:                                               ; preds = %83, %82, %81
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %101

94:                                               ; preds = %85, %77
  store i32 0, ptr %5, align 4
  br label %95

95:                                               ; preds = %94, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %96 = load i32, ptr %5, align 4
  switch i32 %96, label %191 [
    i32 0, label %97
    i32 4, label %98
  ]

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97, %95
  %99 = load i64, ptr %4, align 8, !tbaa !5
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr %4, align 8, !tbaa !5
  br label %27, !llvm.loop !14

101:                                              ; preds = %90, %62, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %185

102:                                              ; preds = %31
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #5
  store i8 0, ptr %20, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %103 = load i64, ptr %2, align 8, !tbaa !5
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %105 = call ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %106 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %22, i32 0, i32 0
  store ptr %105, ptr %106, align 8
  br label %107

107:                                              ; preds = %164, %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %108 = call ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %109 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %23, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  %110 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 5, ptr %5, align 4
  br label %167

112:                                              ; preds = %107
  %113 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %114 = getelementptr inbounds %"struct.std::pair.4", ptr %113, i32 0, i32 0
  %115 = load i64, ptr %114, align 8, !tbaa !18
  %116 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %117 = getelementptr inbounds %"struct.std::pair.4", ptr %116, i32 0, i32 1
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 0
  %119 = load i64, ptr %118, align 8, !tbaa !20
  %120 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %121 = getelementptr inbounds %"struct.std::pair.4", ptr %120, i32 0, i32 1
  %122 = getelementptr inbounds %"struct.std::pair", ptr %121, i32 0, i32 1
  %123 = load i64, ptr %122, align 8, !tbaa !21
  %124 = load i64, ptr %2, align 8, !tbaa !5
  %125 = add nsw i64 %124, 1
  %126 = sdiv i64 %125, 2
  %127 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %115, i64 noundef %119, i64 noundef %123, i64 noundef %126)
          to label %128 unwind label %138

128:                                              ; preds = %112
  %129 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %130 = getelementptr inbounds %"struct.std::pair.4", ptr %129, i32 0, i32 1
  %131 = getelementptr inbounds %"struct.std::pair", ptr %130, i32 0, i32 0
  %132 = load i64, ptr %131, align 8, !tbaa !20
  %133 = load i64, ptr %2, align 8, !tbaa !5
  %134 = add nsw i64 %133, 1
  %135 = sdiv i64 %134, 2
  %136 = icmp slt i64 %132, %135
  br i1 %136, label %137, label %142

137:                                              ; preds = %128
  br label %164

138:                                              ; preds = %112
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %8, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %184

142:                                              ; preds = %128
  store i8 1, ptr %20, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %143 = load i64, ptr %2, align 8, !tbaa !5
  %144 = add nsw i64 %143, 1
  %145 = sdiv i64 %144, 2
  %146 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %147 = getelementptr inbounds %"struct.std::pair.4", ptr %146, i32 0, i32 1
  %148 = getelementptr inbounds %"struct.std::pair", ptr %147, i32 0, i32 1
  %149 = load i64, ptr %148, align 8, !tbaa !21
  %150 = sub nsw i64 %145, %149
  store i64 %150, ptr %24, align 8, !tbaa !5
  %151 = load i64, ptr %24, align 8, !tbaa !5
  %152 = load i64, ptr %21, align 8, !tbaa !5
  %153 = icmp slt i64 %151, %152
  br i1 %153, label %154, label %156

154:                                              ; preds = %142
  %155 = load i64, ptr %24, align 8, !tbaa !5
  store i64 %155, ptr %21, align 8, !tbaa !5
  br label %156

156:                                              ; preds = %154, %142
  %157 = load i64, ptr %21, align 8, !tbaa !5
  %158 = icmp slt i64 %157, 0
  br i1 %158, label %159, label %160

159:                                              ; preds = %156
  store i64 0, ptr %21, align 8, !tbaa !5
  store i32 5, ptr %5, align 4
  br label %161

160:                                              ; preds = %156
  store i32 0, ptr %5, align 4
  br label %161

161:                                              ; preds = %160, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  %162 = load i32, ptr %5, align 4
  switch i32 %162, label %167 [
    i32 0, label %163
  ]

163:                                              ; preds = %161
  br label %164

164:                                              ; preds = %163, %137
  %165 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef 0) #5
  %166 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  br label %107, !llvm.loop !22

167:                                              ; preds = %161, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %168

168:                                              ; preds = %167
  %169 = load i8, ptr %20, align 1, !tbaa !16, !range !23, !noundef !24
  %170 = trunc i8 %169 to i1
  br i1 %170, label %171, label %179

171:                                              ; preds = %168
  %172 = load i64, ptr %21, align 8, !tbaa !5
  %173 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %172)
          to label %174 unwind label %175

174:                                              ; preds = %171
  br label %182

175:                                              ; preds = %179, %171
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %8, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %9, align 4
  br label %184

179:                                              ; preds = %168
  %180 = invoke i32 @puts(ptr noundef @.str.3)
          to label %181 unwind label %175

181:                                              ; preds = %179
  br label %182

182:                                              ; preds = %181, %174
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  call void @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %183 = load i32, ptr %1, align 4
  ret i32 %183

184:                                              ; preds = %175, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  br label %185

185:                                              ; preds = %184, %101
  call void @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %186

186:                                              ; preds = %185
  %187 = load ptr, ptr %8, align 8
  %188 = load i32, ptr %9, align 4
  %189 = insertvalue { ptr, i32 } poison, ptr %187, 0
  %190 = insertvalue { ptr, i32 } %189, i32 %188, 1
  resume { ptr, i32 } %190

191:                                              ; preds = %95
  unreachable
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE6insertIS0_IlS1_EEENSt9enable_ifIXsr16is_constructibleIS5_T_EE5valueES0_ISt17_Rb_tree_iteratorIS5_EbEE4typeEOSB_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIlS_IllEEC2IRlS0_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 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 nounwind uwtable
declare dso_local ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

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

declare i32 @printf(ptr noundef, ...) #2

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

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTSSt4pairIKlS_IllEE", !6, i64 0, !10, i64 8}
!20 = !{!19, !6, i64 8}
!21 = !{!19, !6, i64 16}
!22 = distinct !{!22, !15}
!23 = !{i8 0, i8 2}
!24 = !{}


; 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<long, std::pair<const long, std::pair<long, long>>, std::_Select1st<std::pair<const long, std::pair<long, long>>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, std::pair<long, long>>, std::_Select1st<std::pair<const long, std::pair<long, long>>>, std::less<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 }
%"struct.std::pair.2" = type { i64, %"struct.std::pair" }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; 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 %"class.std::map", align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair.2", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair.2", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #6
  call void @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %59, %0
  %.lcssa = phi i64 [ %16, %0 ], [ %61, %59 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %18 = call ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %18, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %19 = call ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %19, ptr %14, align 8
  %20 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br i1 %20, label %.lr.ph38.preheader, label %._crit_edge39.thread

.lr.ph38.preheader:                               ; preds = %._crit_edge
  %21 = add nsw i64 %.lcssa, 1
  br label %.lr.ph38

._crit_edge39.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %95

.lr.ph:                                           ; preds = %0, %59
  %.034 = phi i64 [ %60, %59 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %23 = invoke noundef i64 @_ZNKSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %24 unwind label %35

24:                                               ; preds = %.lr.ph
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %37, label %25

25:                                               ; preds = %24
  %26 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %27 unwind label %35

27:                                               ; preds = %25
  %28 = load i64, ptr %26, align 8, !tbaa !9
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %26, align 8, !tbaa !9
  %30 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %31 unwind label %35

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !11
  %34 = add nsw i64 %33, 1
  store i64 %34, ptr %32, align 8, !tbaa !11
  br label %42

35:                                               ; preds = %49, %46, %27, %25, %.lr.ph
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %63

37:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 1, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 1, ptr %8, align 4, !tbaa !12
  call void @_ZNSt4pairIllEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_ZNSt4pairIlS_IllEEC2IRlS0_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %38 = invoke { ptr, i8 } @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE6insertIS0_IlS1_EEENSt9enable_ifIXsr16is_constructibleIS5_T_EE5valueES0_ISt17_Rb_tree_iteratorIS5_EbEE4typeEOSB_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %39 unwind label %40

39:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %42

40:                                               ; preds = %37
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %63

42:                                               ; preds = %39, %31
  %43 = load i64, ptr %3, align 8, !tbaa !5
  %44 = load i64, ptr %4, align 8, !tbaa !5
  %45 = icmp eq i64 %43, %44
  br i1 %45, label %59, label %46

46:                                               ; preds = %42
  %47 = invoke noundef i64 @_ZNKSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %48 unwind label %35

48:                                               ; preds = %46
  %.not24 = icmp eq i64 %47, 0
  br i1 %.not24, label %54, label %49

49:                                               ; preds = %48
  %50 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %51 unwind label %35

51:                                               ; preds = %49
  %52 = load i64, ptr %50, align 8, !tbaa !9
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %50, align 8, !tbaa !9
  br label %59

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 1, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  store i32 0, ptr %12, align 4, !tbaa !12
  call void @_ZNSt4pairIllEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @_ZNSt4pairIlS_IllEEC2IRlS0_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %55 = invoke { ptr, i8 } @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE6insertIS0_IlS1_EEENSt9enable_ifIXsr16is_constructibleIS5_T_EE5valueES0_ISt17_Rb_tree_iteratorIS5_EbEE4typeEOSB_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %56 unwind label %57

56:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %59

57:                                               ; preds = %54
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %63

59:                                               ; preds = %51, %56, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %60 = add nuw nsw i64 %.034, 1
  %61 = load i64, ptr %1, align 8, !tbaa !5
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !14

63:                                               ; preds = %57, %40, %35
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %58, %57 ], [ %41, %40 ]
  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 @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

.lr.ph38:                                         ; preds = %.lr.ph38.preheader, %89
  %.01436 = phi i64 [ %.3, %89 ], [ %21, %.lr.ph38.preheader ]
  %.01535 = phi i1 [ %.116, %89 ], [ false, %.lr.ph38.preheader ]
  %64 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %65 = load i64, ptr %64, align 8, !tbaa !16
  %66 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load i64, ptr %67, align 8, !tbaa !18
  %69 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load i64, ptr %70, align 8, !tbaa !19
  %72 = load i64, ptr %1, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  %74 = sdiv i64 %73, 2
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %65, i64 noundef %68, i64 noundef %71, i64 noundef %74)
  %76 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %77 = getelementptr inbounds i8, ptr %76, i64 8
  %78 = load i64, ptr %77, align 8, !tbaa !18
  %79 = load i64, ptr %1, align 8, !tbaa !5
  %80 = add nsw i64 %79, 1
  %81 = sdiv i64 %80, 2
  %82 = icmp slt i64 %78, %81
  br i1 %82, label %89, label %83

83:                                               ; preds = %.lr.ph38
  %84 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %85 = getelementptr inbounds i8, ptr %84, i64 16
  %86 = load i64, ptr %85, align 8, !tbaa !19
  %87 = sub nsw i64 %81, %86
  %spec.select = call i64 @llvm.smin.i64(i64 %87, i64 %.01436)
  %88 = icmp sgt i64 %spec.select, -1
  br i1 %88, label %89, label %.thread

.thread:                                          ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %93

89:                                               ; preds = %83, %.lr.ph38
  %.116 = phi i1 [ %.01535, %.lr.ph38 ], [ true, %83 ]
  %.3 = phi i64 [ %.01436, %.lr.ph38 ], [ %spec.select, %83 ]
  %90 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %91 = call ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %91, ptr %14, align 8
  %92 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKlS0_IllEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br i1 %92, label %.lr.ph38, label %._crit_edge39, !llvm.loop !20

._crit_edge39:                                    ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br i1 %.116, label %93, label %95

93:                                               ; preds = %.thread, %._crit_edge39
  %.428 = phi i64 [ 0, %.thread ], [ %.3, %._crit_edge39 ]
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.428)
  br label %97

95:                                               ; preds = %._crit_edge39.thread, %._crit_edge39
  %96 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %97

97:                                               ; preds = %95, %93
  call void @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE6insertIS0_IlS1_EEENSt9enable_ifIXsr16is_constructibleIS5_T_EE5valueES0_ISt17_Rb_tree_iteratorIS5_EbEE4typeEOSB_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIlS_IllEEC2IRlS0_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 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 nounwind uwtable
declare dso_local ptr @_ZNSt3mapIlSt4pairIllESt4lessIlESaIS0_IKlS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 nosync nounwind speculatable willreturn memory(none) }
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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt4pairIKlS_IllEE", !6, i64 0, !10, i64 8}
!18 = !{!17, !6, i64 8}
!19 = !{!17, !6, i64 16}
!20 = distinct !{!20, !15}


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