; LLVM IR from DionysiosB/CodeForces :: 0800-0899 (808D-ArrayDivision)

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

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

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

23:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %43, %23
  %25 = load i64, ptr %8, align 8, !tbaa !5
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %33, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %50

29:                                               ; preds = %0
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %5, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %194

33:                                               ; preds = %24
  %34 = load i64, ptr %8, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %34) #5
  %36 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %35)
          to label %37 unwind label %46

37:                                               ; preds = %33
  %38 = load i64, ptr %8, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %38) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = load i64, ptr %7, align 8, !tbaa !5
  %42 = add nsw i64 %41, %40
  store i64 %42, ptr %7, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %37
  %44 = load i64, ptr %8, align 8, !tbaa !5
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %8, align 8, !tbaa !5
  br label %24, !llvm.loop !9

46:                                               ; preds = %33
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %193

50:                                               ; preds = %28
  %51 = load i64, ptr %7, align 8, !tbaa !5
  %52 = and i64 %51, 1
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = invoke i32 @puts(ptr noundef @.str.1)
          to label %56 unwind label %57

56:                                               ; preds = %54
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %191

57:                                               ; preds = %54
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  br label %193

61:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  store i8 0, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %112, %61
  %63 = load i64, ptr %13, align 8, !tbaa !5
  %64 = load i64, ptr %2, align 8, !tbaa !5
  %65 = icmp slt i64 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 5, ptr %9, align 4
  br label %115

67:                                               ; preds = %62
  %68 = load i64, ptr %13, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %68) #5
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = load i64, ptr %11, align 8, !tbaa !5
  %72 = add nsw i64 %71, %70
  store i64 %72, ptr %11, align 8, !tbaa !5
  %73 = load i64, ptr %13, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %73) #5
  %75 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %74)
          to label %76 unwind label %86

76:                                               ; preds = %67
  %77 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %78 = extractvalue { ptr, i8 } %75, 0
  store ptr %78, ptr %77, align 8
  %79 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %80 = extractvalue { ptr, i8 } %75, 1
  store i8 %80, ptr %79, align 8
  %81 = load i64, ptr %11, align 8, !tbaa !5
  %82 = mul nsw i64 2, %81
  %83 = load i64, ptr %7, align 8, !tbaa !5
  %84 = icmp eq i64 %82, %83
  br i1 %84, label %85, label %90

85:                                               ; preds = %76
  store i8 1, ptr %10, align 1, !tbaa !11
  store i32 5, ptr %9, align 4
  br label %115

86:                                               ; preds = %67
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %5, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %6, align 4
  br label %116

90:                                               ; preds = %76
  %91 = load i64, ptr %11, align 8, !tbaa !5
  %92 = mul nsw i64 2, %91
  %93 = load i64, ptr %7, align 8, !tbaa !5
  %94 = icmp sgt i64 %92, %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  br i1 %94, label %95, label %103

95:                                               ; preds = %90
  %96 = load i64, ptr %11, align 8, !tbaa !5
  %97 = load i64, ptr %7, align 8, !tbaa !5
  %98 = sdiv i64 %97, 2
  %99 = sub nsw i64 %96, %98
  store i64 %99, ptr %15, align 8, !tbaa !5
  %100 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %101 unwind label %106

101:                                              ; preds = %95
  %102 = icmp ne i64 %100, 0
  br label %103

103:                                              ; preds = %101, %90
  %104 = phi i1 [ false, %90 ], [ %102, %101 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br i1 %104, label %105, label %110

105:                                              ; preds = %103
  store i8 1, ptr %10, align 1, !tbaa !11
  store i32 5, ptr %9, align 4
  br label %115

106:                                              ; preds = %95
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %5, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %116

110:                                              ; preds = %103
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  %113 = load i64, ptr %13, align 8, !tbaa !5
  %114 = add nsw i64 %113, 1
  store i64 %114, ptr %13, align 8, !tbaa !5
  br label %62, !llvm.loop !13

115:                                              ; preds = %105, %85, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %117

116:                                              ; preds = %106, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %190

117:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %118 = load i64, ptr %2, align 8, !tbaa !5
  %119 = sub nsw i64 %118, 1
  store i64 %119, ptr %18, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %173, %117
  %121 = load i64, ptr %18, align 8, !tbaa !5
  %122 = icmp sge i64 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  store i32 8, ptr %9, align 4
  br label %176

124:                                              ; preds = %120
  %125 = load i8, ptr %10, align 1, !tbaa !11, !range !14, !noundef !15
  %126 = trunc i8 %125 to i1
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  store i32 8, ptr %9, align 4
  br label %176

128:                                              ; preds = %124
  %129 = load i64, ptr %18, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %129) #5
  %131 = load i64, ptr %130, align 8, !tbaa !5
  %132 = load i64, ptr %16, align 8, !tbaa !5
  %133 = add nsw i64 %132, %131
  store i64 %133, ptr %16, align 8, !tbaa !5
  %134 = load i64, ptr %18, align 8, !tbaa !5
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %134) #5
  %136 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 8 dereferenceable(8) %135)
          to label %137 unwind label %147

137:                                              ; preds = %128
  %138 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %139 = extractvalue { ptr, i8 } %136, 0
  store ptr %139, ptr %138, align 8
  %140 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %141 = extractvalue { ptr, i8 } %136, 1
  store i8 %141, ptr %140, align 8
  %142 = load i64, ptr %16, align 8, !tbaa !5
  %143 = mul nsw i64 2, %142
  %144 = load i64, ptr %7, align 8, !tbaa !5
  %145 = icmp eq i64 %143, %144
  br i1 %145, label %146, label %151

146:                                              ; preds = %137
  store i8 1, ptr %10, align 1, !tbaa !11
  store i32 8, ptr %9, align 4
  br label %176

147:                                              ; preds = %128
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %5, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %6, align 4
  br label %177

151:                                              ; preds = %137
  %152 = load i64, ptr %16, align 8, !tbaa !5
  %153 = mul nsw i64 2, %152
  %154 = load i64, ptr %7, align 8, !tbaa !5
  %155 = icmp sgt i64 %153, %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  br i1 %155, label %156, label %164

156:                                              ; preds = %151
  %157 = load i64, ptr %16, align 8, !tbaa !5
  %158 = load i64, ptr %7, align 8, !tbaa !5
  %159 = sdiv i64 %158, 2
  %160 = sub nsw i64 %157, %159
  store i64 %160, ptr %20, align 8, !tbaa !5
  %161 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %162 unwind label %167

162:                                              ; preds = %156
  %163 = icmp ne i64 %161, 0
  br label %164

164:                                              ; preds = %162, %151
  %165 = phi i1 [ false, %151 ], [ %163, %162 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br i1 %165, label %166, label %171

166:                                              ; preds = %164
  store i8 1, ptr %10, align 1, !tbaa !11
  store i32 8, ptr %9, align 4
  br label %176

167:                                              ; preds = %156
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %5, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %177

171:                                              ; preds = %164
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172
  %174 = load i64, ptr %18, align 8, !tbaa !5
  %175 = add nsw i64 %174, -1
  store i64 %175, ptr %18, align 8, !tbaa !5
  br label %120, !llvm.loop !16

176:                                              ; preds = %166, %146, %127, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %178

177:                                              ; preds = %167, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %189

178:                                              ; preds = %176
  %179 = load i8, ptr %10, align 1, !tbaa !11, !range !14, !noundef !15
  %180 = trunc i8 %179 to i1
  %181 = zext i1 %180 to i64
  %182 = select i1 %180, ptr @.str.2, ptr @.str.1
  %183 = invoke i32 @puts(ptr noundef %182)
          to label %184 unwind label %185

184:                                              ; preds = %178
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %191

185:                                              ; preds = %178
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %5, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %6, align 4
  br label %189

189:                                              ; preds = %185, %177
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %190

190:                                              ; preds = %189, %116
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %193

191:                                              ; preds = %184, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %192 = load i32, ptr %1, align 4
  ret i32 %192

193:                                              ; preds = %190, %57, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %194

194:                                              ; preds = %193, %29
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %5, align 8
  %197 = load i32, ptr %6, align 4
  %198 = insertvalue { ptr, i32 } poison, ptr %196, 0
  %199 = insertvalue { ptr, i32 } %198, i32 %197, 1
  resume { ptr, i32 } %199
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

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

declare i32 @puts(ptr noundef) #2

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !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, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::set", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::set", align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %9 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %10 unwind label %14

10:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  %11 = load i64, ptr %1, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %.lr.ph
  %13 = and i64 %20, 1
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %._crit_edge.thread, label %24

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  br label %82

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.04358 = phi i64 [ %20, %.lr.ph ], [ 0, %10 ]
  %.04857 = phi i64 [ %21, %.lr.ph ], [ 0, %10 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04857) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04857) #5
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = add nsw i64 %19, %.04358
  %21 = add nuw nsw i64 %.04857, 1
  %22 = load i64, ptr %1, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !9

24:                                               ; preds = %._crit_edge
  %25 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %81

._crit_edge.thread:                               ; preds = %10, %._crit_edge
  %.043.lcssa84 = phi i64 [ %20, %._crit_edge ], [ 0, %10 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %26 = load i64, ptr %1, align 8, !tbaa !5
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %.lr.ph62, label %._crit_edge63

.lr.ph62:                                         ; preds = %._crit_edge.thread
  %28 = ashr exact i64 %.043.lcssa84, 1
  br label %29

29:                                               ; preds = %.lr.ph62, %48
  %.04460 = phi i64 [ 0, %.lr.ph62 ], [ %49, %48 ]
  %.04559 = phi i64 [ 0, %.lr.ph62 ], [ %32, %48 ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04460) #5
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = add nsw i64 %31, %.04559
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04460) #5
  %34 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %35 unwind label %38

35:                                               ; preds = %29
  %36 = shl nsw i64 %32, 1
  %37 = icmp eq i64 %36, %.043.lcssa84
  br i1 %37, label %._crit_edge63, label %40

38:                                               ; preds = %29
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %80

40:                                               ; preds = %35
  %41 = icmp sgt i64 %36, %.043.lcssa84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  br i1 %41, label %42, label %.critedge

42:                                               ; preds = %40
  %43 = sub nsw i64 %32, %28
  store i64 %43, ptr %5, align 8, !tbaa !5
  %44 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %45 unwind label %46

45:                                               ; preds = %42
  %.not51 = icmp eq i64 %44, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %.not51, label %48, label %._crit_edge63

46:                                               ; preds = %42
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %80

.critedge:                                        ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %48

48:                                               ; preds = %.critedge, %45
  %49 = add nuw nsw i64 %.04460, 1
  %50 = load i64, ptr %1, align 8, !tbaa !5
  %51 = icmp slt i64 %49, %50
  br i1 %51, label %29, label %._crit_edge63, !llvm.loop !11

._crit_edge63:                                    ; preds = %48, %35, %45, %._crit_edge.thread
  %.046 = phi i8 [ 0, %._crit_edge.thread ], [ 1, %45 ], [ 1, %35 ], [ 0, %48 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %52 = load i64, ptr %1, align 8, !tbaa !5
  %53 = icmp sgt i64 %52, 0
  br i1 %53, label %.lr.ph73, label %._crit_edge74

.lr.ph73:                                         ; preds = %._crit_edge63
  %54 = trunc nuw i8 %.046 to i1
  %55 = ashr exact i64 %.043.lcssa84, 1
  br i1 %54, label %._crit_edge74, label %.lr.ph73.split

.lr.ph73.split:                                   ; preds = %.lr.ph73, %74
  %.03771.in = phi i64 [ %.03771, %74 ], [ %52, %.lr.ph73 ]
  %.03870 = phi i64 [ %58, %74 ], [ 0, %.lr.ph73 ]
  %.03771 = add nsw i64 %.03771.in, -1
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03771) #5
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = add nsw i64 %57, %.03870
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03771) #5
  %60 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %59)
          to label %61 unwind label %64

61:                                               ; preds = %.lr.ph73.split
  %62 = shl nsw i64 %58, 1
  %63 = icmp eq i64 %62, %.043.lcssa84
  br i1 %63, label %._crit_edge74, label %66

64:                                               ; preds = %.lr.ph73.split
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %79

66:                                               ; preds = %61
  %67 = icmp sgt i64 %62, %.043.lcssa84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  br i1 %67, label %68, label %.critedge2

68:                                               ; preds = %66
  %69 = sub nsw i64 %58, %55
  store i64 %69, ptr %7, align 8, !tbaa !5
  %70 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %71 unwind label %72

71:                                               ; preds = %68
  %.not56 = icmp eq i64 %70, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %.not56, label %74, label %._crit_edge74

72:                                               ; preds = %68
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %79

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

74:                                               ; preds = %.critedge2, %71
  %75 = icmp ugt i64 %.03771.in, 1
  br i1 %75, label %.lr.ph73.split, label %._crit_edge74, !llvm.loop !12

._crit_edge74:                                    ; preds = %74, %61, %71, %.lr.ph73, %._crit_edge63
  %.147 = phi i8 [ %.046, %._crit_edge63 ], [ %.046, %.lr.ph73 ], [ 1, %71 ], [ 1, %61 ], [ %.046, %74 ]
  %76 = trunc nuw i8 %.147 to i1
  %77 = select i1 %76, ptr @.str.2, ptr @.str.1
  %78 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %77)
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  br label %81

79:                                               ; preds = %72, %64
  %.pn52 = phi { ptr, i32 } [ %73, %72 ], [ %65, %64 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  br label %80

80:                                               ; preds = %38, %46, %79
  %.pn52.pn = phi { ptr, i32 } [ %.pn52, %79 ], [ %47, %46 ], [ %39, %38 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  br label %82

81:                                               ; preds = %._crit_edge74, %24
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

82:                                               ; preds = %80, %14
  %.pn52.pn.pn = phi { ptr, i32 } [ %.pn52.pn, %80 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn52.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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