; LLVM IR from mtsamis/box2d-optimized :: src/rope/b2_rope.ll (ZN6b2Rope22SolveBend_PBD_DistanceEv)

; 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.b2Vec2 = type { float, float }
%class.b2Rope = type { %struct.b2Vec2, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.b2Vec2, %struct.b2RopeTuning }
%struct.b2RopeTuning = type <{ i32, i32, float, float, float, float, float, float, float, i8, i8, i8, i8 }>
%struct.b2RopeBend = type { i32, i32, i32, float, float, float, float, float, float, float, float, float, float, float }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmlfRK6b2Vec2(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Rope22SolveBend_PBD_DistanceEv(ptr noundef nonnull align 8 dereferenceable(128) %0) #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.b2Vec2, align 4
  %10 = alloca %struct.b2Vec2, align 4
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %19 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 12
  %20 = getelementptr inbounds %struct.b2RopeTuning, ptr %19, i32 0, i32 6
  %21 = load float, ptr %20, align 8, !tbaa !9
  store float %21, ptr %3, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !19
  br label %22

22:                                               ; preds = %114, %1
  %23 = load i32, ptr %4, align 4, !tbaa !19
  %24 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 3
  %25 = load i32, ptr %24, align 8, !tbaa !20
  %26 = icmp slt i32 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %117

28:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %29 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 5
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = load i32, ptr %4, align 4, !tbaa !19
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.b2RopeBend, ptr %30, i64 %32
  store ptr %33, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.b2RopeBend, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !22
  store i32 %36, ptr %7, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.b2RopeBend, ptr %37, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !24
  store i32 %39, ptr %8, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %40 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 7
  %41 = load ptr, ptr %40, align 8, !tbaa !25
  %42 = load i32, ptr %7, align 4, !tbaa !19
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.b2Vec2, ptr %41, i64 %43
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %44, i64 8, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %45 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 7
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = load i32, ptr %8, align 4, !tbaa !19
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %struct.b2Vec2, ptr %46, i64 %48
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %49, i64 8, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %50 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %50, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %51 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %11)
  store float %51, ptr %12, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2RopeBend, ptr %52, i32 0, i32 3
  %54 = load float, ptr %53, align 4, !tbaa !27
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2RopeBend, ptr %55, i32 0, i32 5
  %57 = load float, ptr %56, align 4, !tbaa !28
  %58 = fadd float %54, %57
  store float %58, ptr %13, align 4, !tbaa !18
  %59 = load float, ptr %13, align 4, !tbaa !18
  %60 = fcmp oeq float %59, 0.000000e+00
  br i1 %60, label %61, label %62

61:                                               ; preds = %28
  store i32 4, ptr %5, align 4
  br label %111

62:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2RopeBend, ptr %63, i32 0, i32 3
  %65 = load float, ptr %64, align 4, !tbaa !27
  %66 = load float, ptr %13, align 4, !tbaa !18
  %67 = fdiv float %65, %66
  store float %67, ptr %14, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.b2RopeBend, ptr %68, i32 0, i32 5
  %70 = load float, ptr %69, align 4, !tbaa !28
  %71 = load float, ptr %13, align 4, !tbaa !18
  %72 = fdiv float %70, %71
  store float %72, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %73 = load float, ptr %3, align 4, !tbaa !18
  %74 = load float, ptr %14, align 4, !tbaa !18
  %75 = fmul float %73, %74
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.b2RopeBend, ptr %76, i32 0, i32 8
  %78 = load float, ptr %77, align 4, !tbaa !29
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2RopeBend, ptr %79, i32 0, i32 9
  %81 = load float, ptr %80, align 4, !tbaa !30
  %82 = fadd float %78, %81
  %83 = load float, ptr %12, align 4, !tbaa !18
  %84 = fsub float %82, %83
  %85 = fmul float %75, %84
  %86 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %85, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %86, ptr %16, align 4
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %87 = load float, ptr %3, align 4, !tbaa !18
  %88 = load float, ptr %15, align 4, !tbaa !18
  %89 = fmul float %87, %88
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.b2RopeBend, ptr %90, i32 0, i32 8
  %92 = load float, ptr %91, align 4, !tbaa !29
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.b2RopeBend, ptr %93, i32 0, i32 9
  %95 = load float, ptr %94, align 4, !tbaa !30
  %96 = fadd float %92, %95
  %97 = load float, ptr %12, align 4, !tbaa !18
  %98 = fsub float %96, %97
  %99 = fmul float %89, %98
  %100 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %99, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %100, ptr %17, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %101 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 7
  %102 = load ptr, ptr %101, align 8, !tbaa !25
  %103 = load i32, ptr %7, align 4, !tbaa !19
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %struct.b2Vec2, ptr %102, i64 %104
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %105, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !26
  %106 = getelementptr inbounds %class.b2Rope, ptr %18, i32 0, i32 7
  %107 = load ptr, ptr %106, align 8, !tbaa !25
  %108 = load i32, ptr %8, align 4, !tbaa !19
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds %struct.b2Vec2, ptr %107, i64 %109
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %110, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  store i32 0, ptr %5, align 4
  br label %111

111:                                              ; preds = %62, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %112 = load i32, ptr %5, align 4
  switch i32 %112, label %118 [
    i32 0, label %113
    i32 4, label %114
  ]

113:                                              ; preds = %111
  br label %114

114:                                              ; preds = %113, %111
  %115 = load i32, ptr %4, align 4, !tbaa !19
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %4, align 4, !tbaa !19
  br label %22, !llvm.loop !31

117:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void

118:                                              ; preds = %111
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { 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 #4 = { 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 #5 = { 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 #6 = { 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, !12, i64 112}
!10 = !{!"_ZTS6b2Rope", !11, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !14, i64 88}
!11 = !{!"_ZTS6b2Vec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS12b2RopeTuning", !15, i64 0, !16, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !17, i64 36, !17, i64 37, !17, i64 38}
!15 = !{!"_ZTS17b2StretchingModel", !7, i64 0}
!16 = !{!"_ZTS14b2BendingModel", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!12, !12, i64 0}
!19 = !{!13, !13, i64 0}
!20 = !{!10, !13, i64 16}
!21 = !{!10, !6, i64 32}
!22 = !{!23, !13, i64 0}
!23 = !{!"_ZTS10b2RopeBend", !13, i64 0, !13, i64 4, !13, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52}
!24 = !{!23, !13, i64 8}
!25 = !{!10, !6, i64 48}
!26 = !{i64 0, i64 4, !18, i64 4, i64 4, !18}
!27 = !{!23, !12, i64 12}
!28 = !{!23, !12, i64 20}
!29 = !{!23, !12, i64 32}
!30 = !{!23, !12, i64 36}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; 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.b2Vec2 = type { float, float }
%struct.b2RopeBend = type { i32, i32, i32, float, float, float, float, float, float, float, float, float, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmlfRK6b2Vec2(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Rope22SolveBend_PBD_DistanceEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca %struct.b2Vec2, align 8
  %3 = alloca %struct.b2Vec2, align 8
  %4 = alloca %struct.b2Vec2, align 8
  %5 = alloca %struct.b2Vec2, align 8
  %6 = alloca %struct.b2Vec2, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 112
  %8 = load float, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !17
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  br label %14

._crit_edge:                                      ; preds = %60, %1
  ret void

14:                                               ; preds = %.lr.ph, %60
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %60 ]
  %15 = load ptr, ptr %12, align 8, !tbaa !18
  %16 = getelementptr inbounds %struct.b2RopeBend, ptr %15, i64 %indvars.iv
  %17 = load i32, ptr %16, align 4, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %16, i64 8
  %19 = load i32, ptr %18, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %20 = load ptr, ptr %13, align 8, !tbaa !22
  %21 = sext i32 %17 to i64
  %22 = getelementptr inbounds %struct.b2Vec2, ptr %20, i64 %21
  %23 = load i64, ptr %22, align 4
  store i64 %23, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %24 = sext i32 %19 to i64
  %25 = getelementptr inbounds %struct.b2Vec2, ptr %20, i64 %24
  %26 = load i64, ptr %25, align 4
  store i64 %26, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %27 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %2)
  store <2 x float> %27, ptr %4, align 8
  %28 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %29 = getelementptr inbounds i8, ptr %16, i64 12
  %30 = load float, ptr %29, align 4, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %16, i64 20
  %32 = load float, ptr %31, align 4, !tbaa !24
  %33 = fadd float %30, %32
  %34 = fcmp oeq float %33, 0.000000e+00
  br i1 %34, label %60, label %35

35:                                               ; preds = %14
  %36 = fdiv float %30, %33
  %37 = fdiv float %32, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %38 = fmul float %8, %36
  %39 = getelementptr inbounds i8, ptr %16, i64 32
  %40 = load float, ptr %39, align 4, !tbaa !25
  %41 = getelementptr inbounds i8, ptr %16, i64 36
  %42 = load float, ptr %41, align 4, !tbaa !26
  %43 = fadd float %40, %42
  %44 = fsub float %43, %28
  %45 = fmul float %38, %44
  %46 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %45, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store <2 x float> %46, ptr %5, align 8
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %47 = fmul float %8, %37
  %48 = load float, ptr %39, align 4, !tbaa !25
  %49 = load float, ptr %41, align 4, !tbaa !26
  %50 = fadd float %48, %49
  %51 = fsub float %50, %28
  %52 = fmul float %47, %51
  %53 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %52, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store <2 x float> %53, ptr %6, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %54 = load ptr, ptr %13, align 8, !tbaa !22
  %55 = getelementptr inbounds %struct.b2Vec2, ptr %54, i64 %21
  %56 = load i64, ptr %2, align 8
  store i64 %56, ptr %55, align 4
  %57 = load ptr, ptr %13, align 8, !tbaa !22
  %58 = getelementptr inbounds %struct.b2Vec2, ptr %57, i64 %24
  %59 = load i64, ptr %3, align 8
  store i64 %59, ptr %58, align 4
  br label %60

60:                                               ; preds = %14, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %61 = load i32, ptr %9, align 8, !tbaa !17
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next, %62
  br i1 %63, label %14, label %._crit_edge, !llvm.loop !27
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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 #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 = { 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 #5 = { 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, !8, i64 112}
!6 = !{!"_ZTS6b2Rope", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !7, i64 80, !13, i64 88}
!7 = !{!"_ZTS6b2Vec2", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"_ZTS12b2RopeTuning", !14, i64 0, !15, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !16, i64 36, !16, i64 37, !16, i64 38}
!14 = !{!"_ZTS17b2StretchingModel", !9, i64 0}
!15 = !{!"_ZTS14b2BendingModel", !9, i64 0}
!16 = !{!"bool", !9, i64 0}
!17 = !{!6, !11, i64 16}
!18 = !{!6, !12, i64 32}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTS10b2RopeBend", !11, i64 0, !11, i64 4, !11, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !8, i64 40, !8, i64 44, !8, i64 48, !8, i64 52}
!21 = !{!20, !11, i64 8}
!22 = !{!6, !12, i64 48}
!23 = !{!20, !8, i64 12}
!24 = !{!20, !8, i64 20}
!25 = !{!20, !8, i64 32}
!26 = !{!20, !8, i64 36}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass