; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/319 Division 1/Problem B (B)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@p = external dso_local global [100100 x i32], align 16
@v = external dso_local global [1001000 x i32], align 16
@e = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = 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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 0, ptr %1, align 4
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %30, %0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %28)
  br label %30

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !9

33:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %67, %33
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 5, ptr %4, align 4
  br label %70

39:                                               ; preds = %34
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %66

46:                                               ; preds = %39
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %62, %46
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp sle i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %65

53:                                               ; preds = %48
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = icmp ne i32 %54, %55
  br i1 %56, label %57, label %61

57:                                               ; preds = %53
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %58, i32 noundef %59)
  br label %61

61:                                               ; preds = %57, %53
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %5, align 4, !tbaa !5
  br label %48, !llvm.loop !11

65:                                               ; preds = %52
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %70

66:                                               ; preds = %39
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %3, align 4, !tbaa !5
  br label %34, !llvm.loop !12

70:                                               ; preds = %65, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %71 = load i32, ptr %4, align 4
  switch i32 %71, label %195 [
    i32 5, label %72
    i32 1, label %193
  ]

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 -1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 -1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %95, %72
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %98

78:                                               ; preds = %73
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = icmp eq i32 %85, %86
  br i1 %87, label %88, label %94

88:                                               ; preds = %78
  %89 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %89, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  store i32 %93, ptr %7, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %88, %78
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %8, align 4, !tbaa !5
  br label %73, !llvm.loop !13

98:                                               ; preds = %77
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = icmp eq i32 %99, -1
  br i1 %100, label %101, label %103

101:                                              ; preds = %98
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %192

103:                                              ; preds = %98
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %105
  store i32 1, ptr %106, align 4, !tbaa !5
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %108
  store i32 1, ptr %109, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %110 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %110, ptr %9, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %166, %103
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = icmp sle i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 14, ptr %4, align 4
  br label %169

116:                                              ; preds = %111
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %165, label %122

122:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %123 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %123, ptr %12, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %125
  store i32 1, ptr %126, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  store i32 %130, ptr %13, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %150, %122
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = icmp ne i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %155

136:                                              ; preds = %131
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %11, align 4, !tbaa !5
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %140
  store i32 1, ptr %141, align 4, !tbaa !5
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = srem i32 %142, 2
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %147

145:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %146 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %146, ptr %14, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %149

147:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %148 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %148, ptr %15, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %149

149:                                              ; preds = %147, %145
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %13, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  store i32 %154, ptr %13, align 4, !tbaa !5
  br label %131, !llvm.loop !14

155:                                              ; preds = %135
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = and i32 %156, 1
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %161

159:                                              ; preds = %155
  %160 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %162

161:                                              ; preds = %155
  store i32 0, ptr %4, align 4
  br label %162

162:                                              ; preds = %161, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %163 = load i32, ptr %4, align 4
  switch i32 %163, label %169 [
    i32 0, label %164
  ]

164:                                              ; preds = %162
  br label %165

165:                                              ; preds = %164, %116
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %10, align 4, !tbaa !5
  br label %111, !llvm.loop !15

169:                                              ; preds = %162, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %170 = load i32, ptr %4, align 4
  switch i32 %170, label %192 [
    i32 14, label %171
  ]

171:                                              ; preds = %169
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %173 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  %174 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %173, ptr %174, align 8
  br label %175

175:                                              ; preds = %188, %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %176 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  %177 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %176, ptr %177, align 8
  %178 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br i1 %178, label %180, label %179

179:                                              ; preds = %175
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %191

180:                                              ; preds = %175
  %181 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %182 = getelementptr inbounds %"struct.std::pair", ptr %181, i32 0, i32 0
  %183 = load i32, ptr %182, align 4, !tbaa !16
  %184 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %185 = getelementptr inbounds %"struct.std::pair", ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !18
  %187 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %183, i32 noundef %186)
  br label %188

188:                                              ; preds = %180
  %189 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #6
  %190 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %189, ptr %190, align 8
  br label %175, !llvm.loop !19

191:                                              ; preds = %179
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %192

192:                                              ; preds = %191, %169, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %193

193:                                              ; preds = %192, %70
  %194 = load i32, ptr %1, align 4
  ret i32 %194

195:                                              ; preds = %70
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #3 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)) #3

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { 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 #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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 4}
!19 = distinct !{!19, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@p = external dso_local global [100100 x i32], align 16
@v = external dso_local local_unnamed_addr global [1001000 x i32], align 16
@e = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = 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 i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not52 = icmp slt i32 %12, 1
  br i1 %.not52, label %._crit_edge.thread, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  %.not3654 = icmp slt i32 %16, 1
  br i1 %.not3654, label %._crit_edge.thread, label %.lr.ph56.preheader

.lr.ph56.preheader:                               ; preds = %.preheader
  %13 = add nuw i32 %16, 1
  %wide.trip.count = zext i32 %13 to i64
  br label %.lr.ph56

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %14 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %.not.not = icmp slt i64 %indvars.iv, %17
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %32
  %indvars.iv96 = phi i64 [ 1, %.lr.ph56.preheader ], [ %indvars.iv.next97, %32 ]
  %18 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv96
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = icmp eq i64 %indvars.iv96, %20
  br i1 %21, label %22, label %32

22:                                               ; preds = %.lr.ph56
  %23 = trunc nuw nsw i64 %indvars.iv96 to i32
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %.not3757 = icmp slt i32 %25, 1
  br i1 %.not3757, label %.loopexit, label %.lr.ph60

.lr.ph60:                                         ; preds = %22, %29
  %26 = phi i32 [ %30, %29 ], [ %25, %22 ]
  %.02958 = phi i32 [ %31, %29 ], [ 1, %22 ]
  %.not45 = icmp eq i32 %.02958, %23
  br i1 %.not45, label %29, label %27

27:                                               ; preds = %.lr.ph60
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %23, i32 noundef %.02958)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %.lr.ph60, %27
  %30 = phi i32 [ %26, %.lr.ph60 ], [ %.pre, %27 ]
  %31 = add nuw nsw i32 %.02958, 1
  %.not37.not = icmp slt i32 %.02958, %30
  br i1 %.not37.not, label %.lr.ph60, label %.loopexit, !llvm.loop !11

32:                                               ; preds = %.lr.ph56
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph56, !llvm.loop !12

._crit_edge.thread:                               ; preds = %.preheader, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  br label %._crit_edge70.thread

._crit_edge:                                      ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  br i1 %.not3654, label %._crit_edge70.thread, label %.lr.ph69.preheader

.lr.ph69.preheader:                               ; preds = %._crit_edge
  %33 = zext nneg i32 %16 to i64
  %34 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %33, 3
  %35 = icmp ult i64 %34, 3
  br i1 %35, label %._crit_edge70.unr-lcssa, label %.lr.ph69.preheader.new

.lr.ph69.preheader.new:                           ; preds = %.lr.ph69.preheader
  %unroll_iter = and i64 %33, 2147483644
  br label %.lr.ph69

._crit_edge70.unr-lcssa:                          ; preds = %.lr.ph69, %.lr.ph69.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph69.preheader ], [ %spec.select.3, %.lr.ph69 ]
  %spec.select91.lcssa.ph = phi i32 [ poison, %.lr.ph69.preheader ], [ %spec.select91.3, %.lr.ph69 ]
  %indvars.iv99.unr = phi i64 [ 1, %.lr.ph69.preheader ], [ %indvars.iv.next100.3, %.lr.ph69 ]
  %.0286266.unr = phi i32 [ -1, %.lr.ph69.preheader ], [ %spec.select91.3, %.lr.ph69 ]
  %.unr = phi i32 [ -1, %.lr.ph69.preheader ], [ %spec.select.3, %.lr.ph69 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge70, label %.lr.ph69.epil

.lr.ph69.epil:                                    ; preds = %._crit_edge70.unr-lcssa, %.lr.ph69.epil
  %indvars.iv99.epil = phi i64 [ %indvars.iv.next100.epil, %.lr.ph69.epil ], [ %indvars.iv99.unr, %._crit_edge70.unr-lcssa ]
  %.0286266.epil = phi i32 [ %spec.select91.epil, %.lr.ph69.epil ], [ %.0286266.unr, %._crit_edge70.unr-lcssa ]
  %36 = phi i32 [ %spec.select.epil, %.lr.ph69.epil ], [ %.unr, %._crit_edge70.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph69.epil ], [ 0, %._crit_edge70.unr-lcssa ]
  %37 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv99.epil
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = icmp eq i64 %indvars.iv99.epil, %42
  %spec.select.epil = select i1 %43, i32 %38, i32 %36
  %44 = trunc nuw nsw i64 %indvars.iv99.epil to i32
  %spec.select91.epil = select i1 %43, i32 %44, i32 %.0286266.epil
  %indvars.iv.next100.epil = add nuw nsw i64 %indvars.iv99.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge70, label %.lr.ph69.epil, !llvm.loop !13

._crit_edge70:                                    ; preds = %.lr.ph69.epil, %._crit_edge70.unr-lcssa
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %._crit_edge70.unr-lcssa ], [ %spec.select.epil, %.lr.ph69.epil ]
  %spec.select91.lcssa = phi i32 [ %spec.select91.lcssa.ph, %._crit_edge70.unr-lcssa ], [ %spec.select91.epil, %.lr.ph69.epil ]
  store i32 %spec.select91.lcssa, ptr %1, align 4, !tbaa !5
  store i32 %spec.select.lcssa, ptr %2, align 4, !tbaa !5
  %45 = icmp eq i32 %spec.select91.lcssa, -1
  br i1 %45, label %._crit_edge70.thread, label %80

.lr.ph69:                                         ; preds = %.lr.ph69, %.lr.ph69.preheader.new
  %indvars.iv99 = phi i64 [ 1, %.lr.ph69.preheader.new ], [ %indvars.iv.next100.3, %.lr.ph69 ]
  %.0286266 = phi i32 [ -1, %.lr.ph69.preheader.new ], [ %spec.select91.3, %.lr.ph69 ]
  %46 = phi i32 [ -1, %.lr.ph69.preheader.new ], [ %spec.select.3, %.lr.ph69 ]
  %niter = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %niter.next.3, %.lr.ph69 ]
  %47 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv99
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = zext i32 %51 to i64
  %53 = icmp eq i64 %indvars.iv99, %52
  %spec.select = select i1 %53, i32 %48, i32 %46
  %54 = trunc nuw nsw i64 %indvars.iv99 to i32
  %spec.select91 = select i1 %53, i32 %54, i32 %.0286266
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %55 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv.next100
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = icmp eq i64 %indvars.iv.next100, %60
  %spec.select.1 = select i1 %61, i32 %56, i32 %spec.select
  %62 = trunc nuw nsw i64 %indvars.iv.next100 to i32
  %spec.select91.1 = select i1 %61, i32 %62, i32 %spec.select91
  %indvars.iv.next100.1 = add nuw nsw i64 %indvars.iv99, 2
  %63 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv.next100.1
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = zext i32 %67 to i64
  %69 = icmp eq i64 %indvars.iv.next100.1, %68
  %spec.select.2 = select i1 %69, i32 %64, i32 %spec.select.1
  %70 = trunc nuw nsw i64 %indvars.iv.next100.1 to i32
  %spec.select91.2 = select i1 %69, i32 %70, i32 %spec.select91.1
  %indvars.iv.next100.2 = add nuw nsw i64 %indvars.iv99, 3
  %71 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv.next100.2
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = zext i32 %75 to i64
  %77 = icmp eq i64 %indvars.iv.next100.2, %76
  %spec.select.3 = select i1 %77, i32 %72, i32 %spec.select.2
  %78 = trunc nuw nsw i64 %indvars.iv.next100.2 to i32
  %spec.select91.3 = select i1 %77, i32 %78, i32 %spec.select91.2
  %indvars.iv.next100.3 = add nuw nsw i64 %indvars.iv99, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge70.unr-lcssa, label %.lr.ph69, !llvm.loop !15

._crit_edge70.thread:                             ; preds = %._crit_edge.thread, %._crit_edge, %._crit_edge70
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %125

80:                                               ; preds = %._crit_edge70
  %81 = sext i32 %spec.select.lcssa to i64
  %82 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %81
  store i32 1, ptr %82, align 4, !tbaa !5
  %83 = sext i32 %spec.select91.lcssa to i64
  %84 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %83
  store i32 1, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %85 = 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 %85, ptr %3, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %.not3983 = icmp slt i32 %86, 1
  br i1 %.not3983, label %._crit_edge87, label %.lr.ph86

.lr.ph86:                                         ; preds = %80, %.critedge
  %87 = phi i32 [ %109, %.critedge ], [ %86, %80 ]
  %storemerge84 = phi i32 [ %111, %.critedge ], [ 1, %80 ]
  %88 = sext i32 %storemerge84 to i64
  %89 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %.not40 = icmp eq i32 %90, 0
  br i1 %.not40, label %91, label %.critedge

91:                                               ; preds = %.lr.ph86
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %92 = 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) %4)
  store i64 %92, ptr %5, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %94
  store i32 1, ptr %95, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %storemerge41.in74 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %94
  %storemerge4175 = load i32, ptr %storemerge41.in74, align 4, !tbaa !5
  store i32 %storemerge4175, ptr %6, align 4, !tbaa !5
  %.not4276 = icmp eq i32 %storemerge4175, %93
  br i1 %.not4276, label %._crit_edge81.thread, label %.lr.ph80

._crit_edge81.thread:                             ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %.loopexit111

._crit_edge81:                                    ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %96 = and i32 %.02777, 1
  %.not43.not = icmp eq i32 %96, 0
  br i1 %.not43.not, label %.loopexit111, label %._crit_edge81..critedge_crit_edge

._crit_edge81..critedge_crit_edge:                ; preds = %._crit_edge81
  %.pre104 = load i32, ptr @n, align 4, !tbaa !5
  br label %.critedge

.lr.ph80:                                         ; preds = %91, %105
  %storemerge4178 = phi i32 [ %storemerge41, %105 ], [ %storemerge4175, %91 ]
  %.02777 = phi i32 [ %97, %105 ], [ 1, %91 ]
  %97 = add nuw nsw i32 %.02777, 1
  %98 = sext i32 %storemerge4178 to i64
  %99 = getelementptr inbounds [1001000 x i32], ptr @v, i64 0, i64 %98
  store i32 1, ptr %99, align 4, !tbaa !5
  %100 = and i32 %.02777, 1
  %.not44.not = icmp eq i32 %100, 0
  br i1 %.not44.not, label %101, label %103

101:                                              ; preds = %.lr.ph80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %102 = 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) %6)
  store i64 %102, ptr %7, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %105

103:                                              ; preds = %.lr.ph80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %104 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %104, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %105

105:                                              ; preds = %101, %103
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %.pn = sext i32 %106 to i64
  %storemerge41.in = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %.pn
  %storemerge41 = load i32, ptr %storemerge41.in, align 4, !tbaa !5
  store i32 %storemerge41, ptr %6, align 4, !tbaa !5
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %.not42 = icmp eq i32 %storemerge41, %107
  br i1 %.not42, label %._crit_edge81, label %.lr.ph80, !llvm.loop !16

.loopexit111:                                     ; preds = %._crit_edge81, %._crit_edge81.thread
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %125

.critedge:                                        ; preds = %._crit_edge81..critedge_crit_edge, %.lr.ph86
  %109 = phi i32 [ %.pre104, %._crit_edge81..critedge_crit_edge ], [ %87, %.lr.ph86 ]
  %110 = phi i32 [ %storemerge41, %._crit_edge81..critedge_crit_edge ], [ %storemerge84, %.lr.ph86 ]
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %4, align 4, !tbaa !5
  %.not39.not = icmp slt i32 %110, %109
  br i1 %.not39.not, label %.lr.ph86, label %._crit_edge87, !llvm.loop !17

._crit_edge87:                                    ; preds = %.critedge, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %113 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  store ptr %113, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %114 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  store ptr %114, ptr %10, align 8
  %115 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %115, label %.lr.ph89, label %._crit_edge90

._crit_edge90:                                    ; preds = %.lr.ph89, %._crit_edge87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %125

.lr.ph89:                                         ; preds = %._crit_edge87, %.lr.ph89
  %116 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %117 = load i32, ptr %116, align 4, !tbaa !18
  %118 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %119 = getelementptr inbounds i8, ptr %118, i64 4
  %120 = load i32, ptr %119, align 4, !tbaa !20
  %121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %117, i32 noundef %120)
  %122 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %123 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  store ptr %123, ptr %10, align 8
  %124 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %124, label %.lr.ph89, label %._crit_edge90, !llvm.loop !21

125:                                              ; preds = %.loopexit111, %._crit_edge90, %._crit_edge70.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %.loopexit

.loopexit:                                        ; preds = %29, %22, %125
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 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 #3

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4 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 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { 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 #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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!20 = !{!19, !6, i64 4}
!21 = distinct !{!21, !10}


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