; LLVM IR from tfhe/spqlios-arithmetic :: spqlios/q120 (q120_ntt)

; 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._q120_ntt_precomp = type { i64, ptr, ptr, %struct._q120_ntt_reduc_step_precomp, i64, i64 }
%struct._q120_ntt_reduc_step_precomp = type { [4 x i64], i64, i64 }
%struct._q120_ntt_step_precomp = type { [4 x i64], i64, i64, i64, i8 }

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@PRIMES_VEC = external hidden constant [4 x i32], align 16
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@__PRETTY_FUNCTION__.q120_new_intt_bb_precomp = external hidden unnamed_addr constant [59 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @new_precomp(i64 noundef) #0

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare double @log2(double noundef) #4

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @modq_pow(i32 noundef, i64 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @fill_omegas(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @fill_reduction_meta(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @round_up_half_n(i64 noundef) #0

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local ptr @q120_new_intt_bb_precomp(i64 noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca [4 x i32], align 16
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #7
  %33 = load i64, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 0
  call void @fill_omegas(i64 noundef %33, ptr noundef %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %35 = load i32, ptr @PRIMES_VEC, align 16, !tbaa !9
  %36 = uitofp i32 %35 to double
  %37 = call double @log2(double noundef %36) #7
  %38 = call double @llvm.ceil.f64(double %37)
  %39 = fptoui double %38 to i64
  store i64 %39, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = call ptr @new_precomp(i64 noundef %40)
  store ptr %41, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %42 = load ptr, ptr %6, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct._q120_ntt_precomp, ptr %42, i32 0, i32 4
  store i64 64, ptr %43, align 8, !tbaa !13
  store i64 64, ptr %7, align 8, !tbaa !5
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %45 = load i64, ptr %3, align 8, !tbaa !5
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i64 noundef %45)
  %47 = load i64, ptr %5, align 8, !tbaa !5
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %47)
  %49 = load i64, ptr %7, align 8, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i64 noundef %49)
  %51 = load i64, ptr %3, align 8, !tbaa !5
  %52 = icmp eq i64 %51, 1
  br i1 %52, label %53, label %55

53:                                               ; preds = %1
  %54 = load ptr, ptr %6, align 8, !tbaa !11
  store ptr %54, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %409

55:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %56 = load i64, ptr %7, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !11
  %58 = getelementptr inbounds %struct._q120_ntt_precomp, ptr %57, i32 0, i32 3
  %59 = call i64 @fill_reduction_meta(i64 noundef %56, ptr noundef %58)
  store i64 %59, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %60 = load ptr, ptr %6, align 8, !tbaa !11
  %61 = getelementptr inbounds %struct._q120_ntt_precomp, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  store ptr %62, ptr %10, align 8, !tbaa !11
  %63 = load i64, ptr %7, align 8, !tbaa !5
  %64 = icmp eq i64 %63, 64
  %65 = zext i1 %64 to i32
  %66 = trunc i32 %65 to i8
  %67 = load ptr, ptr %10, align 8, !tbaa !11
  %68 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %67, i32 0, i32 4
  store i8 %66, ptr %68, align 8, !tbaa !17
  %69 = load ptr, ptr %10, align 8, !tbaa !11
  %70 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %69, i32 0, i32 4
  %71 = load i8, ptr %70, align 8, !tbaa !17
  %72 = icmp ne i8 %71, 0
  br i1 %72, label %73, label %77

73:                                               ; preds = %55
  %74 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %74, ptr %7, align 8, !tbaa !5
  %75 = load i64, ptr %7, align 8, !tbaa !5
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %75)
  br label %77

77:                                               ; preds = %73, %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %97, %77
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = icmp slt i32 %79, 4
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %100

82:                                               ; preds = %78
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [4 x i32], ptr @PRIMES_VEC, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = zext i32 %86 to i64
  %88 = load i64, ptr %7, align 8, !tbaa !5
  %89 = load i64, ptr %5, align 8, !tbaa !5
  %90 = sub i64 %88, %89
  %91 = shl i64 %87, %90
  %92 = load ptr, ptr %10, align 8, !tbaa !11
  %93 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [4 x i64], ptr %93, i64 0, i64 %95
  store i64 %91, ptr %96, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %82
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %11, align 4, !tbaa !9
  br label %78, !llvm.loop !19

100:                                              ; preds = %81
  %101 = load i64, ptr %7, align 8, !tbaa !5
  %102 = add i64 %101, 1
  store i64 %102, ptr %7, align 8, !tbaa !5
  %103 = load ptr, ptr %10, align 8, !tbaa !11
  %104 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %103, i32 0, i32 1
  store i64 %102, ptr %104, align 8, !tbaa !21
  %105 = load ptr, ptr %10, align 8, !tbaa !11
  %106 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %105, i32 0, i32 3
  store i64 0, ptr %106, align 8, !tbaa !22
  %107 = load ptr, ptr %10, align 8, !tbaa !11
  %108 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %107, i32 0, i32 2
  store i64 0, ptr %108, align 8, !tbaa !23
  %109 = load i64, ptr %7, align 8, !tbaa !5
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef 1, i64 noundef %109)
  %111 = load ptr, ptr %10, align 8, !tbaa !11
  %112 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %111, i32 1
  store ptr %112, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 4, ptr %12, align 8, !tbaa !5
  br label %113

113:                                              ; preds = %195, %100
  %114 = load i64, ptr %12, align 8, !tbaa !5
  %115 = load i64, ptr %3, align 8, !tbaa !5
  %116 = icmp ule i64 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %198

118:                                              ; preds = %113
  %119 = load i64, ptr %7, align 8, !tbaa !5
  %120 = icmp eq i64 %119, 64
  %121 = zext i1 %120 to i32
  %122 = trunc i32 %121 to i8
  %123 = load ptr, ptr %10, align 8, !tbaa !11
  %124 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %123, i32 0, i32 4
  store i8 %122, ptr %124, align 8, !tbaa !17
  %125 = load ptr, ptr %10, align 8, !tbaa !11
  %126 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %125, i32 0, i32 4
  %127 = load i8, ptr %126, align 8, !tbaa !17
  %128 = icmp ne i8 %127, 0
  br i1 %128, label %129, label %133

129:                                              ; preds = %118
  %130 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %130, ptr %7, align 8, !tbaa !5
  %131 = load i64, ptr %7, align 8, !tbaa !5
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %131)
  br label %133

133:                                              ; preds = %129, %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %134 = load i64, ptr %7, align 8, !tbaa !5
  %135 = call i64 @round_up_half_n(i64 noundef %134)
  store i64 %135, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %136 = load i64, ptr %13, align 8, !tbaa !5
  %137 = load i64, ptr %5, align 8, !tbaa !5
  %138 = add i64 %136, %137
  %139 = add i64 %138, 1
  store i64 %139, ptr %14, align 8, !tbaa !5
  %140 = load i64, ptr %7, align 8, !tbaa !5
  %141 = load i64, ptr %14, align 8, !tbaa !5
  %142 = icmp ugt i64 %140, %141
  br i1 %142, label %143, label %145

143:                                              ; preds = %133
  %144 = load i64, ptr %7, align 8, !tbaa !5
  br label %147

145:                                              ; preds = %133
  %146 = load i64, ptr %14, align 8, !tbaa !5
  br label %147

147:                                              ; preds = %145, %143
  %148 = phi i64 [ %144, %143 ], [ %146, %145 ]
  %149 = add i64 1, %148
  store i64 %149, ptr %7, align 8, !tbaa !5
  %150 = load i64, ptr %7, align 8, !tbaa !5
  %151 = icmp ule i64 %150, 64
  br i1 %151, label %152, label %153

152:                                              ; preds = %147
  br label %154

153:                                              ; preds = %147
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 260, ptr noundef @__PRETTY_FUNCTION__.q120_new_intt_bb_precomp) #8
  unreachable

154:                                              ; preds = %152
  %155 = load i64, ptr %7, align 8, !tbaa !5
  %156 = load ptr, ptr %10, align 8, !tbaa !11
  %157 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %156, i32 0, i32 1
  store i64 %155, ptr %157, align 8, !tbaa !21
  %158 = load i64, ptr %13, align 8, !tbaa !5
  %159 = load ptr, ptr %10, align 8, !tbaa !11
  %160 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %159, i32 0, i32 2
  store i64 %158, ptr %160, align 8, !tbaa !23
  %161 = load i64, ptr %13, align 8, !tbaa !5
  %162 = shl i64 1, %161
  %163 = sub i64 %162, 1
  %164 = load ptr, ptr %10, align 8, !tbaa !11
  %165 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %164, i32 0, i32 3
  store i64 %163, ptr %165, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %185, %154
  %167 = load i32, ptr %15, align 4, !tbaa !9
  %168 = icmp slt i32 %167, 4
  br i1 %168, label %170, label %169

169:                                              ; preds = %166
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %188

170:                                              ; preds = %166
  %171 = load i32, ptr %15, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [4 x i32], ptr @PRIMES_VEC, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !9
  %175 = zext i32 %174 to i64
  %176 = load i64, ptr %14, align 8, !tbaa !5
  %177 = load i64, ptr %5, align 8, !tbaa !5
  %178 = sub i64 %176, %177
  %179 = shl i64 %175, %178
  %180 = load ptr, ptr %10, align 8, !tbaa !11
  %181 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %180, i32 0, i32 0
  %182 = load i32, ptr %15, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [4 x i64], ptr %181, i64 0, i64 %183
  store i64 %179, ptr %184, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %170
  %186 = load i32, ptr %15, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %15, align 4, !tbaa !9
  br label %166, !llvm.loop !24

188:                                              ; preds = %169
  %189 = load ptr, ptr %10, align 8, !tbaa !11
  %190 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %189, i32 1
  store ptr %190, ptr %10, align 8, !tbaa !11
  %191 = load i64, ptr %12, align 8, !tbaa !5
  %192 = udiv i64 %191, 2
  %193 = load i64, ptr %7, align 8, !tbaa !5
  %194 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef %192, i64 noundef %193)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %195

195:                                              ; preds = %188
  %196 = load i64, ptr %12, align 8, !tbaa !5
  %197 = mul i64 %196, 2
  store i64 %197, ptr %12, align 8, !tbaa !5
  br label %113, !llvm.loop !25

198:                                              ; preds = %117
  %199 = load i64, ptr %7, align 8, !tbaa !5
  %200 = icmp eq i64 %199, 64
  %201 = zext i1 %200 to i32
  %202 = trunc i32 %201 to i8
  %203 = load ptr, ptr %10, align 8, !tbaa !11
  %204 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %203, i32 0, i32 4
  store i8 %202, ptr %204, align 8, !tbaa !17
  %205 = load ptr, ptr %10, align 8, !tbaa !11
  %206 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %205, i32 0, i32 4
  %207 = load i8, ptr %206, align 8, !tbaa !17
  %208 = icmp ne i8 %207, 0
  br i1 %208, label %209, label %213

209:                                              ; preds = %198
  %210 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %210, ptr %7, align 8, !tbaa !5
  %211 = load i64, ptr %7, align 8, !tbaa !5
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %211)
  br label %213

213:                                              ; preds = %209, %198
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %214 = load i64, ptr %7, align 8, !tbaa !5
  %215 = call i64 @round_up_half_n(i64 noundef %214)
  store i64 %215, ptr %16, align 8, !tbaa !5
  %216 = load i64, ptr %16, align 8, !tbaa !5
  %217 = load i64, ptr %5, align 8, !tbaa !5
  %218 = add i64 %216, %217
  %219 = add i64 %218, 1
  store i64 %219, ptr %7, align 8, !tbaa !5
  %220 = load i64, ptr %7, align 8, !tbaa !5
  %221 = icmp ule i64 %220, 64
  br i1 %221, label %222, label %223

222:                                              ; preds = %213
  br label %224

223:                                              ; preds = %213
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 282, ptr noundef @__PRETTY_FUNCTION__.q120_new_intt_bb_precomp) #8
  unreachable

224:                                              ; preds = %222
  %225 = load i64, ptr %7, align 8, !tbaa !5
  %226 = load ptr, ptr %10, align 8, !tbaa !11
  %227 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %226, i32 0, i32 1
  store i64 %225, ptr %227, align 8, !tbaa !21
  %228 = load i64, ptr %16, align 8, !tbaa !5
  %229 = load ptr, ptr %10, align 8, !tbaa !11
  %230 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %229, i32 0, i32 2
  store i64 %228, ptr %230, align 8, !tbaa !23
  %231 = load i64, ptr %16, align 8, !tbaa !5
  %232 = shl i64 1, %231
  %233 = sub i64 %232, 1
  %234 = load ptr, ptr %10, align 8, !tbaa !11
  %235 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %234, i32 0, i32 3
  store i64 %233, ptr %235, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %255, %224
  %237 = load i32, ptr %17, align 4, !tbaa !9
  %238 = icmp slt i32 %237, 4
  br i1 %238, label %240, label %239

239:                                              ; preds = %236
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %258

240:                                              ; preds = %236
  %241 = load i32, ptr %17, align 4, !tbaa !9
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [4 x i32], ptr @PRIMES_VEC, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !9
  %245 = zext i32 %244 to i64
  %246 = load i64, ptr %7, align 8, !tbaa !5
  %247 = load i64, ptr %5, align 8, !tbaa !5
  %248 = sub i64 %246, %247
  %249 = shl i64 %245, %248
  %250 = load ptr, ptr %10, align 8, !tbaa !11
  %251 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %250, i32 0, i32 0
  %252 = load i32, ptr %17, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [4 x i64], ptr %251, i64 0, i64 %253
  store i64 %249, ptr %254, align 8, !tbaa !5
  br label %255

255:                                              ; preds = %240
  %256 = load i32, ptr %17, align 4, !tbaa !9
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %17, align 4, !tbaa !9
  br label %236, !llvm.loop !26

258:                                              ; preds = %239
  %259 = load i64, ptr %3, align 8, !tbaa !5
  %260 = load i64, ptr %7, align 8, !tbaa !5
  %261 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef %259, i64 noundef %260)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %262 = load i64, ptr %3, align 8, !tbaa !5
  %263 = mul i64 8, %262
  %264 = call noalias ptr @malloc(i64 noundef %263) #9
  store ptr %264, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %265

265:                                              ; preds = %403, %258
  %266 = load i32, ptr %19, align 4, !tbaa !9
  %267 = icmp slt i32 %266, 4
  br i1 %267, label %269, label %268

268:                                              ; preds = %265
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %406

269:                                              ; preds = %265
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %270 = load i32, ptr %19, align 4, !tbaa !9
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [4 x i32], ptr @PRIMES_VEC, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !9
  %274 = zext i32 %273 to i64
  store i64 %274, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store i64 0, ptr %21, align 8, !tbaa !5
  br label %275

275:                                              ; preds = %294, %269
  %276 = load i64, ptr %21, align 8, !tbaa !5
  %277 = load i64, ptr %3, align 8, !tbaa !5
  %278 = mul i64 2, %277
  %279 = icmp ult i64 %276, %278
  br i1 %279, label %281, label %280

280:                                              ; preds = %275
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %297

281:                                              ; preds = %275
  %282 = load i32, ptr %19, align 4, !tbaa !9
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !9
  %286 = load i64, ptr %21, align 8, !tbaa !5
  %287 = sub i64 0, %286
  %288 = load i64, ptr %20, align 8, !tbaa !5
  %289 = trunc i64 %288 to i32
  %290 = call i32 @modq_pow(i32 noundef %285, i64 noundef %287, i32 noundef %289)
  %291 = load ptr, ptr %18, align 8, !tbaa !11
  %292 = load i64, ptr %21, align 8, !tbaa !5
  %293 = getelementptr inbounds i32, ptr %291, i64 %292
  store i32 %290, ptr %293, align 4, !tbaa !9
  br label %294

294:                                              ; preds = %281
  %295 = load i64, ptr %21, align 8, !tbaa !5
  %296 = add i64 %295, 1
  store i64 %296, ptr %21, align 8, !tbaa !5
  br label %275, !llvm.loop !27

297:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %298 = load ptr, ptr %6, align 8, !tbaa !11
  %299 = getelementptr inbounds %struct._q120_ntt_precomp, ptr %298, i32 0, i32 2
  %300 = load ptr, ptr %299, align 8, !tbaa !28
  %301 = load i32, ptr %19, align 4, !tbaa !9
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds i64, ptr %300, i64 %302
  store ptr %303, ptr %22, align 8, !tbaa !11
  %304 = load ptr, ptr %6, align 8, !tbaa !11
  %305 = getelementptr inbounds %struct._q120_ntt_precomp, ptr %304, i32 0, i32 1
  %306 = load ptr, ptr %305, align 8, !tbaa !16
  %307 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %306, i64 1
  store ptr %307, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 4, ptr %23, align 8, !tbaa !5
  br label %308

308:                                              ; preds = %359, %297
  %309 = load i64, ptr %23, align 8, !tbaa !5
  %310 = load i64, ptr %3, align 8, !tbaa !5
  %311 = icmp ule i64 %309, %310
  br i1 %311, label %313, label %312

312:                                              ; preds = %308
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %362

313:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %314 = load i64, ptr %23, align 8, !tbaa !5
  %315 = udiv i64 %314, 2
  store i64 %315, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %316 = load i64, ptr %3, align 8, !tbaa !5
  %317 = load i64, ptr %24, align 8, !tbaa !5
  %318 = udiv i64 %316, %317
  store i64 %318, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store i64 1, ptr %26, align 8, !tbaa !5
  br label %319

319:                                              ; preds = %348, %313
  %320 = load i64, ptr %26, align 8, !tbaa !5
  %321 = load i64, ptr %24, align 8, !tbaa !5
  %322 = icmp ult i64 %320, %321
  br i1 %322, label %324, label %323

323:                                              ; preds = %319
  store i32 23, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %351

324:                                              ; preds = %319
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %325 = load ptr, ptr %18, align 8, !tbaa !11
  %326 = load i64, ptr %26, align 8, !tbaa !5
  %327 = load i64, ptr %25, align 8, !tbaa !5
  %328 = mul i64 %326, %327
  %329 = getelementptr inbounds i32, ptr %325, i64 %328
  %330 = load i32, ptr %329, align 4, !tbaa !9
  %331 = zext i32 %330 to i64
  store i64 %331, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %332 = load i64, ptr %27, align 8, !tbaa !5
  %333 = load ptr, ptr %10, align 8, !tbaa !11
  %334 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %333, i32 0, i32 2
  %335 = load i64, ptr %334, align 8, !tbaa !23
  %336 = shl i64 %332, %335
  %337 = load i64, ptr %20, align 8, !tbaa !5
  %338 = urem i64 %336, %337
  store i64 %338, ptr %28, align 8, !tbaa !5
  %339 = load i64, ptr %28, align 8, !tbaa !5
  %340 = shl i64 %339, 32
  %341 = load i64, ptr %27, align 8, !tbaa !5
  %342 = add i64 %340, %341
  %343 = load ptr, ptr %22, align 8, !tbaa !11
  %344 = load i64, ptr %26, align 8, !tbaa !5
  %345 = sub i64 %344, 1
  %346 = mul i64 4, %345
  %347 = getelementptr inbounds i64, ptr %343, i64 %346
  store i64 %342, ptr %347, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %348

348:                                              ; preds = %324
  %349 = load i64, ptr %26, align 8, !tbaa !5
  %350 = add i64 %349, 1
  store i64 %350, ptr %26, align 8, !tbaa !5
  br label %319, !llvm.loop !29

351:                                              ; preds = %323
  %352 = load i64, ptr %24, align 8, !tbaa !5
  %353 = sub i64 %352, 1
  %354 = mul i64 4, %353
  %355 = load ptr, ptr %22, align 8, !tbaa !11
  %356 = getelementptr inbounds i64, ptr %355, i64 %354
  store ptr %356, ptr %22, align 8, !tbaa !11
  %357 = load ptr, ptr %10, align 8, !tbaa !11
  %358 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %357, i32 1
  store ptr %358, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %359

359:                                              ; preds = %351
  %360 = load i64, ptr %23, align 8, !tbaa !5
  %361 = mul i64 %360, 2
  store i64 %361, ptr %23, align 8, !tbaa !5
  br label %308, !llvm.loop !30

362:                                              ; preds = %312
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %363 = load i64, ptr %3, align 8, !tbaa !5
  %364 = trunc i64 %363 to i32
  %365 = load i64, ptr %20, align 8, !tbaa !5
  %366 = trunc i64 %365 to i32
  %367 = call i32 @modq_pow(i32 noundef %364, i64 noundef -1, i32 noundef %366)
  %368 = zext i32 %367 to i64
  store i64 %368, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  store i64 0, ptr %30, align 8, !tbaa !5
  br label %369

369:                                              ; preds = %399, %362
  %370 = load i64, ptr %30, align 8, !tbaa !5
  %371 = load i64, ptr %3, align 8, !tbaa !5
  %372 = icmp ult i64 %370, %371
  br i1 %372, label %374, label %373

373:                                              ; preds = %369
  store i32 26, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %402

374:                                              ; preds = %369
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %375 = load ptr, ptr %18, align 8, !tbaa !11
  %376 = load i64, ptr %30, align 8, !tbaa !5
  %377 = getelementptr inbounds i32, ptr %375, i64 %376
  %378 = load i32, ptr %377, align 4, !tbaa !9
  %379 = zext i32 %378 to i64
  %380 = load i64, ptr %29, align 8, !tbaa !5
  %381 = mul i64 %379, %380
  %382 = load i64, ptr %20, align 8, !tbaa !5
  %383 = urem i64 %381, %382
  store i64 %383, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %384 = load i64, ptr %31, align 8, !tbaa !5
  %385 = load ptr, ptr %10, align 8, !tbaa !11
  %386 = getelementptr inbounds %struct._q120_ntt_step_precomp, ptr %385, i32 0, i32 2
  %387 = load i64, ptr %386, align 8, !tbaa !23
  %388 = shl i64 %384, %387
  %389 = load i64, ptr %20, align 8, !tbaa !5
  %390 = urem i64 %388, %389
  store i64 %390, ptr %32, align 8, !tbaa !5
  %391 = load i64, ptr %32, align 8, !tbaa !5
  %392 = shl i64 %391, 32
  %393 = load i64, ptr %31, align 8, !tbaa !5
  %394 = add i64 %392, %393
  %395 = load ptr, ptr %22, align 8, !tbaa !11
  %396 = load i64, ptr %30, align 8, !tbaa !5
  %397 = mul i64 4, %396
  %398 = getelementptr inbounds i64, ptr %395, i64 %397
  store i64 %394, ptr %398, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %399

399:                                              ; preds = %374
  %400 = load i64, ptr %30, align 8, !tbaa !5
  %401 = add i64 %400, 1
  store i64 %401, ptr %30, align 8, !tbaa !5
  br label %369, !llvm.loop !31

402:                                              ; preds = %373
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %403

403:                                              ; preds = %402
  %404 = load i32, ptr %19, align 4, !tbaa !9
  %405 = add nsw i32 %404, 1
  store i32 %405, ptr %19, align 4, !tbaa !9
  br label %265, !llvm.loop !32

406:                                              ; preds = %268
  %407 = load ptr, ptr %18, align 8, !tbaa !11
  call void @free(ptr noundef %407) #7
  %408 = load ptr, ptr %6, align 8, !tbaa !11
  store ptr %408, ptr %2, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %409

409:                                              ; preds = %406, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #7
  %410 = load ptr, ptr %2, align 8
  ret ptr %410
}

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

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


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

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@PRIMES_VEC = external hidden local_unnamed_addr constant [4 x i32], align 16
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@__PRETTY_FUNCTION__.q120_new_intt_bb_precomp = external hidden unnamed_addr constant [59 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @new_precomp(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log2(double noundef) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @modq_pow(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @fill_omegas(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @fill_reduction_meta(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @round_up_half_n(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
define dso_local ptr @q120_new_intt_bb_precomp(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [4 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #10
  call void @fill_omegas(i64 noundef %0, ptr noundef nonnull %2)
  %3 = load i32, ptr @PRIMES_VEC, align 16, !tbaa !5
  %4 = uitofp i32 %3 to double
  %5 = call double @log2(double noundef %4) #10
  %6 = call double @llvm.ceil.f64(double %5)
  %7 = fptoui double %6 to i64
  %8 = call ptr @new_precomp(i64 noundef %0)
  %9 = getelementptr inbounds i8, ptr %8, i64 72
  store i64 64, ptr %9, align 8, !tbaa !9
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %0)
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %7)
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef 64)
  %14 = icmp eq i64 %0, 1
  br i1 %14, label %153, label %15

15:                                               ; preds = %1
  %16 = getelementptr inbounds i8, ptr %8, i64 24
  %17 = call i64 @fill_reduction_meta(i64 noundef 64, ptr noundef nonnull %16)
  %18 = getelementptr inbounds i8, ptr %8, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %19, i64 56
  store i8 1, ptr %20, align 8, !tbaa !15
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %17)
  %22 = sub i64 %17, %7
  %23 = zext i32 %3 to i64
  %24 = shl i64 %23, %22
  store i64 %24, ptr %19, align 8, !tbaa !17
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @PRIMES_VEC, i64 4), align 4, !tbaa !5
  %26 = zext i32 %25 to i64
  %27 = shl i64 %26, %22
  %28 = getelementptr inbounds i8, ptr %19, i64 8
  store i64 %27, ptr %28, align 8, !tbaa !17
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @PRIMES_VEC, i64 8), align 8, !tbaa !5
  %30 = zext i32 %29 to i64
  %31 = shl i64 %30, %22
  %32 = getelementptr inbounds i8, ptr %19, i64 16
  store i64 %31, ptr %32, align 8, !tbaa !17
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @PRIMES_VEC, i64 12), align 4, !tbaa !5
  %34 = zext i32 %33 to i64
  %35 = shl i64 %34, %22
  %36 = getelementptr inbounds i8, ptr %19, i64 24
  store i64 %35, ptr %36, align 8, !tbaa !17
  %37 = add i64 %17, 1
  %38 = getelementptr inbounds i8, ptr %19, i64 32
  store i64 %37, ptr %38, align 8, !tbaa !18
  %39 = getelementptr inbounds i8, ptr %19, i64 40
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %39, i8 0, i64 16, i1 false)
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef 1, i64 noundef %37)
  %.not165 = icmp ult i64 %0, 4
  br i1 %.not165, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %41 = add i64 %7, 1
  br label %45

._crit_edge:                                      ; preds = %58, %15
  %.pn158.lcssa = phi ptr [ %19, %15 ], [ %.0142169, %58 ]
  %.1.lcssa = phi i64 [ %37, %15 ], [ %55, %58 ]
  %42 = icmp eq i64 %.1.lcssa, 64
  %43 = zext i1 %42 to i8
  %44 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 120
  store i8 %43, ptr %44, align 8, !tbaa !15
  br i1 %42, label %74, label %76

45:                                               ; preds = %.lr.ph, %58
  %.1168 = phi i64 [ %37, %.lr.ph ], [ %55, %58 ]
  %.pn158167 = phi ptr [ %19, %.lr.ph ], [ %.0142169, %58 ]
  %.0146166 = phi i64 [ 4, %.lr.ph ], [ %73, %58 ]
  %.0142169 = getelementptr inbounds i8, ptr %.pn158167, i64 64
  %46 = icmp eq i64 %.1168, 64
  %47 = zext i1 %46 to i8
  %48 = getelementptr inbounds i8, ptr %.pn158167, i64 120
  store i8 %47, ptr %48, align 8, !tbaa !15
  br i1 %46, label %49, label %51

49:                                               ; preds = %45
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %17)
  br label %51

51:                                               ; preds = %49, %45
  %.2 = phi i64 [ %17, %49 ], [ %.1168, %45 ]
  %52 = call i64 @round_up_half_n(i64 noundef %.2)
  %53 = add i64 %41, %52
  %54 = call i64 @llvm.umax.i64(i64 %.2, i64 %53)
  %55 = add i64 %54, 1
  %56 = icmp ult i64 %55, 65
  br i1 %56, label %58, label %57

57:                                               ; preds = %51
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 260, ptr noundef nonnull @__PRETTY_FUNCTION__.q120_new_intt_bb_precomp) #11
  unreachable

58:                                               ; preds = %51
  %59 = getelementptr inbounds i8, ptr %.pn158167, i64 96
  store i64 %55, ptr %59, align 8, !tbaa !18
  %60 = getelementptr inbounds i8, ptr %.pn158167, i64 104
  store i64 %52, ptr %60, align 8, !tbaa !19
  %notmask157 = shl nsw i64 -1, %52
  %61 = xor i64 %notmask157, -1
  %62 = getelementptr inbounds i8, ptr %.pn158167, i64 112
  store i64 %61, ptr %62, align 8, !tbaa !20
  %63 = sub i64 %53, %7
  %64 = shl i64 %23, %63
  store i64 %64, ptr %.0142169, align 8, !tbaa !17
  %65 = shl i64 %26, %63
  %66 = getelementptr inbounds i8, ptr %.pn158167, i64 72
  store i64 %65, ptr %66, align 8, !tbaa !17
  %67 = shl i64 %30, %63
  %68 = getelementptr inbounds i8, ptr %.pn158167, i64 80
  store i64 %67, ptr %68, align 8, !tbaa !17
  %69 = shl i64 %34, %63
  %70 = getelementptr inbounds i8, ptr %.pn158167, i64 88
  store i64 %69, ptr %70, align 8, !tbaa !17
  %71 = lshr exact i64 %.0146166, 1
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef %71, i64 noundef %55)
  %73 = shl i64 %.0146166, 1
  %.not = icmp ugt i64 %73, %0
  br i1 %.not, label %._crit_edge, label %45, !llvm.loop !21

74:                                               ; preds = %._crit_edge
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %17)
  br label %76

76:                                               ; preds = %74, %._crit_edge
  %.3 = phi i64 [ %17, %74 ], [ %.1.lcssa, %._crit_edge ]
  %77 = call i64 @round_up_half_n(i64 noundef %.3)
  %78 = add i64 %7, 1
  %79 = add i64 %78, %77
  %80 = icmp ult i64 %79, 65
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 282, ptr noundef nonnull @__PRETTY_FUNCTION__.q120_new_intt_bb_precomp) #11
  unreachable

82:                                               ; preds = %76
  %83 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 96
  store i64 %79, ptr %83, align 8, !tbaa !18
  %84 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 104
  store i64 %77, ptr %84, align 8, !tbaa !19
  %notmask = shl nsw i64 -1, %77
  %85 = xor i64 %notmask, -1
  %86 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 112
  store i64 %85, ptr %86, align 8, !tbaa !20
  %87 = sub i64 %79, %7
  %88 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 64
  %89 = shl i64 %23, %87
  store i64 %89, ptr %88, align 8, !tbaa !17
  %90 = shl i64 %26, %87
  %91 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 72
  store i64 %90, ptr %91, align 8, !tbaa !17
  %92 = shl i64 %30, %87
  %93 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 80
  store i64 %92, ptr %93, align 8, !tbaa !17
  %94 = shl i64 %34, %87
  %95 = getelementptr inbounds i8, ptr %.pn158.lcssa, i64 88
  store i64 %94, ptr %95, align 8, !tbaa !17
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef %0, i64 noundef %79)
  %97 = shl i64 %0, 3
  %98 = call noalias ptr @malloc(i64 noundef %97) #12
  %99 = shl i64 %0, 1
  %.not197 = icmp eq i64 %99, 0
  %100 = getelementptr inbounds i8, ptr %8, i64 16
  %101 = trunc i64 %0 to i32
  %.not198 = icmp eq i64 %0, 0
  br label %103

102:                                              ; preds = %._crit_edge195
  call void @free(ptr noundef %98) #10
  br label %153

103:                                              ; preds = %82, %._crit_edge195
  %indvars.iv = phi i64 [ 0, %82 ], [ %indvars.iv.next, %._crit_edge195 ]
  %104 = getelementptr inbounds [4 x i32], ptr @PRIMES_VEC, i64 0, i64 %indvars.iv
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = zext i32 %105 to i64
  br i1 %.not197, label %._crit_edge176, label %.lr.ph175

.lr.ph175:                                        ; preds = %103
  %107 = getelementptr inbounds [4 x i32], ptr %2, i64 0, i64 %indvars.iv
  br label %111

._crit_edge176:                                   ; preds = %111, %103
  %108 = load ptr, ptr %100, align 8, !tbaa !23
  %109 = getelementptr inbounds i64, ptr %108, i64 %indvars.iv
  %110 = load ptr, ptr %18, align 8, !tbaa !14
  br i1 %.not165, label %._crit_edge189, label %.lr.ph179

111:                                              ; preds = %.lr.ph175, %111
  %.0150173 = phi i64 [ 0, %.lr.ph175 ], [ %116, %111 ]
  %112 = load i32, ptr %107, align 4, !tbaa !5
  %113 = sub i64 0, %.0150173
  %114 = call i32 @modq_pow(i32 noundef %112, i64 noundef %113, i32 noundef %105)
  %115 = getelementptr inbounds i32, ptr %98, i64 %.0150173
  store i32 %114, ptr %115, align 4, !tbaa !5
  %116 = add nuw i64 %.0150173, 1
  %exitcond.not = icmp eq i64 %116, %99
  br i1 %exitcond.not, label %._crit_edge176, label %111, !llvm.loop !24

._crit_edge189:                                   ; preds = %._crit_edge180, %._crit_edge176
  %.0149.lcssa = phi ptr [ %109, %._crit_edge176 ], [ %125, %._crit_edge180 ]
  %.pn.lcssa = phi ptr [ %110, %._crit_edge176 ], [ %.1143186, %._crit_edge180 ]
  %117 = call i32 @modq_pow(i32 noundef %101, i64 noundef -1, i32 noundef %105)
  %118 = zext i32 %117 to i64
  br i1 %.not198, label %._crit_edge195, label %.lr.ph194

.lr.ph194:                                        ; preds = %._crit_edge189
  %119 = getelementptr inbounds i8, ptr %.pn.lcssa, i64 104
  br label %140

.lr.ph179:                                        ; preds = %._crit_edge176, %._crit_edge180
  %.pn185 = phi ptr [ %.1143186, %._crit_edge180 ], [ %110, %._crit_edge176 ]
  %.0148184 = phi i64 [ %123, %._crit_edge180 ], [ 4, %._crit_edge176 ]
  %.0149183 = phi ptr [ %125, %._crit_edge180 ], [ %109, %._crit_edge176 ]
  %.1143186 = getelementptr inbounds i8, ptr %.pn185, i64 64
  %120 = lshr exact i64 %.0148184, 1
  %121 = udiv i64 %0, %120
  %122 = getelementptr inbounds i8, ptr %.pn185, i64 104
  %umax = call i64 @llvm.umax.i64(i64 %120, i64 2)
  br label %126

._crit_edge180:                                   ; preds = %126
  %123 = shl i64 %.0148184, 1
  %124 = add i64 %123, -4
  %125 = getelementptr inbounds i64, ptr %.0149183, i64 %124
  %.not156 = icmp ugt i64 %123, %0
  br i1 %.not156, label %._crit_edge189, label %.lr.ph179, !llvm.loop !25

126:                                              ; preds = %.lr.ph179, %126
  %.0145177 = phi i64 [ 1, %.lr.ph179 ], [ %139, %126 ]
  %127 = mul i64 %.0145177, %121
  %128 = getelementptr inbounds i32, ptr %98, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = zext i32 %129 to i64
  %131 = load i64, ptr %122, align 8, !tbaa !19
  %132 = shl i64 %130, %131
  %133 = urem i64 %132, %106
  %134 = shl nuw i64 %133, 32
  %135 = or disjoint i64 %134, %130
  %136 = shl i64 %.0145177, 2
  %137 = add i64 %136, -4
  %138 = getelementptr inbounds i64, ptr %.0149183, i64 %137
  store i64 %135, ptr %138, align 8, !tbaa !17
  %139 = add nuw nsw i64 %.0145177, 1
  %exitcond205.not = icmp eq i64 %139, %umax
  br i1 %exitcond205.not, label %._crit_edge180, label %126, !llvm.loop !26

._crit_edge195:                                   ; preds = %140, %._crit_edge189
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond208.not = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond208.not, label %102, label %103, !llvm.loop !27

140:                                              ; preds = %.lr.ph194, %140
  %.0141192 = phi i64 [ 0, %.lr.ph194 ], [ %152, %140 ]
  %141 = getelementptr inbounds i32, ptr %98, i64 %.0141192
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = zext i32 %142 to i64
  %144 = mul nuw i64 %143, %118
  %145 = urem i64 %144, %106
  %146 = load i64, ptr %119, align 8, !tbaa !19
  %147 = shl i64 %145, %146
  %148 = urem i64 %147, %106
  %149 = shl nuw i64 %148, 32
  %150 = or disjoint i64 %149, %145
  %.idx = shl i64 %.0141192, 5
  %151 = getelementptr inbounds i8, ptr %.0149.lcssa, i64 %.idx
  store i64 %150, ptr %151, align 8, !tbaa !17
  %152 = add nuw i64 %.0141192, 1
  %exitcond206.not = icmp eq i64 %152, %0
  br i1 %exitcond206.not, label %._crit_edge195, label %140, !llvm.loop !28

153:                                              ; preds = %1, %102
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #10
  ret ptr %8
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #8

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nounwind }
attributes #11 = { noreturn nounwind }
attributes #12 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 72}
!10 = !{!"_q120_ntt_precomp", !11, i64 0, !12, i64 8, !12, i64 16, !13, i64 24, !11, i64 72, !11, i64 80}
!11 = !{!"long", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_q120_ntt_reduc_step_precomp", !7, i64 0, !11, i64 32, !11, i64 40}
!14 = !{!10, !12, i64 8}
!15 = !{!16, !7, i64 56}
!16 = !{!"_q120_ntt_step_precomp", !7, i64 0, !11, i64 32, !11, i64 40, !11, i64 48, !7, i64 56}
!17 = !{!11, !11, i64 0}
!18 = !{!16, !11, i64 32}
!19 = !{!16, !11, i64 40}
!20 = !{!16, !11, i64 48}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!10, !12, i64 16}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !22}


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