; LLVM IR from tyoma/agge :: src/agge (stroke_features)

; 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.agge::point" = type { float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4agge4caps4butt4calcERNS_10pod_vectorINS_5pointIfEEEEfRKS4_fS8_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, float noundef %2, ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef %4, ptr noundef nonnull align 4 dereferenceable(8) %5) unnamed_addr #0 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %"struct.agge::point", align 4
  %16 = alloca %"struct.agge::point", align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store float %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store float %4, ptr %11, align 4, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8
  %18 = load float, ptr %9, align 4, !tbaa !9
  %19 = load float, ptr %11, align 4, !tbaa !9
  %20 = fdiv float %18, %19
  store float %20, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.agge::point", ptr %21, i32 0, i32 0
  %23 = load float, ptr %22, align 4, !tbaa !11
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.agge::point", ptr %24, i32 0, i32 0
  %26 = load float, ptr %25, align 4, !tbaa !11
  %27 = fsub float %23, %26
  %28 = load float, ptr %11, align 4, !tbaa !9
  %29 = fmul float %27, %28
  store float %29, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.agge::point", ptr %30, i32 0, i32 1
  %32 = load float, ptr %31, align 4, !tbaa !13
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.agge::point", ptr %33, i32 0, i32 1
  %35 = load float, ptr %34, align 4, !tbaa !13
  %36 = fsub float %32, %35
  %37 = load float, ptr %11, align 4, !tbaa !9
  %38 = fmul float %36, %37
  store float %38, ptr %14, align 4, !tbaa !9
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.agge::point", ptr %40, i32 0, i32 0
  %42 = load float, ptr %41, align 4, !tbaa !11
  %43 = load float, ptr %14, align 4, !tbaa !9
  %44 = fsub float %42, %43
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.agge::point", ptr %45, i32 0, i32 1
  %47 = load float, ptr %46, align 4, !tbaa !13
  %48 = load float, ptr %13, align 4, !tbaa !9
  %49 = fadd float %47, %48
  %50 = call <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef %44, float noundef %49)
  store <2 x float> %50, ptr %15, align 4
  %51 = call noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.agge::point", ptr %53, i32 0, i32 0
  %55 = load float, ptr %54, align 4, !tbaa !11
  %56 = load float, ptr %14, align 4, !tbaa !9
  %57 = fadd float %55, %56
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.agge::point", ptr %58, i32 0, i32 1
  %60 = load float, ptr %59, align 4, !tbaa !13
  %61 = load float, ptr %13, align 4, !tbaa !9
  %62 = fsub float %60, %61
  %63 = call <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef %57, float noundef %62)
  store <2 x float> %63, ptr %16, align 4
  %64 = call noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef, float noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { inlinehint 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" }
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 = !{!"_ZTSN4agge5pointIfEE", !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.agge::point" = type { float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4agge4caps4butt4calcERNS_10pod_vectorINS_5pointIfEEEEfRKS4_fS8_(ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, float noundef %2, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %3, float noundef %4, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %5) unnamed_addr #0 align 2 {
  %7 = alloca %"struct.agge::point", align 8
  %8 = alloca %"struct.agge::point", align 8
  %9 = fdiv float %2, %4
  %10 = load float, ptr %5, align 4, !tbaa !5
  %11 = load float, ptr %3, align 4, !tbaa !5
  %12 = fsub float %10, %11
  %13 = fmul float %9, %12
  %14 = getelementptr inbounds i8, ptr %5, i64 4
  %15 = load float, ptr %14, align 4, !tbaa !10
  %16 = getelementptr inbounds i8, ptr %3, i64 4
  %17 = load float, ptr %16, align 4, !tbaa !10
  %18 = fsub float %15, %17
  %19 = fmul float %9, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %20 = fsub float %11, %19
  %21 = fadd float %17, %13
  %22 = tail call <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef %20, float noundef %21)
  store <2 x float> %22, ptr %7, align 8
  %23 = call noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %24 = load float, ptr %3, align 4, !tbaa !5
  %25 = fadd float %19, %24
  %26 = load float, ptr %16, align 4, !tbaa !10
  %27 = fsub float %26, %13
  %28 = call <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef %25, float noundef %27)
  store <2 x float> %28, ptr %8, align 8
  %29 = call noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef, float noundef) local_unnamed_addr #3

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { inlinehint 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" }
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, !7, i64 0}
!6 = !{!"_ZTSN4agge5pointIfEE", !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