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

; 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_sscm(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 ptr, align 8
  %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
  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
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._cpBigNum, ptr %37, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  store ptr %39, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._cpBigNum, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !12
  store i32 %42, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._cpBigNum, ptr %43, i32 0, i32 4
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  store ptr %45, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._cpBigNum, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 8, !tbaa !12
  store i32 %48, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._cpBigNum, ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  store ptr %51, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._gsModEngine, ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 8, !tbaa !14
  store i32 %54, ptr %16, align 4, !tbaa !13
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = load i32, ptr %14, align 4, !tbaa !13
  %57 = call i32 @cpEqu_BNU_CHUNK(ptr noundef %55, i32 noundef %56, i64 noundef 0)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %80

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

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

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

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

79:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %332

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

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

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

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

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

98:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %331

99:                                               ; preds = %80
  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
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = call ptr @gsModPoolAlloc(ptr noundef %100, i32 noundef 2)
  store ptr %101, ptr %20, align 8, !tbaa !5
  %102 = load ptr, ptr %20, align 8, !tbaa !5
  %103 = icmp eq ptr null, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %99
  store i32 1, ptr %21, align 4
  br label %328

105:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %106 = load ptr, ptr %20, align 8, !tbaa !5
  %107 = load i32, ptr %16, align 4, !tbaa !13
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i64, ptr %106, i64 %108
  store ptr %109, 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
  %110 = load i32, ptr %14, align 4, !tbaa !13
  %111 = mul nsw i32 %110, 64
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = load i32, ptr %14, align 4, !tbaa !13
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i64, ptr %112, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !18
  %118 = call i32 @cpNLZ_BNU(i64 noundef %117)
  %119 = sub nsw i32 %111, %118
  store i32 %119, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %120 = load i32, ptr %25, align 4, !tbaa !13
  %121 = call i32 @cpMontExp_WinSize(i32 noundef %120)
  store i32 %121, ptr %26, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %122 = load i32, ptr %26, align 4, !tbaa !13
  %123 = shl i32 1, %122
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  store i64 %125, ptr %27, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  %126 = load i32, ptr %26, align 4, !tbaa !13
  %127 = shl i32 1, %126
  store i32 %127, ptr %28, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._cpBigNum, ptr %128, i32 0, i32 5
  %130 = load ptr, ptr %129, align 8, !tbaa !22
  store ptr %130, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  store i32 0, ptr %31, align 4, !tbaa !13
  br label %131

131:                                              ; preds = %145, %105
  %132 = load i32, ptr %31, align 4, !tbaa !13
  %133 = load i32, ptr %12, align 4, !tbaa !13
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %135, label %148

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

145:                                              ; preds = %135
  %146 = load i32, ptr %31, align 4, !tbaa !13
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %31, align 4, !tbaa !13
  br label %131, !llvm.loop !23

148:                                              ; preds = %131
  br label %149

149:                                              ; preds = %158, %148
  %150 = load i32, ptr %31, align 4, !tbaa !13
  %151 = load i32, ptr %16, align 4, !tbaa !13
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %153, label %161

153:                                              ; preds = %149
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = load i32, ptr %31, align 4, !tbaa !13
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i64, ptr %154, i64 %156
  store i64 0, ptr %157, align 8, !tbaa !18
  br label %158

158:                                              ; preds = %153
  %159 = load i32, ptr %31, align 4, !tbaa !13
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %31, align 4, !tbaa !13
  br label %149, !llvm.loop !24

161:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = call i64 @IPP_INT_PTR(ptr noundef %163)
  %165 = and i64 %164, 63
  %166 = xor i64 %165, -1
  %167 = add nsw i64 %166, 1
  %168 = and i64 %167, 63
  %169 = getelementptr inbounds i8, ptr %162, i64 %168
  store ptr %169, ptr %10, align 8, !tbaa !5
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._gsModEngine, ptr %171, i32 0, i32 10
  %173 = load ptr, ptr %172, align 8, !tbaa !17
  %174 = load i32, ptr %16, align 4, !tbaa !13
  %175 = load i32, ptr %26, align 4, !tbaa !13
  call void @gsScramblePut(ptr noundef %170, i32 noundef 0, ptr noundef %173, i32 noundef %174, i32 noundef %175)
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  store i32 0, ptr %32, align 4, !tbaa !13
  br label %176

176:                                              ; preds = %190, %161
  %177 = load i32, ptr %32, align 4, !tbaa !13
  %178 = load i32, ptr %12, align 4, !tbaa !13
  %179 = icmp slt i32 %177, %178
  br i1 %179, label %180, label %193

180:                                              ; preds = %176
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = load i32, ptr %32, align 4, !tbaa !13
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i64, ptr %181, i64 %183
  %185 = load i64, ptr %184, align 8, !tbaa !18
  %186 = load ptr, ptr %30, 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
  store i64 %185, ptr %189, align 8, !tbaa !18
  br label %190

190:                                              ; preds = %180
  %191 = load i32, ptr %32, align 4, !tbaa !13
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %32, align 4, !tbaa !13
  br label %176, !llvm.loop !25

193:                                              ; preds = %176
  br label %194

194:                                              ; preds = %203, %193
  %195 = load i32, ptr %32, align 4, !tbaa !13
  %196 = load i32, ptr %16, align 4, !tbaa !13
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %198, label %206

198:                                              ; preds = %194
  %199 = load ptr, ptr %30, align 8, !tbaa !5
  %200 = load i32, ptr %32, align 4, !tbaa !13
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i64, ptr %199, i64 %201
  store i64 0, ptr %202, align 8, !tbaa !18
  br label %203

203:                                              ; preds = %198
  %204 = load i32, ptr %32, align 4, !tbaa !13
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %32, align 4, !tbaa !13
  br label %194, !llvm.loop !26

206:                                              ; preds = %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = load ptr, ptr %30, align 8, !tbaa !5
  %209 = load i32, ptr %16, align 4, !tbaa !13
  %210 = load i32, ptr %26, align 4, !tbaa !13
  call void @gsScramblePut(ptr noundef %207, i32 noundef 1, ptr noundef %208, i32 noundef %209, i32 noundef %210)
  store i32 2, ptr %29, align 4, !tbaa !13
  br label %211

211:                                              ; preds = %230, %206
  %212 = load i32, ptr %29, align 4, !tbaa !13
  %213 = load i32, ptr %28, align 4, !tbaa !13
  %214 = icmp slt i32 %212, %213
  br i1 %214, label %215, label %233

215:                                              ; preds = %211
  %216 = load ptr, ptr %23, align 8, !tbaa !5
  %217 = load ptr, ptr %20, align 8, !tbaa !5
  %218 = load ptr, ptr %30, align 8, !tbaa !5
  %219 = load ptr, ptr %15, align 8, !tbaa !5
  %220 = load i32, ptr %16, align 4, !tbaa !13
  %221 = load ptr, ptr %22, align 8, !tbaa !5
  call void %216(ptr noundef %217, ptr noundef %218, ptr noundef %219, i32 noundef %220, ptr noundef %221)
  %222 = load ptr, ptr %30, align 8, !tbaa !5
  %223 = load ptr, ptr %20, align 8, !tbaa !5
  %224 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpMontRed_BNU(ptr noundef %222, ptr noundef %223, ptr noundef %224)
  %225 = load ptr, ptr %10, align 8, !tbaa !5
  %226 = load i32, ptr %29, align 4, !tbaa !13
  %227 = load ptr, ptr %30, align 8, !tbaa !5
  %228 = load i32, ptr %16, align 4, !tbaa !13
  %229 = load i32, ptr %26, align 4, !tbaa !13
  call void @gsScramblePut(ptr noundef %225, i32 noundef %226, ptr noundef %227, i32 noundef %228, i32 noundef %229)
  br label %230

230:                                              ; preds = %215
  %231 = load i32, ptr %29, align 4, !tbaa !13
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %29, align 4, !tbaa !13
  br label %211, !llvm.loop !27

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

272:                                              ; preds = %322, %233
  %273 = load i32, ptr %33, align 4, !tbaa !13
  %274 = icmp sge i32 %273, 0
  br i1 %274, label %275, label %326

275:                                              ; preds = %272
  store i32 0, ptr %29, align 4, !tbaa !13
  store i32 0, ptr %36, align 4, !tbaa !13
  br label %276

276:                                              ; preds = %289, %275
  %277 = load i32, ptr %29, align 4, !tbaa !13
  %278 = load i32, ptr %26, align 4, !tbaa !13
  %279 = icmp slt i32 %277, %278
  br i1 %279, label %280, label %292

280:                                              ; preds = %276
  %281 = load ptr, ptr %24, align 8, !tbaa !5
  %282 = load ptr, ptr %20, align 8, !tbaa !5
  %283 = load ptr, ptr %15, align 8, !tbaa !5
  %284 = load i32, ptr %16, align 4, !tbaa !13
  %285 = load ptr, ptr %22, align 8, !tbaa !5
  call void %281(ptr noundef %282, ptr noundef %283, i32 noundef %284, ptr noundef %285)
  %286 = load ptr, ptr %15, align 8, !tbaa !5
  %287 = load ptr, ptr %20, align 8, !tbaa !5
  %288 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpMontRed_BNU(ptr noundef %286, ptr noundef %287, ptr noundef %288)
  br label %289

289:                                              ; preds = %280
  %290 = load i32, ptr %29, align 4, !tbaa !13
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %29, align 4, !tbaa !13
  br label %276, !llvm.loop !28

292:                                              ; preds = %276
  %293 = load ptr, ptr %13, align 8, !tbaa !5
  %294 = load i32, ptr %33, align 4, !tbaa !13
  %295 = sdiv i32 %294, 16
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds i16, ptr %293, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !13
  store i32 %298, ptr %34, align 4, !tbaa !13
  %299 = load i32, ptr %33, align 4, !tbaa !13
  %300 = and i32 %299, 15
  store i32 %300, ptr %35, align 4, !tbaa !13
  %301 = load i32, ptr %34, align 4, !tbaa !13
  %302 = load i32, ptr %35, align 4, !tbaa !13
  %303 = lshr i32 %301, %302
  %304 = zext i32 %303 to i64
  %305 = load i64, ptr %27, align 8, !tbaa !18
  %306 = and i64 %304, %305
  %307 = trunc i64 %306 to i32
  store i32 %307, ptr %36, align 4, !tbaa !13
  %308 = load ptr, ptr %30, align 8, !tbaa !5
  %309 = load i32, ptr %16, align 4, !tbaa !13
  %310 = load ptr, ptr %10, align 8, !tbaa !5
  %311 = load i32, ptr %36, align 4, !tbaa !13
  %312 = load i32, ptr %26, align 4, !tbaa !13
  call void @gsScrambleGet_sscm(ptr noundef %308, i32 noundef %309, ptr noundef %310, i32 noundef %311, i32 noundef %312)
  %313 = load ptr, ptr %23, align 8, !tbaa !5
  %314 = load ptr, ptr %20, align 8, !tbaa !5
  %315 = load ptr, ptr %15, align 8, !tbaa !5
  %316 = load ptr, ptr %30, align 8, !tbaa !5
  %317 = load i32, ptr %16, align 4, !tbaa !13
  %318 = load ptr, ptr %22, align 8, !tbaa !5
  call void %313(ptr noundef %314, ptr noundef %315, ptr noundef %316, i32 noundef %317, ptr noundef %318)
  %319 = load ptr, ptr %15, align 8, !tbaa !5
  %320 = load ptr, ptr %20, align 8, !tbaa !5
  %321 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpMontRed_BNU(ptr noundef %319, ptr noundef %320, ptr noundef %321)
  br label %322

322:                                              ; preds = %292
  %323 = load i32, ptr %26, align 4, !tbaa !13
  %324 = load i32, ptr %33, align 4, !tbaa !13
  %325 = sub nsw i32 %324, %323
  store i32 %325, ptr %33, align 4, !tbaa !13
  br label %272, !llvm.loop !29

326:                                              ; preds = %272
  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
  %327 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %327, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  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 %328

328:                                              ; preds = %326, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %329 = load i32, ptr %21, align 4
  switch i32 %329, label %341 [
    i32 0, label %330
  ]

330:                                              ; preds = %328
  br label %331

331:                                              ; preds = %330, %98
  br label %332

332:                                              ; preds = %331, %79
  %333 = load ptr, ptr %15, align 8, !tbaa !5
  %334 = load i32, ptr %16, align 4, !tbaa !13
  %335 = call i32 @cpFix_BNU(ptr noundef %333, i32 noundef %334)
  store i32 %335, ptr %16, align 4, !tbaa !13
  %336 = load i32, ptr %16, align 4, !tbaa !13
  %337 = load ptr, ptr %6, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct._cpBigNum, ptr %337, i32 0, i32 2
  store i32 %336, ptr %338, align 8, !tbaa !12
  %339 = load ptr, ptr %6, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct._cpBigNum, ptr %339, i32 0, i32 1
  store i32 1, ptr %340, align 4, !tbaa !30
  store i32 0, ptr %21, align 4
  br label %341

341:                                              ; preds = %332, %328
  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
  %342 = load i32, ptr %21, align 4
  switch i32 %342, label %344 [
    i32 0, label %343
    i32 1, label %343
  ]

343:                                              ; preds = %341, %341
  ret void

344:                                              ; preds = %341
  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 i64 @IPP_INT_PTR(ptr noundef) #2

declare void @gsScramblePut(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

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

declare void @gsScrambleGet_sscm(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

; 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 = !{!10, !6, i64 24}
!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_sscm(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 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = ptrtoint ptr %7 to i64
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %2, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = ptrtoint ptr %16 to i64
  %18 = getelementptr inbounds i8, ptr %3, i64 16
  %19 = load i32, ptr %18, align 8, !tbaa !12
  %20 = tail call i32 @cpEqu_BNU_CHUNK(ptr noundef %12, i32 noundef %14, i64 noundef 0)
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %48, label %.preheader163

.preheader163:                                    ; preds = %5
  %21 = icmp sgt i32 %19, 0
  br i1 %21, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader163
  %22 = getelementptr inbounds i8, ptr %3, i64 64
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %wide.trip.count = zext nneg i32 %19 to i64
  %min.iters.check = icmp ult i32 %19, 6
  %24 = ptrtoint ptr %23 to i64
  %25 = sub i64 %17, %24
  %diff.check = icmp ult i64 %25, 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 ]
  %26 = getelementptr inbounds i64, ptr %23, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <2 x i64>, ptr %26, align 8, !tbaa !16
  %wide.load214 = load <2 x i64>, ptr %27, align 8, !tbaa !16
  %28 = getelementptr inbounds i64, ptr %16, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store <2 x i64> %wide.load, ptr %28, align 8, !tbaa !16
  store <2 x i64> %wide.load214, ptr %29, align 8, !tbaa !16
  %index.next = add nuw i64 %index, 4
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, 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 ]
  %31 = getelementptr inbounds i64, ptr %23, i64 %indvars.iv.prol
  %32 = load i64, ptr %31, align 8, !tbaa !16
  %33 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.prol
  store i64 %32, ptr %33, 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 ]
  %34 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %35 = icmp ugt i64 %34, -4
  br i1 %35, 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 ]
  %36 = getelementptr inbounds i64, ptr %23, i64 %indvars.iv
  %37 = load i64, ptr %36, align 8, !tbaa !16
  %38 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv
  store i64 %37, ptr %38, align 8, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = getelementptr inbounds i64, ptr %23, i64 %indvars.iv.next
  %40 = load i64, ptr %39, align 8, !tbaa !16
  %41 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next
  store i64 %40, ptr %41, align 8, !tbaa !16
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %42 = getelementptr inbounds i64, ptr %23, i64 %indvars.iv.next.1
  %43 = load i64, ptr %42, align 8, !tbaa !16
  %44 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next.1
  store i64 %43, ptr %44, align 8, !tbaa !16
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %45 = getelementptr inbounds i64, ptr %23, i64 %indvars.iv.next.2
  %46 = load i64, ptr %45, align 8, !tbaa !16
  %47 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next.2
  store i64 %46, ptr %47, 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

48:                                               ; preds = %5
  %49 = tail call i32 @cpEqu_BNU_CHUNK(ptr noundef %7, i32 noundef %10, i64 noundef 0)
  %.not156 = icmp eq i32 %49, 0
  br i1 %.not156, label %53, label %.preheader162

.preheader162:                                    ; preds = %48
  %50 = icmp sgt i32 %19, 0
  br i1 %50, label %.lr.ph167.preheader, label %.loopexit

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

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

55:                                               ; preds = %53
  %56 = sext i32 %19 to i64
  %57 = getelementptr inbounds i64, ptr %54, i64 %56
  %58 = shl nsw i32 %14, 6
  %59 = sext i32 %14 to i64
  %60 = getelementptr i64, ptr %12, i64 %59
  %61 = getelementptr i8, ptr %60, i64 -8
  %62 = load i64, ptr %61, align 8, !tbaa !16
  %63 = tail call i32 @cpNLZ_BNU(i64 noundef %62) #4
  %64 = sub nsw i32 %58, %63
  %65 = tail call i32 @cpMontExp_WinSize(i32 noundef %64) #4
  %.fr = freeze i32 %65
  %66 = shl nuw i32 1, %.fr
  %67 = add nsw i32 %66, -1
  %68 = getelementptr inbounds i8, ptr %0, i64 24
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  %70 = ptrtoint ptr %69 to i64
  %71 = icmp sgt i32 %10, 0
  br i1 %71, label %.lr.ph169.preheader, label %.preheader161

.lr.ph169.preheader:                              ; preds = %55
  %wide.trip.count198 = zext nneg i32 %10 to i64
  %min.iters.check219 = icmp ult i32 %10, 6
  %72 = sub i64 %17, %8
  %diff.check216 = icmp ult i64 %72, 32
  %or.cond246 = select i1 %min.iters.check219, i1 true, i1 %diff.check216
  br i1 %or.cond246, label %.lr.ph169.preheader249, label %vector.ph220

.lr.ph169.preheader249:                           ; preds = %middle.block217, %.lr.ph169.preheader
  %indvars.iv195.ph = phi i64 [ 0, %.lr.ph169.preheader ], [ %n.vec222, %middle.block217 ]
  %xtraiter250 = and i64 %wide.trip.count198, 3
  %lcmp.mod251.not = icmp eq i64 %xtraiter250, 0
  br i1 %lcmp.mod251.not, label %.lr.ph169.prol.loopexit, label %.lr.ph169.prol

.lr.ph169.prol:                                   ; preds = %.lr.ph169.preheader249, %.lr.ph169.prol
  %indvars.iv195.prol = phi i64 [ %indvars.iv.next196.prol, %.lr.ph169.prol ], [ %indvars.iv195.ph, %.lr.ph169.preheader249 ]
  %prol.iter252 = phi i64 [ %prol.iter252.next, %.lr.ph169.prol ], [ 0, %.lr.ph169.preheader249 ]
  %73 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv195.prol
  %74 = load i64, ptr %73, align 8, !tbaa !16
  %75 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv195.prol
  store i64 %74, ptr %75, align 8, !tbaa !16
  %indvars.iv.next196.prol = add nuw nsw i64 %indvars.iv195.prol, 1
  %prol.iter252.next = add i64 %prol.iter252, 1
  %prol.iter252.cmp.not = icmp eq i64 %prol.iter252.next, %xtraiter250
  br i1 %prol.iter252.cmp.not, label %.lr.ph169.prol.loopexit, label %.lr.ph169.prol, !llvm.loop !25

.lr.ph169.prol.loopexit:                          ; preds = %.lr.ph169.prol, %.lr.ph169.preheader249
  %indvars.iv195.unr = phi i64 [ %indvars.iv195.ph, %.lr.ph169.preheader249 ], [ %indvars.iv.next196.prol, %.lr.ph169.prol ]
  %76 = sub nsw i64 %indvars.iv195.ph, %wide.trip.count198
  %77 = icmp ugt i64 %76, -4
  br i1 %77, label %.preheader161, label %.lr.ph169

vector.ph220:                                     ; preds = %.lr.ph169.preheader
  %n.vec222 = and i64 %wide.trip.count198, 2147483644
  br label %vector.body224

vector.body224:                                   ; preds = %vector.body224, %vector.ph220
  %index225 = phi i64 [ 0, %vector.ph220 ], [ %index.next228, %vector.body224 ]
  %78 = getelementptr inbounds i64, ptr %7, i64 %index225
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  %wide.load226 = load <2 x i64>, ptr %78, align 8, !tbaa !16
  %wide.load227 = load <2 x i64>, ptr %79, align 8, !tbaa !16
  %80 = getelementptr inbounds i64, ptr %16, i64 %index225
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  store <2 x i64> %wide.load226, ptr %80, align 8, !tbaa !16
  store <2 x i64> %wide.load227, ptr %81, align 8, !tbaa !16
  %index.next228 = add nuw i64 %index225, 4
  %82 = icmp eq i64 %index.next228, %n.vec222
  br i1 %82, label %middle.block217, label %vector.body224, !llvm.loop !26

middle.block217:                                  ; preds = %vector.body224
  %cmp.n229 = icmp eq i64 %n.vec222, %wide.trip.count198
  br i1 %cmp.n229, label %.preheader161, label %.lr.ph169.preheader249

.preheader161:                                    ; preds = %.lr.ph169.prol.loopexit, %.lr.ph169, %middle.block217, %55
  %.0146.lcssa = phi i32 [ 0, %55 ], [ %10, %middle.block217 ], [ %10, %.lr.ph169 ], [ %10, %.lr.ph169.prol.loopexit ]
  %83 = icmp slt i32 %.0146.lcssa, %19
  br i1 %83, label %.lr.ph171.preheader, label %._crit_edge

.lr.ph171.preheader:                              ; preds = %.preheader161
  %84 = zext nneg i32 %.0146.lcssa to i64
  %85 = shl nuw nsw i64 %84, 3
  %scevgep = getelementptr i8, ptr %16, i64 %85
  %86 = xor i32 %.0146.lcssa, -1
  %87 = add i32 %19, %86
  %88 = zext i32 %87 to i64
  %89 = shl nuw nsw i64 %88, 3
  %90 = add nuw nsw i64 %89, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %90, i1 false), !tbaa !16
  br label %._crit_edge

.lr.ph169:                                        ; preds = %.lr.ph169.prol.loopexit, %.lr.ph169
  %indvars.iv195 = phi i64 [ %indvars.iv.next196.3, %.lr.ph169 ], [ %indvars.iv195.unr, %.lr.ph169.prol.loopexit ]
  %91 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv195
  %92 = load i64, ptr %91, align 8, !tbaa !16
  %93 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv195
  store i64 %92, ptr %93, align 8, !tbaa !16
  %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
  %94 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv.next196
  %95 = load i64, ptr %94, align 8, !tbaa !16
  %96 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next196
  store i64 %95, ptr %96, align 8, !tbaa !16
  %indvars.iv.next196.1 = add nuw nsw i64 %indvars.iv195, 2
  %97 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv.next196.1
  %98 = load i64, ptr %97, align 8, !tbaa !16
  %99 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next196.1
  store i64 %98, ptr %99, align 8, !tbaa !16
  %indvars.iv.next196.2 = add nuw nsw i64 %indvars.iv195, 3
  %100 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv.next196.2
  %101 = load i64, ptr %100, align 8, !tbaa !16
  %102 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next196.2
  store i64 %101, ptr %102, align 8, !tbaa !16
  %indvars.iv.next196.3 = add nuw nsw i64 %indvars.iv195, 4
  %exitcond199.not.3 = icmp eq i64 %indvars.iv.next196.3, %wide.trip.count198
  br i1 %exitcond199.not.3, label %.preheader161, label %.lr.ph169, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph171.preheader, %.preheader161
  %103 = tail call i64 @IPP_INT_PTR(ptr noundef %4)
  %104 = sub i64 0, %103
  %105 = and i64 %104, 63
  %106 = getelementptr inbounds i8, ptr %4, i64 %105
  %107 = getelementptr inbounds i8, ptr %3, i64 64
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  tail call void @gsScramblePut(ptr noundef %106, i32 noundef 0, ptr noundef %108, i32 noundef %19, i32 noundef %.fr) #4
  br i1 %71, label %.lr.ph174.preheader, label %.preheader160

.lr.ph174.preheader:                              ; preds = %._crit_edge
  %wide.trip.count206 = zext nneg i32 %10 to i64
  %min.iters.check234 = icmp ult i32 %10, 6
  %109 = sub i64 %70, %8
  %diff.check231 = icmp ult i64 %109, 32
  %or.cond247 = select i1 %min.iters.check234, i1 true, i1 %diff.check231
  br i1 %or.cond247, label %.lr.ph174.preheader248, label %vector.ph235

.lr.ph174.preheader248:                           ; preds = %middle.block232, %.lr.ph174.preheader
  %indvars.iv203.ph = phi i64 [ 0, %.lr.ph174.preheader ], [ %n.vec237, %middle.block232 ]
  %xtraiter253 = and i64 %wide.trip.count206, 3
  %lcmp.mod254.not = icmp eq i64 %xtraiter253, 0
  br i1 %lcmp.mod254.not, label %.lr.ph174.prol.loopexit, label %.lr.ph174.prol

.lr.ph174.prol:                                   ; preds = %.lr.ph174.preheader248, %.lr.ph174.prol
  %indvars.iv203.prol = phi i64 [ %indvars.iv.next204.prol, %.lr.ph174.prol ], [ %indvars.iv203.ph, %.lr.ph174.preheader248 ]
  %prol.iter255 = phi i64 [ %prol.iter255.next, %.lr.ph174.prol ], [ 0, %.lr.ph174.preheader248 ]
  %110 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv203.prol
  %111 = load i64, ptr %110, align 8, !tbaa !16
  %112 = getelementptr inbounds i64, ptr %69, i64 %indvars.iv203.prol
  store i64 %111, ptr %112, align 8, !tbaa !16
  %indvars.iv.next204.prol = add nuw nsw i64 %indvars.iv203.prol, 1
  %prol.iter255.next = add i64 %prol.iter255, 1
  %prol.iter255.cmp.not = icmp eq i64 %prol.iter255.next, %xtraiter253
  br i1 %prol.iter255.cmp.not, label %.lr.ph174.prol.loopexit, label %.lr.ph174.prol, !llvm.loop !28

.lr.ph174.prol.loopexit:                          ; preds = %.lr.ph174.prol, %.lr.ph174.preheader248
  %indvars.iv203.unr = phi i64 [ %indvars.iv203.ph, %.lr.ph174.preheader248 ], [ %indvars.iv.next204.prol, %.lr.ph174.prol ]
  %113 = sub nsw i64 %indvars.iv203.ph, %wide.trip.count206
  %114 = icmp ugt i64 %113, -4
  br i1 %114, label %.preheader160, label %.lr.ph174

vector.ph235:                                     ; preds = %.lr.ph174.preheader
  %n.vec237 = and i64 %wide.trip.count206, 2147483644
  br label %vector.body239

vector.body239:                                   ; preds = %vector.body239, %vector.ph235
  %index240 = phi i64 [ 0, %vector.ph235 ], [ %index.next243, %vector.body239 ]
  %115 = getelementptr inbounds i64, ptr %7, i64 %index240
  %116 = getelementptr inbounds i8, ptr %115, i64 16
  %wide.load241 = load <2 x i64>, ptr %115, align 8, !tbaa !16
  %wide.load242 = load <2 x i64>, ptr %116, align 8, !tbaa !16
  %117 = getelementptr inbounds i64, ptr %69, i64 %index240
  %118 = getelementptr inbounds i8, ptr %117, i64 16
  store <2 x i64> %wide.load241, ptr %117, align 8, !tbaa !16
  store <2 x i64> %wide.load242, ptr %118, align 8, !tbaa !16
  %index.next243 = add nuw i64 %index240, 4
  %119 = icmp eq i64 %index.next243, %n.vec237
  br i1 %119, label %middle.block232, label %vector.body239, !llvm.loop !29

middle.block232:                                  ; preds = %vector.body239
  %cmp.n244 = icmp eq i64 %n.vec237, %wide.trip.count206
  br i1 %cmp.n244, label %.preheader160, label %.lr.ph174.preheader248

.preheader160:                                    ; preds = %.lr.ph174.prol.loopexit, %.lr.ph174, %middle.block232, %._crit_edge
  %.0145.lcssa = phi i32 [ 0, %._crit_edge ], [ %10, %middle.block232 ], [ %10, %.lr.ph174 ], [ %10, %.lr.ph174.prol.loopexit ]
  %120 = icmp slt i32 %.0145.lcssa, %19
  br i1 %120, label %.lr.ph177.preheader, label %._crit_edge178

.lr.ph177.preheader:                              ; preds = %.preheader160
  %121 = zext nneg i32 %.0145.lcssa to i64
  %122 = shl nuw nsw i64 %121, 3
  %scevgep208 = getelementptr i8, ptr %69, i64 %122
  %123 = xor i32 %.0145.lcssa, -1
  %124 = add i32 %19, %123
  %125 = zext i32 %124 to i64
  %126 = shl nuw nsw i64 %125, 3
  %127 = add nuw nsw i64 %126, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep208, i8 0, i64 %127, i1 false), !tbaa !16
  br label %._crit_edge178

.lr.ph174:                                        ; preds = %.lr.ph174.prol.loopexit, %.lr.ph174
  %indvars.iv203 = phi i64 [ %indvars.iv.next204.3, %.lr.ph174 ], [ %indvars.iv203.unr, %.lr.ph174.prol.loopexit ]
  %128 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv203
  %129 = load i64, ptr %128, align 8, !tbaa !16
  %130 = getelementptr inbounds i64, ptr %69, i64 %indvars.iv203
  store i64 %129, ptr %130, align 8, !tbaa !16
  %indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1
  %131 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv.next204
  %132 = load i64, ptr %131, align 8, !tbaa !16
  %133 = getelementptr inbounds i64, ptr %69, i64 %indvars.iv.next204
  store i64 %132, ptr %133, align 8, !tbaa !16
  %indvars.iv.next204.1 = add nuw nsw i64 %indvars.iv203, 2
  %134 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv.next204.1
  %135 = load i64, ptr %134, align 8, !tbaa !16
  %136 = getelementptr inbounds i64, ptr %69, i64 %indvars.iv.next204.1
  store i64 %135, ptr %136, align 8, !tbaa !16
  %indvars.iv.next204.2 = add nuw nsw i64 %indvars.iv203, 3
  %137 = getelementptr inbounds i64, ptr %7, i64 %indvars.iv.next204.2
  %138 = load i64, ptr %137, align 8, !tbaa !16
  %139 = getelementptr inbounds i64, ptr %69, i64 %indvars.iv.next204.2
  store i64 %138, ptr %139, align 8, !tbaa !16
  %indvars.iv.next204.3 = add nuw nsw i64 %indvars.iv203, 4
  %exitcond207.not.3 = icmp eq i64 %indvars.iv.next204.3, %wide.trip.count206
  br i1 %exitcond207.not.3, label %.preheader160, label %.lr.ph174, !llvm.loop !30

._crit_edge178:                                   ; preds = %.lr.ph177.preheader, %.preheader160
  tail call void @gsScramblePut(ptr noundef %106, i32 noundef 1, ptr noundef %69, i32 noundef %19, i32 noundef %.fr) #4
  %140 = icmp sgt i32 %66, 2
  br i1 %140, label %.lr.ph181, label %._crit_edge182

.lr.ph181:                                        ; preds = %._crit_edge178, %.lr.ph181
  %.0148179 = phi i32 [ %141, %.lr.ph181 ], [ 2, %._crit_edge178 ]
  tail call void @gsMul_school(ptr noundef nonnull %54, ptr noundef %69, ptr noundef %16, i32 noundef %19, ptr noundef nonnull %57)
  tail call void @cpMontRed_BNU(ptr noundef %69, ptr noundef nonnull %54, ptr noundef %3)
  tail call void @gsScramblePut(ptr noundef %106, i32 noundef %.0148179, ptr noundef %69, i32 noundef %19, i32 noundef %.fr) #4
  %141 = add nuw nsw i32 %.0148179, 1
  %exitcond212.not = icmp eq i32 %141, %66
  br i1 %exitcond212.not, label %._crit_edge182, label %.lr.ph181, !llvm.loop !31

._crit_edge182:                                   ; preds = %.lr.ph181, %._crit_edge178
  store i64 0, ptr %60, align 8, !tbaa !16
  %142 = add i32 %64, -1
  %143 = add i32 %142, %.fr
  %144 = srem i32 %143, %.fr
  %145 = sub i32 %142, %144
  %146 = sdiv i32 %145, 16
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i16, ptr %12, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !32
  %150 = and i32 %145, 15
  %151 = lshr i32 %149, %150
  %152 = and i32 %151, %67
  tail call void @gsScrambleGet_sscm(ptr noundef %16, i32 noundef %19, ptr noundef %106, i32 noundef %152, i32 noundef %.fr) #4
  %.0186 = sub nsw i32 %145, %.fr
  %153 = icmp sgt i32 %.0186, -1
  br i1 %153, label %.preheader.lr.ph, label %._crit_edge188

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

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge185
  %.0187 = phi i32 [ %.0186, %.preheader.lr.ph ], [ %.0, %._crit_edge185 ]
  br i1 %154, label %.lr.ph184, label %._crit_edge185

.lr.ph184:                                        ; preds = %.preheader, %.lr.ph184
  %.1149183 = phi i32 [ %155, %.lr.ph184 ], [ 0, %.preheader ]
  tail call void @gsSqr_school(ptr noundef nonnull %54, ptr noundef %16, i32 noundef %19, ptr noundef nonnull %57)
  tail call void @cpMontRed_BNU(ptr noundef %16, ptr noundef nonnull %54, ptr noundef %3)
  %155 = add nuw nsw i32 %.1149183, 1
  %exitcond213.not = icmp eq i32 %155, %.fr
  br i1 %exitcond213.not, label %._crit_edge185, label %.lr.ph184, !llvm.loop !33

._crit_edge185:                                   ; preds = %.lr.ph184, %.preheader
  %156 = lshr i32 %.0187, 4
  %157 = zext nneg i32 %156 to i64
  %158 = getelementptr inbounds i16, ptr %12, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !32
  %160 = and i32 %.0187, 15
  %161 = lshr i32 %159, %160
  %162 = and i32 %161, %67
  tail call void @gsScrambleGet_sscm(ptr noundef %69, i32 noundef %19, ptr noundef %106, i32 noundef %162, i32 noundef %.fr) #4
  tail call void @gsMul_school(ptr noundef nonnull %54, ptr noundef %16, ptr noundef %69, i32 noundef %19, ptr noundef nonnull %57)
  tail call void @cpMontRed_BNU(ptr noundef %16, ptr noundef nonnull %54, ptr noundef %3)
  %.0 = sub nsw i32 %.0187, %.fr
  %163 = icmp sgt i32 %.0, -1
  br i1 %163, label %.preheader, label %._crit_edge188, !llvm.loop !34

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

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.lr.ph167.preheader, %.preheader163, %.preheader162, %._crit_edge188
  %164 = tail call i32 @cpFix_BNU(ptr noundef %16, i32 noundef %19)
  %165 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %164, ptr %165, align 8, !tbaa !11
  %166 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 1, ptr %166, align 4, !tbaa !35
  br label %.critedge

.critedge:                                        ; preds = %53, %.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 i64 @IPP_INT_PTR(ptr noundef) local_unnamed_addr #1

declare void @gsScramblePut(ptr noundef, i32 noundef, ptr noundef, i32 noundef, 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

declare void @gsScrambleGet_sscm(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; 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 = !{!6, !10, i64 24}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !18, !19, !20}
!27 = distinct !{!27, !18, !19}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !18, !19, !20}
!30 = distinct !{!30, !18, !19}
!31 = distinct !{!31, !18}
!32 = !{!7, !7, i64 0}
!33 = distinct !{!33, !18}
!34 = distinct !{!34, !18}
!35 = !{!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