; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/ImGui (imgui_draw)

; 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.ImVec2 = type { float, float }

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_Z17ImBezierCubicCalcRK6ImVec2S1_S1_S1_f(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef %4) #3 {
  %6 = alloca %struct.ImVec2, align 4
  %7 = alloca ptr, 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 float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store float %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %17 = load float, ptr %11, align 4, !tbaa !9
  %18 = fsub float 1.000000e+00, %17
  store float %18, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %19 = load float, ptr %12, align 4, !tbaa !9
  %20 = load float, ptr %12, align 4, !tbaa !9
  %21 = fmul float %19, %20
  %22 = load float, ptr %12, align 4, !tbaa !9
  %23 = fmul float %21, %22
  store float %23, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %24 = load float, ptr %12, align 4, !tbaa !9
  %25 = fmul float 3.000000e+00, %24
  %26 = load float, ptr %12, align 4, !tbaa !9
  %27 = fmul float %25, %26
  %28 = load float, ptr %11, align 4, !tbaa !9
  %29 = fmul float %27, %28
  store float %29, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %30 = load float, ptr %12, align 4, !tbaa !9
  %31 = fmul float 3.000000e+00, %30
  %32 = load float, ptr %11, align 4, !tbaa !9
  %33 = fmul float %31, %32
  %34 = load float, ptr %11, align 4, !tbaa !9
  %35 = fmul float %33, %34
  store float %35, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %36 = load float, ptr %11, align 4, !tbaa !9
  %37 = load float, ptr %11, align 4, !tbaa !9
  %38 = fmul float %36, %37
  %39 = load float, ptr %11, align 4, !tbaa !9
  %40 = fmul float %38, %39
  store float %40, ptr %16, align 4, !tbaa !9
  %41 = load float, ptr %13, align 4, !tbaa !9
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ImVec2, ptr %42, i32 0, i32 0
  %44 = load float, ptr %43, align 4, !tbaa !11
  %45 = load float, ptr %14, align 4, !tbaa !9
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ImVec2, ptr %46, i32 0, i32 0
  %48 = load float, ptr %47, align 4, !tbaa !11
  %49 = fmul float %45, %48
  %50 = call float @llvm.fmuladd.f32(float %41, float %44, float %49)
  %51 = load float, ptr %15, align 4, !tbaa !9
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ImVec2, ptr %52, i32 0, i32 0
  %54 = load float, ptr %53, align 4, !tbaa !11
  %55 = call float @llvm.fmuladd.f32(float %51, float %54, float %50)
  %56 = load float, ptr %16, align 4, !tbaa !9
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ImVec2, ptr %57, i32 0, i32 0
  %59 = load float, ptr %58, align 4, !tbaa !11
  %60 = call float @llvm.fmuladd.f32(float %56, float %59, float %55)
  %61 = load float, ptr %13, align 4, !tbaa !9
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ImVec2, ptr %62, i32 0, i32 1
  %64 = load float, ptr %63, align 4, !tbaa !13
  %65 = load float, ptr %14, align 4, !tbaa !9
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ImVec2, ptr %66, i32 0, i32 1
  %68 = load float, ptr %67, align 4, !tbaa !13
  %69 = fmul float %65, %68
  %70 = call float @llvm.fmuladd.f32(float %61, float %64, float %69)
  %71 = load float, ptr %15, align 4, !tbaa !9
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ImVec2, ptr %72, i32 0, i32 1
  %74 = load float, ptr %73, align 4, !tbaa !13
  %75 = call float @llvm.fmuladd.f32(float %71, float %74, float %70)
  %76 = load float, ptr %16, align 4, !tbaa !9
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ImVec2, ptr %77, i32 0, i32 1
  %79 = load float, ptr %78, align 4, !tbaa !13
  %80 = call float @llvm.fmuladd.f32(float %76, float %79, float %75)
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %60, float noundef %80)
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %81 = load <2 x float>, ptr %6, align 4
  ret <2 x float> %81
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}


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

%struct.ImVec2 = type { float, float }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local <2 x float> @_Z17ImBezierCubicCalcRK6ImVec2S1_S1_S1_f(ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %1, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %2, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %3, float noundef %4) local_unnamed_addr #2 {
  %6 = alloca %struct.ImVec2, align 8
  %7 = fsub float 1.000000e+00, %4
  %8 = fmul float %7, %7
  %9 = fmul float %7, %8
  %10 = fmul float %7, 3.000000e+00
  %11 = fmul float %7, %10
  %12 = fmul float %11, %4
  %13 = fmul float %10, %4
  %14 = fmul float %13, %4
  %15 = fmul float %4, %4
  %16 = fmul float %15, %4
  %17 = load float, ptr %0, align 4, !tbaa !5
  %18 = load float, ptr %1, align 4, !tbaa !5
  %19 = fmul float %12, %18
  %20 = tail call float @llvm.fmuladd.f32(float %9, float %17, float %19)
  %21 = load float, ptr %2, align 4, !tbaa !5
  %22 = tail call float @llvm.fmuladd.f32(float %14, float %21, float %20)
  %23 = load float, ptr %3, align 4, !tbaa !5
  %24 = tail call float @llvm.fmuladd.f32(float %16, float %23, float %22)
  %25 = getelementptr inbounds i8, ptr %0, i64 4
  %26 = load float, ptr %25, align 4, !tbaa !10
  %27 = getelementptr inbounds i8, ptr %1, i64 4
  %28 = load float, ptr %27, align 4, !tbaa !10
  %29 = fmul float %12, %28
  %30 = tail call float @llvm.fmuladd.f32(float %9, float %26, float %29)
  %31 = getelementptr inbounds i8, ptr %2, i64 4
  %32 = load float, ptr %31, align 4, !tbaa !10
  %33 = tail call float @llvm.fmuladd.f32(float %14, float %32, float %30)
  %34 = getelementptr inbounds i8, ptr %3, i64 4
  %35 = load float, ptr %34, align 4, !tbaa !10
  %36 = tail call float @llvm.fmuladd.f32(float %16, float %35, float %33)
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %24, float noundef %36)
  %37 = load <2 x float>, ptr %6, align 8
  ret <2 x float> %37
}

attributes #0 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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, !7, i64 0}
!6 = !{!"_ZTS6ImVec2", !7, i64 0, !7, i64 4}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass