; LLVM IR from xirc/cp-algorithm :: atcoder/arc107/C/main.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.9" = type { i8 }
%"class.std::allocator.6" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@A = external dso_local global %"class.std::vector", align 8
@used = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z9factoriali(i32 noundef) #0

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

; 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 void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector.4", align 8
  %2 = alloca %"class.std::vector.0", align 8
  %3 = alloca i8, align 1
  %4 = alloca %"class.std::allocator.9", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::allocator.6", align 1
  %8 = alloca %"class.std::vector.4", align 8
  %9 = alloca %"class.std::vector.0", align 8
  %10 = alloca i8, align 1
  %11 = alloca %"class.std::allocator.9", align 1
  %12 = alloca %"class.std::allocator.6", align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::_Bit_reference", align 8
  %20 = alloca %"struct.std::_Bit_reference", align 8
  %21 = alloca %"struct.std::_Bit_reference", align 8
  %22 = alloca %"struct.std::_Bit_reference", align 8
  %23 = alloca i64, align 8
  %24 = alloca %"class.std::vector.0", align 8
  %25 = alloca i8, align 1
  %26 = alloca %"class.std::allocator.9", align 1
  %27 = alloca i32, align 4
  %28 = alloca %"struct.std::_Bit_reference", align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.std::vector.0", align 8
  %31 = alloca i8, align 1
  %32 = alloca %"class.std::allocator.9", align 1
  %33 = alloca i32, align 4
  %34 = alloca %"struct.std::_Bit_reference", align 8
  %35 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %1) #3
  %36 = load i32, ptr @N, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  call void @llvm.lifetime.start.p0(i64 40, ptr %2) #3
  %38 = load i32, ptr @N, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  store i8 0, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %2, i64 noundef %39, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %40 unwind label %53

40:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  call void @_ZNSaISt6vectorIbSaIbEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #3
  invoke void @_ZNSt6vectorIS_IbSaIbEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %37, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %41 unwind label %57

41:                                               ; preds = %40
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #3
  %42 = load i32, ptr @N, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #3
  %44 = load i32, ptr @N, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  store i8 0, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %45, ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %46 unwind label %62

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  call void @_ZNSaISt6vectorIbSaIbEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #3
  invoke void @_ZNSt6vectorIS_IbSaIbEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %43, ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %47 unwind label %66

47:                                               ; preds = %46
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %207, %47
  %49 = load i32, ptr %13, align 4, !tbaa !5
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %71, label %52

52:                                               ; preds = %48
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %210

53:                                               ; preds = %0
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %5, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %6, align 4
  br label %61

57:                                               ; preds = %40
  %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
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #3
  br label %61

61:                                               ; preds = %57, %53
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %2) #3
  br label %309

62:                                               ; preds = %41
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %5, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %6, align 4
  br label %70

66:                                               ; preds = %46
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #3
  br label %70

70:                                               ; preds = %66, %62
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #3
  br label %308

71:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %15, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %202, %71
  %75 = load i32, ptr %15, align 4, !tbaa !5
  %76 = load i32, ptr @N, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %206

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  store i8 1, ptr %16, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #3
  store i8 1, ptr %17, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %124, %79
  %81 = load i32, ptr %18, align 4, !tbaa !5
  %82 = load i32, ptr @N, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %127

85:                                               ; preds = %80
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %87) #3
  %89 = load i32, ptr %18, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %88, i64 noundef %90) #3
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %15, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %94) #3
  %96 = load i32, ptr %18, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %97) #3
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %92, %99
  %101 = load i32, ptr @K, align 4, !tbaa !5
  %102 = icmp sgt i32 %100, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %85
  store i8 0, ptr %16, align 1, !tbaa !9
  br label %104

104:                                              ; preds = %103, %85
  %105 = load i32, ptr %18, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %106) #3
  %108 = load i32, ptr %13, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %107, i64 noundef %109) #3
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr %18, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %113) #3
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %114, i64 noundef %116) #3
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = add nsw i32 %111, %118
  %120 = load i32, ptr @K, align 4, !tbaa !5
  %121 = icmp sgt i32 %119, %120
  br i1 %121, label %122, label %123

122:                                              ; preds = %104
  store i8 0, ptr %17, align 1, !tbaa !9
  br label %123

123:                                              ; preds = %122, %104
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %18, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %18, align 4, !tbaa !5
  br label %80, !llvm.loop !11

127:                                              ; preds = %84
  %128 = load i8, ptr %16, align 1, !tbaa !9, !range !13, !noundef !14
  %129 = trunc i8 %128 to i1
  br i1 %129, label %130, label %164

130:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #3
  %131 = load i32, ptr %15, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %132) #3
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %133, i64 noundef %135)
          to label %137 unwind label %155

137:                                              ; preds = %130
  %138 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 0
  %139 = extractvalue { ptr, i64 } %136, 0
  store ptr %139, ptr %138, align 8
  %140 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 1
  %141 = extractvalue { ptr, i64 } %136, 1
  store i64 %141, ptr %140, align 8
  %142 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %19, i1 noundef zeroext true) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #3
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %144) #3
  %146 = load i32, ptr %15, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %145, i64 noundef %147)
          to label %149 unwind label %159

149:                                              ; preds = %137
  %150 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 0
  %151 = extractvalue { ptr, i64 } %148, 0
  store ptr %151, ptr %150, align 8
  %152 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 1
  %153 = extractvalue { ptr, i64 } %148, 1
  store i64 %153, ptr %152, align 8
  %154 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %142) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  br label %164

155:                                              ; preds = %130
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %5, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %6, align 4
  br label %163

159:                                              ; preds = %137
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %5, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #3
  br label %163

163:                                              ; preds = %159, %155
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  br label %205

164:                                              ; preds = %149, %127
  %165 = load i8, ptr %17, align 1, !tbaa !9, !range !13, !noundef !14
  %166 = trunc i8 %165 to i1
  br i1 %166, label %167, label %201

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #3
  %168 = load i32, ptr %15, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %169) #3
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %170, i64 noundef %172)
          to label %174 unwind label %192

174:                                              ; preds = %167
  %175 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %176 = extractvalue { ptr, i64 } %173, 0
  store ptr %176, ptr %175, align 8
  %177 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %178 = extractvalue { ptr, i64 } %173, 1
  store i64 %178, ptr %177, align 8
  %179 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %21, i1 noundef zeroext true) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #3
  %180 = load i32, ptr %13, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %181) #3
  %183 = load i32, ptr %15, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %182, i64 noundef %184)
          to label %186 unwind label %196

186:                                              ; preds = %174
  %187 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %188 = extractvalue { ptr, i64 } %185, 0
  store ptr %188, ptr %187, align 8
  %189 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %190 = extractvalue { ptr, i64 } %185, 1
  store i64 %190, ptr %189, align 8
  %191 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %179) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #3
  br label %201

192:                                              ; preds = %167
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %5, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %6, align 4
  br label %200

196:                                              ; preds = %174
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %5, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #3
  br label %200

200:                                              ; preds = %196, %192
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #3
  br label %205

201:                                              ; preds = %186, %164
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %15, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %15, align 4, !tbaa !5
  br label %74, !llvm.loop !15

205:                                              ; preds = %200, %163
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %307

206:                                              ; preds = %78
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %13, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %13, align 4, !tbaa !5
  br label %48, !llvm.loop !16

210:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  store i64 1, ptr %23, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 40, ptr %24) #3
  %211 = load i32, ptr @N, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #3
  store i8 0, ptr %25, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %24, i64 noundef %212, ptr noundef nonnull align 1 dereferenceable(1) %25, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %213 unwind label %220

213:                                              ; preds = %210
  %214 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(40) @used, ptr noundef nonnull align 8 dereferenceable(40) %24) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %215

215:                                              ; preds = %249, %213
  %216 = load i32, ptr %27, align 4, !tbaa !5
  %217 = load i32, ptr @N, align 4, !tbaa !5
  %218 = icmp slt i32 %216, %217
  br i1 %218, label %224, label %219

219:                                              ; preds = %215
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  br label %257

220:                                              ; preds = %210
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %5, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #3
  br label %306

224:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #3
  %225 = load i32, ptr %27, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @used, i64 noundef %226)
          to label %228 unwind label %235

228:                                              ; preds = %224
  %229 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 0
  %230 = extractvalue { ptr, i64 } %227, 0
  store ptr %230, ptr %229, align 8
  %231 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 1
  %232 = extractvalue { ptr, i64 } %227, 1
  store i64 %232, ptr %231, align 8
  %233 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %28) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #3
  br i1 %233, label %234, label %239

234:                                              ; preds = %228
  br label %249

235:                                              ; preds = %224
  %236 = landingpad { ptr, i32 }
          cleanup
  %237 = extractvalue { ptr, i32 } %236, 0
  store ptr %237, ptr %5, align 8
  %238 = extractvalue { ptr, i32 } %236, 1
  store i32 %238, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #3
  br label %256

239:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %240 = load i32, ptr %27, align 4, !tbaa !5
  %241 = invoke noundef i32 @_Z3dfsiRKSt6vectorIS_IbSaIbEESaIS1_EE(i32 noundef %240, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %242 unwind label %252

242:                                              ; preds = %239
  store i32 %241, ptr %29, align 4, !tbaa !5
  %243 = load i32, ptr %29, align 4, !tbaa !5
  %244 = call noundef i64 @_Z9factoriali(i32 noundef %243)
  %245 = load i64, ptr %23, align 8, !tbaa !17
  %246 = mul nsw i64 %245, %244
  store i64 %246, ptr %23, align 8, !tbaa !17
  %247 = load i64, ptr %23, align 8, !tbaa !17
  %248 = srem i64 %247, 998244353
  store i64 %248, ptr %23, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  br label %249

249:                                              ; preds = %242, %234
  %250 = load i32, ptr %27, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %27, align 4, !tbaa !5
  br label %215, !llvm.loop !19

252:                                              ; preds = %239
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %5, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  br label %256

256:                                              ; preds = %252, %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  br label %306

257:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 40, ptr %30) #3
  %258 = load i32, ptr @N, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #3
  store i8 0, ptr %31, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %30, i64 noundef %259, ptr noundef nonnull align 1 dereferenceable(1) %31, ptr noundef nonnull align 1 dereferenceable(1) %32)
          to label %260 unwind label %267

260:                                              ; preds = %257
  %261 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(40) @used, ptr noundef nonnull align 8 dereferenceable(40) %30) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %30) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %30) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #3
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %296, %260
  %263 = load i32, ptr %33, align 4, !tbaa !5
  %264 = load i32, ptr @N, align 4, !tbaa !5
  %265 = icmp slt i32 %263, %264
  br i1 %265, label %271, label %266

266:                                              ; preds = %262
  store i32 14, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #3
  br label %304

267:                                              ; preds = %257
  %268 = landingpad { ptr, i32 }
          cleanup
  %269 = extractvalue { ptr, i32 } %268, 0
  store ptr %269, ptr %5, align 8
  %270 = extractvalue { ptr, i32 } %268, 1
  store i32 %270, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %30) #3
  br label %306

271:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #3
  %272 = load i32, ptr %33, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @used, i64 noundef %273)
          to label %275 unwind label %282

275:                                              ; preds = %271
  %276 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 0
  %277 = extractvalue { ptr, i64 } %274, 0
  store ptr %277, ptr %276, align 8
  %278 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 1
  %279 = extractvalue { ptr, i64 } %274, 1
  store i64 %279, ptr %278, align 8
  %280 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %34) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #3
  br i1 %280, label %281, label %286

281:                                              ; preds = %275
  br label %296

282:                                              ; preds = %271
  %283 = landingpad { ptr, i32 }
          cleanup
  %284 = extractvalue { ptr, i32 } %283, 0
  store ptr %284, ptr %5, align 8
  %285 = extractvalue { ptr, i32 } %283, 1
  store i32 %285, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #3
  br label %303

286:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #3
  %287 = load i32, ptr %33, align 4, !tbaa !5
  %288 = invoke noundef i32 @_Z3dfsiRKSt6vectorIS_IbSaIbEESaIS1_EE(i32 noundef %287, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %289 unwind label %299

289:                                              ; preds = %286
  store i32 %288, ptr %35, align 4, !tbaa !5
  %290 = load i32, ptr %35, align 4, !tbaa !5
  %291 = call noundef i64 @_Z9factoriali(i32 noundef %290)
  %292 = load i64, ptr %23, align 8, !tbaa !17
  %293 = mul nsw i64 %292, %291
  store i64 %293, ptr %23, align 8, !tbaa !17
  %294 = load i64, ptr %23, align 8, !tbaa !17
  %295 = srem i64 %294, 998244353
  store i64 %295, ptr %23, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #3
  br label %296

296:                                              ; preds = %289, %281
  %297 = load i32, ptr %33, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  store i32 %298, ptr %33, align 4, !tbaa !5
  br label %262, !llvm.loop !20

299:                                              ; preds = %286
  %300 = landingpad { ptr, i32 }
          cleanup
  %301 = extractvalue { ptr, i32 } %300, 0
  store ptr %301, ptr %5, align 8
  %302 = extractvalue { ptr, i32 } %300, 1
  store i32 %302, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #3
  br label %303

303:                                              ; preds = %299, %282
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #3
  br label %306

304:                                              ; preds = %266
  %305 = load i64, ptr %23, align 8, !tbaa !17
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #3
  ret i64 %305

306:                                              ; preds = %303, %267, %256, %220
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %307

307:                                              ; preds = %306, %205
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  br label %308

308:                                              ; preds = %307, %70
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  br label %309

309:                                              ; preds = %308, %61
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #3
  br label %310

310:                                              ; preds = %309
  %311 = load ptr, ptr %5, align 8
  %312 = load i32, ptr %6, align 4
  %313 = insertvalue { ptr, i32 } poison, ptr %311, 0
  %314 = insertvalue { ptr, i32 } %313, i32 %312, 1
  resume { ptr, i32 } %314
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }

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

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.9" = type { i8 }
%"class.std::allocator.6" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@N = external dso_local local_unnamed_addr global i32, align 4
@K = external dso_local local_unnamed_addr global i32, align 4
@A = external dso_local global %"class.std::vector", align 8
@used = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z9factoriali(i32 noundef) 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 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 void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i64 -998244352, 998244353) i64 @_Z5solvev() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector.4", align 8
  %2 = alloca %"class.std::vector.0", align 8
  %3 = alloca i8, align 1
  %4 = alloca %"class.std::allocator.9", align 1
  %5 = alloca %"class.std::allocator.6", align 1
  %6 = alloca %"class.std::vector.4", align 8
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca i8, align 1
  %9 = alloca %"class.std::allocator.9", align 1
  %10 = alloca %"class.std::allocator.6", align 1
  %11 = alloca %"struct.std::_Bit_reference", align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca %"struct.std::_Bit_reference", align 8
  %14 = alloca %"struct.std::_Bit_reference", align 8
  %15 = alloca %"class.std::vector.0", align 8
  %16 = alloca i8, align 1
  %17 = alloca %"class.std::allocator.9", align 1
  %18 = alloca %"struct.std::_Bit_reference", align 8
  %19 = alloca %"class.std::vector.0", align 8
  %20 = alloca i8, align 1
  %21 = alloca %"class.std::allocator.9", align 1
  %22 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #3
  %23 = load i32, ptr @N, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #3
  %24 = sext i32 %23 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #3
  store i8 0, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %2, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %25 unwind label %39

25:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_ZNSaISt6vectorIbSaIbEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  invoke void @_ZNSt6vectorIS_IbSaIbEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %24, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %41

26:                                               ; preds = %25
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  %27 = load i32, ptr @N, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #3
  %28 = sext i32 %27 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #3
  store i8 0, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 noundef %28, ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %29 unwind label %44

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #3
  call void @_ZNSaISt6vectorIbSaIbEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #3
  invoke void @_ZNSt6vectorIS_IbSaIbEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %28, ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %30 unwind label %46

30:                                               ; preds = %29
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  %31 = load i32, ptr @N, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph99, label %.._crit_edge100_crit_edge

.._crit_edge100_crit_edge:                        ; preds = %30
  %.pre131 = sext i32 %31 to i64
  br label %._crit_edge100

.lr.ph99:                                         ; preds = %30
  %33 = getelementptr inbounds i8, ptr %11, i64 8
  %34 = getelementptr inbounds i8, ptr %12, i64 8
  %35 = getelementptr inbounds i8, ptr %13, i64 8
  %36 = getelementptr inbounds i8, ptr %14, i64 8
  br label %49

.loopexit.loopexit:                               ; preds = %112
  %.pre = sext i32 %113 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %49
  %.pre-phi = phi i64 [ %.pre, %.loopexit.loopexit ], [ %51, %49 ]
  %37 = phi i32 [ %113, %.loopexit.loopexit ], [ %50, %49 ]
  %38 = icmp slt i64 %indvars.iv.next123, %.pre-phi
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  br i1 %38, label %49, label %._crit_edge100, !llvm.loop !11

._crit_edge100:                                   ; preds = %.loopexit, %.._crit_edge100_crit_edge
  %.pre-phi132 = phi i64 [ %.pre131, %.._crit_edge100_crit_edge ], [ %.pre-phi, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %15) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #3
  store i8 0, ptr %16, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %15, i64 noundef %.pre-phi132, ptr noundef nonnull align 1 dereferenceable(1) %16, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %116 unwind label %121

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %43

41:                                               ; preds = %25
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #3
  br label %43

43:                                               ; preds = %41, %39
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %40, %39 ]
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #3
  br label %174

44:                                               ; preds = %26
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %48

46:                                               ; preds = %29
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt6vectorIbSaIbEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  br label %48

48:                                               ; preds = %46, %44
  %.pn66 = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  br label %173

49:                                               ; preds = %.lr.ph99, %.loopexit
  %50 = phi i32 [ %31, %.lr.ph99 ], [ %37, %.loopexit ]
  %indvars.iv122 = phi i64 [ 0, %.lr.ph99 ], [ %indvars.iv.next123, %.loopexit ]
  %indvars.iv117 = phi i64 [ 1, %.lr.ph99 ], [ %indvars.iv.next118, %.loopexit ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next123, %51
  br i1 %52, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %49, %112
  %53 = phi i32 [ %113, %112 ], [ %50, %49 ]
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %112 ], [ %indvars.iv117, %49 ]
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %.lr.ph
  br i1 %spec.select, label %._crit_edge.thread, label %93

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %.05993 = phi i1 [ %.160, %.lr.ph ], [ true, %.preheader ]
  %.06192 = phi i1 [ %spec.select, %.lr.ph ], [ true, %.preheader ]
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %indvars.iv122) #3
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %indvars.iv) #3
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %indvars.iv119) #3
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %indvars.iv) #3
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, %57
  %62 = load i32, ptr @K, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  %spec.select = select i1 %63, i1 %.06192, i1 false
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %indvars.iv) #3
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %indvars.iv122) #3
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %indvars.iv) #3
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %indvars.iv119) #3
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, %66
  %71 = load i32, ptr @K, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  %.160 = select i1 %72, i1 %.05993, i1 false
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next, %74
  br i1 %75, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  %.059.lcssa138 = phi i1 [ %.160, %._crit_edge ], [ true, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #3
  %76 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv119) #3
  %77 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %76, i64 noundef %indvars.iv122)
          to label %78 unwind label %88

78:                                               ; preds = %._crit_edge.thread
  %79 = extractvalue { ptr, i64 } %77, 0
  store ptr %79, ptr %11, align 8
  %80 = extractvalue { ptr, i64 } %77, 1
  store i64 %80, ptr %33, align 8
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %11, i1 noundef zeroext true) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #3
  %82 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv122) #3
  %83 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %82, i64 noundef %indvars.iv119)
          to label %84 unwind label %90

84:                                               ; preds = %78
  %85 = extractvalue { ptr, i64 } %83, 0
  store ptr %85, ptr %12, align 8
  %86 = extractvalue { ptr, i64 } %83, 1
  store i64 %86, ptr %34, align 8
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %81) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #3
  br i1 %.059.lcssa138, label %94, label %112

88:                                               ; preds = %._crit_edge.thread
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %92

90:                                               ; preds = %78
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #3
  br label %92

92:                                               ; preds = %90, %88
  %.pn73 = phi { ptr, i32 } [ %91, %90 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #3
  br label %172

93:                                               ; preds = %._crit_edge
  br i1 %.160, label %94, label %112

94:                                               ; preds = %84, %93
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #3
  %95 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv119) #3
  %96 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %95, i64 noundef %indvars.iv122)
          to label %97 unwind label %107

97:                                               ; preds = %94
  %98 = extractvalue { ptr, i64 } %96, 0
  store ptr %98, ptr %13, align 8
  %99 = extractvalue { ptr, i64 } %96, 1
  store i64 %99, ptr %35, align 8
  %100 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %13, i1 noundef zeroext true) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #3
  %101 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv122) #3
  %102 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %101, i64 noundef %indvars.iv119)
          to label %103 unwind label %109

103:                                              ; preds = %97
  %104 = extractvalue { ptr, i64 } %102, 0
  store ptr %104, ptr %14, align 8
  %105 = extractvalue { ptr, i64 } %102, 1
  store i64 %105, ptr %36, align 8
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %100) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #3
  br label %112

107:                                              ; preds = %94
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %111

109:                                              ; preds = %97
  %110 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #3
  br label %111

111:                                              ; preds = %109, %107
  %.pn75 = phi { ptr, i32 } [ %110, %109 ], [ %108, %107 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #3
  br label %172

112:                                              ; preds = %84, %103, %93
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %113 = load i32, ptr @N, align 4, !tbaa !5
  %114 = trunc nuw i64 %indvars.iv.next120 to i32
  %115 = icmp sgt i32 %113, %114
  br i1 %115, label %.preheader, label %.loopexit.loopexit, !llvm.loop !14

116:                                              ; preds = %._crit_edge100
  %117 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(40) @used, ptr noundef nonnull align 8 dereferenceable(40) %15) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #3
  %118 = load i32, ptr @N, align 4, !tbaa !5
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %.lr.ph105, label %.._crit_edge106_crit_edge

.._crit_edge106_crit_edge:                        ; preds = %116
  %.pre133 = sext i32 %118 to i64
  br label %._crit_edge106

.lr.ph105:                                        ; preds = %116
  %120 = getelementptr inbounds i8, ptr %18, i64 8
  br label %123

._crit_edge106:                                   ; preds = %138, %.._crit_edge106_crit_edge
  %.pre-phi134 = phi i64 [ %.pre133, %.._crit_edge106_crit_edge ], [ %140, %138 ]
  %.054.lcssa = phi i64 [ 1, %.._crit_edge106_crit_edge ], [ %.155, %138 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %19) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %20) #3
  store i8 0, ptr %20, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %19, i64 noundef %.pre-phi134, ptr noundef nonnull align 1 dereferenceable(1) %20, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %144 unwind label %149

121:                                              ; preds = %._crit_edge100
  %122 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #3
  br label %172

123:                                              ; preds = %.lr.ph105, %138
  %indvars.iv125 = phi i64 [ 0, %.lr.ph105 ], [ %indvars.iv.next126, %138 ]
  %.054102 = phi i64 [ 1, %.lr.ph105 ], [ %.155, %138 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #3
  %124 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @used, i64 noundef %indvars.iv125)
          to label %125 unwind label %129

125:                                              ; preds = %123
  %126 = extractvalue { ptr, i64 } %124, 0
  store ptr %126, ptr %18, align 8
  %127 = extractvalue { ptr, i64 } %124, 1
  store i64 %127, ptr %120, align 8
  %128 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #3
  br i1 %128, label %138, label %131

129:                                              ; preds = %123
  %130 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #3
  br label %172

131:                                              ; preds = %125
  %132 = trunc nuw nsw i64 %indvars.iv125 to i32
  %133 = invoke noundef i32 @_Z3dfsiRKSt6vectorIS_IbSaIbEESaIS1_EE(i32 noundef %132, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %134 unwind label %142

134:                                              ; preds = %131
  %135 = call noundef i64 @_Z9factoriali(i32 noundef %133)
  %136 = mul nsw i64 %135, %.054102
  %137 = srem i64 %136, 998244353
  br label %138

138:                                              ; preds = %125, %134
  %.155 = phi i64 [ %.054102, %125 ], [ %137, %134 ]
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %139 = load i32, ptr @N, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = icmp slt i64 %indvars.iv.next126, %140
  br i1 %141, label %123, label %._crit_edge106, !llvm.loop !15

142:                                              ; preds = %131
  %143 = landingpad { ptr, i32 }
          cleanup
  br label %172

144:                                              ; preds = %._crit_edge106
  %145 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(40) @used, ptr noundef nonnull align 8 dereferenceable(40) %19) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #3
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %20) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %19) #3
  %146 = load i32, ptr @N, align 4, !tbaa !5
  %147 = icmp sgt i32 %146, 0
  br i1 %147, label %.lr.ph112, label %._crit_edge113

.lr.ph112:                                        ; preds = %144
  %148 = getelementptr inbounds i8, ptr %22, i64 8
  br label %151

._crit_edge113:                                   ; preds = %166, %144
  %.256.lcssa = phi i64 [ %.054.lcssa, %144 ], [ %.357, %166 ]
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #3
  ret i64 %.256.lcssa

149:                                              ; preds = %._crit_edge106
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %20) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %19) #3
  br label %172

151:                                              ; preds = %.lr.ph112, %166
  %indvars.iv128 = phi i64 [ 0, %.lr.ph112 ], [ %indvars.iv.next129, %166 ]
  %.256109 = phi i64 [ %.054.lcssa, %.lr.ph112 ], [ %.357, %166 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #3
  %152 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @used, i64 noundef %indvars.iv128)
          to label %153 unwind label %157

153:                                              ; preds = %151
  %154 = extractvalue { ptr, i64 } %152, 0
  store ptr %154, ptr %22, align 8
  %155 = extractvalue { ptr, i64 } %152, 1
  store i64 %155, ptr %148, align 8
  %156 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %22) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #3
  br i1 %156, label %166, label %159

157:                                              ; preds = %151
  %158 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #3
  br label %172

159:                                              ; preds = %153
  %160 = trunc nuw nsw i64 %indvars.iv128 to i32
  %161 = invoke noundef i32 @_Z3dfsiRKSt6vectorIS_IbSaIbEESaIS1_EE(i32 noundef %160, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %162 unwind label %170

162:                                              ; preds = %159
  %163 = call noundef i64 @_Z9factoriali(i32 noundef %161)
  %164 = mul nsw i64 %163, %.256109
  %165 = srem i64 %164, 998244353
  br label %166

166:                                              ; preds = %153, %162
  %.357 = phi i64 [ %.256109, %153 ], [ %165, %162 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %167 = load i32, ptr @N, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = icmp slt i64 %indvars.iv.next129, %168
  br i1 %169, label %151, label %._crit_edge113, !llvm.loop !16

170:                                              ; preds = %159
  %171 = landingpad { ptr, i32 }
          cleanup
  br label %172

172:                                              ; preds = %121, %149, %142, %129, %170, %157, %92, %111
  %.pn75.pn.pn = phi { ptr, i32 } [ %.pn75, %111 ], [ %.pn73, %92 ], [ %150, %149 ], [ %122, %121 ], [ %143, %142 ], [ %130, %129 ], [ %171, %170 ], [ %158, %157 ]
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  br label %173

173:                                              ; preds = %172, %48
  %.pn75.pn.pn.pn = phi { ptr, i32 } [ %.pn75.pn.pn, %172 ], [ %.pn66, %48 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  call void @_ZNSt6vectorIS_IbSaIbEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  br label %174

174:                                              ; preds = %173, %43
  %.pn75.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn75.pn.pn.pn, %173 ], [ %.pn, %43 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #3
  resume { ptr, i32 } %.pn75.pn.pn.pn.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIbSaIbEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }

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

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


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