; LLVM IR from jgaeddert/liquid-dsp :: src/optim/src (gradsearch)

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

%struct.gradsearch_s = type { ptr, i32, float, float, float, ptr, float, ptr, ptr, i32 }

@.str.9 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 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: 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 float @gradsearch_step(ptr noundef %0) #1 {
  %2 = alloca float, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 20, ptr %5, align 4, !tbaa !9
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %80, %1
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = icmp ult i32 %9, %10
  br i1 %11, label %12, label %83

12:                                               ; preds = %8
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.gradsearch_s, ptr %13, i32 0, i32 7
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.gradsearch_s, ptr %16, i32 0, i32 8
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.gradsearch_s, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.gradsearch_s, ptr %22, i32 0, i32 1
  %24 = load i32, ptr %23, align 8, !tbaa !16
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.gradsearch_s, ptr %25, i32 0, i32 3
  %27 = load float, ptr %26, align 8, !tbaa !17
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.gradsearch_s, ptr %28, i32 0, i32 5
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  call void @gradsearch_gradient(ptr noundef %15, ptr noundef %18, ptr noundef %21, i32 noundef %24, float noundef %27, ptr noundef %30)
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.gradsearch_s, ptr %31, i32 0, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.gradsearch_s, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !16
  %37 = call float @gradsearch_norm(ptr noundef %33, i32 noundef %36)
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.gradsearch_s, ptr %38, i32 0, i32 6
  store float %37, ptr %39, align 8, !tbaa !19
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.gradsearch_s, ptr %40, i32 0, i32 6
  %42 = load float, ptr %41, align 8, !tbaa !19
  %43 = fcmp ogt float %42, 0.000000e+00
  br i1 %43, label %44, label %74

44:                                               ; preds = %12
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.gradsearch_s, ptr %45, i32 0, i32 6
  %47 = load float, ptr %46, align 8, !tbaa !19
  %48 = fmul float 0x3F1A36E2E0000000, %47
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.gradsearch_s, ptr %49, i32 0, i32 3
  %51 = load float, ptr %50, align 8, !tbaa !17
  %52 = fcmp olt float %48, %51
  br i1 %52, label %53, label %58

53:                                               ; preds = %44
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.gradsearch_s, ptr %54, i32 0, i32 3
  %56 = load float, ptr %55, align 8, !tbaa !17
  %57 = fmul float %56, 0x3FECCCCCC0000000
  store float %57, ptr %55, align 8, !tbaa !17
  br label %73

58:                                               ; preds = %44
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.gradsearch_s, ptr %59, i32 0, i32 6
  %61 = load float, ptr %60, align 8, !tbaa !19
  %62 = fmul float 0x3EE4F8B580000000, %61
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.gradsearch_s, ptr %63, i32 0, i32 3
  %65 = load float, ptr %64, align 8, !tbaa !17
  %66 = fcmp ogt float %62, %65
  br i1 %66, label %67, label %72

67:                                               ; preds = %58
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.gradsearch_s, ptr %68, i32 0, i32 3
  %70 = load float, ptr %69, align 8, !tbaa !17
  %71 = fmul float %70, 0x3FF19999A0000000
  store float %71, ptr %69, align 8, !tbaa !17
  br label %72

72:                                               ; preds = %67, %58
  br label %73

73:                                               ; preds = %72, %53
  br label %83

74:                                               ; preds = %12
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.gradsearch_s, ptr %75, i32 0, i32 3
  %77 = load float, ptr %76, align 8, !tbaa !17
  %78 = fmul float %77, 1.000000e+01
  store float %78, ptr %76, align 8, !tbaa !17
  br label %79

79:                                               ; preds = %74
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %4, align 4, !tbaa !9
  %82 = add i32 %81, 1
  store i32 %82, ptr %4, align 4, !tbaa !9
  br label %8, !llvm.loop !20

83:                                               ; preds = %73, %8
  %84 = load i32, ptr %4, align 4, !tbaa !9
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = icmp eq i32 %84, %85
  br i1 %86, label %87, label %102

87:                                               ; preds = %83
  %88 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 11, ptr noundef @.str.9, i32 noundef 148, ptr noundef @.str.10)
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.gradsearch_s, ptr %89, i32 0, i32 7
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.gradsearch_s, ptr %92, i32 0, i32 8
  %94 = load ptr, ptr %93, align 8, !tbaa !14
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.gradsearch_s, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !15
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.gradsearch_s, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !16
  %101 = call float %91(ptr noundef %94, ptr noundef %97, i32 noundef %100)
  store float %101, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %189

102:                                              ; preds = %83
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.gradsearch_s, ptr %103, i32 0, i32 7
  %105 = load ptr, ptr %104, align 8, !tbaa !11
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.gradsearch_s, ptr %106, i32 0, i32 8
  %108 = load ptr, ptr %107, align 8, !tbaa !14
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.gradsearch_s, ptr %109, i32 0, i32 9
  %111 = load i32, ptr %110, align 8, !tbaa !22
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.gradsearch_s, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 8, !tbaa !16
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.gradsearch_s, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !15
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.gradsearch_s, ptr %118, i32 0, i32 5
  %120 = load ptr, ptr %119, align 8, !tbaa !18
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.gradsearch_s, ptr %121, i32 0, i32 3
  %123 = load float, ptr %122, align 8, !tbaa !17
  %124 = call float @gradsearch_linesearch(ptr noundef %105, ptr noundef %108, i32 noundef %111, i32 noundef %114, ptr noundef %117, ptr noundef %120, float noundef %123)
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.gradsearch_s, ptr %125, i32 0, i32 4
  store float %124, ptr %126, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.gradsearch_s, ptr %127, i32 0, i32 9
  %129 = load i32, ptr %128, align 8, !tbaa !22
  %130 = icmp eq i32 %129, 0
  %131 = zext i1 %130 to i64
  %132 = select i1 %130, float 1.000000e+00, float -1.000000e+00
  store float %132, ptr %7, align 4, !tbaa !24
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %167, %102
  %134 = load i32, ptr %4, align 4, !tbaa !9
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.gradsearch_s, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !16
  %138 = icmp ult i32 %134, %137
  br i1 %138, label %139, label %170

139:                                              ; preds = %133
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.gradsearch_s, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !15
  %143 = load i32, ptr %4, align 4, !tbaa !9
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds float, ptr %142, i64 %144
  %146 = load float, ptr %145, align 4, !tbaa !24
  %147 = load float, ptr %7, align 4, !tbaa !24
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.gradsearch_s, ptr %148, i32 0, i32 4
  %150 = load float, ptr %149, align 4, !tbaa !23
  %151 = fmul float %147, %150
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.gradsearch_s, ptr %152, i32 0, i32 5
  %154 = load ptr, ptr %153, align 8, !tbaa !18
  %155 = load i32, ptr %4, align 4, !tbaa !9
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds float, ptr %154, i64 %156
  %158 = load float, ptr %157, align 4, !tbaa !24
  %159 = fneg float %151
  %160 = call float @llvm.fmuladd.f32(float %159, float %158, float %146)
  %161 = load ptr, ptr %3, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.gradsearch_s, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !15
  %164 = load i32, ptr %4, align 4, !tbaa !9
  %165 = zext i32 %164 to i64
  %166 = getelementptr inbounds float, ptr %163, i64 %165
  store float %160, ptr %166, align 4, !tbaa !24
  br label %167

167:                                              ; preds = %139
  %168 = load i32, ptr %4, align 4, !tbaa !9
  %169 = add i32 %168, 1
  store i32 %169, ptr %4, align 4, !tbaa !9
  br label %133, !llvm.loop !25

170:                                              ; preds = %133
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.gradsearch_s, ptr %171, i32 0, i32 7
  %173 = load ptr, ptr %172, align 8, !tbaa !11
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.gradsearch_s, ptr %174, i32 0, i32 8
  %176 = load ptr, ptr %175, align 8, !tbaa !14
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.gradsearch_s, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.gradsearch_s, ptr %180, i32 0, i32 1
  %182 = load i32, ptr %181, align 8, !tbaa !16
  %183 = call float %173(ptr noundef %176, ptr noundef %179, i32 noundef %182)
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.gradsearch_s, ptr %184, i32 0, i32 2
  store float %183, ptr %185, align 4, !tbaa !26
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.gradsearch_s, ptr %186, i32 0, i32 2
  %188 = load float, ptr %187, align 4, !tbaa !26
  store float %188, ptr %2, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %189

189:                                              ; preds = %170, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %190 = load float, ptr %2, align 4
  ret float %190
}

; Function Attrs: nounwind uwtable
declare dso_local void @gradsearch_gradient(ptr noundef, ptr noundef, ptr noundef, i32 noundef, float noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local float @gradsearch_norm(ptr noundef, i32 noundef) #1

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local float @gradsearch_linesearch(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, float noundef) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #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 = { 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 = !{!"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, !6, i64 40}
!12 = !{!"gradsearch_s", !6, i64 0, !10, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !6, i64 24, !13, i64 32, !6, i64 40, !6, i64 48, !10, i64 56}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !6, i64 48}
!15 = !{!12, !6, i64 0}
!16 = !{!12, !10, i64 8}
!17 = !{!12, !13, i64 16}
!18 = !{!12, !6, i64 24}
!19 = !{!12, !13, i64 32}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !10, i64 56}
!23 = !{!12, !13, i64 20}
!24 = !{!13, !13, i64 0}
!25 = distinct !{!25, !21}
!26 = !{!12, !13, i64 12}


; 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.9 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local float @gradsearch_step(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %.pre = load float, ptr %5, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %1, %26
  %9 = phi float [ %.pre, %1 ], [ %28, %26 ]
  %.05260 = phi i32 [ 0, %1 ], [ %29, %26 ]
  %10 = load ptr, ptr %2, align 8, !tbaa !12
  %11 = load ptr, ptr %3, align 8, !tbaa !13
  %12 = load ptr, ptr %0, align 8, !tbaa !14
  %13 = load i32, ptr %4, align 8, !tbaa !15
  %14 = load ptr, ptr %6, align 8, !tbaa !16
  tail call void @gradsearch_gradient(ptr noundef %10, ptr noundef %11, ptr noundef %12, i32 noundef %13, float noundef %9, ptr noundef %14)
  %15 = load ptr, ptr %6, align 8, !tbaa !16
  %16 = load i32, ptr %4, align 8, !tbaa !15
  %17 = tail call float @gradsearch_norm(ptr noundef %15, i32 noundef %16)
  store float %17, ptr %7, align 8, !tbaa !17
  %18 = fcmp ogt float %17, 0.000000e+00
  br i1 %18, label %19, label %26

19:                                               ; preds = %8
  %20 = fmul float %17, 0x3F1A36E2E0000000
  %21 = load float, ptr %5, align 8, !tbaa !5
  %22 = fcmp olt float %20, %21
  br i1 %22, label %.thread.sink.split, label %23

23:                                               ; preds = %19
  %24 = fmul float %17, 0x3EE4F8B580000000
  %25 = fcmp ogt float %24, %21
  br i1 %25, label %.thread.sink.split, label %.thread

26:                                               ; preds = %8
  %27 = load float, ptr %5, align 8, !tbaa !5
  %28 = fmul float %27, 1.000000e+01
  store float %28, ptr %5, align 8, !tbaa !5
  %29 = add nuw nsw i32 %.05260, 1
  %exitcond.not = icmp eq i32 %29, 20
  br i1 %exitcond.not, label %30, label %8, !llvm.loop !18

30:                                               ; preds = %26
  %31 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 11, ptr noundef nonnull @.str.9, i32 noundef 148, ptr noundef nonnull @.str.10) #4
  %32 = load ptr, ptr %2, align 8, !tbaa !12
  %33 = load ptr, ptr %3, align 8, !tbaa !13
  %34 = load ptr, ptr %0, align 8, !tbaa !14
  %35 = load i32, ptr %4, align 8, !tbaa !15
  %36 = tail call float %32(ptr noundef %33, ptr noundef %34, i32 noundef %35) #4
  br label %116

.thread.sink.split:                               ; preds = %23, %19
  %.sink76 = phi float [ 0x3FECCCCCC0000000, %19 ], [ 0x3FF19999A0000000, %23 ]
  %37 = fmul float %21, %.sink76
  store float %37, ptr %5, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %23
  %38 = phi float [ %21, %23 ], [ %37, %.thread.sink.split ]
  %39 = load ptr, ptr %2, align 8, !tbaa !12
  %40 = load ptr, ptr %3, align 8, !tbaa !13
  %41 = getelementptr inbounds i8, ptr %0, i64 56
  %42 = load i32, ptr %41, align 8, !tbaa !20
  %43 = load i32, ptr %4, align 8, !tbaa !15
  %44 = load ptr, ptr %0, align 8, !tbaa !14
  %45 = load ptr, ptr %6, align 8, !tbaa !16
  %46 = tail call float @gradsearch_linesearch(ptr noundef %39, ptr noundef %40, i32 noundef %42, i32 noundef %43, ptr noundef %44, ptr noundef %45, float noundef %38)
  %47 = getelementptr inbounds i8, ptr %0, i64 20
  store float %46, ptr %47, align 4, !tbaa !21
  %48 = load i32, ptr %4, align 8, !tbaa !15
  %.not = icmp eq i32 %48, 0
  %.pre73 = load ptr, ptr %0, align 8, !tbaa !14
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.thread
  %49 = load i32, ptr %41, align 8, !tbaa !20
  %.fr62 = freeze i32 %49
  %50 = icmp eq i32 %.fr62, 0
  %51 = load ptr, ptr %6, align 8, !tbaa !16
  %wide.trip.count71 = zext i32 %48 to i64
  %min.iters.check102 = icmp ult i32 %48, 8
  br i1 %50, label %.lr.ph.split.us.preheader, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %.lr.ph
  br i1 %min.iters.check102, label %.lr.ph.split.preheader118, label %vector.memcheck

.lr.ph.split.preheader118:                        ; preds = %middle.block, %vector.memcheck, %.lr.ph.split.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.split.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count71, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.split.prol.loopexit, label %.lr.ph.split.prol

.lr.ph.split.prol:                                ; preds = %.lr.ph.split.preheader118
  %52 = getelementptr inbounds float, ptr %.pre73, i64 %indvars.iv.ph
  %53 = load float, ptr %52, align 4, !tbaa !22
  %54 = load float, ptr %47, align 4, !tbaa !21
  %55 = getelementptr inbounds float, ptr %51, i64 %indvars.iv.ph
  %56 = load float, ptr %55, align 4, !tbaa !22
  %57 = tail call float @llvm.fmuladd.f32(float %54, float %56, float %53)
  store float %57, ptr %52, align 4, !tbaa !22
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %.lr.ph.split.prol.loopexit

.lr.ph.split.prol.loopexit:                       ; preds = %.lr.ph.split.prol, %.lr.ph.split.preheader118
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.split.preheader118 ], [ %indvars.iv.next.prol, %.lr.ph.split.prol ]
  %58 = add nsw i64 %wide.trip.count71, -1
  %59 = icmp eq i64 %indvars.iv.ph, %58
  br i1 %59, label %._crit_edge, label %.lr.ph.split

vector.memcheck:                                  ; preds = %.lr.ph.split.preheader
  %60 = shl nuw nsw i64 %wide.trip.count71, 2
  %scevgep = getelementptr i8, ptr %.pre73, i64 %60
  %scevgep79 = getelementptr i8, ptr %0, i64 24
  %scevgep80 = getelementptr i8, ptr %51, i64 %60
  %bound0 = icmp ult ptr %.pre73, %scevgep79
  %bound1 = icmp ult ptr %47, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound081 = icmp ult ptr %.pre73, %scevgep80
  %bound182 = icmp ult ptr %51, %scevgep
  %found.conflict83 = and i1 %bound081, %bound182
  %conflict.rdx = or i1 %found.conflict, %found.conflict83
  br i1 %conflict.rdx, label %.lr.ph.split.preheader118, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count71, 4294967288
  %61 = load float, ptr %47, align 4, !tbaa !21, !alias.scope !23
  %broadcast.splatinsert87 = insertelement <4 x float> poison, float %61, i64 0
  %broadcast.splat88 = shufflevector <4 x float> %broadcast.splatinsert87, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %62 = getelementptr inbounds float, ptr %.pre73, i64 %index
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %wide.load = load <4 x float>, ptr %62, align 4, !tbaa !22, !alias.scope !26, !noalias !28
  %wide.load84 = load <4 x float>, ptr %63, align 4, !tbaa !22, !alias.scope !26, !noalias !28
  %64 = getelementptr inbounds float, ptr %51, i64 %index
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %wide.load85 = load <4 x float>, ptr %64, align 4, !tbaa !22, !alias.scope !30
  %wide.load86 = load <4 x float>, ptr %65, align 4, !tbaa !22, !alias.scope !30
  %66 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %broadcast.splat88, <4 x float> %wide.load85, <4 x float> %wide.load)
  %67 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %broadcast.splat88, <4 x float> %wide.load86, <4 x float> %wide.load84)
  store <4 x float> %66, ptr %62, align 4, !tbaa !22, !alias.scope !26, !noalias !28
  store <4 x float> %67, ptr %63, align 4, !tbaa !22, !alias.scope !26, !noalias !28
  %index.next = add nuw i64 %index, 8
  %68 = icmp eq i64 %index.next, %n.vec
  br i1 %68, label %middle.block, label %vector.body, !llvm.loop !31

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

.lr.ph.split.us.preheader:                        ; preds = %.lr.ph
  br i1 %min.iters.check102, label %.lr.ph.split.us.preheader117, label %vector.memcheck89

vector.memcheck89:                                ; preds = %.lr.ph.split.us.preheader
  %69 = shl nuw nsw i64 %wide.trip.count71, 2
  %scevgep90 = getelementptr i8, ptr %.pre73, i64 %69
  %scevgep91 = getelementptr i8, ptr %0, i64 24
  %scevgep92 = getelementptr i8, ptr %51, i64 %69
  %bound093 = icmp ult ptr %.pre73, %scevgep91
  %bound194 = icmp ult ptr %47, %scevgep90
  %found.conflict95 = and i1 %bound093, %bound194
  %bound096 = icmp ult ptr %.pre73, %scevgep92
  %bound197 = icmp ult ptr %51, %scevgep90
  %found.conflict98 = and i1 %bound096, %bound197
  %conflict.rdx99 = or i1 %found.conflict95, %found.conflict98
  br i1 %conflict.rdx99, label %.lr.ph.split.us.preheader117, label %vector.ph103

vector.ph103:                                     ; preds = %vector.memcheck89
  %n.vec105 = and i64 %wide.trip.count71, 4294967288
  %70 = load float, ptr %47, align 4, !tbaa !21, !alias.scope !34
  %broadcast.splatinsert113 = insertelement <4 x float> poison, float %70, i64 0
  %broadcast.splat114 = shufflevector <4 x float> %broadcast.splatinsert113, <4 x float> poison, <4 x i32> zeroinitializer
  %71 = fneg <4 x float> %broadcast.splat114
  %72 = fneg <4 x float> %broadcast.splat114
  br label %vector.body107

vector.body107:                                   ; preds = %vector.body107, %vector.ph103
  %index108 = phi i64 [ 0, %vector.ph103 ], [ %index.next115, %vector.body107 ]
  %73 = getelementptr inbounds float, ptr %.pre73, i64 %index108
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  %wide.load109 = load <4 x float>, ptr %73, align 4, !tbaa !22, !alias.scope !37, !noalias !39
  %wide.load110 = load <4 x float>, ptr %74, align 4, !tbaa !22, !alias.scope !37, !noalias !39
  %75 = getelementptr inbounds float, ptr %51, i64 %index108
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  %wide.load111 = load <4 x float>, ptr %75, align 4, !tbaa !22, !alias.scope !41
  %wide.load112 = load <4 x float>, ptr %76, align 4, !tbaa !22, !alias.scope !41
  %77 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %71, <4 x float> %wide.load111, <4 x float> %wide.load109)
  %78 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %72, <4 x float> %wide.load112, <4 x float> %wide.load110)
  store <4 x float> %77, ptr %73, align 4, !tbaa !22, !alias.scope !37, !noalias !39
  store <4 x float> %78, ptr %74, align 4, !tbaa !22, !alias.scope !37, !noalias !39
  %index.next115 = add nuw i64 %index108, 8
  %79 = icmp eq i64 %index.next115, %n.vec105
  br i1 %79, label %middle.block100, label %vector.body107, !llvm.loop !42

middle.block100:                                  ; preds = %vector.body107
  %cmp.n116 = icmp eq i64 %n.vec105, %wide.trip.count71
  br i1 %cmp.n116, label %._crit_edge, label %.lr.ph.split.us.preheader117

.lr.ph.split.us.preheader117:                     ; preds = %middle.block100, %vector.memcheck89, %.lr.ph.split.us.preheader
  %indvars.iv68.ph = phi i64 [ 0, %vector.memcheck89 ], [ 0, %.lr.ph.split.us.preheader ], [ %n.vec105, %middle.block100 ]
  %xtraiter121 = and i64 %wide.trip.count71, 1
  %lcmp.mod122.not = icmp eq i64 %xtraiter121, 0
  br i1 %lcmp.mod122.not, label %.lr.ph.split.us.prol.loopexit, label %.lr.ph.split.us.prol

.lr.ph.split.us.prol:                             ; preds = %.lr.ph.split.us.preheader117
  %80 = getelementptr inbounds float, ptr %.pre73, i64 %indvars.iv68.ph
  %81 = load float, ptr %80, align 4, !tbaa !22
  %82 = load float, ptr %47, align 4, !tbaa !21
  %83 = getelementptr inbounds float, ptr %51, i64 %indvars.iv68.ph
  %84 = load float, ptr %83, align 4, !tbaa !22
  %.neg.us.prol = fneg float %82
  %85 = tail call float @llvm.fmuladd.f32(float %.neg.us.prol, float %84, float %81)
  store float %85, ptr %80, align 4, !tbaa !22
  %indvars.iv.next69.prol = or disjoint i64 %indvars.iv68.ph, 1
  br label %.lr.ph.split.us.prol.loopexit

.lr.ph.split.us.prol.loopexit:                    ; preds = %.lr.ph.split.us.prol, %.lr.ph.split.us.preheader117
  %indvars.iv68.unr = phi i64 [ %indvars.iv68.ph, %.lr.ph.split.us.preheader117 ], [ %indvars.iv.next69.prol, %.lr.ph.split.us.prol ]
  %86 = add nsw i64 %wide.trip.count71, -1
  %87 = icmp eq i64 %indvars.iv68.ph, %86
  br i1 %87, label %._crit_edge, label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.prol.loopexit, %.lr.ph.split.us
  %indvars.iv68 = phi i64 [ %indvars.iv.next69.1, %.lr.ph.split.us ], [ %indvars.iv68.unr, %.lr.ph.split.us.prol.loopexit ]
  %88 = getelementptr inbounds float, ptr %.pre73, i64 %indvars.iv68
  %89 = load float, ptr %88, align 4, !tbaa !22
  %90 = load float, ptr %47, align 4, !tbaa !21
  %91 = getelementptr inbounds float, ptr %51, i64 %indvars.iv68
  %92 = load float, ptr %91, align 4, !tbaa !22
  %.neg.us = fneg float %90
  %93 = tail call float @llvm.fmuladd.f32(float %.neg.us, float %92, float %89)
  store float %93, ptr %88, align 4, !tbaa !22
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %94 = getelementptr inbounds float, ptr %.pre73, i64 %indvars.iv.next69
  %95 = load float, ptr %94, align 4, !tbaa !22
  %96 = load float, ptr %47, align 4, !tbaa !21
  %97 = getelementptr inbounds float, ptr %51, i64 %indvars.iv.next69
  %98 = load float, ptr %97, align 4, !tbaa !22
  %.neg.us.1 = fneg float %96
  %99 = tail call float @llvm.fmuladd.f32(float %.neg.us.1, float %98, float %95)
  store float %99, ptr %94, align 4, !tbaa !22
  %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2
  %exitcond72.not.1 = icmp eq i64 %indvars.iv.next69.1, %wide.trip.count71
  br i1 %exitcond72.not.1, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !43

.lr.ph.split:                                     ; preds = %.lr.ph.split.prol.loopexit, %.lr.ph.split
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph.split ], [ %indvars.iv.unr, %.lr.ph.split.prol.loopexit ]
  %100 = getelementptr inbounds float, ptr %.pre73, i64 %indvars.iv
  %101 = load float, ptr %100, align 4, !tbaa !22
  %102 = load float, ptr %47, align 4, !tbaa !21
  %103 = getelementptr inbounds float, ptr %51, i64 %indvars.iv
  %104 = load float, ptr %103, align 4, !tbaa !22
  %105 = tail call float @llvm.fmuladd.f32(float %102, float %104, float %101)
  store float %105, ptr %100, align 4, !tbaa !22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %106 = getelementptr inbounds float, ptr %.pre73, i64 %indvars.iv.next
  %107 = load float, ptr %106, align 4, !tbaa !22
  %108 = load float, ptr %47, align 4, !tbaa !21
  %109 = getelementptr inbounds float, ptr %51, i64 %indvars.iv.next
  %110 = load float, ptr %109, align 4, !tbaa !22
  %111 = tail call float @llvm.fmuladd.f32(float %108, float %110, float %107)
  store float %111, ptr %106, align 4, !tbaa !22
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond67.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count71
  br i1 %exitcond67.not.1, label %._crit_edge, label %.lr.ph.split, !llvm.loop !44

._crit_edge:                                      ; preds = %.lr.ph.split.prol.loopexit, %.lr.ph.split, %.lr.ph.split.us.prol.loopexit, %.lr.ph.split.us, %middle.block, %middle.block100, %.thread
  %112 = load ptr, ptr %2, align 8, !tbaa !12
  %113 = load ptr, ptr %3, align 8, !tbaa !13
  %114 = tail call float %112(ptr noundef %113, ptr noundef %.pre73, i32 noundef %48) #4
  %115 = getelementptr inbounds i8, ptr %0, i64 12
  store float %114, ptr %115, align 4, !tbaa !45
  br label %116

116:                                              ; preds = %._crit_edge, %30
  %.0 = phi float [ %36, %30 ], [ %114, %._crit_edge ]
  ret float %.0
}

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

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

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #3

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 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 16}
!6 = !{!"gradsearch_s", !7, i64 0, !10, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 48, !10, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !7, i64 40}
!13 = !{!6, !7, i64 48}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !7, i64 24}
!17 = !{!6, !11, i64 32}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!6, !10, i64 56}
!21 = !{!6, !11, i64 20}
!22 = !{!11, !11, i64 0}
!23 = !{!24}
!24 = distinct !{!24, !25}
!25 = distinct !{!25, !"LVerDomain"}
!26 = !{!27}
!27 = distinct !{!27, !25}
!28 = !{!24, !29}
!29 = distinct !{!29, !25}
!30 = !{!29}
!31 = distinct !{!31, !19, !32, !33}
!32 = !{!"llvm.loop.isvectorized", i32 1}
!33 = !{!"llvm.loop.unroll.runtime.disable"}
!34 = !{!35}
!35 = distinct !{!35, !36}
!36 = distinct !{!36, !"LVerDomain"}
!37 = !{!38}
!38 = distinct !{!38, !36}
!39 = !{!35, !40}
!40 = distinct !{!40, !36}
!41 = !{!40}
!42 = distinct !{!42, !19, !32, !33}
!43 = distinct !{!43, !19, !32}
!44 = distinct !{!44, !19, !32}
!45 = !{!6, !11, i64 12}


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