; LLVM IR from eyangch/competitive-programming :: Codeforces/1647 (e)

; 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"

%struct.lift = type { [31 x [100000 x i64]] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"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 i64, align 8
@P = external dso_local global [100000 x i64], align 16
@A = external dso_local global [100000 x i64], align 16
@in = external dso_local global [100000 x i64], align 16
@ans = external dso_local global [100000 x i64], align 16
@vis = external dso_local global [100000 x i8], align 16
@L = external dso_local global %struct.lift, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::set", align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %23 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  %28 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %30

30:                                               ; preds = %49, %0
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %52

35:                                               ; preds = %30
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %39 = load i64, ptr %2, align 8, !tbaa !8
  %40 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = add nsw i64 %41, -1
  store i64 %42, ptr %40, align 8, !tbaa !8
  %43 = load i64, ptr %2, align 8, !tbaa !8
  %44 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = getelementptr inbounds [100000 x i64], ptr @in, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %46, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %35
  %50 = load i64, ptr %2, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %2, align 8, !tbaa !8
  br label %30, !llvm.loop !11

52:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %66, %52
  %54 = load i64, ptr %3, align 8, !tbaa !8
  %55 = load i64, ptr @N, align 8, !tbaa !8
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %69

58:                                               ; preds = %53
  %59 = load i64, ptr %3, align 8, !tbaa !8
  %60 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %59
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %60)
  %62 = load i64, ptr %3, align 8, !tbaa !8
  %63 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr %63, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %58
  %67 = load i64, ptr %3, align 8, !tbaa !8
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %3, align 8, !tbaa !8
  br label %53, !llvm.loop !13

69:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %84, %69
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = load i64, ptr @N, align 8, !tbaa !8
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %87

75:                                               ; preds = %70
  %76 = load i64, ptr %5, align 8, !tbaa !8
  %77 = getelementptr inbounds [100000 x i64], ptr @in, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !8
  %79 = icmp eq i64 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %75
  %81 = load i64, ptr %4, align 8, !tbaa !8
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %4, align 8, !tbaa !8
  br label %83

83:                                               ; preds = %80, %75
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %5, align 8, !tbaa !8
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %5, align 8, !tbaa !8
  br label %70, !llvm.loop !14

87:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %88 = load i64, ptr @N, align 8, !tbaa !8
  %89 = getelementptr inbounds i64, ptr @A, i64 %88
  %90 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef @A, ptr noundef %89)
  %91 = load i64, ptr %90, align 8, !tbaa !8
  store i64 %91, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %92 = load i64, ptr %6, align 8, !tbaa !8
  %93 = load i64, ptr @N, align 8, !tbaa !8
  %94 = sub nsw i64 %93, 1
  %95 = sub nsw i64 %92, %94
  %96 = load i64, ptr %4, align 8, !tbaa !8
  %97 = sdiv i64 %95, %96
  store i64 %97, ptr %7, align 8, !tbaa !8
  %98 = load i64, ptr @N, align 8, !tbaa !8
  call void @_ZN4lift4initExRA100000_x(ptr noundef nonnull align 8 dereferenceable(24800000) @L, i64 noundef %98, ptr noundef nonnull align 8 dereferenceable(800000) @P)
  %99 = load i64, ptr @N, align 8, !tbaa !8
  %100 = getelementptr inbounds i64, ptr @ans, i64 %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 -1, ptr %8, align 4, !tbaa !15
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @ans, ptr noundef %100, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #7
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %101

101:                                              ; preds = %113, %87
  %102 = load i64, ptr %10, align 8, !tbaa !8
  %103 = load i64, ptr @N, align 8, !tbaa !8
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %120

106:                                              ; preds = %101
  %107 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %108 unwind label %116

108:                                              ; preds = %106
  %109 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %110 = extractvalue { ptr, i8 } %107, 0
  store ptr %110, ptr %109, align 8
  %111 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %112 = extractvalue { ptr, i8 } %107, 1
  store i8 %112, ptr %111, align 8
  br label %113

113:                                              ; preds = %108
  %114 = load i64, ptr %10, align 8, !tbaa !8
  %115 = add nsw i64 %114, 1
  store i64 %115, ptr %10, align 8, !tbaa !8
  br label %101, !llvm.loop !17

116:                                              ; preds = %106
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %11, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %232

120:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %121

121:                                              ; preds = %155, %120
  %122 = load i64, ptr %14, align 8, !tbaa !8
  %123 = load i64, ptr @N, align 8, !tbaa !8
  %124 = icmp slt i64 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %158

126:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %127 = load i64, ptr %14, align 8, !tbaa !8
  %128 = load i64, ptr %7, align 8, !tbaa !8
  %129 = invoke noundef i64 @_ZN4lift4jumpExx(ptr noundef nonnull align 8 dereferenceable(24800000) @L, i64 noundef %127, i64 noundef %128)
          to label %130 unwind label %136

130:                                              ; preds = %126
  store i64 %129, ptr %16, align 8, !tbaa !8
  %131 = load i64, ptr %16, align 8, !tbaa !8
  %132 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !18, !range !20, !noundef !21
  %134 = trunc i8 %133 to i1
  br i1 %134, label %135, label %140

135:                                              ; preds = %130
  store i32 16, ptr %15, align 4
  br label %152

136:                                              ; preds = %140, %126
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %11, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %232

140:                                              ; preds = %130
  %141 = load i64, ptr %16, align 8, !tbaa !8
  %142 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %141
  store i8 1, ptr %142, align 1, !tbaa !18
  %143 = load i64, ptr %16, align 8, !tbaa !8
  %144 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !8
  %146 = load i64, ptr %14, align 8, !tbaa !8
  %147 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %146
  store i64 %145, ptr %147, align 8, !tbaa !8
  %148 = load i64, ptr %16, align 8, !tbaa !8
  %149 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %148
  %150 = invoke noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(8) %149)
          to label %151 unwind label %136

151:                                              ; preds = %140
  store i32 0, ptr %15, align 4
  br label %152

152:                                              ; preds = %151, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %153 = load i32, ptr %15, align 4
  switch i32 %153, label %238 [
    i32 0, label %154
    i32 16, label %155
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154, %152
  %156 = load i64, ptr %14, align 8, !tbaa !8
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %14, align 8, !tbaa !8
  br label %121, !llvm.loop !22

158:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %159

159:                                              ; preds = %190, %158
  %160 = load i64, ptr %17, align 8, !tbaa !8
  %161 = load i64, ptr @N, align 8, !tbaa !8
  %162 = icmp slt i64 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %202

164:                                              ; preds = %159
  %165 = load i64, ptr %17, align 8, !tbaa !8
  %166 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !8
  %168 = xor i64 %167, -1
  %169 = icmp ne i64 %168, 0
  br i1 %169, label %170, label %171

170:                                              ; preds = %164
  br label %190

171:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %172 = load i64, ptr %17, align 8, !tbaa !8
  %173 = load i64, ptr %7, align 8, !tbaa !8
  %174 = invoke noundef i64 @_ZN4lift4jumpExx(ptr noundef nonnull align 8 dereferenceable(24800000) @L, i64 noundef %172, i64 noundef %173)
          to label %175 unwind label %193

175:                                              ; preds = %171
  store i64 %174, ptr %18, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %176 = load i64, ptr %18, align 8, !tbaa !8
  %177 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %176
  %178 = invoke ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(8) %177)
          to label %179 unwind label %197

179:                                              ; preds = %175
  %180 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %178, ptr %180, align 8
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %182 = load i64, ptr %181, align 8, !tbaa !8
  %183 = load i64, ptr %17, align 8, !tbaa !8
  %184 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %183
  store i64 %182, ptr %184, align 8, !tbaa !8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !23
  %185 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8
  %187 = invoke ptr @_ZNSt3setIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr %186)
          to label %188 unwind label %197

188:                                              ; preds = %179
  %189 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %187, ptr %189, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %190

190:                                              ; preds = %188, %170
  %191 = load i64, ptr %17, align 8, !tbaa !8
  %192 = add nsw i64 %191, 1
  store i64 %192, ptr %17, align 8, !tbaa !8
  br label %159, !llvm.loop !26

193:                                              ; preds = %171
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %11, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %12, align 4
  br label %201

197:                                              ; preds = %179, %175
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %11, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %201

201:                                              ; preds = %197, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %232

202:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !8
  br label %203

203:                                              ; preds = %217, %202
  %204 = load i64, ptr %22, align 8, !tbaa !8
  %205 = load i64, ptr @N, align 8, !tbaa !8
  %206 = icmp slt i64 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 20, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %224

208:                                              ; preds = %203
  %209 = load i64, ptr %22, align 8, !tbaa !8
  %210 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %209
  %211 = load i64, ptr %210, align 8, !tbaa !8
  %212 = add nsw i64 %211, 1
  %213 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %212)
          to label %214 unwind label %220

214:                                              ; preds = %208
  %215 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %213, i8 noundef signext 32)
          to label %216 unwind label %220

216:                                              ; preds = %214
  br label %217

217:                                              ; preds = %216
  %218 = load i64, ptr %22, align 8, !tbaa !8
  %219 = add nsw i64 %218, 1
  store i64 %219, ptr %22, align 8, !tbaa !8
  br label %203, !llvm.loop !27

220:                                              ; preds = %214, %208
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %11, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %232

224:                                              ; preds = %207
  %225 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %226 unwind label %228

226:                                              ; preds = %224
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  %227 = load i32, ptr %1, align 4
  ret i32 %227

228:                                              ; preds = %224
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %11, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %12, align 4
  br label %232

232:                                              ; preds = %228, %220, %201, %136, %116
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %233

233:                                              ; preds = %232
  %234 = load ptr, ptr %11, align 8
  %235 = load i32, ptr %12, align 4
  %236 = insertvalue { ptr, i32 } poison, ptr %234, 0
  %237 = insertvalue { ptr, i32 } %236, i32 %235, 1
  resume { ptr, i32 } %237

238:                                              ; preds = %152
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4lift4initExRA100000_x(ptr noundef nonnull align 8 dereferenceable(24800000), i64 noundef, ptr noundef nonnull align 8 dereferenceable(800000)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4lift4jumpExx(ptr noundef nonnull align 8 dereferenceable(24800000), i64 noundef, i64 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 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)) #1 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 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 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !12}
!23 = !{i64 0, i64 8, !24}
!24 = !{!25, !25, i64 0}
!25 = !{!"any pointer", !10, i64 0}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.lift = type { [31 x [100000 x i64]] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i64, align 8
@P = external dso_local global [100000 x i64], align 16
@A = external dso_local global [100000 x i64], align 16
@in = external dso_local local_unnamed_addr global [100000 x i64], align 16
@ans = external dso_local global [100000 x i64], align 16
@vis = external dso_local local_unnamed_addr global [100000 x i8], align 16
@L = external dso_local global %struct.lift, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::set", align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %12 = load i64, ptr @N, align 8, !tbaa !8
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.preheader51:                                     ; preds = %.lr.ph
  %14 = icmp sgt i64 %23, 0
  br i1 %14, label %.lr.ph54, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03852 = phi i64 [ %22, %.lr.ph ], [ 0, %0 ]
  %15 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %.03852
  %16 = 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) %15)
  %17 = load i64, ptr %15, align 8, !tbaa !8
  %18 = add nsw i64 %17, -1
  store i64 %18, ptr %15, align 8, !tbaa !8
  %19 = getelementptr inbounds [100000 x i64], ptr @in, i64 0, i64 %18
  %20 = load i64, ptr %19, align 8, !tbaa !8
  %21 = add nsw i64 %20, 1
  store i64 %21, ptr %19, align 8, !tbaa !8
  %22 = add nuw nsw i64 %.03852, 1
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %.lr.ph, label %.preheader51, !llvm.loop !11

.preheader50:                                     ; preds = %.lr.ph54
  %25 = icmp sgt i64 %41, 0
  br i1 %25, label %.lr.ph57.preheader, label %._crit_edge

.lr.ph57.preheader:                               ; preds = %.preheader50
  %min.iters.check = icmp ult i64 %41, 4
  br i1 %min.iters.check, label %.lr.ph57.preheader85, label %vector.ph

.lr.ph57.preheader85:                             ; preds = %middle.block, %.lr.ph57.preheader
  %.04056.ph = phi i64 [ 0, %.lr.ph57.preheader ], [ %35, %middle.block ]
  %.04255.ph = phi i64 [ 0, %.lr.ph57.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph57

vector.ph:                                        ; preds = %.lr.ph57.preheader
  %n.vec = and i64 %41, 9223372036854775804
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %32, %vector.body ]
  %vec.phi81 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %33, %vector.body ]
  %26 = getelementptr inbounds [100000 x i64], ptr @in, i64 0, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <2 x i64>, ptr %26, align 16, !tbaa !8
  %wide.load82 = load <2 x i64>, ptr %27, align 16, !tbaa !8
  %28 = icmp eq <2 x i64> %wide.load, zeroinitializer
  %29 = icmp eq <2 x i64> %wide.load82, zeroinitializer
  %30 = zext <2 x i1> %28 to <2 x i64>
  %31 = zext <2 x i1> %29 to <2 x i64>
  %32 = add <2 x i64> %vec.phi, %30
  %33 = add <2 x i64> %vec.phi81, %31
  %index.next = add nuw i64 %index, 4
  %34 = icmp eq i64 %index.next, %n.vec
  br i1 %34, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %33, %32
  %35 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %41, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph57.preheader85

.lr.ph54:                                         ; preds = %.preheader51, %.lr.ph54
  %.03953 = phi i64 [ %40, %.lr.ph54 ], [ 0, %.preheader51 ]
  %36 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.03953
  %37 = 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) %36)
  %38 = load i64, ptr %36, align 8, !tbaa !8
  %39 = add nsw i64 %38, -1
  store i64 %39, ptr %36, align 8, !tbaa !8
  %40 = add nuw nsw i64 %.03953, 1
  %41 = load i64, ptr @N, align 8, !tbaa !8
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %.lr.ph54, label %.preheader50, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph57, %middle.block, %0, %.preheader51, %.preheader50
  %.lcssa72 = phi i64 [ %41, %.preheader50 ], [ %23, %.preheader51 ], [ %12, %0 ], [ %41, %middle.block ], [ %41, %.lr.ph57 ]
  %.040.lcssa = phi i64 [ 0, %.preheader50 ], [ 0, %.preheader51 ], [ 0, %0 ], [ %35, %middle.block ], [ %spec.select, %.lr.ph57 ]
  %43 = getelementptr inbounds i64, ptr @A, i64 %.lcssa72
  %44 = tail call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef nonnull @A, ptr noundef nonnull %43)
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %.neg48 = add i64 %45, 1
  %47 = sub i64 %.neg48, %46
  %48 = sdiv i64 %47, %.040.lcssa
  tail call void @_ZN4lift4initExRA100000_x(ptr noundef nonnull align 8 dereferenceable(24800000) @L, i64 noundef %46, ptr noundef nonnull align 8 dereferenceable(800000) @P)
  %49 = load i64, ptr @N, align 8, !tbaa !8
  %50 = getelementptr inbounds i64, ptr @ans, i64 %49
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 -1, ptr %1, align 4, !tbaa !17
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @ans, ptr noundef nonnull %50, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #7
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  %51 = load i64, ptr @N, align 8, !tbaa !8
  %52 = icmp sgt i64 %51, 0
  br i1 %52, label %.lr.ph60, label %._crit_edge61.thread

._crit_edge61.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %._crit_edge69

.lr.ph57:                                         ; preds = %.lr.ph57.preheader85, %.lr.ph57
  %.04056 = phi i64 [ %spec.select, %.lr.ph57 ], [ %.04056.ph, %.lr.ph57.preheader85 ]
  %.04255 = phi i64 [ %57, %.lr.ph57 ], [ %.04255.ph, %.lr.ph57.preheader85 ]
  %53 = getelementptr inbounds [100000 x i64], ptr @in, i64 0, i64 %.04255
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = icmp eq i64 %54, 0
  %56 = zext i1 %55 to i64
  %spec.select = add nuw nsw i64 %.04056, %56
  %57 = add nuw nsw i64 %.04255, 1
  %exitcond.not = icmp eq i64 %57, %41
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph57, !llvm.loop !19

._crit_edge61:                                    ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %58 = icmp sgt i64 %63, 0
  br i1 %58, label %.lr.ph64, label %._crit_edge69

.lr.ph60:                                         ; preds = %._crit_edge, %60
  %59 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %60 unwind label %65

60:                                               ; preds = %.lr.ph60
  %61 = load i64, ptr %3, align 8, !tbaa !8
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %3, align 8, !tbaa !8
  %63 = load i64, ptr @N, align 8, !tbaa !8
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %.lr.ph60, label %._crit_edge61, !llvm.loop !20

65:                                               ; preds = %.lr.ph60
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %118

.preheader49:                                     ; preds = %79
  %67 = icmp sgt i64 %81, 0
  br i1 %67, label %.lr.ph66, label %._crit_edge69

.lr.ph64:                                         ; preds = %._crit_edge61, %79
  %.04362 = phi i64 [ %80, %79 ], [ 0, %._crit_edge61 ]
  %68 = call noundef i64 @_ZN4lift4jumpExx(ptr noundef nonnull align 8 dereferenceable(24800000) @L, i64 noundef %.04362, i64 noundef %48)
  %69 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !21, !range !23, !noundef !24
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %79, label %74

72:                                               ; preds = %74
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %118

74:                                               ; preds = %.lr.ph64
  store i8 1, ptr %69, align 1, !tbaa !21
  %75 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %68
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.04362
  store i64 %76, ptr %77, align 8, !tbaa !8
  %78 = invoke noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %75)
          to label %79 unwind label %72

79:                                               ; preds = %74, %.lr.ph64
  %80 = add nuw nsw i64 %.04362, 1
  %81 = load i64, ptr @N, align 8, !tbaa !8
  %82 = icmp slt i64 %80, %81
  br i1 %82, label %.lr.ph64, label %.preheader49, !llvm.loop !25

.preheader:                                       ; preds = %96
  %83 = icmp sgt i64 %97, 0
  br i1 %83, label %.lr.ph68, label %._crit_edge69

.lr.ph66:                                         ; preds = %.preheader49, %96
  %84 = phi i64 [ %97, %96 ], [ %81, %.preheader49 ]
  %.04165 = phi i64 [ %98, %96 ], [ 0, %.preheader49 ]
  %85 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.04165
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %.not = icmp eq i64 %86, -1
  br i1 %.not, label %87, label %96

87:                                               ; preds = %.lr.ph66
  %88 = call noundef i64 @_ZN4lift4jumpExx(ptr noundef nonnull align 8 dereferenceable(24800000) @L, i64 noundef %.04165, i64 noundef %48)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %89 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %88
  %90 = invoke ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %89)
          to label %91 unwind label %100

91:                                               ; preds = %87
  store ptr %90, ptr %4, align 8
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %93 = load i64, ptr %92, align 8, !tbaa !8
  store i64 %93, ptr %85, align 8, !tbaa !8
  %.sroa.03.0.copyload = load ptr, ptr %4, align 8, !tbaa !26
  %94 = invoke ptr @_ZNSt3setIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr %.sroa.03.0.copyload)
          to label %95 unwind label %100

95:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %96

96:                                               ; preds = %.lr.ph66, %95
  %97 = phi i64 [ %84, %.lr.ph66 ], [ %.pre, %95 ]
  %98 = add nuw nsw i64 %.04165, 1
  %99 = icmp slt i64 %98, %97
  br i1 %99, label %.lr.ph66, label %.preheader, !llvm.loop !28

100:                                              ; preds = %91, %87
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %118

._crit_edge69:                                    ; preds = %109, %._crit_edge61.thread, %._crit_edge61, %.preheader49, %.preheader
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %115 unwind label %116

.lr.ph68:                                         ; preds = %.preheader, %109
  %.067 = phi i64 [ %110, %109 ], [ 0, %.preheader ]
  %103 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.067
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = add nsw i64 %104, 1
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %105)
          to label %107 unwind label %113

107:                                              ; preds = %.lr.ph68
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %106, i8 noundef signext 32)
          to label %109 unwind label %113

109:                                              ; preds = %107
  %110 = add nuw nsw i64 %.067, 1
  %111 = load i64, ptr @N, align 8, !tbaa !8
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %.lr.ph68, label %._crit_edge69, !llvm.loop !29

113:                                              ; preds = %107, %.lr.ph68
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %118

115:                                              ; preds = %._crit_edge69
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  ret i32 0

116:                                              ; preds = %._crit_edge69
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %118

118:                                              ; preds = %116, %113, %100, %72, %65
  %.pn = phi { ptr, i32 } [ %66, %65 ], [ %73, %72 ], [ %101, %100 ], [ %114, %113 ], [ %117, %116 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4lift4initExRA100000_x(ptr noundef nonnull align 8 dereferenceable(24800000), i64 noundef, ptr noundef nonnull align 8 dereferenceable(800000)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4lift4jumpExx(ptr noundef nonnull align 8 dereferenceable(24800000), i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 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 #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !10, i64 0}
!19 = distinct !{!19, !12, !15, !14}
!20 = distinct !{!20, !12}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !10, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !12}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !10, i64 0}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}


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