; LLVM IR from tangjz/acm-icpc :: zoj (3788)

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

%struct.Poly = type { i32, [2003 x i32] }

@inv = external dso_local global [5767169 x i32], align 16
@fact = external dso_local global [5767169 x i32], align 16
@iact = external dso_local global [5767169 x i32], align 16
@A = external dso_local global %struct.Poly, align 4
@B = external dso_local global %struct.Poly, align 4
@M = external dso_local global %struct.Poly, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z1Cii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 %struct.Poly, align 4
  %12 = alloca %struct.Poly, align 4
  %13 = alloca %struct.Poly, align 4
  %14 = alloca %struct.Poly, align 4
  %15 = alloca %struct.Poly, align 4
  %16 = alloca %struct.Poly, align 4
  %17 = alloca %struct.Poly, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([5767169 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %43, %0
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = icmp slt i32 %23, 5767169
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %46

26:                                               ; preds = %22
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sdiv i32 5767169, %27
  %29 = sext i32 %28 to i64
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = srem i32 5767169, %30
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [5767169 x i32], ptr @inv, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = mul nsw i64 %29, %35
  %37 = srem i64 %36, 5767169
  %38 = trunc i64 %37 to i32
  %39 = sub nsw i32 5767169, %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [5767169 x i32], ptr @inv, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %26
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !9

46:                                               ; preds = %25
  store i32 1, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr @fact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %83, %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %48, 5767169
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %86

51:                                               ; preds = %47
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5767169 x i32], ptr @fact, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %57, %59
  %61 = srem i64 %60, 5767169
  %62 = trunc i64 %61 to i32
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [5767169 x i32], ptr @fact, i64 0, i64 %64
  store i32 %62, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [5767169 x i32], ptr @iact, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5767169 x i32], ptr @inv, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = mul nsw i64 %71, %76
  %78 = srem i64 %77, 5767169
  %79 = trunc i64 %78 to i32
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [5767169 x i32], ptr @iact, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %51
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %3, align 4, !tbaa !5
  br label %47, !llvm.loop !11

86:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  br label %87

87:                                               ; preds = %221, %86
  %88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8)
  %89 = icmp eq i32 %88, 5
  br i1 %89, label %90, label %224

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = call noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef %91, double noundef 0x3FD5555555555555)
  %93 = call double @llvm.ceil.f64(double %92)
  %94 = fptosi double %93 to i32
  store i32 %94, ptr %9, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %90
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #9
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7) #9
  br label %99

99:                                               ; preds = %98, %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !5
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = srem i32 %100, 5767169
  store i32 %101, ptr %4, align 4, !tbaa !5
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = srem i32 %102, 5767169
  store i32 %103, ptr %5, align 4, !tbaa !5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = icmp sle i32 %104, %105
  br i1 %106, label %107, label %169

107:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8016, ptr %11) #9
  call void @llvm.memset.p0.i64(ptr align 4 %11, i8 0, i64 8016, i1 false)
  %108 = getelementptr inbounds %struct.Poly, ptr %11, i32 0, i32 0
  store i32 1, ptr %108, align 4, !tbaa !12
  %109 = getelementptr inbounds %struct.Poly, ptr %11, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %11, i64 8016, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8016, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 8016, ptr %12) #9
  call void @llvm.memset.p0.i64(ptr align 4 %12, i8 0, i64 8016, i1 false)
  %110 = getelementptr inbounds %struct.Poly, ptr %12, i32 0, i32 0
  store i32 2, ptr %110, align 4, !tbaa !12
  %111 = getelementptr inbounds %struct.Poly, ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %12, i64 8016, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8016, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 8016, ptr %13) #9
  call void @llvm.memset.p0.i64(ptr align 4 %13, i8 0, i64 8016, i1 false)
  %112 = getelementptr inbounds %struct.Poly, ptr %13, i32 0, i32 0
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %112, align 4, !tbaa !12
  %115 = getelementptr inbounds %struct.Poly, ptr %13, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @M, ptr align 4 %13, i64 8016, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8016, ptr %13) #9
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %122

118:                                              ; preds = %107
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = sub nsw i32 5767169, %119
  store i32 %120, ptr getelementptr inbounds (%struct.Poly, ptr @M, i32 0, i32 1), align 4, !tbaa !5
  %121 = icmp ne i32 %120, 0
  br label %122

122:                                              ; preds = %118, %107
  %123 = phi i1 [ false, %107 ], [ %121, %118 ]
  %124 = load i32, ptr %5, align 4, !tbaa !5
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %135

126:                                              ; preds = %122
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sub nsw i32 5767169, %127
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [2003 x i32], ptr getelementptr inbounds (%struct.Poly, ptr @M, i32 0, i32 1), i64 0, i64 %132
  store i32 %128, ptr %133, align 4, !tbaa !5
  %134 = icmp ne i32 %128, 0
  br label %135

135:                                              ; preds = %126, %122
  %136 = phi i1 [ false, %122 ], [ %134, %126 ]
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [2003 x i32], ptr getelementptr inbounds (%struct.Poly, ptr @M, i32 0, i32 1), i64 0, i64 %138
  store i32 1, ptr %139, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([2003 x i32], ptr getelementptr inbounds (%struct.Poly, ptr @B, i32 0, i32 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (%struct.Poly, ptr @A, i32 0, i32 1), align 4, !tbaa !5
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = add nsw i32 %142, %141
  store i32 %143, ptr %8, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %153, %135
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = icmp sgt i32 %145, 0
  br i1 %146, label %147, label %156

147:                                              ; preds = %144
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = and i32 %148, 1
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8016, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 8016, ptr %15) #9
  call void @_ZNK4PolymlERKS_(ptr dead_on_unwind writable sret(%struct.Poly) align 4 %15, ptr noundef nonnull align 4 dereferenceable(8016) @A, ptr noundef nonnull align 4 dereferenceable(8016) @B)
  call void @_ZNK4PolyrmERKS_(ptr dead_on_unwind writable sret(%struct.Poly) align 4 %14, ptr noundef nonnull align 4 dereferenceable(8016) %15, ptr noundef nonnull align 4 dereferenceable(8016) @M)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %14, i64 8016, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8016, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8016, ptr %14) #9
  br label %152

152:                                              ; preds = %151, %147
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = ashr i32 %154, 1
  store i32 %155, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8016, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 8016, ptr %17) #9
  call void @_ZNK4PolymlERKS_(ptr dead_on_unwind writable sret(%struct.Poly) align 4 %17, ptr noundef nonnull align 4 dereferenceable(8016) @B, ptr noundef nonnull align 4 dereferenceable(8016) @B)
  call void @_ZNK4PolyrmERKS_(ptr dead_on_unwind writable sret(%struct.Poly) align 4 %16, ptr noundef nonnull align 4 dereferenceable(8016) %17, ptr noundef nonnull align 4 dereferenceable(8016) @M)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %16, i64 8016, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8016, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8016, ptr %16) #9
  br label %144, !llvm.loop !16

156:                                              ; preds = %144
  %157 = load i32, ptr @A, align 4, !tbaa !12
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = icmp eq i32 %157, %158
  br i1 %159, label %160, label %166

160:                                              ; preds = %156
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [2003 x i32], ptr getelementptr inbounds (%struct.Poly, ptr @A, i32 0, i32 1), i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  br label %167

166:                                              ; preds = %156
  br label %167

167:                                              ; preds = %166, %160
  %168 = phi i32 [ %165, %160 ], [ 0, %166 ]
  store i32 %168, ptr %10, align 4, !tbaa !5
  br label %221

169:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %217, %169
  %171 = load i32, ptr %18, align 4, !tbaa !5
  %172 = load i32, ptr %6, align 4, !tbaa !5
  %173 = mul nsw i32 %171, %172
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %170
  store i32 13, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %220

177:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  %178 = load i32, ptr %8, align 4, !tbaa !5
  %179 = load i32, ptr %18, align 4, !tbaa !5
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = mul nsw i32 %179, %180
  %182 = sub nsw i32 %178, %181
  store i32 %182, ptr %20, align 4, !tbaa !5
  %183 = load i32, ptr %20, align 4, !tbaa !5
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = srem i32 %183, %184
  %186 = icmp sgt i32 %185, 0
  br i1 %186, label %187, label %188

187:                                              ; preds = %177
  store i32 15, ptr %19, align 4
  br label %214

188:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  %189 = load i32, ptr %20, align 4, !tbaa !5
  %190 = load i32, ptr %7, align 4, !tbaa !5
  %191 = sdiv i32 %189, %190
  store i32 %191, ptr %21, align 4, !tbaa !5
  %192 = load i32, ptr %10, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = load i32, ptr %18, align 4, !tbaa !5
  %195 = load i32, ptr %21, align 4, !tbaa !5
  %196 = add nsw i32 %194, %195
  %197 = load i32, ptr %21, align 4, !tbaa !5
  %198 = call noundef i32 @_Z1Cii(i32 noundef %196, i32 noundef %197)
  %199 = sext i32 %198 to i64
  %200 = load i32, ptr %4, align 4, !tbaa !5
  %201 = load i32, ptr %18, align 4, !tbaa !5
  %202 = call noundef i32 @_Z7mod_powii(i32 noundef %200, i32 noundef %201)
  %203 = sext i32 %202 to i64
  %204 = mul nsw i64 %199, %203
  %205 = srem i64 %204, 5767169
  %206 = load i32, ptr %5, align 4, !tbaa !5
  %207 = load i32, ptr %21, align 4, !tbaa !5
  %208 = call noundef i32 @_Z7mod_powii(i32 noundef %206, i32 noundef %207)
  %209 = sext i32 %208 to i64
  %210 = mul nsw i64 %205, %209
  %211 = add nsw i64 %193, %210
  %212 = srem i64 %211, 5767169
  %213 = trunc i64 %212 to i32
  store i32 %213, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  store i32 0, ptr %19, align 4
  br label %214

214:                                              ; preds = %188, %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  %215 = load i32, ptr %19, align 4
  switch i32 %215, label %226 [
    i32 0, label %216
    i32 15, label %217
  ]

216:                                              ; preds = %214
  br label %217

217:                                              ; preds = %216, %214
  %218 = load i32, ptr %18, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %18, align 4, !tbaa !5
  br label %170, !llvm.loop !17

220:                                              ; preds = %176
  br label %221

221:                                              ; preds = %220, %167
  %222 = load i32, ptr %10, align 4, !tbaa !5
  %223 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %222)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %87, !llvm.loop !18

224:                                              ; preds = %87
  store i32 0, ptr %1, align 4
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  %225 = load i32, ptr %1, align 4
  ret i32 %225

226:                                              ; preds = %214
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, double noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #6

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4PolymlERKS_(ptr dead_on_unwind noalias writable sret(%struct.Poly) align 4, ptr noundef nonnull align 4 dereferenceable(8016), ptr noundef nonnull align 4 dereferenceable(8016)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4PolyrmERKS_(ptr dead_on_unwind noalias writable sret(%struct.Poly) align 4, ptr noundef nonnull align 4 dereferenceable(8016), ptr noundef nonnull align 4 dereferenceable(8016)) #1 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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, !6, i64 0}
!13 = !{!"_ZTS4Poly", !6, i64 0, !7, i64 4}
!14 = !{i64 0, i64 4, !5, i64 4, i64 8012, !15}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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"

%struct.Poly = type { i32, [2003 x i32] }

@inv = external dso_local local_unnamed_addr global [5767169 x i32], align 16
@fact = external dso_local local_unnamed_addr global [5767169 x i32], align 16
@iact = external dso_local local_unnamed_addr global [5767169 x i32], align 16
@A = external dso_local global %struct.Poly, align 4
@B = external dso_local global %struct.Poly, align 4
@M = external dso_local global %struct.Poly, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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 %struct.Poly, align 4
  %7 = alloca %struct.Poly, align 4
  %8 = alloca %struct.Poly, align 4
  %9 = alloca %struct.Poly, align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  br label %11

10:                                               ; preds = %11
  store i32 1, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr @fact, align 16, !tbaa !5
  br label %28

11:                                               ; preds = %0, %11
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %11 ]
  %12 = trunc nuw nsw i64 %indvars.iv to i32
  %13 = udiv i32 5767169, %12
  %14 = zext nneg i32 %13 to i64
  %15 = urem i32 5767169, %12
  %16 = zext nneg i32 %15 to i64
  %17 = getelementptr inbounds [5767169 x i32], ptr @inv, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = mul nsw i64 %19, %14
  %21 = srem i64 %20, 5767169
  %22 = trunc nsw i64 %21 to i32
  %23 = sub nsw i32 5767169, %22
  %24 = getelementptr inbounds [5767169 x i32], ptr @inv, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 5767169
  br i1 %exitcond.not, label %10, label %11, !llvm.loop !9

25:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %27 = icmp eq i32 %26, 5
  br i1 %27, label %.lr.ph51, label %._crit_edge52

28:                                               ; preds = %10, %28
  %29 = phi i64 [ 1, %10 ], [ %39, %28 ]
  %30 = phi i64 [ 1, %10 ], [ %32, %28 ]
  %indvars.iv54 = phi i64 [ 1, %10 ], [ %indvars.iv.next55, %28 ]
  %31 = mul nsw i64 %30, %indvars.iv54
  %32 = srem i64 %31, 5767169
  %33 = trunc nsw i64 %32 to i32
  %34 = getelementptr inbounds [5767169 x i32], ptr @fact, i64 0, i64 %indvars.iv54
  store i32 %33, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds [5767169 x i32], ptr @inv, i64 0, i64 %indvars.iv54
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = mul nsw i64 %29, %37
  %39 = srem i64 %38, 5767169
  %40 = trunc nsw i64 %39 to i32
  %41 = getelementptr inbounds [5767169 x i32], ptr @iact, i64 0, i64 %indvars.iv54
  store i32 %40, ptr %41, align 4, !tbaa !5
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond57.not = icmp eq i64 %indvars.iv.next55, 5767169
  br i1 %exitcond57.not, label %25, label %28, !llvm.loop !11

.lr.ph51:                                         ; preds = %25, %.loopexit
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = call noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef %42, double noundef 0x3FD5555555555555)
  %44 = call double @llvm.ceil.f64(double %43)
  %45 = fptosi double %44 to i32
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %.lr.ph51
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #9
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #9
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %49, %.lr.ph51
  %51 = phi i32 [ %.pre, %49 ], [ %46, %.lr.ph51 ]
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = srem i32 %52, 5767169
  store i32 %53, ptr %1, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = srem i32 %54, 5767169
  store i32 %55, ptr %2, align 4, !tbaa !5
  %.not = icmp sgt i32 %51, %45
  br i1 %.not, label %.preheader, label %57

.preheader:                                       ; preds = %50
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %.not4046 = icmp slt i32 %56, 0
  br i1 %.not4046, label %.loopexit, label %.lr.ph49

57:                                               ; preds = %50
  store i32 1, ptr @A, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(8008) getelementptr inbounds (i8, ptr @A, i64 8), i8 0, i64 8008, i1 false)
  store i32 2, ptr @B, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(8012) getelementptr inbounds (i8, ptr @B, i64 4), i8 0, i64 8012, i1 false)
  %58 = add nsw i32 %51, 1
  store i32 %58, ptr @M, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(8012) getelementptr inbounds (i8, ptr @M, i64 4), i8 0, i64 8012, i1 false)
  %.not41 = icmp eq i32 %53, 0
  br i1 %.not41, label %61, label %59

59:                                               ; preds = %57
  %60 = sub nsw i32 5767169, %53
  store i32 %60, ptr getelementptr inbounds (i8, ptr @M, i64 4), align 4, !tbaa !5
  br label %61

61:                                               ; preds = %59, %57
  %.not42 = icmp eq i32 %55, 0
  br i1 %.not42, label %68, label %62

62:                                               ; preds = %61
  %63 = sub nsw i32 5767169, %55
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sub nsw i32 %51, %64
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2003 x i32], ptr getelementptr inbounds (i8, ptr @M, i64 4), i64 0, i64 %66
  store i32 %63, ptr %67, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %62, %61
  %69 = sext i32 %51 to i64
  %70 = getelementptr inbounds [2003 x i32], ptr getelementptr inbounds (i8, ptr @M, i64 4), i64 0, i64 %69
  store i32 1, ptr %70, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @B, i64 8), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !5
  %71 = add nsw i32 %51, -1
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = add nsw i32 %71, %72
  store i32 %73, ptr %5, align 4, !tbaa !5
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %68, %78
  %75 = phi i32 [ %.pr, %78 ], [ %73, %68 ]
  %76 = and i32 %75, 1
  %.not43 = icmp eq i32 %76, 0
  br i1 %.not43, label %78, label %77

77:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8016, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8016, ptr nonnull %7) #9
  call void @_ZNK4PolymlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Poly) align 4 %7, ptr noundef nonnull align 4 dereferenceable(8016) @A, ptr noundef nonnull align 4 dereferenceable(8016) @B)
  call void @_ZNK4PolyrmERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Poly) align 4 %6, ptr noundef nonnull align 4 dereferenceable(8016) %7, ptr noundef nonnull align 4 dereferenceable(8016) @M)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(8016) @A, ptr noundef nonnull align 4 dereferenceable(8016) %6, i64 8016, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8016, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8016, ptr nonnull %6) #9
  %.pre58 = load i32, ptr %5, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %.lr.ph, %77
  %79 = phi i32 [ %75, %.lr.ph ], [ %.pre58, %77 ]
  %80 = ashr i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8016, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 8016, ptr nonnull %9) #9
  call void @_ZNK4PolymlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Poly) align 4 %9, ptr noundef nonnull align 4 dereferenceable(8016) @B, ptr noundef nonnull align 4 dereferenceable(8016) @B)
  call void @_ZNK4PolyrmERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Poly) align 4 %8, ptr noundef nonnull align 4 dereferenceable(8016) %9, ptr noundef nonnull align 4 dereferenceable(8016) @M)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(8016) @B, ptr noundef nonnull align 4 dereferenceable(8016) %8, i64 8016, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8016, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8016, ptr nonnull %8) #9
  %.pr = load i32, ptr %5, align 4, !tbaa !5
  %81 = icmp sgt i32 %.pr, 0
  br i1 %81, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %78
  %.pre59 = load i32, ptr @A, align 4, !tbaa !15
  %.pre60 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %68
  %82 = phi i32 [ %.pre60, %._crit_edge.loopexit ], [ %51, %68 ]
  %83 = phi i32 [ %.pre59, %._crit_edge.loopexit ], [ 1, %68 ]
  %84 = icmp eq i32 %83, %82
  br i1 %84, label %85, label %.loopexit

85:                                               ; preds = %._crit_edge
  %86 = add nsw i32 %82, -1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2003 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 4), i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  br label %.loopexit

.lr.ph49:                                         ; preds = %.preheader, %115
  %90 = phi i32 [ %116, %115 ], [ %56, %.preheader ]
  %91 = phi i32 [ %117, %115 ], [ %51, %.preheader ]
  %92 = phi i32 [ %119, %115 ], [ 0, %.preheader ]
  %.03148 = phi i32 [ %118, %115 ], [ 0, %.preheader ]
  %.03247 = phi i32 [ %.1, %115 ], [ 0, %.preheader ]
  %93 = sub nsw i32 %90, %92
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = srem i32 %93, %94
  %96 = sdiv i32 %93, %94
  %97 = icmp sgt i32 %95, 0
  br i1 %97, label %115, label %98

98:                                               ; preds = %.lr.ph49
  %99 = sext i32 %.03247 to i64
  %100 = add nsw i32 %96, %.03148
  %101 = call noundef i32 @_Z1Cii(i32 noundef %100, i32 noundef %96)
  %102 = sext i32 %101 to i64
  %103 = load i32, ptr %1, align 4, !tbaa !5
  %104 = call noundef i32 @_Z7mod_powii(i32 noundef %103, i32 noundef %.03148)
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %105, %102
  %107 = srem i64 %106, 5767169
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = call noundef i32 @_Z7mod_powii(i32 noundef %108, i32 noundef %96)
  %110 = sext i32 %109 to i64
  %111 = mul nsw i64 %107, %110
  %112 = add nsw i64 %111, %99
  %113 = srem i64 %112, 5767169
  %114 = trunc nsw i64 %113 to i32
  %.pre61 = load i32, ptr %3, align 4, !tbaa !5
  %.pre62 = load i32, ptr %5, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %.lr.ph49, %98
  %116 = phi i32 [ %.pre62, %98 ], [ %90, %.lr.ph49 ]
  %117 = phi i32 [ %.pre61, %98 ], [ %91, %.lr.ph49 ]
  %.1 = phi i32 [ %114, %98 ], [ %.03247, %.lr.ph49 ]
  %118 = add nuw nsw i32 %.03148, 1
  %119 = mul nsw i32 %117, %118
  %.not40 = icmp sgt i32 %119, %116
  br i1 %.not40, label %.loopexit, label %.lr.ph49, !llvm.loop !17

.loopexit:                                        ; preds = %115, %.preheader, %85, %._crit_edge
  %.2 = phi i32 [ %89, %85 ], [ 0, %._crit_edge ], [ 0, %.preheader ], [ %.1, %115 ]
  %120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.2)
  %121 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %122 = icmp eq i32 %121, 5
  br i1 %122, label %.lr.ph51, label %._crit_edge52, !llvm.loop !18

._crit_edge52:                                    ; preds = %.loopexit, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #6

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4PolymlERKS_(ptr dead_on_unwind noalias writable sret(%struct.Poly) align 4, ptr noundef nonnull align 4 dereferenceable(8016), ptr noundef nonnull align 4 dereferenceable(8016)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4PolyrmERKS_(ptr dead_on_unwind noalias writable sret(%struct.Poly) align 4, ptr noundef nonnull align 4 dereferenceable(8016), ptr noundef nonnull align 4 dereferenceable(8016)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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 = !{i64 0, i64 4, !5, i64 4, i64 8012, !13}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS4Poly", !6, i64 0, !7, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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