; LLVM IR from kazunetakahashi/atcoder :: 2019/0112_aising2019 (D)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@A = external dso_local global [100010 x i64], align 16
@B = external dso_local global %"class.std::vector", align 8
@X = external dso_local global [100010 x i64], align 16
@S = external dso_local global %"class.std::set", align 8
@M = external dso_local global %"class.std::map", align 8
@Y = external dso_local global [100010 x i64], align 16
@Z = external dso_local global [100010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL5infty = external hidden constant i64, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5flushv() #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #0 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %35, %0
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @N, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %33)
  br label %35

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

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %57, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @Q, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %60

44:                                               ; preds = %39
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %47)
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %50
  %52 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @S, ptr noundef nonnull align 8 dereferenceable(8) %51)
  %53 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 0
  %54 = extractvalue { ptr, i8 } %52, 0
  store ptr %54, ptr %53, align 8
  %55 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 1
  %56 = extractvalue { ptr, i8 } %52, 1
  store i8 %56, ptr %55, align 8
  br label %57

57:                                               ; preds = %44
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !11

60:                                               ; preds = %43
  %61 = load i32, ptr @N, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i64, ptr @A, i64 %62
  call void @_ZSt7reverseIPxEvT_S1_(ptr noundef @A, ptr noundef %63)
  %64 = load i32, ptr @N, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %66
  store i64 0, ptr %67, align 8, !tbaa !12
  %68 = load i32, ptr @N, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %69
  store i64 0, ptr %70, align 8, !tbaa !12
  %71 = load i32, ptr @N, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !12
  %76 = load i32, ptr @N, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %78
  store i64 %75, ptr %79, align 8, !tbaa !12
  %80 = load i32, ptr @N, align 4, !tbaa !5
  %81 = sub nsw i32 %80, 2
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !12
  %85 = load i32, ptr @N, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 2
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %87
  store i64 %84, ptr %88, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %89 = load i32, ptr @N, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 3
  store i32 %90, ptr %5, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %109, %60
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = icmp sge i32 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %112

95:                                               ; preds = %91
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !12
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = add nsw i32 %100, 2
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !12
  %105 = add nsw i64 %99, %104
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %107
  store i64 %105, ptr %108, align 8, !tbaa !12
  br label %109

109:                                              ; preds = %95
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %5, align 4, !tbaa !5
  br label %91, !llvm.loop !14

112:                                              ; preds = %94
  %113 = load i64, ptr @A, align 16, !tbaa !12
  store i64 %113, ptr @Z, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %133, %112
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = load i32, ptr @N, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

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

119:                                              ; preds = %114
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !12
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !12
  %129 = add nsw i64 %123, %128
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %131
  store i64 %129, ptr %132, align 8, !tbaa !12
  br label %133

133:                                              ; preds = %119
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %6, align 4, !tbaa !5
  br label %114, !llvm.loop !15

136:                                              ; preds = %118
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @B, ptr noundef nonnull align 8 dereferenceable(8) @_ZL5infty)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %146, %136
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = load i32, ptr @N, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %149

142:                                              ; preds = %137
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %144
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @B, ptr noundef nonnull align 8 dereferenceable(8) %145)
  br label %146

146:                                              ; preds = %142
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %7, align 4, !tbaa !5
  br label %137, !llvm.loop !16

149:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 -100000000007, ptr %8, align 8, !tbaa !12
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @B, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %150 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %151 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %9, i32 0, i32 0
  store ptr %150, ptr %151, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %152 = load i32, ptr @N, align 4, !tbaa !5
  store i32 %152, ptr %10, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %255, %149
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = icmp sge i32 %154, 0
  br i1 %155, label %157, label %156

156:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %258

157:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = sdiv i32 %158, 2
  store i32 %159, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = sub nsw i32 %160, %161
  store i32 %162, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %167

165:                                              ; preds = %157
  %166 = load i64, ptr @Y, align 16, !tbaa !12
  store i64 %166, ptr %13, align 8, !tbaa !12
  br label %195

167:                                              ; preds = %157
  %168 = load i32, ptr %12, align 4, !tbaa !5
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = icmp eq i32 %168, %169
  br i1 %170, label %171, label %182

171:                                              ; preds = %167
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = sub nsw i32 %172, 1
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %174
  %176 = load i64, ptr %175, align 8, !tbaa !12
  %177 = load i32, ptr %10, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %178
  %180 = load i64, ptr %179, align 8, !tbaa !12
  %181 = add nsw i64 %176, %180
  store i64 %181, ptr %13, align 8, !tbaa !12
  br label %194

182:                                              ; preds = %167
  %183 = load i32, ptr %12, align 4, !tbaa !5
  %184 = sub nsw i32 %183, 1
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !12
  %188 = load i32, ptr %10, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !12
  %193 = add nsw i64 %187, %192
  store i64 %193, ptr %13, align 8, !tbaa !12
  br label %194

194:                                              ; preds = %182, %171
  br label %195

195:                                              ; preds = %194, %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %196 = load i32, ptr %11, align 4, !tbaa !5
  %197 = icmp eq i32 %196, 0
  br i1 %197, label %198, label %199

198:                                              ; preds = %195
  store i64 100000000007, ptr %14, align 8, !tbaa !12
  store i64 -100000000007, ptr %15, align 8, !tbaa !12
  br label %231

199:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %201) #7
  %203 = load i64, ptr %202, align 8, !tbaa !12
  store i64 %203, ptr %16, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %204 = load i32, ptr %12, align 4, !tbaa !5
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = add nsw i32 %204, %205
  %207 = sext i32 %206 to i64
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %207) #7
  %209 = load i64, ptr %208, align 8, !tbaa !12
  store i64 %209, ptr %17, align 8, !tbaa !12
  %210 = load i64, ptr %16, align 8, !tbaa !12
  %211 = load i64, ptr %17, align 8, !tbaa !12
  %212 = add nsw i64 %210, %211
  %213 = sdiv i64 %212, 2
  store i64 %213, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %216) #7
  %218 = load i64, ptr %217, align 8, !tbaa !12
  store i64 %218, ptr %18, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %219 = load i32, ptr %12, align 4, !tbaa !5
  %220 = load i32, ptr %11, align 4, !tbaa !5
  %221 = add nsw i32 %219, %220
  %222 = add nsw i32 %221, 1
  %223 = sext i32 %222 to i64
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %223) #7
  %225 = load i64, ptr %224, align 8, !tbaa !12
  store i64 %225, ptr %19, align 8, !tbaa !12
  %226 = load i64, ptr %18, align 8, !tbaa !12
  %227 = load i64, ptr %19, align 8, !tbaa !12
  %228 = add nsw i64 %226, %227
  %229 = sdiv i64 %228, 2
  %230 = add nsw i64 %229, 1
  store i64 %230, ptr %15, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %231

231:                                              ; preds = %199, %198
  br label %232

232:                                              ; preds = %253, %231
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %233 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %234 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  %235 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br i1 %235, label %236, label %254

236:                                              ; preds = %232
  %237 = load i64, ptr %15, align 8, !tbaa !12
  %238 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %239 = load i64, ptr %238, align 8, !tbaa !12
  %240 = icmp sle i64 %237, %239
  br i1 %240, label %241, label %252

241:                                              ; preds = %236
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %243 = load i64, ptr %242, align 8, !tbaa !12
  %244 = load i64, ptr %14, align 8, !tbaa !12
  %245 = icmp sle i64 %243, %244
  br i1 %245, label %246, label %252

246:                                              ; preds = %241
  %247 = load i64, ptr %13, align 8, !tbaa !12
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @M, ptr noundef nonnull align 8 dereferenceable(8) %248)
  store i64 %247, ptr %249, align 8, !tbaa !12
  %250 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #7
  %251 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %250, ptr %251, align 8
  br label %253

252:                                              ; preds = %241, %236
  br label %254

253:                                              ; preds = %246
  br label %232, !llvm.loop !17

254:                                              ; preds = %252, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %255

255:                                              ; preds = %254
  %256 = load i32, ptr %10, align 4, !tbaa !5
  %257 = add nsw i32 %256, -1
  store i32 %257, ptr %10, align 4, !tbaa !5
  br label %153, !llvm.loop !18

258:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %259 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %260 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %259, ptr %260, align 8
  %261 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br i1 %261, label %262, label %263

262:                                              ; preds = %258
  br label %265

263:                                              ; preds = %258
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 137, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

264:                                              ; No predecessors!
  br label %265

265:                                              ; preds = %264, %262
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @_Z5flushv()
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %266 = load i32, ptr %1, align 4
  ret i32 %266
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { noreturn 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@A = external dso_local global [100010 x i64], align 16
@B = external dso_local global %"class.std::vector", align 8
@X = external dso_local global [100010 x i64], align 16
@S = external dso_local global %"class.std::set", align 8
@M = external dso_local global %"class.std::map", align 8
@Y = external dso_local local_unnamed_addr global [100010 x i64], align 16
@Z = external dso_local local_unnamed_addr global [100010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL5infty = external hidden constant i64, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5flushv() local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %0
  %9 = phi i32 [ %7, %0 ], [ %14, %.lr.ph ]
  %10 = load i32, ptr @Q, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph62, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @N, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.lr.ph62
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %17 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %9, %.preheader ]
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds i64, ptr @A, i64 %18
  tail call void @_ZSt7reverseIPxEvT_S1_(ptr noundef nonnull @A, ptr noundef nonnull %19)
  %20 = load i32, ptr @N, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %22
  store i64 0, ptr %23, align 8, !tbaa !11
  %24 = sext i32 %20 to i64
  %25 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %24
  store i64 0, ptr %25, align 8, !tbaa !11
  %26 = add nsw i32 %20, -2
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %27
  %29 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %27
  %30 = load <2 x i64>, ptr %28, align 8, !tbaa !11
  store <2 x i64> %30, ptr %29, align 8, !tbaa !11
  %31 = icmp sgt i32 %20, 2
  br i1 %31, label %.lr.ph65.preheader, label %._crit_edge66

.lr.ph65.preheader:                               ; preds = %._crit_edge
  %32 = add nsw i32 %20, -3
  %33 = zext i32 %32 to i64
  %34 = add nuw nsw i64 %33, 1
  %min.iters.check = icmp eq i32 %32, 0
  br i1 %min.iters.check, label %.lr.ph65.preheader106, label %vector.ph

.lr.ph65.preheader106:                            ; preds = %middle.block, %.lr.ph65.preheader
  %indvars.iv88.ph = phi i64 [ %33, %.lr.ph65.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph65

vector.ph:                                        ; preds = %.lr.ph65.preheader
  %n.vec = and i64 %34, 8589934590
  %ind.end = sub nsw i64 %33, %n.vec
  %35 = shl nuw nsw i64 %33, 3
  %36 = getelementptr i8, ptr @Y, i64 %35
  %scevgep = getelementptr i8, ptr %36, i64 8
  %load_initial = load <2 x i64>, ptr %scevgep, align 8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %store_forwarded = phi <2 x i64> [ %load_initial, %vector.ph ], [ %37, %vector.body ]
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %33, %index
  %gep = getelementptr [100010 x i64], ptr getelementptr (i8, ptr @A, i64 -8), i64 0, i64 %offset.idx
  %wide.load = load <2 x i64>, ptr %gep, align 8, !tbaa !11
  %37 = add nsw <2 x i64> %store_forwarded, %wide.load
  %gep108 = getelementptr [100010 x i64], ptr getelementptr (i8, ptr @Y, i64 -8), i64 0, i64 %offset.idx
  store <2 x i64> %37, ptr %gep108, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 2
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %34, %n.vec
  br i1 %cmp.n, label %._crit_edge66, label %.lr.ph65.preheader106

.lr.ph62:                                         ; preds = %.preheader, %.lr.ph62
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph62 ], [ 0, %.preheader ]
  %39 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %indvars.iv85
  %40 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = tail call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @S, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %42 = load i32, ptr @Q, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next86, %43
  br i1 %44, label %.lr.ph62, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge66:                                    ; preds = %.lr.ph65, %middle.block, %._crit_edge
  %45 = load i64, ptr @A, align 16, !tbaa !11
  store i64 %45, ptr @Z, align 16, !tbaa !11
  %46 = icmp sgt i32 %20, 1
  br i1 %46, label %.lr.ph69.preheader, label %._crit_edge70

.lr.ph69.preheader:                               ; preds = %._crit_edge66
  %wide.trip.count = zext nneg i32 %20 to i64
  %47 = add nsw i64 %wide.trip.count, -1
  %48 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %47, 3
  %49 = icmp ult i64 %48, 3
  br i1 %49, label %._crit_edge70.loopexit.unr-lcssa, label %.lr.ph69.preheader.new

.lr.ph69.preheader.new:                           ; preds = %.lr.ph69.preheader
  %unroll_iter = and i64 %47, -4
  br label %.lr.ph69

.lr.ph65:                                         ; preds = %.lr.ph65.preheader106, %.lr.ph65
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph65 ], [ %indvars.iv88.ph, %.lr.ph65.preheader106 ]
  %50 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv88
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = add nuw nsw i64 %indvars.iv88, 2
  %53 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = add nsw i64 %54, %51
  %56 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %indvars.iv88
  store i64 %55, ptr %56, align 8, !tbaa !11
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
  %.not102 = icmp eq i64 %indvars.iv88, 0
  br i1 %.not102, label %._crit_edge66, label %.lr.ph65, !llvm.loop !17

._crit_edge70.loopexit.unr-lcssa:                 ; preds = %.lr.ph69, %.lr.ph69.preheader
  %.unr = phi i64 [ %45, %.lr.ph69.preheader ], [ %79, %.lr.ph69 ]
  %indvars.iv91.unr = phi i64 [ 1, %.lr.ph69.preheader ], [ %indvars.iv.next92.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.loopexit.unr-lcssa, %.lr.ph69.epil
  %57 = phi i64 [ %60, %.lr.ph69.epil ], [ %.unr, %._crit_edge70.loopexit.unr-lcssa ]
  %indvars.iv91.epil = phi i64 [ %indvars.iv.next92.epil, %.lr.ph69.epil ], [ %indvars.iv91.unr, %._crit_edge70.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph69.epil ], [ 0, %._crit_edge70.loopexit.unr-lcssa ]
  %58 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv91.epil
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = add nsw i64 %57, %59
  %61 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %indvars.iv91.epil
  store i64 %60, ptr %61, align 8, !tbaa !11
  %indvars.iv.next92.epil = add nuw nsw i64 %indvars.iv91.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 !18

._crit_edge70:                                    ; preds = %._crit_edge70.loopexit.unr-lcssa, %.lr.ph69.epil, %._crit_edge66
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @B, ptr noundef nonnull align 8 dereferenceable(8) @_ZL5infty)
  %62 = load i32, ptr @N, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph73, label %._crit_edge74

.lr.ph69:                                         ; preds = %.lr.ph69, %.lr.ph69.preheader.new
  %64 = phi i64 [ %45, %.lr.ph69.preheader.new ], [ %79, %.lr.ph69 ]
  %indvars.iv91 = phi i64 [ 1, %.lr.ph69.preheader.new ], [ %indvars.iv.next92.3, %.lr.ph69 ]
  %niter = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %niter.next.3, %.lr.ph69 ]
  %65 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv91
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = add nsw i64 %64, %66
  %68 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %indvars.iv91
  store i64 %67, ptr %68, align 8, !tbaa !11
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %69 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv.next92
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = add nsw i64 %67, %70
  %72 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %indvars.iv.next92
  store i64 %71, ptr %72, align 8, !tbaa !11
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91, 2
  %73 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv.next92.1
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = add nsw i64 %71, %74
  %76 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %indvars.iv.next92.1
  store i64 %75, ptr %76, align 8, !tbaa !11
  %indvars.iv.next92.2 = add nuw nsw i64 %indvars.iv91, 3
  %77 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv.next92.2
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = add nsw i64 %75, %78
  %80 = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %indvars.iv.next92.2
  store i64 %79, ptr %80, align 8, !tbaa !11
  %indvars.iv.next92.3 = add nuw nsw i64 %indvars.iv91, 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.loopexit.unr-lcssa, label %.lr.ph69, !llvm.loop !20

._crit_edge74:                                    ; preds = %.lr.ph73, %._crit_edge70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 -100000000007, ptr %1, align 8, !tbaa !11
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @B, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %81 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %81, ptr %2, align 8
  %82 = load i32, ptr @N, align 4, !tbaa !5
  %83 = icmp sgt i32 %82, -1
  br i1 %83, label %.lr.ph82.preheader, label %._crit_edge83

.lr.ph82.preheader:                               ; preds = %._crit_edge74
  %84 = zext nneg i32 %82 to i64
  br label %.lr.ph82

.lr.ph73:                                         ; preds = %._crit_edge70, %.lr.ph73
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph73 ], [ 0, %._crit_edge70 ]
  %85 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv94
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @B, ptr noundef nonnull align 8 dereferenceable(8) %85)
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %86 = load i32, ptr @N, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next95, %87
  br i1 %88, label %.lr.ph73, label %._crit_edge74, !llvm.loop !21

._crit_edge83:                                    ; preds = %._crit_edge77, %._crit_edge74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %89 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %89, ptr %4, align 8
  %90 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %90, label %137, label %136

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %._crit_edge77
  %indvars.iv97 = phi i64 [ %84, %.lr.ph82.preheader ], [ %indvars.iv.next98, %._crit_edge77 ]
  %91 = trunc nuw nsw i64 %indvars.iv97 to i32
  %92 = lshr i32 %91, 1
  %93 = sub nsw i32 %91, %92
  %94 = icmp eq i64 %indvars.iv97, 0
  br i1 %94, label %.thread, label %96

.thread:                                          ; preds = %.lr.ph82
  %95 = load i64, ptr @Y, align 16, !tbaa !11
  br label %121

96:                                               ; preds = %.lr.ph82
  %97 = icmp ne i32 %93, %92
  %98 = zext i1 %97 to i64
  %indvars.iv97.sink = add nuw nsw i64 %indvars.iv97, %98
  %.pn.in = add nsw i32 %93, -1
  %.pn = sext i32 %.pn.in to i64
  %.sink100.in = getelementptr inbounds [100010 x i64], ptr @Z, i64 0, i64 %.pn
  %.sink100 = load i64, ptr %.sink100.in, align 8, !tbaa !11
  %99 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %indvars.iv97.sink
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = add nsw i64 %100, %.sink100
  %102 = icmp eq i64 %indvars.iv97, 1
  br i1 %102, label %121, label %103

103:                                              ; preds = %96
  %104 = sext i32 %93 to i64
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %104) #7
  %106 = load i64, ptr %105, align 8, !tbaa !11
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %indvars.iv97) #7
  %108 = load i64, ptr %107, align 8, !tbaa !11
  %109 = add nsw i64 %108, %106
  %110 = sdiv i64 %109, 2
  %111 = add nsw i32 %93, 1
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %112) #7
  %114 = load i64, ptr %113, align 8, !tbaa !11
  %115 = add nuw nsw i64 %indvars.iv97, 1
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @B, i64 noundef %115) #7
  %117 = load i64, ptr %116, align 8, !tbaa !11
  %118 = add nsw i64 %117, %114
  %119 = sdiv i64 %118, 2
  %120 = add nsw i64 %119, 1
  br label %121

121:                                              ; preds = %.thread, %96, %103
  %.05459 = phi i64 [ %101, %103 ], [ %101, %96 ], [ %95, %.thread ]
  %.053 = phi i64 [ %110, %103 ], [ 100000000007, %96 ], [ 100000000007, %.thread ]
  %.052 = phi i64 [ %120, %103 ], [ -100000000007, %96 ], [ -100000000007, %.thread ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %122 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %122, ptr %3, align 8
  %123 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br i1 %123, label %.lr.ph76, label %._crit_edge77

.lr.ph76:                                         ; preds = %121, %129
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  %125 = load i64, ptr %124, align 8, !tbaa !11
  %.not = icmp sgt i64 %.052, %125
  br i1 %.not, label %._crit_edge77, label %126

126:                                              ; preds = %.lr.ph76
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  %128 = load i64, ptr %127, align 8, !tbaa !11
  %.not57 = icmp sgt i64 %128, %.053
  br i1 %.not57, label %._crit_edge77, label %129

129:                                              ; preds = %126
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @M, ptr noundef nonnull align 8 dereferenceable(8) %130)
  store i64 %.05459, ptr %131, align 8, !tbaa !11
  %132 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %133 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %133, ptr %3, align 8
  %134 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br i1 %134, label %.lr.ph76, label %._crit_edge77, !llvm.loop !22

._crit_edge77:                                    ; preds = %129, %126, %.lr.ph76, %121
  %indvars.iv.next98 = add nsw i64 %indvars.iv97, -1
  %135 = icmp sgt i64 %indvars.iv97, 0
  br i1 %135, label %.lr.ph82, label %._crit_edge83, !llvm.loop !23

136:                                              ; preds = %._crit_edge83
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 137, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

137:                                              ; preds = %._crit_edge83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @_Z5flushv()
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass