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

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

declare i32 @TA_EMA_Lookback(i32 noundef) #0

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

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

declare i32 @TA_INT_EMA(i32 noundef, i32 noundef, ptr noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

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

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

32:                                               ; preds = %7
  store i32 12, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

33:                                               ; preds = %7
  %34 = load i32, ptr %10, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %40, label %36

36:                                               ; preds = %33
  %37 = load i32, ptr %10, align 4, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %36, %33
  store i32 13, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

41:                                               ; preds = %36
  %42 = load ptr, ptr %11, align 8, !tbaa !9
  %43 = icmp ne ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  store i32 2, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

45:                                               ; preds = %41
  %46 = load i32, ptr %12, align 4, !tbaa !5
  %47 = icmp eq i32 %46, -2147483648
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  store i32 30, ptr %12, align 4, !tbaa !5
  br label %57

49:                                               ; preds = %45
  %50 = load i32, ptr %12, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 2
  br i1 %51, label %55, label %52

52:                                               ; preds = %49
  %53 = load i32, ptr %12, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 100000
  br i1 %54, label %55, label %56

55:                                               ; preds = %52, %49
  store i32 2, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

56:                                               ; preds = %52
  br label %57

57:                                               ; preds = %56, %48
  %58 = load ptr, ptr %15, align 8, !tbaa !9
  %59 = icmp ne ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  store i32 2, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

61:                                               ; preds = %57
  %62 = load ptr, ptr %14, align 8, !tbaa !9
  store i32 0, ptr %62, align 4, !tbaa !5
  %63 = load ptr, ptr %13, align 8, !tbaa !9
  store i32 0, ptr %63, align 4, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = call i32 @TA_EMA_Lookback(i32 noundef %64)
  store i32 %65, ptr %27, align 4, !tbaa !5
  %66 = load i32, ptr %27, align 4, !tbaa !5
  %67 = mul nsw i32 %66, 2
  store i32 %67, ptr %26, align 4, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = load i32, ptr %26, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %61
  %72 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %72, ptr %9, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %71, %61
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = icmp sgt i32 %74, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %73
  store i32 0, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

78:                                               ; preds = %73
  %79 = load i32, ptr %26, align 4, !tbaa !5
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  %83 = add nsw i32 %79, %82
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %23, align 4, !tbaa !5
  %85 = load i32, ptr %23, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = mul i64 8, %86
  %88 = call noalias ptr @malloc(i64 noundef %87) #7
  store ptr %88, ptr %16, align 8, !tbaa !9
  %89 = load ptr, ptr %16, align 8, !tbaa !9
  %90 = icmp ne ptr %89, null
  br i1 %90, label %92, label %91

91:                                               ; preds = %78
  store i32 3, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

92:                                               ; preds = %78
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  %95 = sitofp i32 %94 to double
  %96 = fdiv double 2.000000e+00, %95
  store double %96, ptr %18, align 8, !tbaa !11
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = load i32, ptr %27, align 4, !tbaa !5
  %99 = sub nsw i32 %97, %98
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = load ptr, ptr %11, align 8, !tbaa !9
  %102 = load i32, ptr %12, align 4, !tbaa !5
  %103 = load double, ptr %18, align 8, !tbaa !11
  %104 = load ptr, ptr %16, align 8, !tbaa !9
  %105 = call i32 @TA_S_INT_EMA(i32 noundef %99, i32 noundef %100, ptr noundef %101, i32 noundef %102, double noundef %103, ptr noundef %19, ptr noundef %20, ptr noundef %104)
  store i32 %105, ptr %28, align 4, !tbaa !5
  %106 = load i32, ptr %28, align 4, !tbaa !5
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %111, label %108

108:                                              ; preds = %92
  %109 = load i32, ptr %20, align 4, !tbaa !5
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %119

111:                                              ; preds = %108, %92
  %112 = load ptr, ptr %16, align 8, !tbaa !9
  %113 = load ptr, ptr %15, align 8, !tbaa !9
  %114 = icmp ne ptr %112, %113
  br i1 %114, label %115, label %117

115:                                              ; preds = %111
  %116 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %116) #6
  br label %117

117:                                              ; preds = %115, %111
  %118 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %118, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

119:                                              ; preds = %108
  %120 = load i32, ptr %20, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = mul i64 8, %121
  %123 = call noalias ptr @malloc(i64 noundef %122) #7
  store ptr %123, ptr %17, align 8, !tbaa !9
  %124 = load ptr, ptr %17, align 8, !tbaa !9
  %125 = icmp ne ptr %124, null
  br i1 %125, label %133, label %126

126:                                              ; preds = %119
  %127 = load ptr, ptr %16, align 8, !tbaa !9
  %128 = load ptr, ptr %15, align 8, !tbaa !9
  %129 = icmp ne ptr %127, %128
  br i1 %129, label %130, label %132

130:                                              ; preds = %126
  %131 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %131) #6
  br label %132

132:                                              ; preds = %130, %126
  store i32 3, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

133:                                              ; preds = %119
  %134 = load i32, ptr %20, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  %136 = load ptr, ptr %16, align 8, !tbaa !9
  %137 = load i32, ptr %12, align 4, !tbaa !5
  %138 = load double, ptr %18, align 8, !tbaa !11
  %139 = load ptr, ptr %17, align 8, !tbaa !9
  %140 = call i32 @TA_INT_EMA(i32 noundef 0, i32 noundef %135, ptr noundef %136, i32 noundef %137, double noundef %138, ptr noundef %21, ptr noundef %22, ptr noundef %139)
  store i32 %140, ptr %28, align 4, !tbaa !5
  %141 = load i32, ptr %28, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %146, label %143

143:                                              ; preds = %133
  %144 = load i32, ptr %22, align 4, !tbaa !5
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %146, label %150

146:                                              ; preds = %143, %133
  %147 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %147) #6
  %148 = load ptr, ptr %17, align 8, !tbaa !9
  call void @free(ptr noundef %148) #6
  %149 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %149, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

150:                                              ; preds = %143
  %151 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %151, ptr %25, align 4, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %156, %150
  %153 = load i32, ptr %24, align 4, !tbaa !5
  %154 = load i32, ptr %22, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %176

156:                                              ; preds = %152
  %157 = load ptr, ptr %16, align 8, !tbaa !9
  %158 = load i32, ptr %25, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %25, align 4, !tbaa !5
  %160 = sext i32 %158 to i64
  %161 = getelementptr inbounds double, ptr %157, i64 %160
  %162 = load double, ptr %161, align 8, !tbaa !11
  %163 = load ptr, ptr %17, align 8, !tbaa !9
  %164 = load i32, ptr %24, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %163, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !11
  %168 = fneg double %167
  %169 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %162, double %168)
  %170 = load ptr, ptr %15, align 8, !tbaa !9
  %171 = load i32, ptr %24, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds double, ptr %170, i64 %172
  store double %169, ptr %173, align 8, !tbaa !11
  %174 = load i32, ptr %24, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %24, align 4, !tbaa !5
  br label %152, !llvm.loop !13

176:                                              ; preds = %152
  %177 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %177) #6
  %178 = load ptr, ptr %17, align 8, !tbaa !9
  call void @free(ptr noundef %178) #6
  %179 = load i32, ptr %19, align 4, !tbaa !5
  %180 = load i32, ptr %21, align 4, !tbaa !5
  %181 = add nsw i32 %179, %180
  %182 = load ptr, ptr %13, align 8, !tbaa !9
  store i32 %181, ptr %182, align 4, !tbaa !5
  %183 = load i32, ptr %24, align 4, !tbaa !5
  %184 = load ptr, ptr %14, align 8, !tbaa !9
  store i32 %183, ptr %184, align 4, !tbaa !5
  store i32 0, ptr %8, align 4
  store i32 1, ptr %29, align 4
  br label %185

185:                                              ; preds = %176, %146, %132, %117, %91, %77, %60, %55, %44, %40, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #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 8, ptr %16) #6
  %186 = load i32, ptr %8, align 4
  ret i32 %186
}

declare i32 @TA_S_INT_EMA(i32 noundef, i32 noundef, ptr noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !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"}


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

declare i32 @TA_EMA_Lookback(i32 noundef) local_unnamed_addr #0

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

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

declare i32 @TA_INT_EMA(i32 noundef, i32 noundef, ptr noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @TA_S_DEMA(i32 noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5, ptr noundef writeonly %6) local_unnamed_addr #5 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %12 = icmp slt i32 %0, 0
  br i1 %12, label %79, label %13

13:                                               ; preds = %7
  %14 = icmp slt i32 %1, %0
  br i1 %14, label %79, label %15

15:                                               ; preds = %13
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %79, label %16

16:                                               ; preds = %15
  %17 = icmp eq i32 %3, -2147483648
  br i1 %17, label %20, label %18

18:                                               ; preds = %16
  %19 = add i32 %3, -100001
  %or.cond = icmp ult i32 %19, -99999
  br i1 %or.cond, label %79, label %20

20:                                               ; preds = %16, %18
  %.069 = phi i32 [ %3, %18 ], [ 30, %16 ]
  %.not79 = icmp eq ptr %6, null
  br i1 %.not79, label %79, label %21

21:                                               ; preds = %20
  store i32 0, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !5
  %22 = tail call i32 @TA_EMA_Lookback(i32 noundef %.069) #7
  %23 = shl nsw i32 %22, 1
  %spec.select = tail call i32 @llvm.smax.i32(i32 %23, i32 %0)
  %24 = icmp ugt i32 %spec.select, %1
  br i1 %24, label %79, label %25

25:                                               ; preds = %21
  %26 = add nuw i32 %1, 1
  %27 = add i32 %26, %23
  %28 = sub i32 %27, %spec.select
  %29 = sext i32 %28 to i64
  %30 = shl nsw i64 %29, 3
  %31 = tail call noalias ptr @malloc(i64 noundef %30) #8
  %.not80 = icmp eq ptr %31, null
  br i1 %.not80, label %79, label %32

32:                                               ; preds = %25
  %33 = add nuw nsw i32 %.069, 1
  %34 = uitofp nneg i32 %33 to double
  %35 = fdiv double 2.000000e+00, %34
  %36 = sub nsw i32 %spec.select, %22
  %37 = call i32 @TA_S_INT_EMA(i32 noundef %36, i32 noundef %1, ptr noundef nonnull %2, i32 noundef %.069, double noundef %35, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %31) #7
  %38 = icmp ne i32 %37, 0
  %39 = load i32, ptr %9, align 4
  %40 = icmp eq i32 %39, 0
  %or.cond3 = select i1 %38, i1 true, i1 %40
  br i1 %or.cond3, label %41, label %43

41:                                               ; preds = %32
  %.not83 = icmp eq ptr %31, %6
  br i1 %.not83, label %79, label %42

42:                                               ; preds = %41
  call void @free(ptr noundef nonnull %31) #7
  br label %79

43:                                               ; preds = %32
  %44 = sext i32 %39 to i64
  %45 = shl nsw i64 %44, 3
  %46 = call noalias ptr @malloc(i64 noundef %45) #8
  %.not81 = icmp eq ptr %46, null
  br i1 %.not81, label %47, label %49

47:                                               ; preds = %43
  %.not82 = icmp eq ptr %31, %6
  br i1 %.not82, label %79, label %48

48:                                               ; preds = %47
  call void @free(ptr noundef nonnull %31) #7
  br label %79

49:                                               ; preds = %43
  %50 = add nsw i32 %39, -1
  %51 = call i32 @TA_INT_EMA(i32 noundef 0, i32 noundef %50, ptr noundef nonnull %31, i32 noundef %.069, double noundef %35, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %46) #7
  %52 = icmp ne i32 %51, 0
  %53 = load i32, ptr %11, align 4
  %54 = icmp eq i32 %53, 0
  %or.cond5 = select i1 %52, i1 true, i1 %54
  br i1 %or.cond5, label %55, label %56

55:                                               ; preds = %49
  call void @free(ptr noundef nonnull %31) #7
  call void @free(ptr noundef nonnull %46) #7
  br label %79

56:                                               ; preds = %49
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = icmp sgt i32 %53, 0
  br i1 %58, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %56
  %59 = sext i32 %57 to i64
  %wide.trip.count = zext nneg i32 %53 to i64
  %min.iters.check = icmp ult i32 %53, 4
  br i1 %min.iters.check, label %.lr.ph.preheader96, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  %ind.end = add nsw i64 %n.vec, %59
  %invariant.gep = getelementptr double, ptr %31, i64 %59
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %gep = getelementptr double, ptr %invariant.gep, i64 %index
  %60 = getelementptr inbounds i8, ptr %gep, i64 16
  %wide.load = load <2 x double>, ptr %gep, align 8, !tbaa !9
  %wide.load93 = load <2 x double>, ptr %60, align 8, !tbaa !9
  %61 = getelementptr inbounds double, ptr %46, i64 %index
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load94 = load <2 x double>, ptr %61, align 8, !tbaa !9
  %wide.load95 = load <2 x double>, ptr %62, align 8, !tbaa !9
  %63 = fneg <2 x double> %wide.load94
  %64 = fneg <2 x double> %wide.load95
  %65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %63)
  %66 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load93, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %64)
  %67 = getelementptr inbounds double, ptr %6, i64 %index
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  store <2 x double> %65, ptr %67, align 8, !tbaa !9
  store <2 x double> %66, ptr %68, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %69 = icmp eq i64 %index.next, %n.vec
  br i1 %69, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader96

.lr.ph.preheader96:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv87.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %indvars.iv.ph = phi i64 [ %59, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader96, %.lr.ph
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.lr.ph ], [ %indvars.iv87.ph, %.lr.ph.preheader96 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader96 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %70 = getelementptr inbounds double, ptr %31, i64 %indvars.iv
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds double, ptr %46, i64 %indvars.iv87
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = fneg double %73
  %75 = call double @llvm.fmuladd.f64(double %71, double 2.000000e+00, double %74)
  %76 = getelementptr inbounds double, ptr %6, i64 %indvars.iv87
  store double %75, ptr %76, align 8, !tbaa !9
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %56
  %.068.lcssa = phi i32 [ 0, %56 ], [ %53, %middle.block ], [ %53, %.lr.ph ]
  call void @free(ptr noundef nonnull %31) #7
  call void @free(ptr noundef nonnull %46) #7
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = add nsw i32 %77, %57
  store i32 %78, ptr %4, align 4, !tbaa !5
  store i32 %.068.lcssa, ptr %5, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %47, %48, %41, %42, %25, %21, %20, %18, %15, %13, %7, %._crit_edge, %55
  %.0 = phi i32 [ %51, %55 ], [ 0, %._crit_edge ], [ 12, %7 ], [ 13, %13 ], [ 2, %15 ], [ 2, %18 ], [ 2, %20 ], [ 0, %21 ], [ 3, %25 ], [ %37, %42 ], [ %37, %41 ], [ 3, %48 ], [ 3, %47 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  ret i32 %.0
}

declare i32 @TA_S_INT_EMA(i32 noundef, i32 noundef, ptr noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

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


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