; LLVM IR from intel/cryptography-primitives :: sources/ippcp (pcpmont_expwinbnu)

; 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._cpBigNum = type { i32, i32, i32, i32, ptr, ptr }
%struct._gsModEngine = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, i32, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @cpMontExpWin_BN(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._cpBigNum, ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  store ptr %40, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._cpBigNum, ptr %41, i32 0, i32 2
  %43 = load i32, ptr %42, align 8, !tbaa !12
  store i32 %43, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._cpBigNum, ptr %44, i32 0, i32 4
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  store ptr %46, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._cpBigNum, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 8, !tbaa !12
  store i32 %49, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._cpBigNum, ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  store ptr %52, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._gsModEngine, ptr %53, i32 0, i32 3
  %55 = load i32, ptr %54, align 8, !tbaa !14
  store i32 %55, ptr %16, align 4, !tbaa !13
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = load i32, ptr %14, align 4, !tbaa !13
  %58 = call i32 @cpEqu_BNU_CHUNK(ptr noundef %56, i32 noundef %57, i64 noundef 0)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %81

60:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !13
  br label %61

61:                                               ; preds = %77, %60
  %62 = load i32, ptr %17, align 4, !tbaa !13
  %63 = load i32, ptr %16, align 4, !tbaa !13
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %80

65:                                               ; preds = %61
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._gsModEngine, ptr %66, i32 0, i32 10
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = load i32, ptr %17, align 4, !tbaa !13
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i64, ptr %68, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !18
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = load i32, ptr %17, align 4, !tbaa !13
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i64, ptr %73, i64 %75
  store i64 %72, ptr %76, align 8, !tbaa !18
  br label %77

77:                                               ; preds = %65
  %78 = load i32, ptr %17, align 4, !tbaa !13
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %17, align 4, !tbaa !13
  br label %61, !llvm.loop !19

80:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %353

81:                                               ; preds = %5
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !13
  %84 = call i32 @cpEqu_BNU_CHUNK(ptr noundef %82, i32 noundef %83, i64 noundef 0)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %100

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %87

87:                                               ; preds = %96, %86
  %88 = load i32, ptr %18, align 4, !tbaa !13
  %89 = load i32, ptr %16, align 4, !tbaa !13
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %99

91:                                               ; preds = %87
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = load i32, ptr %18, align 4, !tbaa !13
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds i64, ptr %92, i64 %94
  store i64 0, ptr %95, align 8, !tbaa !18
  br label %96

96:                                               ; preds = %91
  %97 = load i32, ptr %18, align 4, !tbaa !13
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %18, align 4, !tbaa !13
  br label %87, !llvm.loop !21

99:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %352

100:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 2, ptr %19, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = call ptr @gsModPoolAlloc(ptr noundef %101, i32 noundef 2)
  store ptr %102, ptr %20, align 8, !tbaa !5
  %103 = load ptr, ptr %20, align 8, !tbaa !5
  %104 = icmp eq ptr null, %103
  br i1 %104, label %105, label %106

105:                                              ; preds = %100
  store i32 1, ptr %21, align 4
  br label %349

106:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %107 = load ptr, ptr %20, align 8, !tbaa !5
  %108 = load i32, ptr %16, align 4, !tbaa !13
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i64, ptr %107, i64 %109
  store ptr %110, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  store ptr @gsMul_school, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  store ptr @gsSqr_school, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %111 = load i32, ptr %14, align 4, !tbaa !13
  %112 = mul nsw i32 %111, 64
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = load i32, ptr %14, align 4, !tbaa !13
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i64, ptr %113, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !18
  %119 = call i32 @cpNLZ_BNU(i64 noundef %118)
  %120 = sub nsw i32 %112, %119
  store i32 %120, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %121 = load i32, ptr %25, align 4, !tbaa !13
  %122 = call i32 @cpMontExp_WinSize(i32 noundef %121)
  store i32 %122, ptr %26, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %123 = load i32, ptr %26, align 4, !tbaa !13
  %124 = shl i32 1, %123
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  store i64 %126, ptr %27, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  %127 = load i32, ptr %26, align 4, !tbaa !13
  %128 = shl i32 1, %127
  store i32 %128, ptr %28, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  store i32 0, ptr %30, align 4, !tbaa !13
  br label %129

129:                                              ; preds = %143, %106
  %130 = load i32, ptr %30, align 4, !tbaa !13
  %131 = load i32, ptr %12, align 4, !tbaa !13
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %146

133:                                              ; preds = %129
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = load i32, ptr %30, align 4, !tbaa !13
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i64, ptr %134, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !18
  %139 = load ptr, ptr %15, align 8, !tbaa !5
  %140 = load i32, ptr %30, align 4, !tbaa !13
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i64, ptr %139, i64 %141
  store i64 %138, ptr %142, align 8, !tbaa !18
  br label %143

143:                                              ; preds = %133
  %144 = load i32, ptr %30, align 4, !tbaa !13
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %30, align 4, !tbaa !13
  br label %129, !llvm.loop !22

146:                                              ; preds = %129
  br label %147

147:                                              ; preds = %156, %146
  %148 = load i32, ptr %30, align 4, !tbaa !13
  %149 = load i32, ptr %16, align 4, !tbaa !13
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %151, label %159

151:                                              ; preds = %147
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  %153 = load i32, ptr %30, align 4, !tbaa !13
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds i64, ptr %152, i64 %154
  store i64 0, ptr %155, align 8, !tbaa !18
  br label %156

156:                                              ; preds = %151
  %157 = load i32, ptr %30, align 4, !tbaa !13
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %30, align 4, !tbaa !13
  br label %147, !llvm.loop !23

159:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  store i32 0, ptr %31, align 4, !tbaa !13
  br label %160

160:                                              ; preds = %177, %159
  %161 = load i32, ptr %31, align 4, !tbaa !13
  %162 = load i32, ptr %16, align 4, !tbaa !13
  %163 = icmp slt i32 %161, %162
  br i1 %163, label %164, label %180

164:                                              ; preds = %160
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._gsModEngine, ptr %165, i32 0, i32 10
  %167 = load ptr, ptr %166, align 8, !tbaa !17
  %168 = load i32, ptr %31, align 4, !tbaa !13
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds i64, ptr %167, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !18
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = getelementptr inbounds i64, ptr %172, i64 0
  %174 = load i32, ptr %31, align 4, !tbaa !13
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i64, ptr %173, i64 %175
  store i64 %171, ptr %176, align 8, !tbaa !18
  br label %177

177:                                              ; preds = %164
  %178 = load i32, ptr %31, align 4, !tbaa !13
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %31, align 4, !tbaa !13
  br label %160, !llvm.loop !24

180:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  store i32 0, ptr %32, align 4, !tbaa !13
  br label %181

181:                                              ; preds = %198, %180
  %182 = load i32, ptr %32, align 4, !tbaa !13
  %183 = load i32, ptr %16, align 4, !tbaa !13
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %185, label %201

185:                                              ; preds = %181
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = load i32, ptr %32, align 4, !tbaa !13
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds i64, ptr %186, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !18
  %191 = load ptr, ptr %10, align 8, !tbaa !5
  %192 = load i32, ptr %16, align 4, !tbaa !13
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i64, ptr %191, i64 %193
  %195 = load i32, ptr %32, align 4, !tbaa !13
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i64, ptr %194, i64 %196
  store i64 %190, ptr %197, align 8, !tbaa !18
  br label %198

198:                                              ; preds = %185
  %199 = load i32, ptr %32, align 4, !tbaa !13
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %32, align 4, !tbaa !13
  br label %181, !llvm.loop !25

201:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  store i32 2, ptr %29, align 4, !tbaa !13
  br label %202

202:                                              ; preds = %227, %201
  %203 = load i32, ptr %29, align 4, !tbaa !13
  %204 = load i32, ptr %28, align 4, !tbaa !13
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %206, label %230

206:                                              ; preds = %202
  %207 = load ptr, ptr %23, align 8, !tbaa !5
  %208 = load ptr, ptr %20, align 8, !tbaa !5
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  %210 = load i32, ptr %29, align 4, !tbaa !13
  %211 = sub nsw i32 %210, 1
  %212 = load i32, ptr %16, align 4, !tbaa !13
  %213 = mul nsw i32 %211, %212
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds i64, ptr %209, i64 %214
  %216 = load ptr, ptr %15, align 8, !tbaa !5
  %217 = load i32, ptr %16, align 4, !tbaa !13
  %218 = load ptr, ptr %22, align 8, !tbaa !5
  call void %207(ptr noundef %208, ptr noundef %215, ptr noundef %216, i32 noundef %217, ptr noundef %218)
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = load i32, ptr %29, align 4, !tbaa !13
  %221 = load i32, ptr %16, align 4, !tbaa !13
  %222 = mul nsw i32 %220, %221
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds i64, ptr %219, i64 %223
  %225 = load ptr, ptr %20, align 8, !tbaa !5
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpMontRed_BNU(ptr noundef %224, ptr noundef %225, ptr noundef %226)
  br label %227

227:                                              ; preds = %206
  %228 = load i32, ptr %29, align 4, !tbaa !13
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %29, align 4, !tbaa !13
  br label %202, !llvm.loop !26

230:                                              ; preds = %202
  %231 = load ptr, ptr %13, align 8, !tbaa !5
  %232 = load i32, ptr %14, align 4, !tbaa !13
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds i64, ptr %231, i64 %233
  store i64 0, ptr %234, align 8, !tbaa !18
  %235 = load i32, ptr %25, align 4, !tbaa !13
  %236 = load i32, ptr %26, align 4, !tbaa !13
  %237 = add nsw i32 %235, %236
  %238 = sub nsw i32 %237, 1
  %239 = load i32, ptr %26, align 4, !tbaa !13
  %240 = sdiv i32 %238, %239
  %241 = load i32, ptr %26, align 4, !tbaa !13
  %242 = mul nsw i32 %240, %241
  store i32 %242, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  %243 = load i32, ptr %25, align 4, !tbaa !13
  %244 = load i32, ptr %26, align 4, !tbaa !13
  %245 = sub nsw i32 %243, %244
  store i32 %245, ptr %33, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #4
  %246 = load ptr, ptr %13, align 8, !tbaa !5
  %247 = load i32, ptr %33, align 4, !tbaa !13
  %248 = sdiv i32 %247, 16
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i16, ptr %246, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !13
  store i32 %251, ptr %34, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #4
  %252 = load i32, ptr %33, align 4, !tbaa !13
  %253 = and i32 %252, 15
  store i32 %253, ptr %35, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #4
  %254 = load i32, ptr %34, align 4, !tbaa !13
  %255 = load i32, ptr %35, align 4, !tbaa !13
  %256 = lshr i32 %254, %255
  %257 = zext i32 %256 to i64
  %258 = load i64, ptr %27, align 8, !tbaa !18
  %259 = and i64 %257, %258
  %260 = trunc i64 %259 to i32
  store i32 %260, ptr %36, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #4
  store i32 0, ptr %37, align 4, !tbaa !13
  br label %261

261:                                              ; preds = %281, %230
  %262 = load i32, ptr %37, align 4, !tbaa !13
  %263 = load i32, ptr %16, align 4, !tbaa !13
  %264 = icmp slt i32 %262, %263
  br i1 %264, label %265, label %284

265:                                              ; preds = %261
  %266 = load ptr, ptr %10, align 8, !tbaa !5
  %267 = load i32, ptr %36, align 4, !tbaa !13
  %268 = zext i32 %267 to i64
  %269 = load i32, ptr %16, align 4, !tbaa !13
  %270 = sext i32 %269 to i64
  %271 = mul i64 %268, %270
  %272 = getelementptr inbounds i64, ptr %266, i64 %271
  %273 = load i32, ptr %37, align 4, !tbaa !13
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds i64, ptr %272, i64 %274
  %276 = load i64, ptr %275, align 8, !tbaa !18
  %277 = load ptr, ptr %15, align 8, !tbaa !5
  %278 = load i32, ptr %37, align 4, !tbaa !13
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds i64, ptr %277, i64 %279
  store i64 %276, ptr %280, align 8, !tbaa !18
  br label %281

281:                                              ; preds = %265
  %282 = load i32, ptr %37, align 4, !tbaa !13
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %37, align 4, !tbaa !13
  br label %261, !llvm.loop !27

284:                                              ; preds = %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #4
  %285 = load i32, ptr %26, align 4, !tbaa !13
  %286 = load i32, ptr %33, align 4, !tbaa !13
  %287 = sub nsw i32 %286, %285
  store i32 %287, ptr %33, align 4, !tbaa !13
  br label %288

288:                                              ; preds = %343, %284
  %289 = load i32, ptr %33, align 4, !tbaa !13
  %290 = icmp sge i32 %289, 0
  br i1 %290, label %291, label %347

291:                                              ; preds = %288
  store i32 0, ptr %29, align 4, !tbaa !13
  store i32 0, ptr %36, align 4, !tbaa !13
  br label %292

292:                                              ; preds = %305, %291
  %293 = load i32, ptr %29, align 4, !tbaa !13
  %294 = load i32, ptr %26, align 4, !tbaa !13
  %295 = icmp slt i32 %293, %294
  br i1 %295, label %296, label %308

296:                                              ; preds = %292
  %297 = load ptr, ptr %24, align 8, !tbaa !5
  %298 = load ptr, ptr %20, align 8, !tbaa !5
  %299 = load ptr, ptr %15, align 8, !tbaa !5
  %300 = load i32, ptr %16, align 4, !tbaa !13
  %301 = load ptr, ptr %22, align 8, !tbaa !5
  call void %297(ptr noundef %298, ptr noundef %299, i32 noundef %300, ptr noundef %301)
  %302 = load ptr, ptr %15, align 8, !tbaa !5
  %303 = load ptr, ptr %20, align 8, !tbaa !5
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpMontRed_BNU(ptr noundef %302, ptr noundef %303, ptr noundef %304)
  br label %305

305:                                              ; preds = %296
  %306 = load i32, ptr %29, align 4, !tbaa !13
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %29, align 4, !tbaa !13
  br label %292, !llvm.loop !28

308:                                              ; preds = %292
  %309 = load ptr, ptr %13, align 8, !tbaa !5
  %310 = load i32, ptr %33, align 4, !tbaa !13
  %311 = sdiv i32 %310, 16
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds i16, ptr %309, i64 %312
  %314 = load i32, ptr %313, align 4, !tbaa !13
  store i32 %314, ptr %34, align 4, !tbaa !13
  %315 = load i32, ptr %33, align 4, !tbaa !13
  %316 = and i32 %315, 15
  store i32 %316, ptr %35, align 4, !tbaa !13
  %317 = load i32, ptr %34, align 4, !tbaa !13
  %318 = load i32, ptr %35, align 4, !tbaa !13
  %319 = lshr i32 %317, %318
  %320 = zext i32 %319 to i64
  %321 = load i64, ptr %27, align 8, !tbaa !18
  %322 = and i64 %320, %321
  %323 = trunc i64 %322 to i32
  store i32 %323, ptr %36, align 4, !tbaa !13
  %324 = load i32, ptr %36, align 4, !tbaa !13
  %325 = icmp ne i32 %324, 0
  br i1 %325, label %326, label %342

326:                                              ; preds = %308
  %327 = load ptr, ptr %23, align 8, !tbaa !5
  %328 = load ptr, ptr %20, align 8, !tbaa !5
  %329 = load ptr, ptr %15, align 8, !tbaa !5
  %330 = load ptr, ptr %10, align 8, !tbaa !5
  %331 = load i32, ptr %36, align 4, !tbaa !13
  %332 = zext i32 %331 to i64
  %333 = load i32, ptr %16, align 4, !tbaa !13
  %334 = sext i32 %333 to i64
  %335 = mul i64 %332, %334
  %336 = getelementptr inbounds i64, ptr %330, i64 %335
  %337 = load i32, ptr %16, align 4, !tbaa !13
  %338 = load ptr, ptr %22, align 8, !tbaa !5
  call void %327(ptr noundef %328, ptr noundef %329, ptr noundef %336, i32 noundef %337, ptr noundef %338)
  %339 = load ptr, ptr %15, align 8, !tbaa !5
  %340 = load ptr, ptr %20, align 8, !tbaa !5
  %341 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpMontRed_BNU(ptr noundef %339, ptr noundef %340, ptr noundef %341)
  br label %342

342:                                              ; preds = %326, %308
  br label %343

343:                                              ; preds = %342
  %344 = load i32, ptr %26, align 4, !tbaa !13
  %345 = load i32, ptr %33, align 4, !tbaa !13
  %346 = sub nsw i32 %345, %344
  store i32 %346, ptr %33, align 4, !tbaa !13
  br label %288, !llvm.loop !29

347:                                              ; preds = %288
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  %348 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %348, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  store i32 0, ptr %21, align 4
  br label %349

349:                                              ; preds = %347, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %350 = load i32, ptr %21, align 4
  switch i32 %350, label %362 [
    i32 0, label %351
  ]

351:                                              ; preds = %349
  br label %352

352:                                              ; preds = %351, %99
  br label %353

353:                                              ; preds = %352, %80
  %354 = load ptr, ptr %15, align 8, !tbaa !5
  %355 = load i32, ptr %16, align 4, !tbaa !13
  %356 = call i32 @cpFix_BNU(ptr noundef %354, i32 noundef %355)
  store i32 %356, ptr %16, align 4, !tbaa !13
  %357 = load i32, ptr %16, align 4, !tbaa !13
  %358 = load ptr, ptr %6, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct._cpBigNum, ptr %358, i32 0, i32 2
  store i32 %357, ptr %359, align 8, !tbaa !12
  %360 = load ptr, ptr %6, align 8, !tbaa !5
  %361 = getelementptr inbounds %struct._cpBigNum, ptr %360, i32 0, i32 1
  store i32 1, ptr %361, align 4, !tbaa !30
  store i32 0, ptr %21, align 4
  br label %362

362:                                              ; preds = %353, %349
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %363 = load i32, ptr %21, align 4
  switch i32 %363, label %365 [
    i32 0, label %364
    i32 1, label %364
  ]

364:                                              ; preds = %362, %362
  ret void

365:                                              ; preds = %362
  unreachable
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpEqu_BNU_CHUNK(ptr noundef, i32 noundef, i64 noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @gsModPoolAlloc(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @gsMul_school(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @gsSqr_school(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

declare i32 @cpNLZ_BNU(i64 noundef) #3

declare i32 @cpMontExp_WinSize(i32 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cpMontRed_BNU(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @gsModPoolFree(ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpFix_BNU(ptr noundef, i32 noundef) #2

attributes #0 = { 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 = { inlinehint 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 = { "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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_cpBigNum", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 16}
!15 = !{!"_gsModEngine", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !16, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !6, i64 104}
!16 = !{!"long long", !7, i64 0}
!17 = !{!15, !6, i64 64}
!18 = !{!16, !16, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !20}
!29 = distinct !{!29, !20}
!30 = !{!10, !11, i64 4}


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

; Function Attrs: nounwind uwtable
define dso_local void @cpMontExpWin_BN(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = ptrtoint ptr %4 to i64
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = ptrtoint ptr %8 to i64
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %2, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = ptrtoint ptr %17 to i64
  %19 = getelementptr inbounds i8, ptr %3, i64 16
  %20 = load i32, ptr %19, align 8, !tbaa !12
  %21 = tail call i32 @cpEqu_BNU_CHUNK(ptr noundef %13, i32 noundef %15, i64 noundef 0)
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %49, label %.preheader162

.preheader162:                                    ; preds = %5
  %22 = icmp sgt i32 %20, 0
  br i1 %22, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader162
  %23 = getelementptr inbounds i8, ptr %3, i64 64
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %wide.trip.count = zext nneg i32 %20 to i64
  %min.iters.check = icmp ult i32 %20, 6
  %25 = ptrtoint ptr %24 to i64
  %26 = sub i64 %18, %25
  %diff.check = icmp ult i64 %26, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %27 = getelementptr inbounds i64, ptr %24, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <2 x i64>, ptr %27, align 8, !tbaa !16
  %wide.load220 = load <2 x i64>, ptr %28, align 8, !tbaa !16
  %29 = getelementptr inbounds i64, ptr %17, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store <2 x i64> %wide.load, ptr %29, align 8, !tbaa !16
  store <2 x i64> %wide.load220, ptr %30, align 8, !tbaa !16
  %index.next = add nuw i64 %index, 4
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %32 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv.prol
  %33 = load i64, ptr %32, align 8, !tbaa !16
  %34 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.prol
  store i64 %33, ptr %34, align 8, !tbaa !16
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !21

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %35 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %36 = icmp ugt i64 %35, -4
  br i1 %36, label %.loopexit, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %37 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv
  %38 = load i64, ptr %37, align 8, !tbaa !16
  %39 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv
  store i64 %38, ptr %39, align 8, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv.next
  %41 = load i64, ptr %40, align 8, !tbaa !16
  %42 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next
  store i64 %41, ptr %42, align 8, !tbaa !16
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %43 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv.next.1
  %44 = load i64, ptr %43, align 8, !tbaa !16
  %45 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next.1
  store i64 %44, ptr %45, align 8, !tbaa !16
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %46 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv.next.2
  %47 = load i64, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next.2
  store i64 %47, ptr %48, align 8, !tbaa !16
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.loopexit, label %scalar.ph, !llvm.loop !23

49:                                               ; preds = %5
  %50 = tail call i32 @cpEqu_BNU_CHUNK(ptr noundef %8, i32 noundef %11, i64 noundef 0)
  %.not151 = icmp eq i32 %50, 0
  br i1 %.not151, label %54, label %.preheader161

.preheader161:                                    ; preds = %49
  %51 = icmp sgt i32 %20, 0
  br i1 %51, label %.lr.ph166.preheader, label %.loopexit

.lr.ph166.preheader:                              ; preds = %.preheader161
  %52 = zext nneg i32 %20 to i64
  %53 = shl nuw nsw i64 %52, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 %53, i1 false), !tbaa !16
  br label %.loopexit

54:                                               ; preds = %49
  %55 = tail call ptr @gsModPoolAlloc(ptr noundef nonnull %3, i32 noundef 2)
  %.not154 = icmp eq ptr %55, null
  br i1 %.not154, label %.critedge, label %56

56:                                               ; preds = %54
  %57 = sext i32 %20 to i64
  %58 = getelementptr inbounds i64, ptr %55, i64 %57
  %59 = shl nsw i32 %15, 6
  %60 = sext i32 %15 to i64
  %61 = getelementptr i64, ptr %13, i64 %60
  %62 = getelementptr i8, ptr %61, i64 -8
  %63 = load i64, ptr %62, align 8, !tbaa !16
  %64 = tail call i32 @cpNLZ_BNU(i64 noundef %63) #4
  %65 = sub nsw i32 %59, %64
  %66 = tail call i32 @cpMontExp_WinSize(i32 noundef %65) #4
  %.fr = freeze i32 %66
  %67 = shl nuw i32 1, %.fr
  %68 = add nsw i32 %67, -1
  %69 = icmp sgt i32 %11, 0
  br i1 %69, label %.lr.ph168.preheader, label %.preheader160

.lr.ph168.preheader:                              ; preds = %56
  %wide.trip.count194 = zext nneg i32 %11 to i64
  %min.iters.check225 = icmp ult i32 %11, 6
  %70 = sub i64 %18, %9
  %diff.check222 = icmp ult i64 %70, 32
  %or.cond282 = select i1 %min.iters.check225, i1 true, i1 %diff.check222
  br i1 %or.cond282, label %.lr.ph168.preheader285, label %vector.ph226

.lr.ph168.preheader285:                           ; preds = %middle.block223, %.lr.ph168.preheader
  %indvars.iv191.ph = phi i64 [ 0, %.lr.ph168.preheader ], [ %n.vec228, %middle.block223 ]
  %xtraiter286 = and i64 %wide.trip.count194, 3
  %lcmp.mod287.not = icmp eq i64 %xtraiter286, 0
  br i1 %lcmp.mod287.not, label %.lr.ph168.prol.loopexit, label %.lr.ph168.prol

.lr.ph168.prol:                                   ; preds = %.lr.ph168.preheader285, %.lr.ph168.prol
  %indvars.iv191.prol = phi i64 [ %indvars.iv.next192.prol, %.lr.ph168.prol ], [ %indvars.iv191.ph, %.lr.ph168.preheader285 ]
  %prol.iter288 = phi i64 [ %prol.iter288.next, %.lr.ph168.prol ], [ 0, %.lr.ph168.preheader285 ]
  %71 = getelementptr inbounds i64, ptr %8, i64 %indvars.iv191.prol
  %72 = load i64, ptr %71, align 8, !tbaa !16
  %73 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv191.prol
  store i64 %72, ptr %73, align 8, !tbaa !16
  %indvars.iv.next192.prol = add nuw nsw i64 %indvars.iv191.prol, 1
  %prol.iter288.next = add i64 %prol.iter288, 1
  %prol.iter288.cmp.not = icmp eq i64 %prol.iter288.next, %xtraiter286
  br i1 %prol.iter288.cmp.not, label %.lr.ph168.prol.loopexit, label %.lr.ph168.prol, !llvm.loop !24

.lr.ph168.prol.loopexit:                          ; preds = %.lr.ph168.prol, %.lr.ph168.preheader285
  %indvars.iv191.unr = phi i64 [ %indvars.iv191.ph, %.lr.ph168.preheader285 ], [ %indvars.iv.next192.prol, %.lr.ph168.prol ]
  %74 = sub nsw i64 %indvars.iv191.ph, %wide.trip.count194
  %75 = icmp ugt i64 %74, -4
  br i1 %75, label %.preheader160, label %.lr.ph168

vector.ph226:                                     ; preds = %.lr.ph168.preheader
  %n.vec228 = and i64 %wide.trip.count194, 2147483644
  br label %vector.body230

vector.body230:                                   ; preds = %vector.body230, %vector.ph226
  %index231 = phi i64 [ 0, %vector.ph226 ], [ %index.next234, %vector.body230 ]
  %76 = getelementptr inbounds i64, ptr %8, i64 %index231
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %wide.load232 = load <2 x i64>, ptr %76, align 8, !tbaa !16
  %wide.load233 = load <2 x i64>, ptr %77, align 8, !tbaa !16
  %78 = getelementptr inbounds i64, ptr %17, i64 %index231
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  store <2 x i64> %wide.load232, ptr %78, align 8, !tbaa !16
  store <2 x i64> %wide.load233, ptr %79, align 8, !tbaa !16
  %index.next234 = add nuw i64 %index231, 4
  %80 = icmp eq i64 %index.next234, %n.vec228
  br i1 %80, label %middle.block223, label %vector.body230, !llvm.loop !25

middle.block223:                                  ; preds = %vector.body230
  %cmp.n235 = icmp eq i64 %n.vec228, %wide.trip.count194
  br i1 %cmp.n235, label %.preheader160, label %.lr.ph168.preheader285

.preheader160:                                    ; preds = %.lr.ph168.prol.loopexit, %.lr.ph168, %middle.block223, %56
  %.0141.lcssa = phi i32 [ 0, %56 ], [ %11, %middle.block223 ], [ %11, %.lr.ph168 ], [ %11, %.lr.ph168.prol.loopexit ]
  %81 = icmp slt i32 %.0141.lcssa, %20
  br i1 %81, label %.lr.ph170.preheader, label %.preheader159

.lr.ph170.preheader:                              ; preds = %.preheader160
  %82 = zext nneg i32 %.0141.lcssa to i64
  %83 = shl nuw nsw i64 %82, 3
  %scevgep = getelementptr i8, ptr %17, i64 %83
  %84 = xor i32 %.0141.lcssa, -1
  %85 = add i32 %20, %84
  %86 = zext i32 %85 to i64
  %87 = shl nuw nsw i64 %86, 3
  %88 = add nuw nsw i64 %87, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %88, i1 false), !tbaa !16
  br label %.preheader159

.lr.ph168:                                        ; preds = %.lr.ph168.prol.loopexit, %.lr.ph168
  %indvars.iv191 = phi i64 [ %indvars.iv.next192.3, %.lr.ph168 ], [ %indvars.iv191.unr, %.lr.ph168.prol.loopexit ]
  %89 = getelementptr inbounds i64, ptr %8, i64 %indvars.iv191
  %90 = load i64, ptr %89, align 8, !tbaa !16
  %91 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv191
  store i64 %90, ptr %91, align 8, !tbaa !16
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %92 = getelementptr inbounds i64, ptr %8, i64 %indvars.iv.next192
  %93 = load i64, ptr %92, align 8, !tbaa !16
  %94 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next192
  store i64 %93, ptr %94, align 8, !tbaa !16
  %indvars.iv.next192.1 = add nuw nsw i64 %indvars.iv191, 2
  %95 = getelementptr inbounds i64, ptr %8, i64 %indvars.iv.next192.1
  %96 = load i64, ptr %95, align 8, !tbaa !16
  %97 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next192.1
  store i64 %96, ptr %97, align 8, !tbaa !16
  %indvars.iv.next192.2 = add nuw nsw i64 %indvars.iv191, 3
  %98 = getelementptr inbounds i64, ptr %8, i64 %indvars.iv.next192.2
  %99 = load i64, ptr %98, align 8, !tbaa !16
  %100 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next192.2
  store i64 %99, ptr %100, align 8, !tbaa !16
  %indvars.iv.next192.3 = add nuw nsw i64 %indvars.iv191, 4
  %exitcond195.not.3 = icmp eq i64 %indvars.iv.next192.3, %wide.trip.count194
  br i1 %exitcond195.not.3, label %.preheader160, label %.lr.ph168, !llvm.loop !26

.preheader159:                                    ; preds = %.lr.ph170.preheader, %.preheader160
  %101 = icmp sgt i32 %20, 0
  br i1 %101, label %.lr.ph172, label %.preheader157

.lr.ph172:                                        ; preds = %.preheader159
  %102 = getelementptr inbounds i8, ptr %3, i64 64
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %wide.trip.count202 = zext nneg i32 %20 to i64
  %min.iters.check240 = icmp ult i32 %20, 6
  %104 = ptrtoint ptr %103 to i64
  %105 = sub i64 %6, %104
  %diff.check237 = icmp ult i64 %105, 32
  %or.cond284 = select i1 %min.iters.check240, i1 true, i1 %diff.check237
  br i1 %or.cond284, label %scalar.ph239.preheader, label %vector.ph241

scalar.ph239.preheader:                           ; preds = %middle.block238, %.lr.ph172
  %indvars.iv199.ph = phi i64 [ 0, %.lr.ph172 ], [ %n.vec243, %middle.block238 ]
  %xtraiter289 = and i64 %wide.trip.count202, 3
  %lcmp.mod290.not = icmp eq i64 %xtraiter289, 0
  br i1 %lcmp.mod290.not, label %scalar.ph239.prol.loopexit, label %scalar.ph239.prol

scalar.ph239.prol:                                ; preds = %scalar.ph239.preheader, %scalar.ph239.prol
  %indvars.iv199.prol = phi i64 [ %indvars.iv.next200.prol, %scalar.ph239.prol ], [ %indvars.iv199.ph, %scalar.ph239.preheader ]
  %prol.iter291 = phi i64 [ %prol.iter291.next, %scalar.ph239.prol ], [ 0, %scalar.ph239.preheader ]
  %106 = getelementptr inbounds i64, ptr %103, i64 %indvars.iv199.prol
  %107 = load i64, ptr %106, align 8, !tbaa !16
  %108 = getelementptr inbounds i64, ptr %4, i64 %indvars.iv199.prol
  store i64 %107, ptr %108, align 8, !tbaa !16
  %indvars.iv.next200.prol = add nuw nsw i64 %indvars.iv199.prol, 1
  %prol.iter291.next = add i64 %prol.iter291, 1
  %prol.iter291.cmp.not = icmp eq i64 %prol.iter291.next, %xtraiter289
  br i1 %prol.iter291.cmp.not, label %scalar.ph239.prol.loopexit, label %scalar.ph239.prol, !llvm.loop !27

scalar.ph239.prol.loopexit:                       ; preds = %scalar.ph239.prol, %scalar.ph239.preheader
  %indvars.iv199.unr = phi i64 [ %indvars.iv199.ph, %scalar.ph239.preheader ], [ %indvars.iv.next200.prol, %scalar.ph239.prol ]
  %109 = sub nsw i64 %indvars.iv199.ph, %wide.trip.count202
  %110 = icmp ugt i64 %109, -4
  br i1 %110, label %.preheader158, label %scalar.ph239

vector.ph241:                                     ; preds = %.lr.ph172
  %n.vec243 = and i64 %wide.trip.count202, 2147483644
  br label %vector.body245

vector.body245:                                   ; preds = %vector.body245, %vector.ph241
  %index246 = phi i64 [ 0, %vector.ph241 ], [ %index.next249, %vector.body245 ]
  %111 = getelementptr inbounds i64, ptr %103, i64 %index246
  %112 = getelementptr inbounds i8, ptr %111, i64 16
  %wide.load247 = load <2 x i64>, ptr %111, align 8, !tbaa !16
  %wide.load248 = load <2 x i64>, ptr %112, align 8, !tbaa !16
  %113 = getelementptr inbounds i64, ptr %4, i64 %index246
  %114 = getelementptr inbounds i8, ptr %113, i64 16
  store <2 x i64> %wide.load247, ptr %113, align 8, !tbaa !16
  store <2 x i64> %wide.load248, ptr %114, align 8, !tbaa !16
  %index.next249 = add nuw i64 %index246, 4
  %115 = icmp eq i64 %index.next249, %n.vec243
  br i1 %115, label %middle.block238, label %vector.body245, !llvm.loop !28

middle.block238:                                  ; preds = %vector.body245
  %cmp.n250 = icmp eq i64 %n.vec243, %wide.trip.count202
  br i1 %cmp.n250, label %.preheader158, label %scalar.ph239.preheader

.preheader158:                                    ; preds = %scalar.ph239.prol.loopexit, %scalar.ph239, %middle.block238
  br i1 %101, label %.lr.ph174, label %.preheader157

.lr.ph174:                                        ; preds = %.preheader158
  %116 = getelementptr inbounds i64, ptr %4, i64 %57
  %wide.trip.count207 = zext nneg i32 %20 to i64
  %min.iters.check255 = icmp ult i32 %20, 10
  br i1 %min.iters.check255, label %scalar.ph254.preheader, label %vector.memcheck251

scalar.ph254.preheader:                           ; preds = %middle.block253, %vector.memcheck251, %.lr.ph174
  %indvars.iv204.ph = phi i64 [ 0, %vector.memcheck251 ], [ 0, %.lr.ph174 ], [ %n.vec258, %middle.block253 ]
  %xtraiter292 = and i64 %wide.trip.count202, 3
  %lcmp.mod293.not = icmp eq i64 %xtraiter292, 0
  br i1 %lcmp.mod293.not, label %scalar.ph254.prol.loopexit, label %scalar.ph254.prol

scalar.ph254.prol:                                ; preds = %scalar.ph254.preheader, %scalar.ph254.prol
  %indvars.iv204.prol = phi i64 [ %indvars.iv.next205.prol, %scalar.ph254.prol ], [ %indvars.iv204.ph, %scalar.ph254.preheader ]
  %prol.iter294 = phi i64 [ %prol.iter294.next, %scalar.ph254.prol ], [ 0, %scalar.ph254.preheader ]
  %117 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv204.prol
  %118 = load i64, ptr %117, align 8, !tbaa !16
  %119 = getelementptr inbounds i64, ptr %116, i64 %indvars.iv204.prol
  store i64 %118, ptr %119, align 8, !tbaa !16
  %indvars.iv.next205.prol = add nuw nsw i64 %indvars.iv204.prol, 1
  %prol.iter294.next = add i64 %prol.iter294, 1
  %prol.iter294.cmp.not = icmp eq i64 %prol.iter294.next, %xtraiter292
  br i1 %prol.iter294.cmp.not, label %scalar.ph254.prol.loopexit, label %scalar.ph254.prol, !llvm.loop !29

scalar.ph254.prol.loopexit:                       ; preds = %scalar.ph254.prol, %scalar.ph254.preheader
  %indvars.iv204.unr = phi i64 [ %indvars.iv204.ph, %scalar.ph254.preheader ], [ %indvars.iv.next205.prol, %scalar.ph254.prol ]
  %120 = sub nsw i64 %indvars.iv204.ph, %wide.trip.count202
  %121 = icmp ugt i64 %120, -4
  br i1 %121, label %.preheader157, label %scalar.ph254

vector.memcheck251:                               ; preds = %.lr.ph174
  %122 = shl nuw nsw i64 %57, 3
  %123 = add i64 %122, %6
  %124 = sub i64 %123, %18
  %diff.check252 = icmp ult i64 %124, 32
  br i1 %diff.check252, label %scalar.ph254.preheader, label %vector.ph256

vector.ph256:                                     ; preds = %vector.memcheck251
  %n.vec258 = and i64 %wide.trip.count202, 2147483644
  br label %vector.body260

vector.body260:                                   ; preds = %vector.body260, %vector.ph256
  %index261 = phi i64 [ 0, %vector.ph256 ], [ %index.next264, %vector.body260 ]
  %125 = getelementptr inbounds i64, ptr %17, i64 %index261
  %126 = getelementptr inbounds i8, ptr %125, i64 16
  %wide.load262 = load <2 x i64>, ptr %125, align 8, !tbaa !16
  %wide.load263 = load <2 x i64>, ptr %126, align 8, !tbaa !16
  %127 = getelementptr inbounds i64, ptr %116, i64 %index261
  %128 = getelementptr inbounds i8, ptr %127, i64 16
  store <2 x i64> %wide.load262, ptr %127, align 8, !tbaa !16
  store <2 x i64> %wide.load263, ptr %128, align 8, !tbaa !16
  %index.next264 = add nuw i64 %index261, 4
  %129 = icmp eq i64 %index.next264, %n.vec258
  br i1 %129, label %middle.block253, label %vector.body260, !llvm.loop !30

middle.block253:                                  ; preds = %vector.body260
  %cmp.n265 = icmp eq i64 %n.vec258, %wide.trip.count202
  br i1 %cmp.n265, label %.preheader157, label %scalar.ph254.preheader

scalar.ph239:                                     ; preds = %scalar.ph239.prol.loopexit, %scalar.ph239
  %indvars.iv199 = phi i64 [ %indvars.iv.next200.3, %scalar.ph239 ], [ %indvars.iv199.unr, %scalar.ph239.prol.loopexit ]
  %130 = getelementptr inbounds i64, ptr %103, i64 %indvars.iv199
  %131 = load i64, ptr %130, align 8, !tbaa !16
  %132 = getelementptr inbounds i64, ptr %4, i64 %indvars.iv199
  store i64 %131, ptr %132, align 8, !tbaa !16
  %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
  %133 = getelementptr inbounds i64, ptr %103, i64 %indvars.iv.next200
  %134 = load i64, ptr %133, align 8, !tbaa !16
  %135 = getelementptr inbounds i64, ptr %4, i64 %indvars.iv.next200
  store i64 %134, ptr %135, align 8, !tbaa !16
  %indvars.iv.next200.1 = add nuw nsw i64 %indvars.iv199, 2
  %136 = getelementptr inbounds i64, ptr %103, i64 %indvars.iv.next200.1
  %137 = load i64, ptr %136, align 8, !tbaa !16
  %138 = getelementptr inbounds i64, ptr %4, i64 %indvars.iv.next200.1
  store i64 %137, ptr %138, align 8, !tbaa !16
  %indvars.iv.next200.2 = add nuw nsw i64 %indvars.iv199, 3
  %139 = getelementptr inbounds i64, ptr %103, i64 %indvars.iv.next200.2
  %140 = load i64, ptr %139, align 8, !tbaa !16
  %141 = getelementptr inbounds i64, ptr %4, i64 %indvars.iv.next200.2
  store i64 %140, ptr %141, align 8, !tbaa !16
  %indvars.iv.next200.3 = add nuw nsw i64 %indvars.iv199, 4
  %exitcond203.not.3 = icmp eq i64 %indvars.iv.next200.3, %wide.trip.count202
  br i1 %exitcond203.not.3, label %.preheader158, label %scalar.ph239, !llvm.loop !31

.preheader157:                                    ; preds = %scalar.ph254.prol.loopexit, %scalar.ph254, %middle.block253, %.preheader159, %.preheader158
  %142 = icmp sgt i32 %67, 2
  br i1 %142, label %.lr.ph176.preheader, label %._crit_edge

.lr.ph176.preheader:                              ; preds = %.preheader157
  %wide.trip.count212 = zext nneg i32 %67 to i64
  br label %.lr.ph176

scalar.ph254:                                     ; preds = %scalar.ph254.prol.loopexit, %scalar.ph254
  %indvars.iv204 = phi i64 [ %indvars.iv.next205.3, %scalar.ph254 ], [ %indvars.iv204.unr, %scalar.ph254.prol.loopexit ]
  %143 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv204
  %144 = load i64, ptr %143, align 8, !tbaa !16
  %145 = getelementptr inbounds i64, ptr %116, i64 %indvars.iv204
  store i64 %144, ptr %145, align 8, !tbaa !16
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %146 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next205
  %147 = load i64, ptr %146, align 8, !tbaa !16
  %148 = getelementptr inbounds i64, ptr %116, i64 %indvars.iv.next205
  store i64 %147, ptr %148, align 8, !tbaa !16
  %indvars.iv.next205.1 = add nuw nsw i64 %indvars.iv204, 2
  %149 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next205.1
  %150 = load i64, ptr %149, align 8, !tbaa !16
  %151 = getelementptr inbounds i64, ptr %116, i64 %indvars.iv.next205.1
  store i64 %150, ptr %151, align 8, !tbaa !16
  %indvars.iv.next205.2 = add nuw nsw i64 %indvars.iv204, 3
  %152 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next205.2
  %153 = load i64, ptr %152, align 8, !tbaa !16
  %154 = getelementptr inbounds i64, ptr %116, i64 %indvars.iv.next205.2
  store i64 %153, ptr %154, align 8, !tbaa !16
  %indvars.iv.next205.3 = add nuw nsw i64 %indvars.iv204, 4
  %exitcond208.not.3 = icmp eq i64 %indvars.iv.next205.3, %wide.trip.count207
  br i1 %exitcond208.not.3, label %.preheader157, label %scalar.ph254, !llvm.loop !32

.lr.ph176:                                        ; preds = %.lr.ph176.preheader, %.lr.ph176
  %indvars.iv209 = phi i64 [ 2, %.lr.ph176.preheader ], [ %indvars.iv.next210, %.lr.ph176 ]
  %155 = add nsw i64 %indvars.iv209, -1
  %156 = mul nsw i64 %155, %57
  %157 = getelementptr inbounds i64, ptr %4, i64 %156
  tail call void @gsMul_school(ptr noundef nonnull %55, ptr noundef %157, ptr noundef %17, i32 noundef %20, ptr noundef nonnull %58)
  %158 = mul nsw i64 %indvars.iv209, %57
  %159 = getelementptr inbounds i64, ptr %4, i64 %158
  tail call void @cpMontRed_BNU(ptr noundef %159, ptr noundef nonnull %55, ptr noundef %3)
  %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1
  %exitcond213.not = icmp eq i64 %indvars.iv.next210, %wide.trip.count212
  br i1 %exitcond213.not, label %._crit_edge, label %.lr.ph176, !llvm.loop !33

._crit_edge:                                      ; preds = %.lr.ph176, %.preheader157
  store i64 0, ptr %61, align 8, !tbaa !16
  %160 = add i32 %65, -1
  %161 = add i32 %160, %.fr
  %162 = srem i32 %161, %.fr
  %163 = sub i32 %160, %162
  br i1 %101, label %.lr.ph179, label %.preheader156

.lr.ph179:                                        ; preds = %._crit_edge
  %164 = sdiv i32 %163, 16
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i16, ptr %13, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !34
  %168 = and i32 %163, 15
  %169 = lshr i32 %167, %168
  %170 = and i32 %169, %68
  %171 = zext i32 %170 to i64
  %172 = mul nuw nsw i64 %171, %57
  %173 = getelementptr inbounds i64, ptr %4, i64 %172
  %wide.trip.count217 = zext nneg i32 %20 to i64
  %min.iters.check270 = icmp ult i32 %20, 16
  br i1 %min.iters.check270, label %scalar.ph269.preheader, label %vector.memcheck266

scalar.ph269.preheader:                           ; preds = %middle.block268, %vector.memcheck266, %.lr.ph179
  %indvars.iv214.ph = phi i64 [ 0, %vector.memcheck266 ], [ 0, %.lr.ph179 ], [ %n.vec273, %middle.block268 ]
  %xtraiter295 = and i64 %wide.trip.count217, 3
  %lcmp.mod296.not = icmp eq i64 %xtraiter295, 0
  br i1 %lcmp.mod296.not, label %scalar.ph269.prol.loopexit, label %scalar.ph269.prol

scalar.ph269.prol:                                ; preds = %scalar.ph269.preheader, %scalar.ph269.prol
  %indvars.iv214.prol = phi i64 [ %indvars.iv.next215.prol, %scalar.ph269.prol ], [ %indvars.iv214.ph, %scalar.ph269.preheader ]
  %prol.iter297 = phi i64 [ %prol.iter297.next, %scalar.ph269.prol ], [ 0, %scalar.ph269.preheader ]
  %174 = getelementptr inbounds i64, ptr %173, i64 %indvars.iv214.prol
  %175 = load i64, ptr %174, align 8, !tbaa !16
  %176 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv214.prol
  store i64 %175, ptr %176, align 8, !tbaa !16
  %indvars.iv.next215.prol = add nuw nsw i64 %indvars.iv214.prol, 1
  %prol.iter297.next = add i64 %prol.iter297, 1
  %prol.iter297.cmp.not = icmp eq i64 %prol.iter297.next, %xtraiter295
  br i1 %prol.iter297.cmp.not, label %scalar.ph269.prol.loopexit, label %scalar.ph269.prol, !llvm.loop !35

scalar.ph269.prol.loopexit:                       ; preds = %scalar.ph269.prol, %scalar.ph269.preheader
  %indvars.iv214.unr = phi i64 [ %indvars.iv214.ph, %scalar.ph269.preheader ], [ %indvars.iv.next215.prol, %scalar.ph269.prol ]
  %177 = sub nsw i64 %indvars.iv214.ph, %wide.trip.count217
  %178 = icmp ugt i64 %177, -4
  br i1 %178, label %.preheader156, label %scalar.ph269

vector.memcheck266:                               ; preds = %.lr.ph179
  %179 = mul nuw nsw i64 %57, %171
  %180 = shl i64 %179, 3
  %181 = add i64 %180, %6
  %182 = sub i64 %18, %181
  %diff.check267 = icmp ult i64 %182, 32
  br i1 %diff.check267, label %scalar.ph269.preheader, label %vector.ph271

vector.ph271:                                     ; preds = %vector.memcheck266
  %n.vec273 = and i64 %wide.trip.count217, 2147483644
  br label %vector.body275

vector.body275:                                   ; preds = %vector.body275, %vector.ph271
  %index276 = phi i64 [ 0, %vector.ph271 ], [ %index.next279, %vector.body275 ]
  %183 = getelementptr inbounds i64, ptr %173, i64 %index276
  %184 = getelementptr inbounds i8, ptr %183, i64 16
  %wide.load277 = load <2 x i64>, ptr %183, align 8, !tbaa !16
  %wide.load278 = load <2 x i64>, ptr %184, align 8, !tbaa !16
  %185 = getelementptr inbounds i64, ptr %17, i64 %index276
  %186 = getelementptr inbounds i8, ptr %185, i64 16
  store <2 x i64> %wide.load277, ptr %185, align 8, !tbaa !16
  store <2 x i64> %wide.load278, ptr %186, align 8, !tbaa !16
  %index.next279 = add nuw i64 %index276, 4
  %187 = icmp eq i64 %index.next279, %n.vec273
  br i1 %187, label %middle.block268, label %vector.body275, !llvm.loop !36

middle.block268:                                  ; preds = %vector.body275
  %cmp.n280 = icmp eq i64 %n.vec273, %wide.trip.count217
  br i1 %cmp.n280, label %.preheader156, label %scalar.ph269.preheader

.preheader156:                                    ; preds = %scalar.ph269.prol.loopexit, %scalar.ph269, %middle.block268, %._crit_edge
  %.0138183 = sub nsw i32 %163, %.fr
  %188 = icmp sgt i32 %.0138183, -1
  br i1 %188, label %.preheader.lr.ph, label %._crit_edge185

.preheader.lr.ph:                                 ; preds = %.preheader156
  %189 = icmp sgt i32 %.fr, 0
  br label %.preheader

scalar.ph269:                                     ; preds = %scalar.ph269.prol.loopexit, %scalar.ph269
  %indvars.iv214 = phi i64 [ %indvars.iv.next215.3, %scalar.ph269 ], [ %indvars.iv214.unr, %scalar.ph269.prol.loopexit ]
  %190 = getelementptr inbounds i64, ptr %173, i64 %indvars.iv214
  %191 = load i64, ptr %190, align 8, !tbaa !16
  %192 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv214
  store i64 %191, ptr %192, align 8, !tbaa !16
  %indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
  %193 = getelementptr inbounds i64, ptr %173, i64 %indvars.iv.next215
  %194 = load i64, ptr %193, align 8, !tbaa !16
  %195 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next215
  store i64 %194, ptr %195, align 8, !tbaa !16
  %indvars.iv.next215.1 = add nuw nsw i64 %indvars.iv214, 2
  %196 = getelementptr inbounds i64, ptr %173, i64 %indvars.iv.next215.1
  %197 = load i64, ptr %196, align 8, !tbaa !16
  %198 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next215.1
  store i64 %197, ptr %198, align 8, !tbaa !16
  %indvars.iv.next215.2 = add nuw nsw i64 %indvars.iv214, 3
  %199 = getelementptr inbounds i64, ptr %173, i64 %indvars.iv.next215.2
  %200 = load i64, ptr %199, align 8, !tbaa !16
  %201 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next215.2
  store i64 %200, ptr %201, align 8, !tbaa !16
  %indvars.iv.next215.3 = add nuw nsw i64 %indvars.iv214, 4
  %exitcond218.not.3 = icmp eq i64 %indvars.iv.next215.3, %wide.trip.count217
  br i1 %exitcond218.not.3, label %.preheader156, label %scalar.ph269, !llvm.loop !37

.preheader:                                       ; preds = %.preheader.lr.ph, %214
  %.0138184 = phi i32 [ %.0138183, %.preheader.lr.ph ], [ %.0138, %214 ]
  br i1 %189, label %.lr.ph181, label %._crit_edge182

.lr.ph181:                                        ; preds = %.preheader, %.lr.ph181
  %.1143180 = phi i32 [ %202, %.lr.ph181 ], [ 0, %.preheader ]
  tail call void @gsSqr_school(ptr noundef nonnull %55, ptr noundef %17, i32 noundef %20, ptr noundef nonnull %58)
  tail call void @cpMontRed_BNU(ptr noundef %17, ptr noundef nonnull %55, ptr noundef %3)
  %202 = add nuw nsw i32 %.1143180, 1
  %exitcond219.not = icmp eq i32 %202, %.fr
  br i1 %exitcond219.not, label %._crit_edge182, label %.lr.ph181, !llvm.loop !38

._crit_edge182:                                   ; preds = %.lr.ph181, %.preheader
  %203 = lshr i32 %.0138184, 4
  %204 = zext nneg i32 %203 to i64
  %205 = getelementptr inbounds i16, ptr %13, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !34
  %207 = and i32 %.0138184, 15
  %208 = lshr i32 %206, %207
  %209 = and i32 %208, %68
  %.not153 = icmp eq i32 %209, 0
  br i1 %.not153, label %214, label %210

210:                                              ; preds = %._crit_edge182
  %211 = zext i32 %209 to i64
  %212 = mul nsw i64 %211, %57
  %213 = getelementptr inbounds i64, ptr %4, i64 %212
  tail call void @gsMul_school(ptr noundef nonnull %55, ptr noundef %17, ptr noundef %213, i32 noundef %20, ptr noundef nonnull %58)
  tail call void @cpMontRed_BNU(ptr noundef %17, ptr noundef nonnull %55, ptr noundef %3)
  br label %214

214:                                              ; preds = %._crit_edge182, %210
  %.0138 = sub nsw i32 %.0138184, %.fr
  %215 = icmp sgt i32 %.0138, -1
  br i1 %215, label %.preheader, label %._crit_edge185, !llvm.loop !39

._crit_edge185:                                   ; preds = %214, %.preheader156
  tail call void @gsModPoolFree(ptr noundef %3, i32 noundef 2)
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.lr.ph166.preheader, %.preheader162, %.preheader161, %._crit_edge185
  %216 = tail call i32 @cpFix_BNU(ptr noundef %17, i32 noundef %20)
  %217 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %216, ptr %217, align 8, !tbaa !11
  %218 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 1, ptr %218, align 4, !tbaa !40
  br label %.critedge

.critedge:                                        ; preds = %54, %.loopexit
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpEqu_BNU_CHUNK(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @gsModPoolAlloc(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @gsMul_school(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @gsSqr_school(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @cpNLZ_BNU(i64 noundef) local_unnamed_addr #2

declare i32 @cpMontExp_WinSize(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cpMontRed_BNU(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @gsModPoolFree(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpFix_BNU(ptr noundef, i32 noundef) local_unnamed_addr #1

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

attributes #0 = { 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 = { inlinehint 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !10, i64 16}
!6 = !{!"_cpBigNum", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!13, !7, i64 16}
!13 = !{!"_gsModEngine", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !14, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !7, i64 100, !10, i64 104}
!14 = !{!"long long", !8, i64 0}
!15 = !{!13, !10, i64 64}
!16 = !{!14, !14, i64 0}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !18, !19}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !18, !19, !20}
!26 = distinct !{!26, !18, !19}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !18, !19, !20}
!29 = distinct !{!29, !22}
!30 = distinct !{!30, !18, !19, !20}
!31 = distinct !{!31, !18, !19}
!32 = distinct !{!32, !18, !19}
!33 = distinct !{!33, !18}
!34 = !{!7, !7, i64 0}
!35 = distinct !{!35, !22}
!36 = distinct !{!36, !18, !19, !20}
!37 = distinct !{!37, !18, !19}
!38 = distinct !{!38, !18}
!39 = distinct !{!39, !18}
!40 = !{!6, !7, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass