; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @TA_S_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) #3 {
  %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 %295

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 %295

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 %295

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 %295

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 %295

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 %295

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 %295

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 = %125, %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 %128

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 float, ptr %95, i64 %97
  %99 = load float, ptr %98, align 4, !tbaa !13
  %100 = fpext float %99 to double
  store double %100, ptr %23, align 8, !tbaa !11
  %101 = load double, ptr %23, align 8, !tbaa !11
  %102 = load double, ptr %19, align 8, !tbaa !11
  %103 = fadd double %102, %101
  store double %103, ptr %19, align 8, !tbaa !11
  %104 = load double, ptr %23, align 8, !tbaa !11
  %105 = load double, ptr %23, align 8, !tbaa !11
  %106 = load double, ptr %21, align 8, !tbaa !11
  %107 = call double @llvm.fmuladd.f64(double %104, double %105, double %106)
  store double %107, ptr %21, align 8, !tbaa !11
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = load i32, ptr %29, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds float, ptr %108, i64 %110
  %112 = load float, ptr %111, align 4, !tbaa !13
  %113 = fpext float %112 to double
  store double %113, ptr %24, align 8, !tbaa !11
  %114 = load double, ptr %23, align 8, !tbaa !11
  %115 = load double, ptr %24, align 8, !tbaa !11
  %116 = load double, ptr %18, align 8, !tbaa !11
  %117 = call double @llvm.fmuladd.f64(double %114, double %115, double %116)
  store double %117, ptr %18, align 8, !tbaa !11
  %118 = load double, ptr %24, align 8, !tbaa !11
  %119 = load double, ptr %20, align 8, !tbaa !11
  %120 = fadd double %119, %118
  store double %120, ptr %20, align 8, !tbaa !11
  %121 = load double, ptr %24, align 8, !tbaa !11
  %122 = load double, ptr %24, align 8, !tbaa !11
  %123 = load double, ptr %22, align 8, !tbaa !11
  %124 = call double @llvm.fmuladd.f64(double %121, double %122, double %123)
  store double %124, ptr %22, align 8, !tbaa !11
  br label %125

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

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

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

175:                                              ; preds = %128
  %176 = load ptr, ptr %17, align 8, !tbaa !9
  %177 = getelementptr inbounds double, ptr %176, i64 0
  store double 0.000000e+00, ptr %177, align 8, !tbaa !11
  br label %178

178:                                              ; preds = %175, %161
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %291, %178
  %180 = load i32, ptr %29, align 4, !tbaa !5
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = icmp sle i32 %180, %181
  br i1 %182, label %183, label %292

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

268:                                              ; preds = %183
  %269 = load double, ptr %18, align 8, !tbaa !11
  %270 = load double, ptr %19, align 8, !tbaa !11
  %271 = load double, ptr %20, align 8, !tbaa !11
  %272 = fmul double %270, %271
  %273 = load i32, ptr %14, align 4, !tbaa !5
  %274 = sitofp i32 %273 to double
  %275 = fdiv double %272, %274
  %276 = fsub double %269, %275
  %277 = load double, ptr %27, align 8, !tbaa !11
  %278 = call double @sqrt(double noundef %277) #4
  %279 = fdiv double %276, %278
  %280 = load ptr, ptr %17, align 8, !tbaa !9
  %281 = load i32, ptr %31, align 4, !tbaa !5
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %31, align 4, !tbaa !5
  %283 = sext i32 %281 to i64
  %284 = getelementptr inbounds double, ptr %280, i64 %283
  store double %279, ptr %284, align 8, !tbaa !11
  br label %291

285:                                              ; preds = %183
  %286 = load ptr, ptr %17, align 8, !tbaa !9
  %287 = load i32, ptr %31, align 4, !tbaa !5
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %31, align 4, !tbaa !5
  %289 = sext i32 %287 to i64
  %290 = getelementptr inbounds double, ptr %286, i64 %289
  store double 0.000000e+00, ptr %290, align 8, !tbaa !11
  br label %291

291:                                              ; preds = %285, %268
  br label %179, !llvm.loop !17

292:                                              ; preds = %179
  %293 = load i32, ptr %31, align 4, !tbaa !5
  %294 = load ptr, ptr %16, align 8, !tbaa !9
  store i32 %293, ptr %294, align 4, !tbaa !5
  store i32 0, ptr %9, align 4
  store i32 1, ptr %32, align 4
  br label %295

295:                                              ; preds = %292, %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
  %296 = load i32, ptr %9, align 4
  ret i32 %296
}

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


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

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

; Function Attrs: nofree nounwind memory(write, argmem: readwrite) uwtable
define dso_local range(i32 0, 14) i32 @TA_S_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 #2 {
  %9 = icmp slt i32 %0, 0
  br i1 %9, label %109, label %10

10:                                               ; preds = %8
  %11 = icmp slt i32 %1, %0
  br i1 %11, label %109, 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 %109, 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 %109, label %17

17:                                               ; preds = %13, %15
  %.0137 = phi i32 [ %4, %15 ], [ 30, %13 ]
  %.not148 = icmp eq ptr %7, null
  br i1 %.not148, label %109, 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 ], [ %36, %.lr.ph ]
  %25 = phi <2 x double> [ zeroinitializer, %.lr.ph.preheader ], [ %38, %.lr.ph ]
  %26 = phi <2 x double> [ zeroinitializer, %.lr.ph.preheader ], [ %37, %.lr.ph ]
  %27 = getelementptr inbounds float, ptr %2, i64 %indvars.iv
  %28 = load float, ptr %27, align 4, !tbaa !9
  %29 = getelementptr inbounds float, ptr %3, i64 %indvars.iv
  %30 = load float, ptr %29, align 4, !tbaa !9
  %31 = insertelement <2 x float> poison, float %30, i64 0
  %32 = insertelement <2 x float> %31, float %28, i64 1
  %33 = fpext <2 x float> %32 to <2 x double>
  %34 = extractelement <2 x double> %33, i64 0
  %35 = extractelement <2 x double> %33, i64 1
  %36 = tail call double @llvm.fmuladd.f64(double %35, double %34, double %.0134154)
  %37 = fadd <2 x double> %26, %33
  %38 = 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
  %39 = trunc nsw i64 %indvars.iv.next to i32
  %40 = getelementptr inbounds float, ptr %2, i64 %23
  %41 = load float, ptr %40, align 4, !tbaa !9
  %42 = getelementptr inbounds float, ptr %3, i64 %23
  %43 = load float, ptr %42, align 4, !tbaa !9
  %44 = sitofp i32 %.0137 to double
  %45 = fmul <2 x double> %37, %37
  %46 = insertelement <2 x double> poison, double %44, i64 0
  %47 = shufflevector <2 x double> %46, <2 x double> poison, <2 x i32> zeroinitializer
  %48 = fdiv <2 x double> %45, %47
  %49 = fsub <2 x double> %38, %48
  %shift = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %50 = fmul <2 x double> %shift, %49
  %51 = extractelement <2 x double> %50, i64 0
  %52 = fcmp olt double %51, 0x3D06849B86A12B9B
  br i1 %52, label %60, label %53

53:                                               ; preds = %._crit_edge
  %shift206 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %54 = fmul <2 x double> %shift206, %37
  %55 = extractelement <2 x double> %54, i64 0
  %56 = fdiv double %55, %44
  %57 = fsub double %36, %56
  %58 = tail call double @sqrt(double noundef %51) #4
  %59 = fdiv double %57, %58
  br label %60

60:                                               ; preds = %._crit_edge, %53
  %storemerge = phi double [ %59, %53 ], [ 0.000000e+00, %._crit_edge ]
  store double %storemerge, ptr %7, align 8, !tbaa !13
  %.not150166 = icmp sgt i32 %39, %1
  br i1 %.not150166, label %.sink.split, label %.lr.ph178.preheader

.lr.ph178.preheader:                              ; preds = %60
  %61 = and i64 %indvars.iv.next, 4294967295
  %62 = add i32 %1, 2
  %63 = sub i32 %62, %39
  %wide.trip.count = zext i32 %63 to i64
  %64 = insertelement <2 x float> poison, float %43, i64 0
  %65 = insertelement <2 x float> %64, float %41, i64 1
  br label %.lr.ph178

.lr.ph178:                                        ; preds = %.lr.ph178.preheader, %105
  %indvars.iv191 = phi i64 [ %61, %.lr.ph178.preheader ], [ %indvars.iv.next192, %105 ]
  %indvars.iv189 = phi i64 [ 1, %.lr.ph178.preheader ], [ %indvars.iv.next190, %105 ]
  %indvars.iv187 = phi i64 [ %23, %.lr.ph178.preheader ], [ %indvars.iv.next188, %105 ]
  %.1135167 = phi double [ %36, %.lr.ph178.preheader ], [ %84, %105 ]
  %66 = phi <2 x double> [ %38, %.lr.ph178.preheader ], [ %87, %105 ]
  %67 = phi <2 x float> [ %65, %.lr.ph178.preheader ], [ %108, %105 ]
  %68 = phi <2 x double> [ %37, %.lr.ph178.preheader ], [ %86, %105 ]
  %indvars.iv.next188 = add nsw i64 %indvars.iv187, 1
  %69 = fpext <2 x float> %67 to <2 x double>
  %70 = getelementptr inbounds float, ptr %2, i64 %indvars.iv191
  %71 = load float, ptr %70, align 4, !tbaa !9
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %72 = getelementptr inbounds float, ptr %3, i64 %indvars.iv191
  %73 = load float, ptr %72, align 4, !tbaa !9
  %74 = fneg <2 x double> %69
  %75 = extractelement <2 x double> %74, i64 1
  %76 = extractelement <2 x double> %69, i64 0
  %77 = tail call double @llvm.fmuladd.f64(double %75, double %76, double %.1135167)
  %78 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %69, <2 x double> %66)
  %79 = insertelement <2 x float> poison, float %73, i64 0
  %80 = insertelement <2 x float> %79, float %71, i64 1
  %81 = fpext <2 x float> %80 to <2 x double>
  %82 = extractelement <2 x double> %81, i64 0
  %83 = extractelement <2 x double> %81, i64 1
  %84 = tail call double @llvm.fmuladd.f64(double %83, double %82, double %77)
  %85 = fsub <2 x double> %68, %69
  %86 = fadd <2 x double> %85, %81
  %87 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %81, <2 x double> %81, <2 x double> %78)
  %88 = getelementptr inbounds float, ptr %2, i64 %indvars.iv.next188
  %89 = load float, ptr %88, align 4, !tbaa !9
  %90 = getelementptr inbounds float, ptr %3, i64 %indvars.iv.next188
  %91 = load float, ptr %90, align 4, !tbaa !9
  %92 = fmul <2 x double> %86, %86
  %93 = fdiv <2 x double> %92, %47
  %94 = fsub <2 x double> %87, %93
  %shift207 = shufflevector <2 x double> %94, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %95 = fmul <2 x double> %shift207, %94
  %96 = extractelement <2 x double> %95, i64 0
  %97 = fcmp olt double %96, 0x3D06849B86A12B9B
  br i1 %97, label %105, label %98

98:                                               ; preds = %.lr.ph178
  %shift208 = shufflevector <2 x double> %86, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %99 = fmul <2 x double> %shift208, %86
  %100 = extractelement <2 x double> %99, i64 0
  %101 = fdiv double %100, %44
  %102 = fsub double %84, %101
  %103 = tail call double @sqrt(double noundef %96) #4
  %104 = fdiv double %102, %103
  br label %105

105:                                              ; preds = %.lr.ph178, %98
  %.sink = phi double [ %104, %98 ], [ 0.000000e+00, %.lr.ph178 ]
  %106 = getelementptr inbounds double, ptr %7, i64 %indvars.iv189
  store double %.sink, ptr %106, align 8
  %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count
  %107 = insertelement <2 x float> poison, float %91, i64 0
  %108 = insertelement <2 x float> %107, float %89, i64 1
  br i1 %exitcond.not, label %.sink.split, label %.lr.ph178, !llvm.loop !15

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

109:                                              ; 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: 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !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