; LLVM IR from tangjz/acm-icpc :: lydsy (5474)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::pair.2" = type { i64, i64 }

@tot = external dso_local global i32, align 4
@pr = external dso_local global [100001 x i32], align 16
@d = external dso_local global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZZ4mainE3per = external hidden global [101 x i64], align 16
@_ZZ4mainE3ans = external hidden global [101 x i64], align 16
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_Z7mod_powSt4pairIxxExx(i64, i64, i64 noundef, i64 noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z6getPerx(i64 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::map", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"struct.std::pair.0", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %25

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

28:                                               ; preds = %25
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %81

29:                                               ; preds = %25
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %44, label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr @tot, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @tot, align 4, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %42
  store i32 %36, ptr %43, align 4, !tbaa !5
  br label %44

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

45:                                               ; preds = %73, %44
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = mul nsw i32 %46, %50
  store i32 %51, ptr %5, align 4, !tbaa !5
  %52 = icmp slt i32 %51, 100001
  br i1 %52, label %54, label %53

53:                                               ; preds = %45
  store i32 5, ptr %3, align 4
  br label %76

54:                                               ; preds = %45
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %60
  store i32 %58, ptr %61, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp eq i32 %65, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %54
  store i32 5, ptr %3, align 4
  br label %76

72:                                               ; preds = %54
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %4, align 4, !tbaa !5
  br label %45, !llvm.loop !9

76:                                               ; preds = %71, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !11

81:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %82 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  br label %83

83:                                               ; preds = %236, %81
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr %6, align 4, !tbaa !5
  %86 = icmp ne i32 %84, 0
  br i1 %86, label %87, label %242

87:                                               ; preds = %83
  %88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #5
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  store i64 %90, ptr @_ZZ4mainE3per, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %148, %87
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = icmp sle i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %152

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %99
  %101 = invoke ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %100)
          to label %102 unwind label %132

102:                                              ; preds = %96
  %103 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %101, ptr %103, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %104 = call ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  %105 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %104, ptr %105, align 8
  %106 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKxxEES5_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br i1 %106, label %107, label %140

107:                                              ; preds = %102
  %108 = load i32, ptr %13, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !12
  %113 = invoke noundef i64 @_Z6getPerx(i64 noundef %112)
          to label %114 unwind label %132

114:                                              ; preds = %107
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %116
  store i64 %113, ptr %117, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %120
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %123
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef nonnull align 8 dereferenceable(8) %124)
          to label %125 unwind label %136

125:                                              ; preds = %114
  %126 = invoke { ptr, i8 } @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6insertIS2_IxxEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueES2_ISt17_Rb_tree_iteratorIS4_EbEE4typeEOSA_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %127 unwind label %136

127:                                              ; preds = %125
  %128 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %129 = extractvalue { ptr, i8 } %126, 0
  store ptr %129, ptr %128, align 8
  %130 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %131 = extractvalue { ptr, i8 } %126, 1
  store i8 %131, ptr %130, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  br label %147

132:                                              ; preds = %107, %96
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %15, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %16, align 4
  br label %151

136:                                              ; preds = %125, %114
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %15, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  br label %151

140:                                              ; preds = %102
  %141 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %142 = getelementptr inbounds %"struct.std::pair.2", ptr %141, i32 0, i32 1
  %143 = load i64, ptr %142, align 8, !tbaa !14
  %144 = load i32, ptr %13, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %145
  store i64 %143, ptr %146, align 8, !tbaa !12
  br label %147

147:                                              ; preds = %140, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %13, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %13, align 4, !tbaa !5
  br label %91, !llvm.loop !16

151:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %241

152:                                              ; preds = %95
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !12
  %159 = srem i64 %154, %158
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %161
  store i64 %159, ptr %162, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = sub nsw i32 %163, 1
  store i32 %164, ptr %20, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %229, %152
  %166 = load i32, ptr %20, align 4, !tbaa !5
  %167 = icmp sge i32 %166, 0
  br i1 %167, label %169, label %168

168:                                              ; preds = %165
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %232

169:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 1, ptr %24, align 4, !tbaa !5
  invoke void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %170 unwind label %224

170:                                              ; preds = %169
  %171 = load i32, ptr %20, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !12
  %176 = load i32, ptr %20, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !12
  %180 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 0
  %181 = load i64, ptr %180, align 8
  %182 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 1
  %183 = load i64, ptr %182, align 8
  %184 = invoke { i64, i64 } @_Z7mod_powSt4pairIxxExx(i64 %181, i64 %183, i64 noundef %175, i64 noundef %179)
          to label %185 unwind label %224

185:                                              ; preds = %170
  %186 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %187 = extractvalue { i64, i64 } %184, 0
  store i64 %187, ptr %186, align 8
  %188 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %189 = extractvalue { i64, i64 } %184, 1
  store i64 %189, ptr %188, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  %190 = load i32, ptr %8, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %193 = load i64, ptr %192, align 8, !tbaa !17
  %194 = mul nsw i64 %191, %193
  %195 = load i32, ptr %7, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %198 = load i64, ptr %197, align 8, !tbaa !19
  %199 = mul nsw i64 %196, %198
  %200 = sub nsw i64 %194, %199
  %201 = load i32, ptr %20, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %202
  %204 = load i64, ptr %203, align 8, !tbaa !12
  %205 = srem i64 %200, %204
  %206 = load i32, ptr %20, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %207
  store i64 %205, ptr %208, align 8, !tbaa !12
  %209 = load i32, ptr %20, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %210
  %212 = load i64, ptr %211, align 8, !tbaa !12
  %213 = icmp slt i64 %212, 0
  br i1 %213, label %214, label %228

214:                                              ; preds = %185
  %215 = load i32, ptr %20, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !12
  %219 = load i32, ptr %20, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %220
  %222 = load i64, ptr %221, align 8, !tbaa !12
  %223 = add nsw i64 %222, %218
  store i64 %223, ptr %221, align 8, !tbaa !12
  br label %228

224:                                              ; preds = %170, %169
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %15, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %241

228:                                              ; preds = %214, %185
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  br label %229

229:                                              ; preds = %228
  %230 = load i32, ptr %20, align 4, !tbaa !5
  %231 = add nsw i32 %230, -1
  store i32 %231, ptr %20, align 4, !tbaa !5
  br label %165, !llvm.loop !20

232:                                              ; preds = %168
  %233 = load i64, ptr @_ZZ4mainE3ans, align 16, !tbaa !12
  %234 = trunc i64 %233 to i32
  %235 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %234)
          to label %236 unwind label %237

236:                                              ; preds = %232
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  br label %83, !llvm.loop !21

237:                                              ; preds = %232
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %15, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %16, align 4
  br label %241

241:                                              ; preds = %237, %224, %151
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %244

242:                                              ; preds = %83
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %243 = load i32, ptr %1, align 4
  ret i32 %243

244:                                              ; preds = %241
  %245 = load ptr, ptr %15, align 8
  %246 = load i32, ptr %16, align 4
  %247 = insertvalue { ptr, i32 } poison, ptr %245, 0
  %248 = insertvalue { ptr, i32 } %247, i32 %246, 1
  resume { ptr, i32 } %248
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare i32 @printf(ptr noundef, ...) #4

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

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

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

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


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i64, i64 }

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [100001 x i32], align 16
@d = external dso_local local_unnamed_addr global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZZ4mainE3per = external hidden global [101 x i64], align 16
@_ZZ4mainE3ans = external hidden local_unnamed_addr global [101 x i64], align 16
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_Z7mod_powSt4pairIxxExx(i64, i64, i64 noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z6getPerx(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::map", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %19

14:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr %1, align 4, !tbaa !5
  %.not61 = icmp eq i32 %16, 0
  br i1 %.not61, label %._crit_edge64, label %.lr.ph63

.lr.ph63:                                         ; preds = %14
  %18 = getelementptr inbounds i8, ptr %11, i64 8
  br label %43

19:                                               ; preds = %0, %._crit_edge
  %indvars.iv67 = phi i64 [ 2, %0 ], [ %indvars.iv.next68, %._crit_edge ]
  %20 = phi i32 [ %tot.promoted, %0 ], [ %28, %._crit_edge ]
  %21 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %indvars.iv67
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %.not44 = icmp eq i32 %22, 0
  %23 = trunc nuw nsw i64 %indvars.iv67 to i32
  br i1 %.not44, label %24, label %._crit_edge76

24:                                               ; preds = %19
  store i32 %23, ptr %21, align 4, !tbaa !5
  %25 = add nsw i32 %20, 1
  store i32 %25, ptr @tot, align 4, !tbaa !5
  %26 = sext i32 %20 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %26
  store i32 %23, ptr %27, align 4, !tbaa !5
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %19, %24
  %28 = phi i32 [ %25, %24 ], [ %20, %19 ]
  %29 = load i32, ptr @pr, align 16, !tbaa !5
  %30 = mul nsw i32 %29, %23
  %31 = icmp slt i32 %30, 100001
  br i1 %31, label %.lr.ph, label %._crit_edge

32:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = mul nsw i32 %34, %23
  %36 = icmp slt i32 %35, 100001
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge76, %32
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ 0, %._crit_edge76 ]
  %37 = phi i32 [ %35, %32 ], [ %30, %._crit_edge76 ]
  %38 = phi i32 [ %34, %32 ], [ %29, %._crit_edge76 ]
  %39 = sext i32 %37 to i64
  %40 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %39
  store i32 %38, ptr %40, align 4, !tbaa !5
  %41 = load i32, ptr %21, align 4, !tbaa !5
  %42 = icmp eq i32 %41, %38
  br i1 %42, label %._crit_edge, label %32

._crit_edge:                                      ; preds = %32, %.lr.ph, %._crit_edge76
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next68, 100001
  br i1 %exitcond.not, label %14, label %19, !llvm.loop !11

43:                                               ; preds = %.lr.ph63, %._crit_edge60
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #5
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  store i64 %46, ptr @_ZZ4mainE3per, align 16, !tbaa !12
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %.not4150 = icmp slt i32 %47, 1
  br i1 %.not4150, label %._crit_edge54.thread, label %.lr.ph53

._crit_edge54.thread:                             ; preds = %43
  %.pre77 = sext i32 %47 to i64
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %.pre77
  %51 = load i64, ptr %50, align 8, !tbaa !12
  %52 = srem i64 %49, %51
  %53 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %.pre77
  store i64 %52, ptr %53, align 8, !tbaa !12
  br label %._crit_edge60

._crit_edge54:                                    ; preds = %84
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %86
  %57 = load i64, ptr %56, align 8, !tbaa !12
  %58 = srem i64 %55, %57
  %59 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %86
  store i64 %58, ptr %59, align 8, !tbaa !12
  %60 = icmp sgt i32 %85, 0
  br i1 %60, label %.lr.ph59.preheader, label %._crit_edge60

.lr.ph59.preheader:                               ; preds = %._crit_edge54
  %61 = zext nneg i32 %85 to i64
  br label %.lr.ph59

.lr.ph53:                                         ; preds = %43, %84
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %84 ], [ 1, %43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %62 = add nsw i64 %indvars.iv70, -1
  %63 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %62
  %64 = invoke ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %63)
          to label %65 unwind label %75

65:                                               ; preds = %.lr.ph53
  store ptr %64, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %66 = call ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  store ptr %66, ptr %9, align 8
  %67 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKxxEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %67, label %68, label %79

68:                                               ; preds = %65
  %69 = load i64, ptr %63, align 8, !tbaa !12
  %70 = invoke noundef i64 @_Z6getPerx(i64 noundef %69)
          to label %71 unwind label %75

71:                                               ; preds = %68
  %72 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %indvars.iv70
  store i64 %70, ptr %72, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull align 8 dereferenceable(8) %72)
  %73 = invoke { ptr, i8 } @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6insertIS2_IxxEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueES2_ISt17_Rb_tree_iteratorIS4_EbEE4typeEOSA_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %74 unwind label %77

74:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %84

75:                                               ; preds = %68, %.lr.ph53
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %87

77:                                               ; preds = %71
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %87

79:                                               ; preds = %65
  %80 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %81 = getelementptr inbounds i8, ptr %80, i64 8
  %82 = load i64, ptr %81, align 8, !tbaa !14
  %83 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %indvars.iv70
  store i64 %82, ptr %83, align 8, !tbaa !12
  br label %84

84:                                               ; preds = %79, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %.not41.not = icmp slt i64 %indvars.iv70, %86
  br i1 %.not41.not, label %.lr.ph53, label %._crit_edge54, !llvm.loop !16

87:                                               ; preds = %77, %75
  %.pn = phi { ptr, i32 } [ %78, %77 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %118

._crit_edge60:                                    ; preds = %100, %._crit_edge54.thread, %._crit_edge54
  %88 = load i64, ptr @_ZZ4mainE3ans, align 16, !tbaa !12
  %89 = trunc i64 %88 to i32
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %89)
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  %91 = load i32, ptr %1, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %91, 0
  br i1 %.not, label %._crit_edge64, label %43, !llvm.loop !17

.lr.ph59:                                         ; preds = %.lr.ph59.preheader, %100
  %indvars.iv73 = phi i64 [ %61, %.lr.ph59.preheader ], [ %indvars.iv.next74, %100 ]
  %indvars.iv.next74 = add nsw i64 %indvars.iv73, -1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %93 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %indvars.iv73
  %94 = load i64, ptr %93, align 8, !tbaa !12
  %95 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3per, i64 0, i64 %indvars.iv.next74
  %96 = load i64, ptr %95, align 8, !tbaa !12
  %97 = load i64, ptr %11, align 8
  %98 = load i64, ptr %18, align 8
  %99 = invoke { i64, i64 } @_Z7mod_powSt4pairIxxExx(i64 %97, i64 %98, i64 noundef %94, i64 noundef %96)
          to label %100 unwind label %116

100:                                              ; preds = %.lr.ph59
  %101 = extractvalue { i64, i64 } %99, 0
  %102 = extractvalue { i64, i64 } %99, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = mul nsw i64 %102, %104
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %101, %107
  %109 = sub nsw i64 %105, %108
  %110 = load i64, ptr %95, align 8, !tbaa !12
  %111 = srem i64 %109, %110
  %112 = getelementptr inbounds [101 x i64], ptr @_ZZ4mainE3ans, i64 0, i64 %indvars.iv.next74
  %113 = icmp slt i64 %111, 0
  %114 = select i1 %113, i64 %110, i64 0
  %spec.select = add nsw i64 %111, %114
  store i64 %spec.select, ptr %112, align 8, !tbaa !12
  %115 = icmp ugt i64 %indvars.iv73, 1
  br i1 %115, label %.lr.ph59, label %._crit_edge60, !llvm.loop !18

116:                                              ; preds = %.lr.ph59
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  br label %118

118:                                              ; preds = %116, %87
  %.pn.pn = phi { ptr, i32 } [ %.pn, %87 ], [ %117, %116 ]
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn.pn

._crit_edge64:                                    ; preds = %._crit_edge60, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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


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