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

; 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: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; 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 uwtable
declare dso_local <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Rope20SolveBend_PBD_HeightEv(ptr noundef nonnull align 8 dereferenceable(128) %0) #3 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 %struct.b2Vec2, align 4
  %8 = alloca %struct.b2Vec2, align 4
  %9 = alloca %struct.b2Vec2, align 4
  %10 = alloca %struct.b2Vec2, align 4
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca float, align 4
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca %struct.b2Vec2, align 4
  %24 = alloca %struct.b2Vec2, align 4
  %25 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %26 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %27 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 12
  %28 = getelementptr inbounds %struct.b2RopeTuning, ptr %27, i32 0, i32 6
  %29 = load float, ptr %28, align 8, !tbaa !9
  store float %29, 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 %30

30:                                               ; preds = %171, %1
  %31 = load i32, ptr %4, align 4, !tbaa !19
  %32 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 3
  %33 = load i32, ptr %32, align 8, !tbaa !20
  %34 = icmp slt i32 %31, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %37 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = load i32, ptr %4, align 4, !tbaa !19
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.b2RopeBend, ptr %38, i64 %40
  store ptr %41, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %42 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 7
  %43 = load ptr, ptr %42, align 8, !tbaa !22
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.b2RopeBend, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 4, !tbaa !23
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds %struct.b2Vec2, ptr %43, i64 %47
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %48, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %49 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 7
  %50 = load ptr, ptr %49, align 8, !tbaa !22
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.b2RopeBend, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !26
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct.b2Vec2, ptr %50, i64 %54
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %55, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %56 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 7
  %57 = load ptr, ptr %56, align 8, !tbaa !22
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.b2RopeBend, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 4, !tbaa !27
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds %struct.b2Vec2, ptr %57, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %62, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2RopeBend, ptr %63, i32 0, i32 10
  %65 = load float, ptr %64, align 4, !tbaa !28
  %66 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %65, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %66, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b2RopeBend, ptr %67, i32 0, i32 11
  %69 = load float, ptr %68, align 4, !tbaa !29
  %70 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %69, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %70, ptr %13, align 4
  %71 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store <2 x float> %71, ptr %11, align 4
  %72 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %72, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %73 = call noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  store float %73, ptr %14, align 4, !tbaa !18
  %74 = load float, ptr %14, align 4, !tbaa !18
  %75 = fcmp oeq float %74, 0.000000e+00
  br i1 %75, label %76, label %77

76:                                               ; preds = %36
  store i32 4, ptr %5, align 4
  br label %168

77:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %78 = load float, ptr %14, align 4, !tbaa !18
  %79 = fdiv float 1.000000e+00, %78
  %80 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %79, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %80, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.b2RopeBend, ptr %81, i32 0, i32 10
  %83 = load float, ptr %82, align 4, !tbaa !28
  %84 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %83, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %84, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %85 = call <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %85, ptr %17, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.b2RopeBend, ptr %86, i32 0, i32 11
  %88 = load float, ptr %87, align 4, !tbaa !29
  %89 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %88, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %89, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.b2RopeBend, ptr %90, i32 0, i32 3
  %92 = load float, ptr %91, align 4, !tbaa !30
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.b2RopeBend, ptr %93, i32 0, i32 10
  %95 = load float, ptr %94, align 4, !tbaa !28
  %96 = fmul float %92, %95
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.b2RopeBend, ptr %97, i32 0, i32 10
  %99 = load float, ptr %98, align 4, !tbaa !28
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.b2RopeBend, ptr %100, i32 0, i32 4
  %102 = load float, ptr %101, align 4, !tbaa !31
  %103 = call float @llvm.fmuladd.f32(float %96, float %99, float %102)
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.b2RopeBend, ptr %104, i32 0, i32 5
  %106 = load float, ptr %105, align 4, !tbaa !32
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.b2RopeBend, ptr %107, i32 0, i32 11
  %109 = load float, ptr %108, align 4, !tbaa !29
  %110 = fmul float %106, %109
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.b2RopeBend, ptr %111, i32 0, i32 11
  %113 = load float, ptr %112, align 4, !tbaa !29
  %114 = call float @llvm.fmuladd.f32(float %110, float %113, float %103)
  store float %114, ptr %19, align 4, !tbaa !18
  %115 = load float, ptr %19, align 4, !tbaa !18
  %116 = fcmp oeq float %115, 0.000000e+00
  br i1 %116, label %117, label %118

117:                                              ; preds = %77
  store i32 4, ptr %5, align 4
  br label %167

118:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %119 = load float, ptr %14, align 4, !tbaa !18
  store float %119, ptr %20, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %120 = load float, ptr %19, align 4, !tbaa !18
  %121 = fdiv float 1.000000e+00, %120
  store float %121, ptr %21, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %122 = load float, ptr %3, align 4, !tbaa !18
  %123 = fneg float %122
  %124 = load float, ptr %21, align 4, !tbaa !18
  %125 = fmul float %123, %124
  %126 = load float, ptr %20, align 4, !tbaa !18
  %127 = fmul float %125, %126
  store float %127, ptr %22, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.b2RopeBend, ptr %128, i32 0, i32 3
  %130 = load float, ptr %129, align 4, !tbaa !30
  %131 = load float, ptr %22, align 4, !tbaa !18
  %132 = fmul float %130, %131
  %133 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %132, ptr noundef nonnull align 4 dereferenceable(8) %16)
  store <2 x float> %133, ptr %23, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.b2RopeBend, ptr %134, i32 0, i32 4
  %136 = load float, ptr %135, align 4, !tbaa !31
  %137 = load float, ptr %22, align 4, !tbaa !18
  %138 = fmul float %136, %137
  %139 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %138, ptr noundef nonnull align 4 dereferenceable(8) %17)
  store <2 x float> %139, ptr %24, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %24)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.b2RopeBend, ptr %140, i32 0, i32 5
  %142 = load float, ptr %141, align 4, !tbaa !32
  %143 = load float, ptr %22, align 4, !tbaa !18
  %144 = fmul float %142, %143
  %145 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %144, ptr noundef nonnull align 4 dereferenceable(8) %18)
  store <2 x float> %145, ptr %25, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  %146 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 7
  %147 = load ptr, ptr %146, align 8, !tbaa !22
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.b2RopeBend, ptr %148, i32 0, i32 0
  %150 = load i32, ptr %149, align 4, !tbaa !23
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.b2Vec2, ptr %147, i64 %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %152, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !25
  %153 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 7
  %154 = load ptr, ptr %153, align 8, !tbaa !22
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.b2RopeBend, ptr %155, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !26
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds %struct.b2Vec2, ptr %154, i64 %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %159, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !25
  %160 = getelementptr inbounds %class.b2Rope, ptr %26, i32 0, i32 7
  %161 = load ptr, ptr %160, align 8, !tbaa !22
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.b2RopeBend, ptr %162, i32 0, i32 2
  %164 = load i32, ptr %163, align 4, !tbaa !27
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds %struct.b2Vec2, ptr %161, i64 %165
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %166, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  store i32 0, ptr %5, align 4
  br label %167

167:                                              ; preds = %118, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %168

168:                                              ; preds = %167, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #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 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %169 = load i32, ptr %5, align 4
  switch i32 %169, label %175 [
    i32 0, label %170
    i32 4, label %171
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %168
  %172 = load i32, ptr %4, align 4, !tbaa !19
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %4, align 4, !tbaa !19
  br label %30, !llvm.loop !33

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

175:                                              ; preds = %168
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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 = !{!10, !6, i64 48}
!23 = !{!24, !13, i64 0}
!24 = !{!"_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}
!25 = !{i64 0, i64 4, !18, i64 4, i64 4, !18}
!26 = !{!24, !13, i64 4}
!27 = !{!24, !13, i64 8}
!28 = !{!24, !12, i64 40}
!29 = !{!24, !12, i64 44}
!30 = !{!24, !12, i64 12}
!31 = !{!24, !12, i64 16}
!32 = !{!24, !12, i64 20}
!33 = distinct !{!33, !34}
!34 = !{!"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: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; 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 uwtable
declare dso_local <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Rope20SolveBend_PBD_HeightEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0) local_unnamed_addr #2 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 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = alloca %struct.b2Vec2, align 8
  %10 = alloca %struct.b2Vec2, align 8
  %11 = alloca %struct.b2Vec2, align 8
  %12 = alloca %struct.b2Vec2, align 8
  %13 = alloca %struct.b2Vec2, align 8
  %14 = alloca %struct.b2Vec2, align 8
  %15 = alloca %struct.b2Vec2, align 8
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %19 = getelementptr inbounds i8, ptr %0, i64 112
  %20 = load float, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = getelementptr inbounds i8, ptr %0, i64 48
  %23 = fneg float %20
  br label %24

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

24:                                               ; preds = %.lr.ph, %101
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %101 ]
  %25 = load ptr, ptr %21, align 8, !tbaa !18
  %26 = getelementptr inbounds %struct.b2RopeBend, ptr %25, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %27 = load ptr, ptr %22, align 8, !tbaa !19
  %28 = load i32, ptr %26, align 4, !tbaa !20
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct.b2Vec2, ptr %27, i64 %29
  %31 = load i64, ptr %30, align 4
  store i64 %31, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %32 = getelementptr inbounds i8, ptr %26, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !22
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %struct.b2Vec2, ptr %27, i64 %34
  %36 = load i64, ptr %35, align 4
  store i64 %36, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %37 = getelementptr inbounds i8, ptr %26, i64 8
  %38 = load i32, ptr %37, align 4, !tbaa !23
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %struct.b2Vec2, ptr %27, i64 %39
  %41 = load i64, ptr %40, align 4
  store i64 %41, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %42 = getelementptr inbounds i8, ptr %26, i64 40
  %43 = load float, ptr %42, align 4, !tbaa !24
  %44 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %43, ptr noundef nonnull align 4 dereferenceable(8) %2)
  store <2 x float> %44, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %45 = getelementptr inbounds i8, ptr %26, i64 44
  %46 = load float, ptr %45, align 4, !tbaa !25
  %47 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %46, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store <2 x float> %47, ptr %8, align 8
  %48 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %48, ptr %6, align 8
  %49 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %49, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %50 = call noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %51 = fcmp oeq float %50, 0.000000e+00
  br i1 %51, label %101, label %52

52:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %53 = fdiv float 1.000000e+00, %50
  %54 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %53, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %54, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %55 = load float, ptr %42, align 4, !tbaa !24
  %56 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %55, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %56, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %57 = call <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %57, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %58 = load float, ptr %45, align 4, !tbaa !25
  %59 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %58, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %59, ptr %12, align 8
  %60 = getelementptr inbounds i8, ptr %26, i64 12
  %61 = load float, ptr %60, align 4, !tbaa !26
  %62 = load float, ptr %42, align 4, !tbaa !24
  %63 = fmul float %61, %62
  %64 = getelementptr inbounds i8, ptr %26, i64 16
  %65 = load float, ptr %64, align 4, !tbaa !27
  %66 = call float @llvm.fmuladd.f32(float %63, float %62, float %65)
  %67 = getelementptr inbounds i8, ptr %26, i64 20
  %68 = load float, ptr %67, align 4, !tbaa !28
  %69 = load float, ptr %45, align 4, !tbaa !25
  %70 = fmul float %68, %69
  %71 = call float @llvm.fmuladd.f32(float %70, float %69, float %66)
  %72 = fcmp oeq float %71, 0.000000e+00
  br i1 %72, label %100, label %73

73:                                               ; preds = %52
  %74 = fdiv float 1.000000e+00, %71
  %75 = fmul float %74, %23
  %76 = fmul float %50, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %77 = fmul float %76, %61
  %78 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %77, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %78, ptr %13, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %13)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %79 = load float, ptr %64, align 4, !tbaa !27
  %80 = fmul float %76, %79
  %81 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %80, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %81, ptr %14, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %82 = load float, ptr %67, align 4, !tbaa !28
  %83 = fmul float %76, %82
  %84 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %83, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %84, ptr %15, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  %85 = load ptr, ptr %22, align 8, !tbaa !19
  %86 = load i32, ptr %26, align 4, !tbaa !20
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.b2Vec2, ptr %85, i64 %87
  %89 = load i64, ptr %2, align 8
  store i64 %89, ptr %88, align 4
  %90 = load ptr, ptr %22, align 8, !tbaa !19
  %91 = load i32, ptr %32, align 4, !tbaa !22
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %struct.b2Vec2, ptr %90, i64 %92
  %94 = load i64, ptr %3, align 8
  store i64 %94, ptr %93, align 4
  %95 = load ptr, ptr %22, align 8, !tbaa !19
  %96 = load i32, ptr %37, align 4, !tbaa !23
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds %struct.b2Vec2, ptr %95, i64 %97
  %99 = load i64, ptr %4, align 8
  store i64 %99, ptr %98, align 4
  br label %100

100:                                              ; preds = %52, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %101

101:                                              ; preds = %24, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  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
  %102 = load i32, ptr %16, align 8, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = icmp slt i64 %indvars.iv.next, %103
  br i1 %104, label %24, label %._crit_edge, !llvm.loop !29
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 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 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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, !11, i64 16}
!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, !8, i64 112}
!18 = !{!6, !12, i64 32}
!19 = !{!6, !12, i64 48}
!20 = !{!21, !11, i64 0}
!21 = !{!"_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}
!22 = !{!21, !11, i64 4}
!23 = !{!21, !11, i64 8}
!24 = !{!21, !8, i64 40}
!25 = !{!21, !8, i64 44}
!26 = !{!21, !8, i64 12}
!27 = !{!21, !8, i64 16}
!28 = !{!21, !8, i64 20}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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