; LLVM IR from jgaeddert/liquid-dsp :: sandbox (rhamming_test)

; 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.15 = external hidden unnamed_addr constant [76 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local float @bisect_search(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, i32 noundef %5) #1 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !5
  store float %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !11
  store i32 %5, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store float 1.000000e+00, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = load float, ptr %10, align 4, !tbaa !9
  %29 = load ptr, ptr %11, align 8, !tbaa !11
  %30 = load float, ptr %13, align 4, !tbaa !9
  %31 = call float @bisect_eval(i32 noundef %25, i32 noundef %26, i32 noundef %27, float noundef %28, ptr noundef %29, float noundef %30)
  store float %31, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store float 0x3FF0CCCCC0000000, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = load i32, ptr %9, align 4, !tbaa !5
  %35 = load float, ptr %10, align 4, !tbaa !9
  %36 = load ptr, ptr %11, align 8, !tbaa !11
  %37 = load float, ptr %15, align 4, !tbaa !9
  %38 = call float @bisect_eval(i32 noundef %32, i32 noundef %33, i32 noundef %34, float noundef %35, ptr noundef %36, float noundef %37)
  store float %38, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store float 1.500000e+00, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = load float, ptr %10, align 4, !tbaa !9
  %43 = load ptr, ptr %11, align 8, !tbaa !11
  %44 = load float, ptr %17, align 4, !tbaa !9
  %45 = call float @bisect_eval(i32 noundef %39, i32 noundef %40, i32 noundef %41, float noundef %42, ptr noundef %43, float noundef %44)
  store float %45, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 16, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %130, %6
  %47 = load i32, ptr %20, align 4, !tbaa !5
  %48 = load i32, ptr %19, align 4, !tbaa !5
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %50, label %133

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %51 = load float, ptr %13, align 4, !tbaa !9
  %52 = load float, ptr %15, align 4, !tbaa !9
  %53 = fmul float %51, %52
  %54 = call float @sqrtf(float noundef %53) #4
  store float %54, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = load float, ptr %10, align 4, !tbaa !9
  %59 = load ptr, ptr %11, align 8, !tbaa !11
  %60 = load float, ptr %21, align 4, !tbaa !9
  %61 = call float @bisect_eval(i32 noundef %55, i32 noundef %56, i32 noundef %57, float noundef %58, ptr noundef %59, float noundef %60)
  store float %61, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %62 = load float, ptr %15, align 4, !tbaa !9
  %63 = load float, ptr %17, align 4, !tbaa !9
  %64 = fmul float %62, %63
  %65 = call float @sqrtf(float noundef %64) #4
  store float %65, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = load float, ptr %10, align 4, !tbaa !9
  %70 = load ptr, ptr %11, align 8, !tbaa !11
  %71 = load float, ptr %23, align 4, !tbaa !9
  %72 = call float @bisect_eval(i32 noundef %66, i32 noundef %67, i32 noundef %68, float noundef %69, ptr noundef %70, float noundef %71)
  store float %72, ptr %24, align 4, !tbaa !9
  %73 = load i32, ptr %12, align 4, !tbaa !5
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %97

75:                                               ; preds = %50
  %76 = load float, ptr %13, align 4, !tbaa !9
  %77 = fpext float %76 to double
  %78 = load float, ptr %21, align 4, !tbaa !9
  %79 = fpext float %78 to double
  %80 = load float, ptr %15, align 4, !tbaa !9
  %81 = fpext float %80 to double
  %82 = load float, ptr %23, align 4, !tbaa !9
  %83 = fpext float %82 to double
  %84 = load float, ptr %17, align 4, !tbaa !9
  %85 = fpext float %84 to double
  %86 = load float, ptr %14, align 4, !tbaa !9
  %87 = fpext float %86 to double
  %88 = load float, ptr %22, align 4, !tbaa !9
  %89 = fpext float %88 to double
  %90 = load float, ptr %16, align 4, !tbaa !9
  %91 = fpext float %90 to double
  %92 = load float, ptr %24, align 4, !tbaa !9
  %93 = fpext float %92 to double
  %94 = load float, ptr %18, align 4, !tbaa !9
  %95 = fpext float %94 to double
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, double noundef %77, double noundef %79, double noundef %81, double noundef %83, double noundef %85, double noundef %87, double noundef %89, double noundef %91, double noundef %93, double noundef %95)
  br label %97

97:                                               ; preds = %75, %50
  %98 = load float, ptr %22, align 4, !tbaa !9
  %99 = load float, ptr %16, align 4, !tbaa !9
  %100 = fcmp olt float %98, %99
  br i1 %100, label %101, label %110

101:                                              ; preds = %97
  %102 = load float, ptr %22, align 4, !tbaa !9
  %103 = load float, ptr %24, align 4, !tbaa !9
  %104 = fcmp olt float %102, %103
  br i1 %104, label %105, label %110

105:                                              ; preds = %101
  %106 = load float, ptr %15, align 4, !tbaa !9
  store float %106, ptr %17, align 4, !tbaa !9
  %107 = load float, ptr %16, align 4, !tbaa !9
  store float %107, ptr %18, align 4, !tbaa !9
  %108 = load float, ptr %21, align 4, !tbaa !9
  store float %108, ptr %15, align 4, !tbaa !9
  %109 = load float, ptr %22, align 4, !tbaa !9
  store float %109, ptr %16, align 4, !tbaa !9
  br label %129

110:                                              ; preds = %101, %97
  %111 = load float, ptr %16, align 4, !tbaa !9
  %112 = load float, ptr %22, align 4, !tbaa !9
  %113 = fcmp olt float %111, %112
  br i1 %113, label %114, label %123

114:                                              ; preds = %110
  %115 = load float, ptr %16, align 4, !tbaa !9
  %116 = load float, ptr %24, align 4, !tbaa !9
  %117 = fcmp olt float %115, %116
  br i1 %117, label %118, label %123

118:                                              ; preds = %114
  %119 = load float, ptr %21, align 4, !tbaa !9
  store float %119, ptr %13, align 4, !tbaa !9
  %120 = load float, ptr %22, align 4, !tbaa !9
  store float %120, ptr %14, align 4, !tbaa !9
  %121 = load float, ptr %23, align 4, !tbaa !9
  store float %121, ptr %17, align 4, !tbaa !9
  %122 = load float, ptr %24, align 4, !tbaa !9
  store float %122, ptr %18, align 4, !tbaa !9
  br label %128

123:                                              ; preds = %114, %110
  %124 = load float, ptr %15, align 4, !tbaa !9
  store float %124, ptr %13, align 4, !tbaa !9
  %125 = load float, ptr %16, align 4, !tbaa !9
  store float %125, ptr %14, align 4, !tbaa !9
  %126 = load float, ptr %23, align 4, !tbaa !9
  store float %126, ptr %15, align 4, !tbaa !9
  %127 = load float, ptr %24, align 4, !tbaa !9
  store float %127, ptr %16, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %123, %118
  br label %129

129:                                              ; preds = %128, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %20, align 4, !tbaa !5
  %132 = add i32 %131, 1
  store i32 %132, ptr %20, align 4, !tbaa !5
  br label %46, !llvm.loop !13

133:                                              ; preds = %46
  %134 = load float, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret float %134
}

declare i32 @printf(ptr 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
declare dso_local float @bisect_eval(i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, float noundef) #1

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { "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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !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"

@.str.15 = external hidden unnamed_addr constant [76 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local float @bisect_search(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef 1.000000e+00)
  %8 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef 0x3FF0CCCCC0000000)
  %9 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef 1.500000e+00)
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %.split.us, label %.split

.split.us:                                        ; preds = %6, %22
  %.088.us = phi float [ %.1.us, %22 ], [ 1.000000e+00, %6 ]
  %.07086.us = phi float [ %.171.us, %22 ], [ 0x3FF0CCCCC0000000, %6 ]
  %.07285.us = phi float [ %.173.us, %22 ], [ %8, %6 ]
  %.07484.us = phi i32 [ %23, %22 ], [ 0, %6 ]
  %.07583.us = phi float [ %.176.us, %22 ], [ 1.500000e+00, %6 ]
  %10 = fmul float %.07086.us, %.088.us
  %11 = tail call float @sqrtf(float noundef %10) #3
  %12 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef %11)
  %13 = fmul float %.07583.us, %.07086.us
  %14 = tail call float @sqrtf(float noundef %13) #3
  %15 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef %14)
  %16 = fcmp olt float %12, %.07285.us
  %17 = fcmp olt float %12, %15
  %or.cond.us = select i1 %16, i1 %17, i1 false
  br i1 %or.cond.us, label %22, label %18

18:                                               ; preds = %.split.us
  %19 = fcmp olt float %.07285.us, %12
  %20 = fcmp olt float %.07285.us, %15
  %or.cond81.us = select i1 %19, i1 %20, i1 false
  br i1 %or.cond81.us, label %22, label %21

21:                                               ; preds = %18
  br label %22

22:                                               ; preds = %21, %18, %.split.us
  %.176.us = phi float [ %.07583.us, %21 ], [ %.07086.us, %.split.us ], [ %14, %18 ]
  %.173.us = phi float [ %15, %21 ], [ %12, %.split.us ], [ %.07285.us, %18 ]
  %.171.us = phi float [ %14, %21 ], [ %11, %.split.us ], [ %.07086.us, %18 ]
  %.1.us = phi float [ %.07086.us, %21 ], [ %.088.us, %.split.us ], [ %11, %18 ]
  %23 = add nuw nsw i32 %.07484.us, 1
  %exitcond92.not = icmp eq i32 %23, 16
  br i1 %exitcond92.not, label %.split90.us, label %.split.us, !llvm.loop !5

.split:                                           ; preds = %6, %47
  %.088 = phi float [ %.1, %47 ], [ 1.000000e+00, %6 ]
  %.06887 = phi float [ %.169, %47 ], [ %7, %6 ]
  %.07086 = phi float [ %.171, %47 ], [ 0x3FF0CCCCC0000000, %6 ]
  %.07285 = phi float [ %.173, %47 ], [ %8, %6 ]
  %.07484 = phi i32 [ %48, %47 ], [ 0, %6 ]
  %.07583 = phi float [ %.176, %47 ], [ 1.500000e+00, %6 ]
  %.07782 = phi float [ %.178, %47 ], [ %9, %6 ]
  %24 = fmul float %.07086, %.088
  %25 = tail call float @sqrtf(float noundef %24) #3
  %26 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef %25)
  %27 = fmul float %.07583, %.07086
  %28 = tail call float @sqrtf(float noundef %27) #3
  %29 = tail call float @bisect_eval(i32 noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, float noundef %28)
  %30 = fpext float %.088 to double
  %31 = fpext float %25 to double
  %32 = fpext float %.07086 to double
  %33 = fpext float %28 to double
  %34 = fpext float %.07583 to double
  %35 = fpext float %.06887 to double
  %36 = fpext float %26 to double
  %37 = fpext float %.07285 to double
  %38 = fpext float %29 to double
  %39 = fpext float %.07782 to double
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, double noundef %30, double noundef %31, double noundef %32, double noundef %33, double noundef %34, double noundef %35, double noundef %36, double noundef %37, double noundef %38, double noundef %39)
  %41 = fcmp olt float %26, %.07285
  %42 = fcmp olt float %26, %29
  %or.cond = and i1 %41, %42
  br i1 %or.cond, label %47, label %43

43:                                               ; preds = %.split
  %44 = fcmp olt float %.07285, %26
  %45 = fcmp olt float %.07285, %29
  %or.cond81 = and i1 %44, %45
  br i1 %or.cond81, label %47, label %46

46:                                               ; preds = %43
  br label %47

47:                                               ; preds = %43, %.split, %46
  %.178 = phi float [ %.07782, %46 ], [ %.07285, %.split ], [ %29, %43 ]
  %.176 = phi float [ %.07583, %46 ], [ %.07086, %.split ], [ %28, %43 ]
  %.173 = phi float [ %29, %46 ], [ %26, %.split ], [ %.07285, %43 ]
  %.171 = phi float [ %28, %46 ], [ %25, %.split ], [ %.07086, %43 ]
  %.169 = phi float [ %.07285, %46 ], [ %.06887, %.split ], [ %26, %43 ]
  %.1 = phi float [ %.07086, %46 ], [ %.088, %.split ], [ %25, %43 ]
  %48 = add nuw nsw i32 %.07484, 1
  %exitcond.not = icmp eq i32 %48, 16
  br i1 %exitcond.not, label %.split90.us, label %.split, !llvm.loop !5

.split90.us:                                      ; preds = %47, %22
  %.us-phi = phi float [ %.171.us, %22 ], [ %.171, %47 ]
  ret float %.us-phi
}

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

; Function Attrs: nounwind uwtable
declare dso_local float @bisect_eval(i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, float noundef) local_unnamed_addr #0

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

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 = { 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 #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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass