; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libUSAC/utils/FundmatrixFunctions.ll (ZN6FTools15normalizePointsEPdS0_jS0_S0_)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6FTools15normalizePointsEPdS0_jS0_S0_(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [2 x double], align 16
  %15 = alloca [2 x double], align 16
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %51, %5
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = icmp ult i32 %24, 3
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %54

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %47, %27
  %29 = load i32, ptr %13, align 4, !tbaa !9
  %30 = icmp ult i32 %29, 3
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %50

32:                                               ; preds = %28
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = mul i32 3, %34
  %36 = load i32, ptr %13, align 4, !tbaa !9
  %37 = add i32 %35, %36
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %33, i64 %38
  store double 0.000000e+00, ptr %39, align 8, !tbaa !11
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = mul i32 3, %41
  %43 = load i32, ptr %13, align 4, !tbaa !9
  %44 = add i32 %42, %43
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %40, i64 %45
  store double 0.000000e+00, ptr %46, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %32
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = add i32 %48, 1
  store i32 %49, ptr %13, align 4, !tbaa !9
  br label %28, !llvm.loop !13

50:                                               ; preds = %31
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = add i32 %52, 1
  store i32 %53, ptr %11, align 4, !tbaa !9
  br label %23, !llvm.loop !15

54:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %100, %54
  %56 = load i32, ptr %16, align 4, !tbaa !9
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = icmp ult i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %103

60:                                               ; preds = %55
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = mul i32 6, %62
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %61, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 0
  %68 = load double, ptr %67, align 16, !tbaa !11
  %69 = fadd double %68, %66
  store double %69, ptr %67, align 16, !tbaa !11
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i32, ptr %16, align 4, !tbaa !9
  %72 = mul i32 6, %71
  %73 = add i32 %72, 1
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %70, i64 %74
  %76 = load double, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 1
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = fadd double %78, %76
  store double %79, ptr %77, align 8, !tbaa !11
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = mul i32 6, %81
  %83 = add i32 %82, 3
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %80, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 0
  %88 = load double, ptr %87, align 16, !tbaa !11
  %89 = fadd double %88, %86
  store double %89, ptr %87, align 16, !tbaa !11
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load i32, ptr %16, align 4, !tbaa !9
  %92 = mul i32 6, %91
  %93 = add i32 %92, 4
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %90, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 1
  %98 = load double, ptr %97, align 8, !tbaa !11
  %99 = fadd double %98, %96
  store double %99, ptr %97, align 8, !tbaa !11
  br label %100

100:                                              ; preds = %60
  %101 = load i32, ptr %16, align 4, !tbaa !9
  %102 = add i32 %101, 1
  store i32 %102, ptr %16, align 4, !tbaa !9
  br label %55, !llvm.loop !16

103:                                              ; preds = %59
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = uitofp i32 %104 to double
  %106 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 0
  %107 = load double, ptr %106, align 16, !tbaa !11
  %108 = fdiv double %107, %105
  store double %108, ptr %106, align 16, !tbaa !11
  %109 = load i32, ptr %8, align 4, !tbaa !9
  %110 = uitofp i32 %109 to double
  %111 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 0
  %112 = load double, ptr %111, align 16, !tbaa !11
  %113 = fdiv double %112, %110
  store double %113, ptr %111, align 16, !tbaa !11
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = uitofp i32 %114 to double
  %116 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 1
  %117 = load double, ptr %116, align 8, !tbaa !11
  %118 = fdiv double %117, %115
  store double %118, ptr %116, align 8, !tbaa !11
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = uitofp i32 %119 to double
  %121 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 1
  %122 = load double, ptr %121, align 8, !tbaa !11
  %123 = fdiv double %122, %120
  store double %123, ptr %121, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store double 0.000000e+00, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %218, %103
  %125 = load i32, ptr %19, align 4, !tbaa !9
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = icmp ult i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %221

129:                                              ; preds = %124
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = load i32, ptr %19, align 4, !tbaa !9
  %132 = mul i32 6, %131
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds double, ptr %130, i64 %133
  %135 = load double, ptr %134, align 8, !tbaa !11
  %136 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 0
  %137 = load double, ptr %136, align 16, !tbaa !11
  %138 = fsub double %135, %137
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = load i32, ptr %19, align 4, !tbaa !9
  %141 = mul i32 6, %140
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %139, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !11
  %145 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 0
  %146 = load double, ptr %145, align 16, !tbaa !11
  %147 = fsub double %144, %146
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load i32, ptr %19, align 4, !tbaa !9
  %150 = mul i32 6, %149
  %151 = add i32 %150, 1
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds double, ptr %148, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 1
  %156 = load double, ptr %155, align 8, !tbaa !11
  %157 = fsub double %154, %156
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = mul i32 6, %159
  %161 = add i32 %160, 1
  %162 = zext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %158, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !11
  %165 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 1
  %166 = load double, ptr %165, align 8, !tbaa !11
  %167 = fsub double %164, %166
  %168 = fmul double %157, %167
  %169 = call double @llvm.fmuladd.f64(double %138, double %147, double %168)
  %170 = call double @sqrt(double noundef %169) #6
  %171 = load double, ptr %17, align 8, !tbaa !11
  %172 = fadd double %171, %170
  store double %172, ptr %17, align 8, !tbaa !11
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = load i32, ptr %19, align 4, !tbaa !9
  %175 = mul i32 6, %174
  %176 = add i32 %175, 3
  %177 = zext i32 %176 to i64
  %178 = getelementptr inbounds double, ptr %173, i64 %177
  %179 = load double, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 0
  %181 = load double, ptr %180, align 16, !tbaa !11
  %182 = fsub double %179, %181
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = load i32, ptr %19, align 4, !tbaa !9
  %185 = mul i32 6, %184
  %186 = add i32 %185, 3
  %187 = zext i32 %186 to i64
  %188 = getelementptr inbounds double, ptr %183, i64 %187
  %189 = load double, ptr %188, align 8, !tbaa !11
  %190 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 0
  %191 = load double, ptr %190, align 16, !tbaa !11
  %192 = fsub double %189, %191
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = load i32, ptr %19, align 4, !tbaa !9
  %195 = mul i32 6, %194
  %196 = add i32 %195, 4
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds double, ptr %193, i64 %197
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 1
  %201 = load double, ptr %200, align 8, !tbaa !11
  %202 = fsub double %199, %201
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = load i32, ptr %19, align 4, !tbaa !9
  %205 = mul i32 6, %204
  %206 = add i32 %205, 4
  %207 = zext i32 %206 to i64
  %208 = getelementptr inbounds double, ptr %203, i64 %207
  %209 = load double, ptr %208, align 8, !tbaa !11
  %210 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 1
  %211 = load double, ptr %210, align 8, !tbaa !11
  %212 = fsub double %209, %211
  %213 = fmul double %202, %212
  %214 = call double @llvm.fmuladd.f64(double %182, double %192, double %213)
  %215 = call double @sqrt(double noundef %214) #6
  %216 = load double, ptr %18, align 8, !tbaa !11
  %217 = fadd double %216, %215
  store double %217, ptr %18, align 8, !tbaa !11
  br label %218

218:                                              ; preds = %129
  %219 = load i32, ptr %19, align 4, !tbaa !9
  %220 = add i32 %219, 1
  store i32 %220, ptr %19, align 4, !tbaa !9
  br label %124, !llvm.loop !17

221:                                              ; preds = %128
  %222 = load i32, ptr %8, align 4, !tbaa !9
  %223 = uitofp i32 %222 to double
  %224 = load double, ptr %17, align 8, !tbaa !11
  %225 = fdiv double %224, %223
  store double %225, ptr %17, align 8, !tbaa !11
  %226 = load i32, ptr %8, align 4, !tbaa !9
  %227 = uitofp i32 %226 to double
  %228 = load double, ptr %18, align 8, !tbaa !11
  %229 = fdiv double %228, %227
  store double %229, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %230 = call double @sqrt(double noundef 2.000000e+00) #6
  %231 = load double, ptr %17, align 8, !tbaa !11
  %232 = fdiv double %230, %231
  store double %232, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %233 = call double @sqrt(double noundef 2.000000e+00) #6
  %234 = load double, ptr %18, align 8, !tbaa !11
  %235 = fdiv double %233, %234
  store double %235, ptr %21, align 8, !tbaa !11
  %236 = load double, ptr %20, align 8, !tbaa !11
  %237 = load ptr, ptr %9, align 8, !tbaa !5
  %238 = getelementptr inbounds double, ptr %237, i64 0
  store double %236, ptr %238, align 8, !tbaa !11
  %239 = load double, ptr %20, align 8, !tbaa !11
  %240 = fneg double %239
  %241 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 0
  %242 = load double, ptr %241, align 16, !tbaa !11
  %243 = fmul double %240, %242
  %244 = load ptr, ptr %9, align 8, !tbaa !5
  %245 = getelementptr inbounds double, ptr %244, i64 2
  store double %243, ptr %245, align 8, !tbaa !11
  %246 = load double, ptr %20, align 8, !tbaa !11
  %247 = load ptr, ptr %9, align 8, !tbaa !5
  %248 = getelementptr inbounds double, ptr %247, i64 4
  store double %246, ptr %248, align 8, !tbaa !11
  %249 = load double, ptr %20, align 8, !tbaa !11
  %250 = fneg double %249
  %251 = getelementptr inbounds [2 x double], ptr %14, i64 0, i64 1
  %252 = load double, ptr %251, align 8, !tbaa !11
  %253 = fmul double %250, %252
  %254 = load ptr, ptr %9, align 8, !tbaa !5
  %255 = getelementptr inbounds double, ptr %254, i64 5
  store double %253, ptr %255, align 8, !tbaa !11
  %256 = load ptr, ptr %9, align 8, !tbaa !5
  %257 = getelementptr inbounds double, ptr %256, i64 8
  store double 1.000000e+00, ptr %257, align 8, !tbaa !11
  %258 = load double, ptr %21, align 8, !tbaa !11
  %259 = load ptr, ptr %10, align 8, !tbaa !5
  %260 = getelementptr inbounds double, ptr %259, i64 0
  store double %258, ptr %260, align 8, !tbaa !11
  %261 = load double, ptr %21, align 8, !tbaa !11
  %262 = fneg double %261
  %263 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 0
  %264 = load double, ptr %263, align 16, !tbaa !11
  %265 = fmul double %262, %264
  %266 = load ptr, ptr %10, align 8, !tbaa !5
  %267 = getelementptr inbounds double, ptr %266, i64 2
  store double %265, ptr %267, align 8, !tbaa !11
  %268 = load double, ptr %21, align 8, !tbaa !11
  %269 = load ptr, ptr %10, align 8, !tbaa !5
  %270 = getelementptr inbounds double, ptr %269, i64 4
  store double %268, ptr %270, align 8, !tbaa !11
  %271 = load double, ptr %21, align 8, !tbaa !11
  %272 = fneg double %271
  %273 = getelementptr inbounds [2 x double], ptr %15, i64 0, i64 1
  %274 = load double, ptr %273, align 8, !tbaa !11
  %275 = fmul double %272, %274
  %276 = load ptr, ptr %10, align 8, !tbaa !5
  %277 = getelementptr inbounds double, ptr %276, i64 5
  store double %275, ptr %277, align 8, !tbaa !11
  %278 = load ptr, ptr %10, align 8, !tbaa !5
  %279 = getelementptr inbounds double, ptr %278, i64 8
  store double 1.000000e+00, ptr %279, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %280

280:                                              ; preds = %310, %221
  %281 = load i32, ptr %22, align 4, !tbaa !9
  %282 = load i32, ptr %8, align 4, !tbaa !9
  %283 = icmp ult i32 %281, %282
  br i1 %283, label %285, label %284

284:                                              ; preds = %280
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %313

285:                                              ; preds = %280
  %286 = load ptr, ptr %7, align 8, !tbaa !5
  %287 = load i32, ptr %22, align 4, !tbaa !9
  %288 = mul i32 6, %287
  %289 = zext i32 %288 to i64
  %290 = getelementptr inbounds double, ptr %286, i64 %289
  %291 = load ptr, ptr %9, align 8, !tbaa !5
  %292 = load ptr, ptr %6, align 8, !tbaa !5
  %293 = load i32, ptr %22, align 4, !tbaa !9
  %294 = mul i32 6, %293
  %295 = zext i32 %294 to i64
  %296 = getelementptr inbounds double, ptr %292, i64 %295
  call void @_ZN9MathTools4vmulEPdS0_S0_i(ptr noundef %290, ptr noundef %291, ptr noundef %296, i32 noundef 3)
  %297 = load ptr, ptr %7, align 8, !tbaa !5
  %298 = load i32, ptr %22, align 4, !tbaa !9
  %299 = mul i32 6, %298
  %300 = zext i32 %299 to i64
  %301 = getelementptr inbounds double, ptr %297, i64 %300
  %302 = getelementptr inbounds double, ptr %301, i64 3
  %303 = load ptr, ptr %10, align 8, !tbaa !5
  %304 = load ptr, ptr %6, align 8, !tbaa !5
  %305 = load i32, ptr %22, align 4, !tbaa !9
  %306 = mul i32 6, %305
  %307 = zext i32 %306 to i64
  %308 = getelementptr inbounds double, ptr %304, i64 %307
  %309 = getelementptr inbounds double, ptr %308, i64 3
  call void @_ZN9MathTools4vmulEPdS0_S0_i(ptr noundef %302, ptr noundef %303, ptr noundef %309, i32 noundef 3)
  br label %310

310:                                              ; preds = %285
  %311 = load i32, ptr %22, align 4, !tbaa !9
  %312 = add i32 %311, 1
  store i32 %312, ptr %22, align 4, !tbaa !9
  br label %280, !llvm.loop !18

313:                                              ; preds = %284
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  ret void
}

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

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

declare void @_ZN9MathTools4vmulEPdS0_S0_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

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


; 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: mustprogress uwtable
define dso_local void @_ZN6FTools15normalizePointsEPdS0_jS0_S0_(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
.preheader108:
  store double 0.000000e+00, ptr %3, align 8, !tbaa !5
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %3, i64 8
  store double 0.000000e+00, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  store double 0.000000e+00, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %3, i64 16
  store double 0.000000e+00, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %4, i64 16
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 24
  store double 0.000000e+00, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %4, i64 24
  store double 0.000000e+00, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %3, i64 32
  store double 0.000000e+00, ptr %11, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %4, i64 32
  store double 0.000000e+00, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %3, i64 40
  store double 0.000000e+00, ptr %13, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %4, i64 40
  store double 0.000000e+00, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %3, i64 48
  store double 0.000000e+00, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %4, i64 48
  store double 0.000000e+00, ptr %16, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %3, i64 56
  store double 0.000000e+00, ptr %17, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %4, i64 56
  store double 0.000000e+00, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %3, i64 64
  store double 0.000000e+00, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %4, i64 64
  store double 0.000000e+00, ptr %20, align 8, !tbaa !5
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %._crit_edge.thread, label %.lr.ph.preheader

._crit_edge.thread:                               ; preds = %.preheader108
  %21 = uitofp nneg i32 %2 to double
  %22 = insertelement <4 x double> poison, double %21, i64 0
  %23 = fdiv <4 x double> <double 0.000000e+00, double poison, double poison, double poison>, %22
  %24 = shufflevector <4 x double> %23, <4 x double> poison, <4 x i32> zeroinitializer
  br label %._crit_edge124

.lr.ph.preheader:                                 ; preds = %.preheader108
  %wide.trip.count = zext i32 %2 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %25 = uitofp i32 %2 to double
  %26 = insertelement <4 x double> poison, double %25, i64 0
  %27 = shufflevector <4 x double> %26, <4 x double> poison, <4 x i32> zeroinitializer
  %28 = fdiv <4 x double> %53, %27
  br i1 %.not, label %._crit_edge124, label %.lr.ph123.preheader

.lr.ph123.preheader:                              ; preds = %._crit_edge
  %wide.trip.count144 = zext i32 %2 to i64
  %29 = shufflevector <4 x double> %28, <4 x double> poison, <2 x i32> <i32 2, i32 3>
  %30 = shufflevector <4 x double> %28, <4 x double> poison, <2 x i32> <i32 0, i32 1>
  br label %.lr.ph123

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %31 = phi <4 x double> [ zeroinitializer, %.lr.ph.preheader ], [ %53, %.lr.ph ]
  %32 = trunc nuw i64 %indvars.iv to i32
  %33 = mul i32 %32, 6
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds double, ptr %0, i64 %34
  %36 = load double, ptr %35, align 8, !tbaa !5
  %37 = or disjoint i32 %33, 1
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %0, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !5
  %41 = add i32 %33, 3
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %0, i64 %42
  %44 = load double, ptr %43, align 8, !tbaa !5
  %45 = add i32 %33, 4
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds double, ptr %0, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !5
  %49 = insertelement <4 x double> poison, double %48, i64 0
  %50 = insertelement <4 x double> %49, double %40, i64 1
  %51 = insertelement <4 x double> %50, double %44, i64 2
  %52 = insertelement <4 x double> %51, double %36, i64 3
  %53 = fadd <4 x double> %31, %52
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge124:                                   ; preds = %.lr.ph123, %._crit_edge.thread, %._crit_edge
  %54 = phi double [ %25, %._crit_edge ], [ %21, %._crit_edge.thread ], [ %25, %.lr.ph123 ]
  %55 = phi <4 x double> [ %28, %._crit_edge ], [ %24, %._crit_edge.thread ], [ %28, %.lr.ph123 ]
  %56 = phi <2 x double> [ zeroinitializer, %._crit_edge ], [ zeroinitializer, %._crit_edge.thread ], [ %100, %.lr.ph123 ]
  %57 = extractelement <2 x double> %56, i64 1
  %58 = fdiv double %57, %54
  %59 = extractelement <2 x double> %56, i64 0
  %60 = fdiv double %59, %54
  %61 = fdiv double 0x3FF6A09E667F3BCD, %58
  %62 = fdiv double 0x3FF6A09E667F3BCD, %60
  store double %61, ptr %3, align 8, !tbaa !5
  %63 = fneg double %61
  %64 = extractelement <4 x double> %55, i64 3
  %65 = fmul double %64, %63
  store double %65, ptr %7, align 8, !tbaa !5
  store double %61, ptr %11, align 8, !tbaa !5
  %66 = extractelement <4 x double> %55, i64 1
  %67 = fmul double %66, %63
  store double %67, ptr %13, align 8, !tbaa !5
  store double 1.000000e+00, ptr %19, align 8, !tbaa !5
  store double %62, ptr %4, align 8, !tbaa !5
  %68 = fneg double %62
  %69 = extractelement <4 x double> %55, i64 2
  %70 = fmul double %69, %68
  store double %70, ptr %8, align 8, !tbaa !5
  store double %62, ptr %12, align 8, !tbaa !5
  %71 = extractelement <4 x double> %55, i64 0
  %72 = fmul double %71, %68
  store double %72, ptr %14, align 8, !tbaa !5
  store double 1.000000e+00, ptr %20, align 8, !tbaa !5
  br i1 %.not, label %._crit_edge130, label %.lr.ph129.preheader

.lr.ph129.preheader:                              ; preds = %._crit_edge124
  %wide.trip.count149 = zext i32 %2 to i64
  br label %.lr.ph129

.lr.ph123:                                        ; preds = %.lr.ph123.preheader, %.lr.ph123
  %indvars.iv141 = phi i64 [ 0, %.lr.ph123.preheader ], [ %indvars.iv.next142, %.lr.ph123 ]
  %73 = phi <2 x double> [ zeroinitializer, %.lr.ph123.preheader ], [ %100, %.lr.ph123 ]
  %74 = trunc nuw i64 %indvars.iv141 to i32
  %75 = mul i32 %74, 6
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %0, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !5
  %79 = or disjoint i32 %75, 1
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %0, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !5
  %83 = add i32 %75, 3
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %0, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = add i32 %75, 4
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %0, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !5
  %91 = insertelement <2 x double> poison, double %86, i64 0
  %92 = insertelement <2 x double> %91, double %78, i64 1
  %93 = fsub <2 x double> %92, %29
  %94 = insertelement <2 x double> poison, double %90, i64 0
  %95 = insertelement <2 x double> %94, double %82, i64 1
  %96 = fsub <2 x double> %95, %30
  %97 = fmul <2 x double> %96, %96
  %98 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %93, <2 x double> %93, <2 x double> %97)
  %99 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %98)
  %100 = fadd <2 x double> %73, %99
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
  br i1 %exitcond145.not, label %._crit_edge124, label %.lr.ph123, !llvm.loop !11

._crit_edge130:                                   ; preds = %.lr.ph129, %._crit_edge124
  ret void

.lr.ph129:                                        ; preds = %.lr.ph129.preheader, %.lr.ph129
  %indvars.iv146 = phi i64 [ 0, %.lr.ph129.preheader ], [ %indvars.iv.next147, %.lr.ph129 ]
  %101 = mul i64 %indvars.iv146, 6
  %102 = and i64 %101, 4294967294
  %103 = getelementptr inbounds double, ptr %1, i64 %102
  %104 = getelementptr inbounds double, ptr %0, i64 %102
  tail call void @_ZN9MathTools4vmulEPdS0_S0_i(ptr noundef %103, ptr noundef nonnull %3, ptr noundef %104, i32 noundef 3)
  %105 = getelementptr inbounds i8, ptr %103, i64 24
  %106 = getelementptr inbounds i8, ptr %104, i64 24
  tail call void @_ZN9MathTools4vmulEPdS0_S0_i(ptr noundef nonnull %105, ptr noundef nonnull %4, ptr noundef nonnull %106, i32 noundef 3)
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %exitcond150.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count149
  br i1 %exitcond150.not, label %._crit_edge130, label %.lr.ph129, !llvm.loop !12
}

declare void @_ZN9MathTools4vmulEPdS0_S0_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass