; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseFloat32.ll (ZN4Simd4Base14Uint8ToFloat32EPKhmPKfS4_Pf)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Simd7AlignLoEmm(i64 noundef, i64 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14Uint8ToFloat32EPKhmPKfS4_Pf(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = getelementptr inbounds float, ptr %15, i64 0
  %17 = load float, ptr %16, align 4, !tbaa !11
  store float %17, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds float, ptr %18, i64 0
  %20 = load float, ptr %19, align 4, !tbaa !11
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds float, ptr %21, i64 0
  %23 = load float, ptr %22, align 4, !tbaa !11
  %24 = fsub float %20, %23
  %25 = fdiv float %24, 2.550000e+02
  store float %25, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %26 = load i64, ptr %7, align 8, !tbaa !9
  %27 = call noundef i64 @_ZN4Simd7AlignLoEmm(i64 noundef %26, i64 noundef 4)
  store i64 %27, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %85, %5
  %29 = load i64, ptr %14, align 8, !tbaa !9
  %30 = load i64, ptr %13, align 8, !tbaa !9
  %31 = icmp ult i64 %29, %30
  br i1 %31, label %32, label %88

32:                                               ; preds = %28
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i64, ptr %14, align 8, !tbaa !9
  %35 = add i64 %34, 0
  %36 = getelementptr inbounds i8, ptr %33, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !13
  %38 = zext i8 %37 to i32
  %39 = load float, ptr %11, align 4, !tbaa !11
  %40 = load float, ptr %12, align 4, !tbaa !11
  %41 = call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %38, float noundef %39, float noundef %40)
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load i64, ptr %14, align 8, !tbaa !9
  %44 = add i64 %43, 0
  %45 = getelementptr inbounds float, ptr %42, i64 %44
  store float %41, ptr %45, align 4, !tbaa !11
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load i64, ptr %14, align 8, !tbaa !9
  %48 = add i64 %47, 1
  %49 = getelementptr inbounds i8, ptr %46, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !13
  %51 = zext i8 %50 to i32
  %52 = load float, ptr %11, align 4, !tbaa !11
  %53 = load float, ptr %12, align 4, !tbaa !11
  %54 = call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %51, float noundef %52, float noundef %53)
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = load i64, ptr %14, align 8, !tbaa !9
  %57 = add i64 %56, 1
  %58 = getelementptr inbounds float, ptr %55, i64 %57
  store float %54, ptr %58, align 4, !tbaa !11
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load i64, ptr %14, align 8, !tbaa !9
  %61 = add i64 %60, 2
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !13
  %64 = zext i8 %63 to i32
  %65 = load float, ptr %11, align 4, !tbaa !11
  %66 = load float, ptr %12, align 4, !tbaa !11
  %67 = call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %64, float noundef %65, float noundef %66)
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i64, ptr %14, align 8, !tbaa !9
  %70 = add i64 %69, 2
  %71 = getelementptr inbounds float, ptr %68, i64 %70
  store float %67, ptr %71, align 4, !tbaa !11
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = load i64, ptr %14, align 8, !tbaa !9
  %74 = add i64 %73, 3
  %75 = getelementptr inbounds i8, ptr %72, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !13
  %77 = zext i8 %76 to i32
  %78 = load float, ptr %11, align 4, !tbaa !11
  %79 = load float, ptr %12, align 4, !tbaa !11
  %80 = call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %77, float noundef %78, float noundef %79)
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = load i64, ptr %14, align 8, !tbaa !9
  %83 = add i64 %82, 3
  %84 = getelementptr inbounds float, ptr %81, i64 %83
  store float %80, ptr %84, align 4, !tbaa !11
  br label %85

85:                                               ; preds = %32
  %86 = load i64, ptr %14, align 8, !tbaa !9
  %87 = add i64 %86, 4
  store i64 %87, ptr %14, align 8, !tbaa !9
  br label %28, !llvm.loop !14

88:                                               ; preds = %28
  br label %89

89:                                               ; preds = %105, %88
  %90 = load i64, ptr %14, align 8, !tbaa !9
  %91 = load i64, ptr %7, align 8, !tbaa !9
  %92 = icmp ult i64 %90, %91
  br i1 %92, label %93, label %108

93:                                               ; preds = %89
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load i64, ptr %14, align 8, !tbaa !9
  %96 = getelementptr inbounds i8, ptr %94, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !13
  %98 = zext i8 %97 to i32
  %99 = load float, ptr %11, align 4, !tbaa !11
  %100 = load float, ptr %12, align 4, !tbaa !11
  %101 = call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %98, float noundef %99, float noundef %100)
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load i64, ptr %14, align 8, !tbaa !9
  %104 = getelementptr inbounds float, ptr %102, i64 %103
  store float %101, ptr %104, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %93
  %106 = load i64, ptr %14, align 8, !tbaa !9
  %107 = add i64 %106, 1
  store i64 %107, ptr %14, align 8, !tbaa !9
  br label %89, !llvm.loop !16

108:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef, float noundef, float noundef) #1

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


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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Simd7AlignLoEmm(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4Simd4Base14Uint8ToFloat32EPKhmPKfS4_Pf(ptr nocapture noundef readonly %0, i64 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #1 {
  %6 = load float, ptr %2, align 4, !tbaa !5
  %7 = load float, ptr %3, align 4, !tbaa !5
  %8 = fsub float %7, %6
  %9 = fdiv float %8, 2.550000e+02
  %10 = tail call noundef i64 @_ZN4Simd7AlignLoEmm(i64 noundef %1, i64 noundef 4)
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %5
  %.0.lcssa = phi i64 [ 0, %5 ], [ %35, %.lr.ph ]
  %11 = icmp ult i64 %.0.lcssa, %1
  br i1 %11, label %.lr.ph41, label %._crit_edge

.lr.ph:                                           ; preds = %5, %.lr.ph
  %.039 = phi i64 [ %35, %.lr.ph ], [ 0, %5 ]
  %12 = getelementptr inbounds i8, ptr %0, i64 %.039
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = zext i8 %13 to i32
  %15 = tail call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %14, float noundef %6, float noundef %9)
  %16 = getelementptr inbounds float, ptr %4, i64 %.039
  store float %15, ptr %16, align 4, !tbaa !5
  %17 = or disjoint i64 %.039, 1
  %18 = getelementptr inbounds i8, ptr %0, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = tail call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %20, float noundef %6, float noundef %9)
  %22 = getelementptr inbounds float, ptr %4, i64 %17
  store float %21, ptr %22, align 4, !tbaa !5
  %23 = or disjoint i64 %.039, 2
  %24 = getelementptr inbounds i8, ptr %0, i64 %23
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = zext i8 %25 to i32
  %27 = tail call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %26, float noundef %6, float noundef %9)
  %28 = getelementptr inbounds float, ptr %4, i64 %23
  store float %27, ptr %28, align 4, !tbaa !5
  %29 = or disjoint i64 %.039, 3
  %30 = getelementptr inbounds i8, ptr %0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = zext i8 %31 to i32
  %33 = tail call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %32, float noundef %6, float noundef %9)
  %34 = getelementptr inbounds float, ptr %4, i64 %29
  store float %33, ptr %34, align 4, !tbaa !5
  %35 = add i64 %.039, 4
  %36 = icmp ult i64 %35, %10
  br i1 %36, label %.lr.ph, label %.preheader, !llvm.loop !10

.lr.ph41:                                         ; preds = %.preheader, %.lr.ph41
  %.140 = phi i64 [ %42, %.lr.ph41 ], [ %.0.lcssa, %.preheader ]
  %37 = getelementptr inbounds i8, ptr %0, i64 %.140
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = zext i8 %38 to i32
  %40 = tail call noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef %39, float noundef %6, float noundef %9)
  %41 = getelementptr inbounds float, ptr %4, i64 %.140
  store float %40, ptr %41, align 4, !tbaa !5
  %42 = add i64 %.140, 1
  %exitcond.not = icmp eq i64 %42, %1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph41, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph41, %.preheader
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd4Base14Uint8ToFloat32Eiff(i32 noundef, float noundef, float noundef) local_unnamed_addr #0

attributes #0 = { alwaysinline mustprogress 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 = { mustprogress 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass