; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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)) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"_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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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 #1 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 #2

; Function Attrs: mustprogress 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 @_ZNK4agge5joins5bevel4calcERNS_10pod_vectorINS_5pointIfEEEEfRKS4_fS8_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, float noundef %6, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %7) unnamed_addr #3 align 2 {
  %9 = alloca %"struct.agge::point", align 8
  %10 = alloca %"struct.agge::point", align 8
  %11 = fdiv float %2, %4
  %12 = fdiv float %2, %6
  %13 = load float, ptr %5, align 4, !tbaa !5
  %14 = load float, ptr %3, align 4, !tbaa !5
  %15 = fsub float %13, %14
  %16 = fmul float %11, %15
  %17 = getelementptr inbounds i8, ptr %5, i64 4
  %18 = load float, ptr %17, align 4, !tbaa !10
  %19 = getelementptr inbounds i8, ptr %3, i64 4
  %20 = load float, ptr %19, align 4, !tbaa !10
  %21 = fsub float %18, %20
  %22 = fmul float %11, %21
  %23 = load float, ptr %7, align 4, !tbaa !5
  %24 = fsub float %23, %13
  %25 = fmul float %12, %24
  %26 = getelementptr inbounds i8, ptr %7, i64 4
  %27 = load float, ptr %26, align 4, !tbaa !10
  %28 = fsub float %27, %18
  %29 = fmul float %12, %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %30 = fadd float %13, %22
  %31 = fsub float %18, %16
  %32 = tail call <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef %30, float noundef %31)
  store <2 x float> %32, ptr %9, align 8
  %33 = call noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %34 = load float, ptr %5, align 4, !tbaa !5
  %35 = fadd float %29, %34
  %36 = load float, ptr %17, align 4, !tbaa !10
  %37 = fsub float %36, %25
  %38 = call <2 x float> @_ZN4agge12create_pointIfEENS_5pointIT_EES2_S2_(float noundef %35, float noundef %37)
  store <2 x float> %38, ptr %10, align 8
  %39 = call noundef ptr @_ZN4agge10pod_vectorINS_5pointIfEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  ret void
}

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