; LLVM IR from eyangch/competitive-programming :: Codeforces/799 (c)

; 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::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.anon = type { i8 }
%class.anon.3 = type { i8 }
%"class.std::initializer_list" = type { ptr, i64 }

@N = external dso_local global i64, align 8
@C = external dso_local global i64, align 8
@D = external dso_local global i64, align 8
@cN = external dso_local global i64, align 8
@dN = external dso_local global i64, align 8
@cI = external dso_local global [100000 x i64], align 16
@dI = external dso_local global [100000 x i64], align 16
@cc = external dso_local global %"class.std::vector", align 8
@cd = external dso_local global %"class.std::vector", align 8
@bc = external dso_local global %"class.std::vector", align 8
@bd = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5clownxxRSt6vectorIxSaIxEES2_RA100000_x(i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(800000)) #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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i8, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %class.anon, align 1
  %7 = alloca %class.anon.3, align 1
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %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 %"class.std::initializer_list", align 8
  %19 = alloca [4 x i64], align 8
  store i32 0, ptr %1, align 4
  %20 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %22
  %24 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %23, ptr noundef null)
  %25 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %26 = 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)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) @C)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) @D)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %29

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

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

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %38 = load i8, ptr %3, align 1, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 67
  br i1 %40, label %41, label %42

41:                                               ; preds = %34
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @bc, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @cc, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %43

42:                                               ; preds = %34
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @bd, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @cd, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %43

43:                                               ; preds = %42, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %44

44:                                               ; preds = %43
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %2, align 8, !tbaa !8
  br label %29, !llvm.loop !12

47:                                               ; preds = %33
  %48 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cc) #7
  store i64 %48, ptr @cN, align 8, !tbaa !8
  %49 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cd) #7
  store i64 %49, ptr @dN, align 8, !tbaa !8
  %50 = load i64, ptr @cN, align 8, !tbaa !8
  %51 = getelementptr inbounds i64, ptr @cI, i64 %50
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @cI, ptr noundef %51, i32 noundef 0)
  %52 = load i64, ptr @dN, align 8, !tbaa !8
  %53 = getelementptr inbounds i64, ptr @dI, i64 %52
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @dI, ptr noundef %53, i32 noundef 0)
  %54 = load i64, ptr @cN, align 8, !tbaa !8
  %55 = getelementptr inbounds i64, ptr @cI, i64 %54
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @cI, ptr noundef %55)
  %56 = load i64, ptr @dN, align 8, !tbaa !8
  %57 = getelementptr inbounds i64, ptr @dI, i64 %56
  call void @"_ZSt4sortIPxZ4mainE3$_1EvT_S2_T0_"(ptr noundef @dI, ptr noundef %57)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 -1000000000, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 -1000000000, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %81, %47
  %59 = load i64, ptr %10, align 8, !tbaa !8
  %60 = load i64, ptr @cN, align 8, !tbaa !8
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 5, ptr %11, align 4
  br label %84

63:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %64 = load i64, ptr %10, align 8, !tbaa !8
  %65 = getelementptr inbounds [100000 x i64], ptr @cI, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !8
  store i64 %66, ptr %12, align 8, !tbaa !8
  %67 = load i64, ptr %12, align 8, !tbaa !8
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cc, i64 noundef %67) #7
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = load i64, ptr @C, align 8, !tbaa !8
  %71 = icmp sgt i64 %69, %70
  br i1 %71, label %72, label %73

72:                                               ; preds = %63
  store i32 5, ptr %11, align 4
  br label %78

73:                                               ; preds = %63
  %74 = load i64, ptr %12, align 8, !tbaa !8
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @bc, i64 noundef %74) #7
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %75)
  %77 = load i64, ptr %76, align 8, !tbaa !8
  store i64 %77, ptr %8, align 8, !tbaa !8
  store i32 0, ptr %11, align 4
  br label %78

78:                                               ; preds = %73, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %79 = load i32, ptr %11, align 4
  switch i32 %79, label %84 [
    i32 0, label %80
  ]

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %10, align 8, !tbaa !8
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %10, align 8, !tbaa !8
  br label %58, !llvm.loop !14

84:                                               ; preds = %78, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %86

86:                                               ; preds = %109, %85
  %87 = load i64, ptr %13, align 8, !tbaa !8
  %88 = load i64, ptr @dN, align 8, !tbaa !8
  %89 = icmp slt i64 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 8, ptr %11, align 4
  br label %112

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %92 = load i64, ptr %13, align 8, !tbaa !8
  %93 = getelementptr inbounds [100000 x i64], ptr @dI, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !8
  store i64 %94, ptr %14, align 8, !tbaa !8
  %95 = load i64, ptr %14, align 8, !tbaa !8
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cd, i64 noundef %95) #7
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = load i64, ptr @D, align 8, !tbaa !8
  %99 = icmp sgt i64 %97, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %91
  store i32 8, ptr %11, align 4
  br label %106

101:                                              ; preds = %91
  %102 = load i64, ptr %14, align 8, !tbaa !8
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @bd, i64 noundef %102) #7
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %103)
  %105 = load i64, ptr %104, align 8, !tbaa !8
  store i64 %105, ptr %9, align 8, !tbaa !8
  store i32 0, ptr %11, align 4
  br label %106

106:                                              ; preds = %101, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %107 = load i32, ptr %11, align 4
  switch i32 %107, label %112 [
    i32 0, label %108
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  %110 = load i64, ptr %13, align 8, !tbaa !8
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %13, align 8, !tbaa !8
  br label %86, !llvm.loop !15

112:                                              ; preds = %106, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %113

113:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %114 = load i64, ptr %8, align 8, !tbaa !8
  %115 = load i64, ptr %9, align 8, !tbaa !8
  %116 = add nsw i64 %114, %115
  store i64 %116, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %117 = load i64, ptr @cN, align 8, !tbaa !8
  %118 = load i64, ptr @C, align 8, !tbaa !8
  %119 = call noundef i64 @_Z5clownxxRSt6vectorIxSaIxEES2_RA100000_x(i64 noundef %117, i64 noundef %118, ptr noundef nonnull align 8 dereferenceable(24) @cc, ptr noundef nonnull align 8 dereferenceable(24) @bc, ptr noundef nonnull align 8 dereferenceable(800000) @cI)
  store i64 %119, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %120 = load i64, ptr @dN, align 8, !tbaa !8
  %121 = load i64, ptr @D, align 8, !tbaa !8
  %122 = call noundef i64 @_Z5clownxxRSt6vectorIxSaIxEES2_RA100000_x(i64 noundef %120, i64 noundef %121, ptr noundef nonnull align 8 dereferenceable(24) @cd, ptr noundef nonnull align 8 dereferenceable(24) @bd, ptr noundef nonnull align 8 dereferenceable(800000) @dI)
  store i64 %122, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  store i64 0, ptr %19, align 8, !tbaa !8
  %123 = getelementptr inbounds i64, ptr %19, i64 1
  %124 = load i64, ptr %15, align 8, !tbaa !8
  store i64 %124, ptr %123, align 8, !tbaa !8
  %125 = getelementptr inbounds i64, ptr %19, i64 2
  %126 = load i64, ptr %16, align 8, !tbaa !8
  store i64 %126, ptr %125, align 8, !tbaa !8
  %127 = getelementptr inbounds i64, ptr %19, i64 3
  %128 = load i64, ptr %17, align 8, !tbaa !8
  store i64 %128, ptr %127, align 8, !tbaa !8
  %129 = getelementptr inbounds %"class.std::initializer_list", ptr %18, i32 0, i32 0
  store ptr %19, ptr %129, align 8, !tbaa !16
  %130 = getelementptr inbounds %"class.std::initializer_list", ptr %18, i32 0, i32 1
  store i64 4, ptr %130, align 8, !tbaa !20
  %131 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8
  %133 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %134 = load i64, ptr %133, align 8
  %135 = call noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr %132, i64 %134)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %135)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %136, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %138 = load i32, ptr %1, align 4
  ret i32 %138
}

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

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

; 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #5

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_1EvT_S2_T0_"(ptr noundef, ptr noundef) #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) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr, i64) #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 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "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 = { 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 #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 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTSSt16initializer_listIxE", !18, i64 0, !19, i64 8}
!18 = !{!"any pointer", !10, i64 0}
!19 = !{!"long", !10, i64 0}
!20 = !{!17, !19, i64 8}


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

@N = external dso_local global i64, align 8
@C = external dso_local global i64, align 8
@D = external dso_local global i64, align 8
@cN = external dso_local local_unnamed_addr global i64, align 8
@dN = external dso_local local_unnamed_addr global i64, align 8
@cI = external dso_local global [100000 x i64], align 16
@dI = external dso_local global [100000 x i64], align 16
@cc = external dso_local global %"class.std::vector", align 8
@cd = external dso_local global %"class.std::vector", align 8
@bc = external dso_local global %"class.std::vector", align 8
@bd = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5clownxxRSt6vectorIxSaIxEES2_RA100000_x(i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(800000)) 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 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 #2 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i8, align 1
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca [4 x i64], align 8
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @N)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @C)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @D)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %18 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cc) #7
  store i64 %18, ptr @cN, align 8, !tbaa !8
  %19 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cd) #7
  store i64 %19, ptr @dN, align 8, !tbaa !8
  %20 = load i64, ptr @cN, align 8, !tbaa !8
  %21 = getelementptr inbounds i64, ptr @cI, i64 %20
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @cI, ptr noundef nonnull %21, i32 noundef 0)
  %22 = load i64, ptr @dN, align 8, !tbaa !8
  %23 = getelementptr inbounds i64, ptr @dI, i64 %22
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @dI, ptr noundef nonnull %23, i32 noundef 0)
  %24 = load i64, ptr @cN, align 8, !tbaa !8
  %25 = getelementptr inbounds i64, ptr @cI, i64 %24
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @cI, ptr noundef nonnull %25)
  %26 = load i64, ptr @dN, align 8, !tbaa !8
  %27 = getelementptr inbounds i64, ptr @dI, i64 %26
  call void @"_ZSt4sortIPxZ4mainE3$_1EvT_S2_T0_"(ptr noundef nonnull @dI, ptr noundef nonnull %27)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 -1000000000, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store i64 -1000000000, ptr %5, align 8, !tbaa !8
  %28 = load i64, ptr @cN, align 8, !tbaa !8
  %29 = icmp sgt i64 %28, 0
  br i1 %29, label %.lr.ph28, label %.critedge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.025 = phi i64 [ %35, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 1 dereferenceable(1) %1)
  %33 = load i8, ptr %1, align 1, !tbaa !11
  %34 = icmp eq i8 %33, 67
  %bc.bd = select i1 %34, ptr @bc, ptr @bd
  %cc.cd = select i1 %34, ptr @cc, ptr @cd
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %bc.bd, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %cc.cd, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #7
  %35 = add nuw nsw i64 %.025, 1
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !12

.lr.ph28:                                         ; preds = %._crit_edge, %43
  %.01926 = phi i64 [ %47, %43 ], [ 0, %._crit_edge ]
  %38 = getelementptr inbounds [100000 x i64], ptr @cI, i64 0, i64 %.01926
  %39 = load i64, ptr %38, align 8, !tbaa !8
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cc, i64 noundef %39) #7
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = load i64, ptr @C, align 8, !tbaa !8
  %.not = icmp sgt i64 %41, %42
  br i1 %.not, label %.critedge, label %43

43:                                               ; preds = %.lr.ph28
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @bc, i64 noundef %39) #7
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = load i64, ptr %45, align 8, !tbaa !8
  store i64 %46, ptr %4, align 8, !tbaa !8
  %47 = add nuw nsw i64 %.01926, 1
  %48 = load i64, ptr @cN, align 8, !tbaa !8
  %49 = icmp slt i64 %47, %48
  br i1 %49, label %.lr.ph28, label %.critedge, !llvm.loop !14

.critedge:                                        ; preds = %43, %.lr.ph28, %._crit_edge
  %50 = load i64, ptr @dN, align 8, !tbaa !8
  %51 = icmp sgt i64 %50, 0
  br i1 %51, label %.lr.ph31, label %.critedge24

.lr.ph31:                                         ; preds = %.critedge, %57
  %.02130 = phi i64 [ %61, %57 ], [ 0, %.critedge ]
  %52 = getelementptr inbounds [100000 x i64], ptr @dI, i64 0, i64 %.02130
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cd, i64 noundef %53) #7
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = load i64, ptr @D, align 8, !tbaa !8
  %.not22 = icmp sgt i64 %55, %56
  br i1 %.not22, label %.lr.ph31..critedge24.loopexit_crit_edge, label %57

.lr.ph31..critedge24.loopexit_crit_edge:          ; preds = %.lr.ph31
  %.pre.pre = load i64, ptr %5, align 8, !tbaa !8
  br label %.critedge24

57:                                               ; preds = %.lr.ph31
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @bd, i64 noundef %53) #7
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %58)
  %60 = load i64, ptr %59, align 8, !tbaa !8
  store i64 %60, ptr %5, align 8, !tbaa !8
  %61 = add nuw nsw i64 %.02130, 1
  %62 = load i64, ptr @dN, align 8, !tbaa !8
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %.lr.ph31, label %.critedge24, !llvm.loop !15

.critedge24:                                      ; preds = %57, %.lr.ph31..critedge24.loopexit_crit_edge, %.critedge
  %64 = phi i64 [ -1000000000, %.critedge ], [ %.pre.pre, %.lr.ph31..critedge24.loopexit_crit_edge ], [ %60, %57 ]
  %65 = load i64, ptr %4, align 8, !tbaa !8
  %66 = add nsw i64 %64, %65
  %67 = load i64, ptr @cN, align 8, !tbaa !8
  %68 = load i64, ptr @C, align 8, !tbaa !8
  %69 = call noundef i64 @_Z5clownxxRSt6vectorIxSaIxEES2_RA100000_x(i64 noundef %67, i64 noundef %68, ptr noundef nonnull align 8 dereferenceable(24) @cc, ptr noundef nonnull align 8 dereferenceable(24) @bc, ptr noundef nonnull align 8 dereferenceable(800000) @cI)
  %70 = load i64, ptr @dN, align 8, !tbaa !8
  %71 = load i64, ptr @D, align 8, !tbaa !8
  %72 = call noundef i64 @_Z5clownxxRSt6vectorIxSaIxEES2_RA100000_x(i64 noundef %70, i64 noundef %71, ptr noundef nonnull align 8 dereferenceable(24) @cd, ptr noundef nonnull align 8 dereferenceable(24) @bd, ptr noundef nonnull align 8 dereferenceable(800000) @dI)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  %73 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 %66, ptr %73, align 8, !tbaa !8
  %74 = getelementptr inbounds i8, ptr %6, i64 16
  store i64 %69, ptr %74, align 8, !tbaa !8
  %75 = getelementptr inbounds i8, ptr %6, i64 24
  store i64 %72, ptr %75, align 8, !tbaa !8
  %76 = call noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr nonnull %6, i64 4)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %76)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %77, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret i32 0
}

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

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

; 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_1EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #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) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr, i64) 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 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "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 = { 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 #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 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass