; LLVM IR from mkmarek/forex.analytics :: lib/ta-lib/src/tools/ta_regtest (test_util)

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

@.str.13 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [40 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @checkExpectedValue(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, double noundef %7, i32 noundef %8) #1 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store i32 %2, ptr %13, align 4, !tbaa !9
  store i32 %3, ptr %14, align 4, !tbaa !9
  store i32 %4, ptr %15, align 4, !tbaa !9
  store i32 %5, ptr %16, align 4, !tbaa !9
  store i32 %6, ptr %17, align 4, !tbaa !9
  store double %7, ptr %18, align 8, !tbaa !11
  store i32 %8, ptr %19, align 4, !tbaa !9
  %20 = load i32, ptr %12, align 4, !tbaa !9
  %21 = load i32, ptr %13, align 4, !tbaa !9
  %22 = icmp ne i32 %20, %21
  br i1 %22, label %23, label %27

23:                                               ; preds = %9
  %24 = load i32, ptr %12, align 4, !tbaa !9
  %25 = load i32, ptr %13, align 4, !tbaa !9
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %24, i32 noundef %25)
  store i32 121, ptr %10, align 4
  br label %85

27:                                               ; preds = %9
  %28 = load i32, ptr %12, align 4, !tbaa !9
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  store i32 0, ptr %10, align 4
  br label %85

31:                                               ; preds = %27
  %32 = load i32, ptr %16, align 4, !tbaa !9
  %33 = icmp ugt i32 %32, 280
  br i1 %33, label %34, label %37

34:                                               ; preds = %31
  %35 = load i32, ptr %16, align 4, !tbaa !9
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %35)
  store i32 139, ptr %10, align 4
  br label %85

37:                                               ; preds = %31
  %38 = load i32, ptr %16, align 4, !tbaa !9
  %39 = load i32, ptr %17, align 4, !tbaa !9
  %40 = icmp ne i32 %38, %39
  br i1 %40, label %41, label %45

41:                                               ; preds = %37
  %42 = load i32, ptr %17, align 4, !tbaa !9
  %43 = load i32, ptr %16, align 4, !tbaa !9
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %42, i32 noundef %43)
  store i32 124, ptr %10, align 4
  br label %85

45:                                               ; preds = %37
  %46 = load i32, ptr %17, align 4, !tbaa !9
  %47 = icmp ugt i32 %46, 0
  br i1 %47, label %48, label %84

48:                                               ; preds = %45
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load i32, ptr %19, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %49, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = fsub double %53, 1.000000e-02
  %55 = load double, ptr %18, align 8, !tbaa !11
  %56 = fcmp olt double %54, %55
  br i1 %56, label %57, label %66

57:                                               ; preds = %48
  %58 = load double, ptr %18, align 8, !tbaa !11
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = load i32, ptr %19, align 4, !tbaa !9
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %59, i64 %61
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = fadd double %63, 1.000000e-02
  %65 = fcmp olt double %58, %64
  br i1 %65, label %75, label %66

66:                                               ; preds = %57, %48
  %67 = load i32, ptr %19, align 4, !tbaa !9
  %68 = load double, ptr %18, align 8, !tbaa !11
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = load i32, ptr %19, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %69, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !11
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %67, double noundef %68, double noundef %73)
  store i32 122, ptr %10, align 4
  br label %85

75:                                               ; preds = %57
  %76 = load i32, ptr %15, align 4, !tbaa !9
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = icmp ne i32 %76, %77
  br i1 %78, label %79, label %83

79:                                               ; preds = %75
  %80 = load i32, ptr %15, align 4, !tbaa !9
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, i32 noundef %80, i32 noundef %81)
  store i32 123, ptr %10, align 4
  br label %85

83:                                               ; preds = %75
  br label %84

84:                                               ; preds = %83, %45
  store i32 0, ptr %10, align 4
  br label %85

85:                                               ; preds = %84, %79, %66, %41, %34, %30, %23
  %86 = load i32, ptr %10, align 4
  ret i32 %86
}

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 = { 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" }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.13 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [40 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local range(i32 0, 140) i32 @checkExpectedValue(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, double noundef %7, i32 noundef %8) local_unnamed_addr #1 {
  %.not = icmp eq i32 %1, %2
  br i1 %.not, label %12, label %10

10:                                               ; preds = %9
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %1, i32 noundef %2)
  br label %34

12:                                               ; preds = %9
  %.not35 = icmp eq i32 %1, 0
  br i1 %.not35, label %13, label %34

13:                                               ; preds = %12
  %14 = icmp ugt i32 %5, 280
  br i1 %14, label %15, label %17

15:                                               ; preds = %13
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %5)
  br label %34

17:                                               ; preds = %13
  %.not36 = icmp eq i32 %5, %6
  br i1 %.not36, label %20, label %18

18:                                               ; preds = %17
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %6, i32 noundef %5)
  br label %34

20:                                               ; preds = %17
  %.not37 = icmp eq i32 %5, 0
  br i1 %.not37, label %34, label %21

21:                                               ; preds = %20
  %22 = zext i32 %8 to i64
  %23 = getelementptr inbounds double, ptr %0, i64 %22
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = fadd double %24, -1.000000e-02
  %26 = fcmp olt double %25, %7
  %27 = fadd double %24, 1.000000e-02
  %28 = fcmp ogt double %27, %7
  %or.cond = and i1 %26, %28
  br i1 %or.cond, label %31, label %29

29:                                               ; preds = %21
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %8, double noundef %7, double noundef %24)
  br label %34

31:                                               ; preds = %21
  %.not38 = icmp eq i32 %4, %3
  br i1 %.not38, label %34, label %32

32:                                               ; preds = %31
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, i32 noundef %4, i32 noundef %3)
  br label %34

34:                                               ; preds = %20, %31, %12, %32, %29, %18, %15, %10
  %.0 = phi i32 [ 121, %10 ], [ 139, %15 ], [ 124, %18 ], [ 123, %32 ], [ 122, %29 ], [ 0, %12 ], [ 0, %31 ], [ 0, %20 ]
  ret i32 %.0
}

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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" }

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass