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

; 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._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 i32 @alm_mont_inv_ct(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._gsModEngine, ptr %30, i32 0, i32 8
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  store ptr %32, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._gsModEngine, ptr %33, i32 0, i32 3
  %35 = load i32, ptr %34, align 8, !tbaa !13
  store i32 %35, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._gsModEngine, ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 4, !tbaa !15
  store i32 %38, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 6, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call ptr @gsModPoolAlloc(ptr noundef %39, i32 noundef 6)
  store ptr %40, ptr %12, align 8, !tbaa !5
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = icmp eq ptr null, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %310

44:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %45, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = load i32, ptr %9, align 4, !tbaa !14
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i64, ptr %46, i64 %48
  store ptr %49, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = load i32, ptr %9, align 4, !tbaa !14
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i64, ptr %50, i64 %52
  store ptr %53, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = load i32, ptr %9, align 4, !tbaa !14
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i64, ptr %54, i64 %56
  store ptr %57, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %58 = load ptr, ptr %17, align 8, !tbaa !5
  %59 = load i32, ptr %9, align 4, !tbaa !14
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i64, ptr %58, i64 %60
  store ptr %61, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %62 = load ptr, ptr %18, align 8, !tbaa !5
  %63 = load i32, ptr %9, align 4, !tbaa !14
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i64, ptr %62, i64 %64
  store ptr %65, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store i64 0, ptr %22, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !14
  br label %66

66:                                               ; preds = %80, %44
  %67 = load i32, ptr %23, align 4, !tbaa !14
  %68 = load i32, ptr %9, align 4, !tbaa !14
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %83

70:                                               ; preds = %66
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load i32, ptr %23, align 4, !tbaa !14
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i64, ptr %71, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !16
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = load i32, ptr %23, align 4, !tbaa !14
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i64, ptr %76, i64 %78
  store i64 %75, ptr %79, align 8, !tbaa !16
  br label %80

80:                                               ; preds = %70
  %81 = load i32, ptr %23, align 4, !tbaa !14
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %23, align 4, !tbaa !14
  br label %66, !llvm.loop !17

83:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !14
  br label %84

84:                                               ; preds = %93, %83
  %85 = load i32, ptr %24, align 4, !tbaa !14
  %86 = load i32, ptr %9, align 4, !tbaa !14
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %96

88:                                               ; preds = %84
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = load i32, ptr %24, align 4, !tbaa !14
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i64, ptr %89, i64 %91
  store i64 0, ptr %92, align 8, !tbaa !16
  br label %93

93:                                               ; preds = %88
  %94 = load i32, ptr %24, align 4, !tbaa !14
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %24, align 4, !tbaa !14
  br label %84, !llvm.loop !19

96:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = getelementptr inbounds i64, ptr %97, i64 0
  store i64 1, ptr %98, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !14
  br label %99

99:                                               ; preds = %113, %96
  %100 = load i32, ptr %25, align 4, !tbaa !14
  %101 = load i32, ptr %9, align 4, !tbaa !14
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %116

103:                                              ; preds = %99
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load i32, ptr %25, align 4, !tbaa !14
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i64, ptr %104, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !16
  %109 = load ptr, ptr %16, align 8, !tbaa !5
  %110 = load i32, ptr %25, align 4, !tbaa !14
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i64, ptr %109, i64 %111
  store i64 %108, ptr %112, align 8, !tbaa !16
  br label %113

113:                                              ; preds = %103
  %114 = load i32, ptr %25, align 4, !tbaa !14
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %25, align 4, !tbaa !14
  br label %99, !llvm.loop !20

116:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !14
  br label %117

117:                                              ; preds = %126, %116
  %118 = load i32, ptr %26, align 4, !tbaa !14
  %119 = load i32, ptr %9, align 4, !tbaa !14
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %129

121:                                              ; preds = %117
  %122 = load ptr, ptr %17, align 8, !tbaa !5
  %123 = load i32, ptr %26, align 4, !tbaa !14
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i64, ptr %122, i64 %124
  store i64 0, ptr %125, align 8, !tbaa !16
  br label %126

126:                                              ; preds = %121
  %127 = load i32, ptr %26, align 4, !tbaa !14
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %26, align 4, !tbaa !14
  br label %117, !llvm.loop !21

129:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  store i32 0, ptr %21, align 4, !tbaa !14
  br label %130

130:                                              ; preds = %279, %129
  %131 = load i32, ptr %21, align 4, !tbaa !14
  %132 = load i32, ptr %10, align 4, !tbaa !14
  %133 = mul nsw i32 2, %132
  %134 = icmp slt i32 %131, %133
  br i1 %134, label %135, label %282

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %136 = load ptr, ptr %16, align 8, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !14
  %138 = call i64 @cpIsGFpElemEquChunk_ct(ptr noundef %136, i32 noundef %137, i64 noundef 0)
  %139 = xor i64 %138, -1
  store i64 %139, ptr %27, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = load ptr, ptr %15, align 8, !tbaa !5
  %142 = load ptr, ptr %17, align 8, !tbaa !5
  %143 = load i32, ptr %9, align 4, !tbaa !14
  %144 = call i64 @cpAdd_BNU(ptr noundef %140, ptr noundef %141, ptr noundef %142, i32 noundef %143)
  %145 = load i64, ptr %27, align 8, !tbaa !16
  %146 = load ptr, ptr %14, align 8, !tbaa !5
  %147 = getelementptr inbounds i64, ptr %146, i64 0
  %148 = load i64, ptr %147, align 8, !tbaa !16
  %149 = call i64 @cpIsEven_ct(i64 noundef %148)
  %150 = and i64 %145, %149
  store i64 %150, ptr %28, align 8, !tbaa !16
  %151 = load ptr, ptr %18, align 8, !tbaa !5
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = load i32, ptr %9, align 4, !tbaa !14
  %154 = call i32 @cpLSR_BNU(ptr noundef %151, ptr noundef %152, i32 noundef %153, i32 noundef 1)
  %155 = load ptr, ptr %19, align 8, !tbaa !5
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  %158 = load i32, ptr %9, align 4, !tbaa !14
  %159 = call i64 @cpAdd_BNU(ptr noundef %155, ptr noundef %156, ptr noundef %157, i32 noundef %158)
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = load ptr, ptr %18, align 8, !tbaa !5
  %162 = load i32, ptr %9, align 4, !tbaa !14
  %163 = load i64, ptr %28, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %160, ptr noundef %161, i32 noundef %162, i64 noundef %163)
  %164 = load ptr, ptr %15, align 8, !tbaa !5
  %165 = load ptr, ptr %19, align 8, !tbaa !5
  %166 = load i32, ptr %9, align 4, !tbaa !14
  %167 = load i64, ptr %28, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %164, ptr noundef %165, i32 noundef %166, i64 noundef %167)
  %168 = load i64, ptr %27, align 8, !tbaa !16
  %169 = load i64, ptr %28, align 8, !tbaa !16
  %170 = xor i64 %169, -1
  %171 = and i64 %168, %170
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  %173 = getelementptr inbounds i64, ptr %172, i64 0
  %174 = load i64, ptr %173, align 8, !tbaa !16
  %175 = call i64 @cpIsEven_ct(i64 noundef %174)
  %176 = and i64 %171, %175
  store i64 %176, ptr %29, align 8, !tbaa !16
  %177 = load ptr, ptr %18, align 8, !tbaa !5
  %178 = load ptr, ptr %16, align 8, !tbaa !5
  %179 = load i32, ptr %9, align 4, !tbaa !14
  %180 = call i32 @cpLSR_BNU(ptr noundef %177, ptr noundef %178, i32 noundef %179, i32 noundef 1)
  %181 = load ptr, ptr %19, align 8, !tbaa !5
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  %183 = load ptr, ptr %17, align 8, !tbaa !5
  %184 = load i32, ptr %9, align 4, !tbaa !14
  %185 = call i64 @cpAdd_BNU(ptr noundef %181, ptr noundef %182, ptr noundef %183, i32 noundef %184)
  %186 = load ptr, ptr %16, align 8, !tbaa !5
  %187 = load ptr, ptr %18, align 8, !tbaa !5
  %188 = load i32, ptr %9, align 4, !tbaa !14
  %189 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %186, ptr noundef %187, i32 noundef %188, i64 noundef %189)
  %190 = load ptr, ptr %17, align 8, !tbaa !5
  %191 = load ptr, ptr %19, align 8, !tbaa !5
  %192 = load i32, ptr %9, align 4, !tbaa !14
  %193 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %190, ptr noundef %191, i32 noundef %192, i64 noundef %193)
  %194 = load i64, ptr %29, align 8, !tbaa !16
  %195 = load i64, ptr %28, align 8, !tbaa !16
  %196 = or i64 %195, %194
  store i64 %196, ptr %28, align 8, !tbaa !16
  %197 = load ptr, ptr %18, align 8, !tbaa !5
  %198 = load ptr, ptr %16, align 8, !tbaa !5
  %199 = load ptr, ptr %14, align 8, !tbaa !5
  %200 = load i32, ptr %9, align 4, !tbaa !14
  %201 = call i64 @cpSub_BNU(ptr noundef %197, ptr noundef %198, ptr noundef %199, i32 noundef %200)
  store i64 %201, ptr %29, align 8, !tbaa !16
  %202 = load i64, ptr %29, align 8, !tbaa !16
  %203 = call i64 @cpIsZero_ct(i64 noundef %202)
  store i64 %203, ptr %29, align 8, !tbaa !16
  %204 = load i64, ptr %27, align 8, !tbaa !16
  %205 = load i64, ptr %28, align 8, !tbaa !16
  %206 = xor i64 %205, -1
  %207 = and i64 %204, %206
  %208 = load i64, ptr %29, align 8, !tbaa !16
  %209 = and i64 %207, %208
  store i64 %209, ptr %29, align 8, !tbaa !16
  %210 = load ptr, ptr %18, align 8, !tbaa !5
  %211 = load ptr, ptr %18, align 8, !tbaa !5
  %212 = load i32, ptr %9, align 4, !tbaa !14
  %213 = call i32 @cpLSR_BNU(ptr noundef %210, ptr noundef %211, i32 noundef %212, i32 noundef 1)
  %214 = load ptr, ptr %19, align 8, !tbaa !5
  %215 = load ptr, ptr %17, align 8, !tbaa !5
  %216 = load ptr, ptr %17, align 8, !tbaa !5
  %217 = load i32, ptr %9, align 4, !tbaa !14
  %218 = call i64 @cpAdd_BNU(ptr noundef %214, ptr noundef %215, ptr noundef %216, i32 noundef %217)
  %219 = load i64, ptr %29, align 8, !tbaa !16
  %220 = and i64 %218, %219
  %221 = load i64, ptr %22, align 8, !tbaa !16
  %222 = add i64 %221, %220
  store i64 %222, ptr %22, align 8, !tbaa !16
  %223 = load ptr, ptr %16, align 8, !tbaa !5
  %224 = load ptr, ptr %18, align 8, !tbaa !5
  %225 = load i32, ptr %9, align 4, !tbaa !14
  %226 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %223, ptr noundef %224, i32 noundef %225, i64 noundef %226)
  %227 = load ptr, ptr %15, align 8, !tbaa !5
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = load i32, ptr %9, align 4, !tbaa !14
  %230 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %227, ptr noundef %228, i32 noundef %229, i64 noundef %230)
  %231 = load ptr, ptr %17, align 8, !tbaa !5
  %232 = load ptr, ptr %19, align 8, !tbaa !5
  %233 = load i32, ptr %9, align 4, !tbaa !14
  %234 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %231, ptr noundef %232, i32 noundef %233, i64 noundef %234)
  %235 = load ptr, ptr %18, align 8, !tbaa !5
  %236 = load ptr, ptr %14, align 8, !tbaa !5
  %237 = load ptr, ptr %16, align 8, !tbaa !5
  %238 = load i32, ptr %9, align 4, !tbaa !14
  %239 = call i64 @cpSub_BNU(ptr noundef %235, ptr noundef %236, ptr noundef %237, i32 noundef %238)
  %240 = load i64, ptr %27, align 8, !tbaa !16
  %241 = load i64, ptr %28, align 8, !tbaa !16
  %242 = xor i64 %241, -1
  %243 = and i64 %240, %242
  %244 = load i64, ptr %29, align 8, !tbaa !16
  %245 = xor i64 %244, -1
  %246 = and i64 %243, %245
  store i64 %246, ptr %29, align 8, !tbaa !16
  %247 = load ptr, ptr %18, align 8, !tbaa !5
  %248 = load ptr, ptr %18, align 8, !tbaa !5
  %249 = load i32, ptr %9, align 4, !tbaa !14
  %250 = call i32 @cpLSR_BNU(ptr noundef %247, ptr noundef %248, i32 noundef %249, i32 noundef 1)
  %251 = load ptr, ptr %19, align 8, !tbaa !5
  %252 = load ptr, ptr %15, align 8, !tbaa !5
  %253 = load ptr, ptr %15, align 8, !tbaa !5
  %254 = load i32, ptr %9, align 4, !tbaa !14
  %255 = call i64 @cpAdd_BNU(ptr noundef %251, ptr noundef %252, ptr noundef %253, i32 noundef %254)
  %256 = load ptr, ptr %14, align 8, !tbaa !5
  %257 = load ptr, ptr %18, align 8, !tbaa !5
  %258 = load i32, ptr %9, align 4, !tbaa !14
  %259 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %256, ptr noundef %257, i32 noundef %258, i64 noundef %259)
  %260 = load ptr, ptr %17, align 8, !tbaa !5
  %261 = load ptr, ptr %5, align 8, !tbaa !5
  %262 = load i32, ptr %9, align 4, !tbaa !14
  %263 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %260, ptr noundef %261, i32 noundef %262, i64 noundef %263)
  %264 = load ptr, ptr %15, align 8, !tbaa !5
  %265 = load ptr, ptr %19, align 8, !tbaa !5
  %266 = load i32, ptr %9, align 4, !tbaa !14
  %267 = load i64, ptr %29, align 8, !tbaa !16
  call void @cpMaskedReplace_ct(ptr noundef %264, ptr noundef %265, i32 noundef %266, i64 noundef %267)
  %268 = load i32, ptr %20, align 4, !tbaa !14
  %269 = add nsw i32 %268, 1
  %270 = load i64, ptr %27, align 8, !tbaa !16
  %271 = trunc i64 %270 to i32
  %272 = and i32 %269, %271
  %273 = load i32, ptr %20, align 4, !tbaa !14
  %274 = load i64, ptr %27, align 8, !tbaa !16
  %275 = xor i64 %274, -1
  %276 = trunc i64 %275 to i32
  %277 = and i32 %273, %276
  %278 = or i32 %272, %277
  store i32 %278, ptr %20, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %279

279:                                              ; preds = %135
  %280 = load i32, ptr %21, align 4, !tbaa !14
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %21, align 4, !tbaa !14
  br label %130, !llvm.loop !22

282:                                              ; preds = %130
  %283 = load ptr, ptr %5, align 8, !tbaa !5
  %284 = load ptr, ptr %17, align 8, !tbaa !5
  %285 = load ptr, ptr %8, align 8, !tbaa !5
  %286 = load i32, ptr %9, align 4, !tbaa !14
  %287 = call i64 @cpSub_BNU(ptr noundef %283, ptr noundef %284, ptr noundef %285, i32 noundef %286)
  %288 = load i64, ptr %22, align 8, !tbaa !16
  %289 = sub i64 %288, %287
  store i64 %289, ptr %22, align 8, !tbaa !16
  %290 = load ptr, ptr %5, align 8, !tbaa !5
  %291 = load ptr, ptr %17, align 8, !tbaa !5
  %292 = load i32, ptr %9, align 4, !tbaa !14
  %293 = load i64, ptr %22, align 8, !tbaa !16
  %294 = call i64 @cpIsZero_ct(i64 noundef %293)
  %295 = xor i64 %294, -1
  call void @cpMaskedReplace_ct(ptr noundef %290, ptr noundef %291, i32 noundef %292, i64 noundef %295)
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = load ptr, ptr %8, align 8, !tbaa !5
  %298 = load ptr, ptr %5, align 8, !tbaa !5
  %299 = load i32, ptr %9, align 4, !tbaa !14
  %300 = call i64 @cpSub_BNU(ptr noundef %296, ptr noundef %297, ptr noundef %298, i32 noundef %299)
  %301 = load ptr, ptr %14, align 8, !tbaa !5
  %302 = load i32, ptr %9, align 4, !tbaa !14
  %303 = call i64 @cpIsGFpElemEquChunk_ct(ptr noundef %301, i32 noundef %302, i64 noundef 1)
  %304 = load i32, ptr %20, align 4, !tbaa !14
  %305 = sext i32 %304 to i64
  %306 = and i64 %305, %303
  %307 = trunc i64 %306 to i32
  store i32 %307, ptr %20, align 4, !tbaa !14
  %308 = load ptr, ptr %7, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %308, i32 noundef 6)
  %309 = load i32, ptr %20, align 4, !tbaa !14
  store i32 %309, ptr %4, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %310

310:                                              ; preds = %282, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %311 = load i32, ptr %4, align 4
  ret i32 %311
}

; 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 ptr @gsModPoolAlloc(ptr noundef, i32 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: noinline nounwind uwtable
declare hidden i64 @cpIsGFpElemEquChunk_ct(ptr noundef, i32 noundef, i64 noundef) #3

declare i64 @cpAdd_BNU(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @cpIsEven_ct(i64 noundef) #2

declare i32 @cpLSR_BNU(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

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

declare i64 @cpSub_BNU(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @cpIsZero_ct(i64 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @gsModPoolFree(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 = { noinline 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


; 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 i32 @alm_mont_inv_ct(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = ptrtoint ptr %1 to i64
  %5 = getelementptr inbounds i8, ptr %2, i64 48
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = ptrtoint ptr %6 to i64
  %8 = getelementptr inbounds i8, ptr %2, i64 16
  %9 = load i32, ptr %8, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %2, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !13
  %12 = tail call ptr @gsModPoolAlloc(ptr noundef %2, i32 noundef 6)
  %13 = ptrtoint ptr %12 to i64
  %14 = icmp eq ptr %12, null
  br i1 %14, label %121, label %15

15:                                               ; preds = %3
  %16 = sext i32 %9 to i64
  %17 = getelementptr i64, ptr %12, i64 %16
  %18 = getelementptr i64, ptr %17, i64 %16
  %19 = getelementptr i64, ptr %18, i64 %16
  %20 = getelementptr inbounds i64, ptr %19, i64 %16
  %21 = getelementptr inbounds i64, ptr %20, i64 %16
  %22 = icmp sgt i32 %9, 0
  br i1 %22, label %.lr.ph.preheader, label %.preheader173.thread

.lr.ph.preheader:                                 ; preds = %15
  %wide.trip.count = zext nneg i32 %9 to i64
  %min.iters.check = icmp ult i32 %9, 6
  %23 = sub i64 %13, %7
  %diff.check = icmp ult i64 %23, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %.lr.ph.preheader223, label %vector.ph

.lr.ph.preheader223:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %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 %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader223, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader223 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader223 ]
  %24 = getelementptr inbounds i64, ptr %6, i64 %indvars.iv.prol
  %25 = load i64, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds i64, ptr %12, i64 %indvars.iv.prol
  store i64 %25, ptr %26, align 8, !tbaa !14
  %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 %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !15

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader223
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader223 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %27 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %28 = icmp ugt i64 %27, -4
  br i1 %28, label %.preheader174, label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %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 ]
  %29 = getelementptr inbounds i64, ptr %6, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load = load <2 x i64>, ptr %29, align 8, !tbaa !14
  %wide.load205 = load <2 x i64>, ptr %30, align 8, !tbaa !14
  %31 = getelementptr inbounds i64, ptr %12, i64 %index
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  store <2 x i64> %wide.load, ptr %31, align 8, !tbaa !14
  store <2 x i64> %wide.load205, ptr %32, align 8, !tbaa !14
  %index.next = add nuw i64 %index, 4
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, 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 %.preheader174, label %.lr.ph.preheader223

.preheader174:                                    ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block
  br i1 %22, label %.lr.ph180.preheader, label %.preheader173.thread

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %34 = getelementptr inbounds i64, ptr %6, i64 %indvars.iv
  %35 = load i64, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds i64, ptr %12, i64 %indvars.iv
  store i64 %35, ptr %36, align 8, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = getelementptr inbounds i64, ptr %6, i64 %indvars.iv.next
  %38 = load i64, ptr %37, align 8, !tbaa !14
  %39 = getelementptr inbounds i64, ptr %12, i64 %indvars.iv.next
  store i64 %38, ptr %39, align 8, !tbaa !14
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %40 = getelementptr inbounds i64, ptr %6, i64 %indvars.iv.next.1
  %41 = load i64, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds i64, ptr %12, i64 %indvars.iv.next.1
  store i64 %41, ptr %42, align 8, !tbaa !14
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %43 = getelementptr inbounds i64, ptr %6, i64 %indvars.iv.next.2
  %44 = load i64, ptr %43, align 8, !tbaa !14
  %45 = getelementptr inbounds i64, ptr %12, i64 %indvars.iv.next.2
  store i64 %44, ptr %45, align 8, !tbaa !14
  %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 %.preheader174, label %.lr.ph, !llvm.loop !21

.preheader173.thread:                             ; preds = %15, %.preheader174
  store i64 1, ptr %17, align 8, !tbaa !14
  br label %.preheader

.lr.ph180.preheader:                              ; preds = %.preheader174
  %46 = zext nneg i32 %9 to i64
  %47 = shl nuw nsw i64 %46, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 %47, i1 false), !tbaa !14
  store i64 1, ptr %17, align 8, !tbaa !14
  %wide.trip.count197 = zext nneg i32 %9 to i64
  %min.iters.check210 = icmp ult i32 %9, 10
  br i1 %min.iters.check210, label %.lr.ph180.preheader222, label %vector.memcheck206

.lr.ph180.preheader222:                           ; preds = %middle.block208, %vector.memcheck206, %.lr.ph180.preheader
  %indvars.iv194.ph = phi i64 [ 0, %vector.memcheck206 ], [ 0, %.lr.ph180.preheader ], [ %n.vec213, %middle.block208 ]
  %xtraiter224 = and i64 %wide.trip.count, 3
  %lcmp.mod225.not = icmp eq i64 %xtraiter224, 0
  br i1 %lcmp.mod225.not, label %.lr.ph180.prol.loopexit, label %.lr.ph180.prol

.lr.ph180.prol:                                   ; preds = %.lr.ph180.preheader222, %.lr.ph180.prol
  %indvars.iv194.prol = phi i64 [ %indvars.iv.next195.prol, %.lr.ph180.prol ], [ %indvars.iv194.ph, %.lr.ph180.preheader222 ]
  %prol.iter226 = phi i64 [ %prol.iter226.next, %.lr.ph180.prol ], [ 0, %.lr.ph180.preheader222 ]
  %48 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv194.prol
  %49 = load i64, ptr %48, align 8, !tbaa !14
  %50 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv194.prol
  store i64 %49, ptr %50, align 8, !tbaa !14
  %indvars.iv.next195.prol = add nuw nsw i64 %indvars.iv194.prol, 1
  %prol.iter226.next = add i64 %prol.iter226, 1
  %prol.iter226.cmp.not = icmp eq i64 %prol.iter226.next, %xtraiter224
  br i1 %prol.iter226.cmp.not, label %.lr.ph180.prol.loopexit, label %.lr.ph180.prol, !llvm.loop !22

.lr.ph180.prol.loopexit:                          ; preds = %.lr.ph180.prol, %.lr.ph180.preheader222
  %indvars.iv194.unr = phi i64 [ %indvars.iv194.ph, %.lr.ph180.preheader222 ], [ %indvars.iv.next195.prol, %.lr.ph180.prol ]
  %51 = sub nsw i64 %indvars.iv194.ph, %wide.trip.count
  %52 = icmp ugt i64 %51, -4
  br i1 %52, label %.preheader173, label %.lr.ph180

vector.memcheck206:                               ; preds = %.lr.ph180.preheader
  %53 = shl nuw nsw i64 %16, 4
  %54 = add i64 %53, %13
  %55 = sub i64 %54, %4
  %diff.check207 = icmp ult i64 %55, 32
  br i1 %diff.check207, label %.lr.ph180.preheader222, label %vector.ph211

vector.ph211:                                     ; preds = %vector.memcheck206
  %n.vec213 = and i64 %wide.trip.count, 2147483644
  br label %vector.body215

vector.body215:                                   ; preds = %vector.body215, %vector.ph211
  %index216 = phi i64 [ 0, %vector.ph211 ], [ %index.next219, %vector.body215 ]
  %56 = getelementptr inbounds i64, ptr %1, i64 %index216
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %wide.load217 = load <2 x i64>, ptr %56, align 8, !tbaa !14
  %wide.load218 = load <2 x i64>, ptr %57, align 8, !tbaa !14
  %58 = getelementptr inbounds i64, ptr %18, i64 %index216
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <2 x i64> %wide.load217, ptr %58, align 8, !tbaa !14
  store <2 x i64> %wide.load218, ptr %59, align 8, !tbaa !14
  %index.next219 = add nuw i64 %index216, 4
  %60 = icmp eq i64 %index.next219, %n.vec213
  br i1 %60, label %middle.block208, label %vector.body215, !llvm.loop !23

middle.block208:                                  ; preds = %vector.body215
  %cmp.n220 = icmp eq i64 %n.vec213, %wide.trip.count
  br i1 %cmp.n220, label %.preheader173, label %.lr.ph180.preheader222

.preheader173:                                    ; preds = %.lr.ph180.prol.loopexit, %.lr.ph180, %middle.block208
  br i1 %22, label %.lr.ph182.preheader, label %.preheader

.lr.ph182.preheader:                              ; preds = %.preheader173
  %61 = zext nneg i32 %9 to i64
  %62 = shl nuw nsw i64 %61, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 %62, i1 false), !tbaa !14
  br label %.preheader

.lr.ph180:                                        ; preds = %.lr.ph180.prol.loopexit, %.lr.ph180
  %indvars.iv194 = phi i64 [ %indvars.iv.next195.3, %.lr.ph180 ], [ %indvars.iv194.unr, %.lr.ph180.prol.loopexit ]
  %63 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv194
  %64 = load i64, ptr %63, align 8, !tbaa !14
  %65 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv194
  store i64 %64, ptr %65, align 8, !tbaa !14
  %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
  %66 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next195
  %67 = load i64, ptr %66, align 8, !tbaa !14
  %68 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv.next195
  store i64 %67, ptr %68, align 8, !tbaa !14
  %indvars.iv.next195.1 = add nuw nsw i64 %indvars.iv194, 2
  %69 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next195.1
  %70 = load i64, ptr %69, align 8, !tbaa !14
  %71 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv.next195.1
  store i64 %70, ptr %71, align 8, !tbaa !14
  %indvars.iv.next195.2 = add nuw nsw i64 %indvars.iv194, 3
  %72 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next195.2
  %73 = load i64, ptr %72, align 8, !tbaa !14
  %74 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv.next195.2
  store i64 %73, ptr %74, align 8, !tbaa !14
  %indvars.iv.next195.3 = add nuw nsw i64 %indvars.iv194, 4
  %exitcond198.not.3 = icmp eq i64 %indvars.iv.next195.3, %wide.trip.count197
  br i1 %exitcond198.not.3, label %.preheader173, label %.lr.ph180, !llvm.loop !24

.preheader:                                       ; preds = %.preheader173.thread, %.lr.ph182.preheader, %.preheader173
  %75 = icmp sgt i32 %11, 0
  br i1 %75, label %.lr.ph186.preheader, label %._crit_edge187

.lr.ph186.preheader:                              ; preds = %.preheader
  %76 = shl nuw i32 %11, 1
  %smax = tail call i32 @llvm.smax.i32(i32 %76, i32 1)
  br label %.lr.ph186

.lr.ph186:                                        ; preds = %.lr.ph186.preheader, %.lr.ph186
  %.0164185 = phi i32 [ %111, %.lr.ph186 ], [ 0, %.lr.ph186.preheader ]
  %.0169184 = phi i64 [ %101, %.lr.ph186 ], [ 0, %.lr.ph186.preheader ]
  %.0170183 = phi i32 [ %112, %.lr.ph186 ], [ 0, %.lr.ph186.preheader ]
  %77 = tail call i64 @cpIsGFpElemEquChunk_ct(ptr noundef nonnull %18, i32 noundef %9, i64 noundef 0)
  %78 = xor i64 %77, -1
  %79 = tail call i64 @cpAdd_BNU(ptr noundef %0, ptr noundef nonnull %17, ptr noundef nonnull %19, i32 noundef %9) #6
  %80 = load i64, ptr %12, align 8, !tbaa !14
  %81 = tail call i64 @cpIsEven_ct(i64 noundef %80)
  %82 = and i64 %81, %78
  %83 = tail call i32 @cpLSR_BNU(ptr noundef nonnull %20, ptr noundef nonnull %12, i32 noundef %9, i32 noundef 1) #6
  %84 = tail call i64 @cpAdd_BNU(ptr noundef nonnull %21, ptr noundef nonnull %17, ptr noundef nonnull %17, i32 noundef %9) #6
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %12, ptr noundef nonnull %20, i32 noundef %9, i64 noundef %82)
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %17, ptr noundef nonnull %21, i32 noundef %9, i64 noundef %82)
  %85 = or i64 %81, %77
  %86 = xor i64 %85, -1
  %87 = load i64, ptr %18, align 8, !tbaa !14
  %88 = tail call i64 @cpIsEven_ct(i64 noundef %87)
  %89 = and i64 %88, %86
  %90 = tail call i32 @cpLSR_BNU(ptr noundef nonnull %20, ptr noundef nonnull %18, i32 noundef %9, i32 noundef 1) #6
  %91 = tail call i64 @cpAdd_BNU(ptr noundef nonnull %21, ptr noundef nonnull %19, ptr noundef nonnull %19, i32 noundef %9) #6
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %18, ptr noundef nonnull %20, i32 noundef %9, i64 noundef %89)
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %19, ptr noundef nonnull %21, i32 noundef %9, i64 noundef %89)
  %92 = tail call i64 @cpSub_BNU(ptr noundef nonnull %20, ptr noundef nonnull %18, ptr noundef nonnull %12, i32 noundef %9) #6
  %93 = tail call i64 @cpIsZero_ct(i64 noundef %92)
  %94 = or i64 %89, %81
  %95 = xor i64 %94, -1
  %96 = and i64 %95, %78
  %97 = and i64 %93, %96
  %98 = tail call i32 @cpLSR_BNU(ptr noundef nonnull %20, ptr noundef nonnull %20, i32 noundef %9, i32 noundef 1) #6
  %99 = tail call i64 @cpAdd_BNU(ptr noundef nonnull %21, ptr noundef nonnull %19, ptr noundef nonnull %19, i32 noundef %9) #6
  %100 = and i64 %99, %97
  %101 = add i64 %100, %.0169184
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %18, ptr noundef nonnull %20, i32 noundef %9, i64 noundef %97)
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %17, ptr noundef %0, i32 noundef %9, i64 noundef %97)
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %19, ptr noundef nonnull %21, i32 noundef %9, i64 noundef %97)
  %102 = tail call i64 @cpSub_BNU(ptr noundef nonnull %20, ptr noundef nonnull %12, ptr noundef nonnull %18, i32 noundef %9) #6
  %103 = xor i64 %97, %96
  %104 = tail call i32 @cpLSR_BNU(ptr noundef nonnull %20, ptr noundef nonnull %20, i32 noundef %9, i32 noundef 1) #6
  %105 = tail call i64 @cpAdd_BNU(ptr noundef nonnull %21, ptr noundef nonnull %17, ptr noundef nonnull %17, i32 noundef %9) #6
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %12, ptr noundef nonnull %20, i32 noundef %9, i64 noundef %103)
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %19, ptr noundef %0, i32 noundef %9, i64 noundef %103)
  tail call void @cpMaskedReplace_ct(ptr noundef nonnull %17, ptr noundef nonnull %21, i32 noundef %9, i64 noundef %103)
  %106 = add nsw i32 %.0164185, 1
  %107 = trunc i64 %78 to i32
  %108 = and i32 %106, %107
  %109 = trunc i64 %77 to i32
  %110 = and i32 %.0164185, %109
  %111 = or i32 %108, %110
  %112 = add nuw nsw i32 %.0170183, 1
  %exitcond202.not = icmp eq i32 %112, %smax
  br i1 %exitcond202.not, label %._crit_edge187, label %.lr.ph186, !llvm.loop !25

._crit_edge187:                                   ; preds = %.lr.ph186, %.preheader
  %.0169.lcssa = phi i64 [ 0, %.preheader ], [ %101, %.lr.ph186 ]
  %.0164.lcssa = phi i32 [ 0, %.preheader ], [ %111, %.lr.ph186 ]
  %113 = tail call i64 @cpSub_BNU(ptr noundef %0, ptr noundef nonnull %19, ptr noundef %6, i32 noundef %9) #6
  %114 = sub i64 %.0169.lcssa, %113
  %115 = tail call i64 @cpIsZero_ct(i64 noundef %114)
  %116 = xor i64 %115, -1
  tail call void @cpMaskedReplace_ct(ptr noundef %0, ptr noundef nonnull %19, i32 noundef %9, i64 noundef %116)
  %117 = tail call i64 @cpSub_BNU(ptr noundef %0, ptr noundef %6, ptr noundef %0, i32 noundef %9) #6
  %118 = tail call i64 @cpIsGFpElemEquChunk_ct(ptr noundef nonnull %12, i32 noundef %9, i64 noundef 1)
  %119 = trunc i64 %118 to i32
  %120 = and i32 %.0164.lcssa, %119
  tail call void @gsModPoolFree(ptr noundef %2, i32 noundef 6)
  br label %121

121:                                              ; preds = %3, %._crit_edge187
  %.0 = phi i32 [ %120, %._crit_edge187 ], [ 0, %3 ]
  ret i32 %.0
}

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

; Function Attrs: noinline nounwind uwtable
declare hidden i64 @cpIsGFpElemEquChunk_ct(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #2

declare i64 @cpAdd_BNU(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @cpIsEven_ct(i64 noundef) local_unnamed_addr #1

declare i32 @cpLSR_BNU(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

declare i64 @cpSub_BNU(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @cpIsZero_ct(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @gsModPoolFree(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) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 = { noinline 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !7, i64 48}
!6 = !{!"_gsModEngine", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !11, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !7, i64 104}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !10, i64 12}
!14 = !{!11, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!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, !18, !19}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !18, !19, !20}
!24 = distinct !{!24, !18, !19}
!25 = distinct !{!25, !18}


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