; LLVM IR from mkmarek/forex.analytics :: lib/ta-lib/src/ta_func (ta_CORREL)

; 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: nounwind uwtable
define dso_local i32 @TA_CORREL(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  store i32 %0, ptr %10, align 4, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !9
  store ptr %3, ptr %13, align 8, !tbaa !9
  store i32 %4, ptr %14, align 4, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !9
  store ptr %6, ptr %16, align 8, !tbaa !9
  store ptr %7, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  %33 = load i32, ptr %10, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %8
  store i32 12, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

36:                                               ; preds = %8
  %37 = load i32, ptr %11, align 4, !tbaa !5
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %43, label %39

39:                                               ; preds = %36
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = load i32, ptr %10, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %39, %36
  store i32 13, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

44:                                               ; preds = %39
  %45 = load ptr, ptr %12, align 8, !tbaa !9
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 2, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

48:                                               ; preds = %44
  %49 = load ptr, ptr %13, align 8, !tbaa !9
  %50 = icmp ne ptr %49, null
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 2, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

52:                                               ; preds = %48
  %53 = load i32, ptr %14, align 4, !tbaa !5
  %54 = icmp eq i32 %53, -2147483648
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  store i32 30, ptr %14, align 4, !tbaa !5
  br label %64

56:                                               ; preds = %52
  %57 = load i32, ptr %14, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 1
  br i1 %58, label %62, label %59

59:                                               ; preds = %56
  %60 = load i32, ptr %14, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 100000
  br i1 %61, label %62, label %63

62:                                               ; preds = %59, %56
  store i32 2, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

63:                                               ; preds = %59
  br label %64

64:                                               ; preds = %63, %55
  %65 = load ptr, ptr %17, align 8, !tbaa !9
  %66 = icmp ne ptr %65, null
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 2, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

68:                                               ; preds = %64
  %69 = load i32, ptr %14, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 1
  store i32 %70, ptr %28, align 4, !tbaa !5
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = load i32, ptr %28, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %76

74:                                               ; preds = %68
  %75 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %75, ptr %10, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %74, %68
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = icmp sgt i32 %77, %78
  br i1 %79, label %80, label %83

80:                                               ; preds = %76
  %81 = load ptr, ptr %15, align 8, !tbaa !9
  store i32 0, ptr %81, align 4, !tbaa !5
  %82 = load ptr, ptr %16, align 8, !tbaa !9
  store i32 0, ptr %82, align 4, !tbaa !5
  store i32 0, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

83:                                               ; preds = %76
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = load ptr, ptr %15, align 8, !tbaa !9
  store i32 %84, ptr %85, align 4, !tbaa !5
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = load i32, ptr %28, align 4, !tbaa !5
  %88 = sub nsw i32 %86, %87
  store i32 %88, ptr %30, align 4, !tbaa !5
  store double 0.000000e+00, ptr %22, align 8, !tbaa !11
  store double 0.000000e+00, ptr %21, align 8, !tbaa !11
  store double 0.000000e+00, ptr %20, align 8, !tbaa !11
  store double 0.000000e+00, ptr %19, align 8, !tbaa !11
  store double 0.000000e+00, ptr %18, align 8, !tbaa !11
  %89 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %89, ptr %29, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %123, %83
  %91 = load i32, ptr %29, align 4, !tbaa !5
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = icmp sle i32 %91, %92
  br i1 %93, label %94, label %126

94:                                               ; preds = %90
  %95 = load ptr, ptr %12, align 8, !tbaa !9
  %96 = load i32, ptr %29, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %95, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !11
  store double %99, ptr %23, align 8, !tbaa !11
  %100 = load double, ptr %23, align 8, !tbaa !11
  %101 = load double, ptr %19, align 8, !tbaa !11
  %102 = fadd double %101, %100
  store double %102, ptr %19, align 8, !tbaa !11
  %103 = load double, ptr %23, align 8, !tbaa !11
  %104 = load double, ptr %23, align 8, !tbaa !11
  %105 = load double, ptr %21, align 8, !tbaa !11
  %106 = call double @llvm.fmuladd.f64(double %103, double %104, double %105)
  store double %106, ptr %21, align 8, !tbaa !11
  %107 = load ptr, ptr %13, align 8, !tbaa !9
  %108 = load i32, ptr %29, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %107, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !11
  store double %111, ptr %24, align 8, !tbaa !11
  %112 = load double, ptr %23, align 8, !tbaa !11
  %113 = load double, ptr %24, align 8, !tbaa !11
  %114 = load double, ptr %18, align 8, !tbaa !11
  %115 = call double @llvm.fmuladd.f64(double %112, double %113, double %114)
  store double %115, ptr %18, align 8, !tbaa !11
  %116 = load double, ptr %24, align 8, !tbaa !11
  %117 = load double, ptr %20, align 8, !tbaa !11
  %118 = fadd double %117, %116
  store double %118, ptr %20, align 8, !tbaa !11
  %119 = load double, ptr %24, align 8, !tbaa !11
  %120 = load double, ptr %24, align 8, !tbaa !11
  %121 = load double, ptr %22, align 8, !tbaa !11
  %122 = call double @llvm.fmuladd.f64(double %119, double %120, double %121)
  store double %122, ptr %22, align 8, !tbaa !11
  br label %123

123:                                              ; preds = %94
  %124 = load i32, ptr %29, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %29, align 4, !tbaa !5
  br label %90, !llvm.loop !13

126:                                              ; preds = %90
  %127 = load ptr, ptr %12, align 8, !tbaa !9
  %128 = load i32, ptr %30, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !11
  store double %131, ptr %25, align 8, !tbaa !11
  %132 = load ptr, ptr %13, align 8, !tbaa !9
  %133 = load i32, ptr %30, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %30, align 4, !tbaa !5
  %135 = sext i32 %133 to i64
  %136 = getelementptr inbounds double, ptr %132, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !11
  store double %137, ptr %26, align 8, !tbaa !11
  %138 = load double, ptr %21, align 8, !tbaa !11
  %139 = load double, ptr %19, align 8, !tbaa !11
  %140 = load double, ptr %19, align 8, !tbaa !11
  %141 = fmul double %139, %140
  %142 = load i32, ptr %14, align 4, !tbaa !5
  %143 = sitofp i32 %142 to double
  %144 = fdiv double %141, %143
  %145 = fsub double %138, %144
  %146 = load double, ptr %22, align 8, !tbaa !11
  %147 = load double, ptr %20, align 8, !tbaa !11
  %148 = load double, ptr %20, align 8, !tbaa !11
  %149 = fmul double %147, %148
  %150 = load i32, ptr %14, align 4, !tbaa !5
  %151 = sitofp i32 %150 to double
  %152 = fdiv double %149, %151
  %153 = fsub double %146, %152
  %154 = fmul double %145, %153
  store double %154, ptr %27, align 8, !tbaa !11
  %155 = load double, ptr %27, align 8, !tbaa !11
  %156 = fcmp olt double %155, 0x3D06849B86A12B9B
  br i1 %156, label %171, label %157

157:                                              ; preds = %126
  %158 = load double, ptr %18, align 8, !tbaa !11
  %159 = load double, ptr %19, align 8, !tbaa !11
  %160 = load double, ptr %20, align 8, !tbaa !11
  %161 = fmul double %159, %160
  %162 = load i32, ptr %14, align 4, !tbaa !5
  %163 = sitofp i32 %162 to double
  %164 = fdiv double %161, %163
  %165 = fsub double %158, %164
  %166 = load double, ptr %27, align 8, !tbaa !11
  %167 = call double @sqrt(double noundef %166) #4
  %168 = fdiv double %165, %167
  %169 = load ptr, ptr %17, align 8, !tbaa !9
  %170 = getelementptr inbounds double, ptr %169, i64 0
  store double %168, ptr %170, align 8, !tbaa !11
  br label %174

171:                                              ; preds = %126
  %172 = load ptr, ptr %17, align 8, !tbaa !9
  %173 = getelementptr inbounds double, ptr %172, i64 0
  store double 0.000000e+00, ptr %173, align 8, !tbaa !11
  br label %174

174:                                              ; preds = %171, %157
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %283, %174
  %176 = load i32, ptr %29, align 4, !tbaa !5
  %177 = load i32, ptr %11, align 4, !tbaa !5
  %178 = icmp sle i32 %176, %177
  br i1 %178, label %179, label %284

179:                                              ; preds = %175
  %180 = load double, ptr %25, align 8, !tbaa !11
  %181 = load double, ptr %19, align 8, !tbaa !11
  %182 = fsub double %181, %180
  store double %182, ptr %19, align 8, !tbaa !11
  %183 = load double, ptr %25, align 8, !tbaa !11
  %184 = load double, ptr %25, align 8, !tbaa !11
  %185 = load double, ptr %21, align 8, !tbaa !11
  %186 = fneg double %183
  %187 = call double @llvm.fmuladd.f64(double %186, double %184, double %185)
  store double %187, ptr %21, align 8, !tbaa !11
  %188 = load double, ptr %25, align 8, !tbaa !11
  %189 = load double, ptr %26, align 8, !tbaa !11
  %190 = load double, ptr %18, align 8, !tbaa !11
  %191 = fneg double %188
  %192 = call double @llvm.fmuladd.f64(double %191, double %189, double %190)
  store double %192, ptr %18, align 8, !tbaa !11
  %193 = load double, ptr %26, align 8, !tbaa !11
  %194 = load double, ptr %20, align 8, !tbaa !11
  %195 = fsub double %194, %193
  store double %195, ptr %20, align 8, !tbaa !11
  %196 = load double, ptr %26, align 8, !tbaa !11
  %197 = load double, ptr %26, align 8, !tbaa !11
  %198 = load double, ptr %22, align 8, !tbaa !11
  %199 = fneg double %196
  %200 = call double @llvm.fmuladd.f64(double %199, double %197, double %198)
  store double %200, ptr %22, align 8, !tbaa !11
  %201 = load ptr, ptr %12, align 8, !tbaa !9
  %202 = load i32, ptr %29, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds double, ptr %201, i64 %203
  %205 = load double, ptr %204, align 8, !tbaa !11
  store double %205, ptr %23, align 8, !tbaa !11
  %206 = load double, ptr %23, align 8, !tbaa !11
  %207 = load double, ptr %19, align 8, !tbaa !11
  %208 = fadd double %207, %206
  store double %208, ptr %19, align 8, !tbaa !11
  %209 = load double, ptr %23, align 8, !tbaa !11
  %210 = load double, ptr %23, align 8, !tbaa !11
  %211 = load double, ptr %21, align 8, !tbaa !11
  %212 = call double @llvm.fmuladd.f64(double %209, double %210, double %211)
  store double %212, ptr %21, align 8, !tbaa !11
  %213 = load ptr, ptr %13, align 8, !tbaa !9
  %214 = load i32, ptr %29, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %29, align 4, !tbaa !5
  %216 = sext i32 %214 to i64
  %217 = getelementptr inbounds double, ptr %213, i64 %216
  %218 = load double, ptr %217, align 8, !tbaa !11
  store double %218, ptr %24, align 8, !tbaa !11
  %219 = load double, ptr %23, align 8, !tbaa !11
  %220 = load double, ptr %24, align 8, !tbaa !11
  %221 = load double, ptr %18, align 8, !tbaa !11
  %222 = call double @llvm.fmuladd.f64(double %219, double %220, double %221)
  store double %222, ptr %18, align 8, !tbaa !11
  %223 = load double, ptr %24, align 8, !tbaa !11
  %224 = load double, ptr %20, align 8, !tbaa !11
  %225 = fadd double %224, %223
  store double %225, ptr %20, align 8, !tbaa !11
  %226 = load double, ptr %24, align 8, !tbaa !11
  %227 = load double, ptr %24, align 8, !tbaa !11
  %228 = load double, ptr %22, align 8, !tbaa !11
  %229 = call double @llvm.fmuladd.f64(double %226, double %227, double %228)
  store double %229, ptr %22, align 8, !tbaa !11
  %230 = load ptr, ptr %12, align 8, !tbaa !9
  %231 = load i32, ptr %30, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds double, ptr %230, i64 %232
  %234 = load double, ptr %233, align 8, !tbaa !11
  store double %234, ptr %25, align 8, !tbaa !11
  %235 = load ptr, ptr %13, align 8, !tbaa !9
  %236 = load i32, ptr %30, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %30, align 4, !tbaa !5
  %238 = sext i32 %236 to i64
  %239 = getelementptr inbounds double, ptr %235, i64 %238
  %240 = load double, ptr %239, align 8, !tbaa !11
  store double %240, ptr %26, align 8, !tbaa !11
  %241 = load double, ptr %21, align 8, !tbaa !11
  %242 = load double, ptr %19, align 8, !tbaa !11
  %243 = load double, ptr %19, align 8, !tbaa !11
  %244 = fmul double %242, %243
  %245 = load i32, ptr %14, align 4, !tbaa !5
  %246 = sitofp i32 %245 to double
  %247 = fdiv double %244, %246
  %248 = fsub double %241, %247
  %249 = load double, ptr %22, align 8, !tbaa !11
  %250 = load double, ptr %20, align 8, !tbaa !11
  %251 = load double, ptr %20, align 8, !tbaa !11
  %252 = fmul double %250, %251
  %253 = load i32, ptr %14, align 4, !tbaa !5
  %254 = sitofp i32 %253 to double
  %255 = fdiv double %252, %254
  %256 = fsub double %249, %255
  %257 = fmul double %248, %256
  store double %257, ptr %27, align 8, !tbaa !11
  %258 = load double, ptr %27, align 8, !tbaa !11
  %259 = fcmp olt double %258, 0x3D06849B86A12B9B
  br i1 %259, label %277, label %260

260:                                              ; preds = %179
  %261 = load double, ptr %18, align 8, !tbaa !11
  %262 = load double, ptr %19, align 8, !tbaa !11
  %263 = load double, ptr %20, align 8, !tbaa !11
  %264 = fmul double %262, %263
  %265 = load i32, ptr %14, align 4, !tbaa !5
  %266 = sitofp i32 %265 to double
  %267 = fdiv double %264, %266
  %268 = fsub double %261, %267
  %269 = load double, ptr %27, align 8, !tbaa !11
  %270 = call double @sqrt(double noundef %269) #4
  %271 = fdiv double %268, %270
  %272 = load ptr, ptr %17, align 8, !tbaa !9
  %273 = load i32, ptr %31, align 4, !tbaa !5
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr %31, align 4, !tbaa !5
  %275 = sext i32 %273 to i64
  %276 = getelementptr inbounds double, ptr %272, i64 %275
  store double %271, ptr %276, align 8, !tbaa !11
  br label %283

277:                                              ; preds = %179
  %278 = load ptr, ptr %17, align 8, !tbaa !9
  %279 = load i32, ptr %31, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %31, align 4, !tbaa !5
  %281 = sext i32 %279 to i64
  %282 = getelementptr inbounds double, ptr %278, i64 %281
  store double 0.000000e+00, ptr %282, align 8, !tbaa !11
  br label %283

283:                                              ; preds = %277, %260
  br label %175, !llvm.loop !15

284:                                              ; preds = %175
  %285 = load i32, ptr %31, align 4, !tbaa !5
  %286 = load ptr, ptr %16, align 8, !tbaa !9
  store i32 %285, ptr %286, align 4, !tbaa !5
  store i32 0, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %287

287:                                              ; preds = %284, %80, %67, %62, %51, %47, %43, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %288 = load i32, ptr %9, align 4
  ret i32 %288
}

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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}


; 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: nofree nounwind memory(write, argmem: readwrite) uwtable
define dso_local range(i32 0, 14) i32 @TA_CORREL(i32 noundef %0, i32 noundef %1, ptr noundef readonly %2, ptr noundef readonly %3, i32 noundef %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6, ptr noundef writeonly %7) local_unnamed_addr #0 {
  %9 = icmp slt i32 %0, 0
  br i1 %9, label %102, label %10

10:                                               ; preds = %8
  %11 = icmp slt i32 %1, %0
  br i1 %11, label %102, label %12

12:                                               ; preds = %10
  %.not = icmp eq ptr %2, null
  %.not147 = icmp eq ptr %3, null
  %or.cond152 = or i1 %.not, %.not147
  br i1 %or.cond152, label %102, label %13

13:                                               ; preds = %12
  %14 = icmp eq i32 %4, -2147483648
  br i1 %14, label %17, label %15

15:                                               ; preds = %13
  %16 = add i32 %4, -100001
  %or.cond = icmp ult i32 %16, -100000
  br i1 %or.cond, label %102, label %17

17:                                               ; preds = %13, %15
  %.0137 = phi i32 [ %4, %15 ], [ 30, %13 ]
  %.not148 = icmp eq ptr %7, null
  br i1 %.not148, label %102, label %18

18:                                               ; preds = %17
  %19 = add nsw i32 %.0137, -1
  %spec.select = tail call i32 @llvm.umax.i32(i32 %19, i32 %0)
  %20 = icmp ugt i32 %spec.select, %1
  br i1 %20, label %21, label %.lr.ph.preheader

21:                                               ; preds = %18
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %.sink.split

.lr.ph.preheader:                                 ; preds = %18
  store i32 %spec.select, ptr %5, align 4, !tbaa !5
  %22 = sub nsw i32 %spec.select, %19
  %23 = sext i32 %22 to i64
  %24 = zext nneg i32 %spec.select to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %23, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.0134154 = phi double [ 0.000000e+00, %.lr.ph.preheader ], [ %31, %.lr.ph ]
  %25 = phi <2 x double> [ zeroinitializer, %.lr.ph.preheader ], [ %35, %.lr.ph ]
  %26 = phi <2 x double> [ zeroinitializer, %.lr.ph.preheader ], [ %34, %.lr.ph ]
  %27 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = tail call double @llvm.fmuladd.f64(double %28, double %30, double %.0134154)
  %32 = insertelement <2 x double> poison, double %30, i64 0
  %33 = insertelement <2 x double> %32, double %28, i64 1
  %34 = fadd <2 x double> %26, %33
  %35 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %33, <2 x double> %25)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %.not149.not = icmp slt i64 %indvars.iv, %24
  br i1 %.not149.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %36 = trunc nsw i64 %indvars.iv.next to i32
  %37 = getelementptr inbounds double, ptr %2, i64 %23
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds double, ptr %3, i64 %23
  %40 = load double, ptr %39, align 8, !tbaa !9
  %41 = sitofp i32 %.0137 to double
  %42 = fmul <2 x double> %34, %34
  %43 = insertelement <2 x double> poison, double %41, i64 0
  %44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
  %45 = fdiv <2 x double> %42, %44
  %46 = fsub <2 x double> %35, %45
  %shift = shufflevector <2 x double> %46, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %47 = fmul <2 x double> %shift, %46
  %48 = extractelement <2 x double> %47, i64 0
  %49 = fcmp olt double %48, 0x3D06849B86A12B9B
  br i1 %49, label %57, label %50

50:                                               ; preds = %._crit_edge
  %shift206 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %51 = fmul <2 x double> %shift206, %34
  %52 = extractelement <2 x double> %51, i64 0
  %53 = fdiv double %52, %41
  %54 = fsub double %31, %53
  %55 = tail call double @sqrt(double noundef %48) #4
  %56 = fdiv double %54, %55
  br label %57

57:                                               ; preds = %._crit_edge, %50
  %storemerge = phi double [ %56, %50 ], [ 0.000000e+00, %._crit_edge ]
  store double %storemerge, ptr %7, align 8, !tbaa !9
  %.not150166 = icmp sgt i32 %36, %1
  br i1 %.not150166, label %.sink.split, label %.lr.ph178.preheader

.lr.ph178.preheader:                              ; preds = %57
  %58 = and i64 %indvars.iv.next, 4294967295
  %59 = add i32 %1, 2
  %60 = sub i32 %59, %36
  %wide.trip.count = zext i32 %60 to i64
  %61 = insertelement <2 x double> poison, double %40, i64 0
  %62 = insertelement <2 x double> %61, double %38, i64 1
  br label %.lr.ph178

.lr.ph178:                                        ; preds = %.lr.ph178.preheader, %98
  %indvars.iv191 = phi i64 [ %58, %.lr.ph178.preheader ], [ %indvars.iv.next192, %98 ]
  %indvars.iv189 = phi i64 [ 1, %.lr.ph178.preheader ], [ %indvars.iv.next190, %98 ]
  %indvars.iv187 = phi i64 [ %23, %.lr.ph178.preheader ], [ %indvars.iv.next188, %98 ]
  %.1135167 = phi double [ %31, %.lr.ph178.preheader ], [ %74, %98 ]
  %63 = phi <2 x double> [ %35, %.lr.ph178.preheader ], [ %78, %98 ]
  %64 = phi <2 x double> [ %62, %.lr.ph178.preheader ], [ %101, %98 ]
  %65 = phi <2 x double> [ %34, %.lr.ph178.preheader ], [ %84, %98 ]
  %indvars.iv.next188 = add nsw i64 %indvars.iv187, 1
  %66 = fneg <2 x double> %64
  %67 = extractelement <2 x double> %66, i64 1
  %68 = extractelement <2 x double> %64, i64 0
  %69 = tail call double @llvm.fmuladd.f64(double %67, double %68, double %.1135167)
  %70 = getelementptr inbounds double, ptr %2, i64 %indvars.iv191
  %71 = load double, ptr %70, align 8, !tbaa !9
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %72 = getelementptr inbounds double, ptr %3, i64 %indvars.iv191
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = tail call double @llvm.fmuladd.f64(double %71, double %73, double %69)
  %75 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %64, <2 x double> %63)
  %76 = insertelement <2 x double> poison, double %73, i64 0
  %77 = insertelement <2 x double> %76, double %71, i64 1
  %78 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %77, <2 x double> %77, <2 x double> %75)
  %79 = getelementptr inbounds double, ptr %2, i64 %indvars.iv.next188
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next188
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fsub <2 x double> %65, %64
  %84 = fadd <2 x double> %83, %77
  %85 = fmul <2 x double> %84, %84
  %86 = fdiv <2 x double> %85, %44
  %87 = fsub <2 x double> %78, %86
  %shift207 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %88 = fmul <2 x double> %shift207, %87
  %89 = extractelement <2 x double> %88, i64 0
  %90 = fcmp olt double %89, 0x3D06849B86A12B9B
  br i1 %90, label %98, label %91

91:                                               ; preds = %.lr.ph178
  %shift208 = shufflevector <2 x double> %84, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %92 = fmul <2 x double> %shift208, %84
  %93 = extractelement <2 x double> %92, i64 0
  %94 = fdiv double %93, %41
  %95 = fsub double %74, %94
  %96 = tail call double @sqrt(double noundef %89) #4
  %97 = fdiv double %95, %96
  br label %98

98:                                               ; preds = %.lr.ph178, %91
  %.sink = phi double [ %97, %91 ], [ 0.000000e+00, %.lr.ph178 ]
  %99 = getelementptr inbounds double, ptr %7, i64 %indvars.iv189
  store double %.sink, ptr %99, align 8
  %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count
  %100 = insertelement <2 x double> poison, double %82, i64 0
  %101 = insertelement <2 x double> %100, double %80, i64 1
  br i1 %exitcond.not, label %.sink.split, label %.lr.ph178, !llvm.loop !13

.sink.split:                                      ; preds = %98, %57, %21
  %.0.lcssa.sink = phi i32 [ 0, %21 ], [ 1, %57 ], [ %60, %98 ]
  store i32 %.0.lcssa.sink, ptr %6, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %.sink.split, %17, %15, %12, %10, %8
  %.0123 = phi i32 [ 12, %8 ], [ 13, %10 ], [ 2, %12 ], [ 2, %15 ], [ 2, %17 ], [ 0, %.sink.split ]
  ret i32 %.0123
}

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

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

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

; 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>) #3

attributes #0 = { nofree nounwind memory(write, argmem: readwrite) 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 speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass