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

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

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Rope17SolveStretch_XPBDEf = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

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

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

; 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)) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #5

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Rope17SolveStretch_XPBDEf(ptr noundef nonnull align 8 dereferenceable(128) %0, float noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %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 float, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca %struct.b2Vec2, align 4
  %26 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %27 = load ptr, ptr %3, align 8
  %28 = load float, ptr %4, align 4, !tbaa !9
  %29 = fcmp ogt float %28, 0.000000e+00
  br i1 %29, label %30, label %31

30:                                               ; preds = %2
  br label %33

31:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 387, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Rope17SolveStretch_XPBDEf) #9
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #10
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %34

34:                                               ; preds = %170, %33
  %35 = load i32, ptr %5, align 4, !tbaa !11
  %36 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 2
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = icmp slt i32 %35, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %41 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !20
  %43 = load i32, ptr %5, align 4, !tbaa !11
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %struct.b2RopeStretch, ptr %42, i64 %44
  store ptr %45, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %46 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 7
  %47 = load ptr, ptr %46, align 8, !tbaa !21
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.b2RopeStretch, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !22
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds %struct.b2Vec2, ptr %47, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %52, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %53 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 7
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2RopeStretch, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !25
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.b2Vec2, ptr %54, i64 %58
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %59, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %60 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 8
  %61 = load ptr, ptr %60, align 8, !tbaa !26
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.b2RopeStretch, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 4, !tbaa !22
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.b2Vec2, ptr %61, i64 %65
  %67 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %66)
  store <2 x float> %67, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %68 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 8
  %69 = load ptr, ptr %68, align 8, !tbaa !26
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.b2RopeStretch, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !25
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.b2Vec2, ptr %69, i64 %73
  %75 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %74)
  store <2 x float> %75, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %76 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %76, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  %77 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  store float %77, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %78 = call <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %78, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2RopeStretch, ptr %79, i32 0, i32 2
  %81 = load float, ptr %80, align 4, !tbaa !27
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2RopeStretch, ptr %82, i32 0, i32 3
  %84 = load float, ptr %83, align 4, !tbaa !28
  %85 = fadd float %81, %84
  store float %85, ptr %16, align 4, !tbaa !9
  %86 = load float, ptr %16, align 4, !tbaa !9
  %87 = fcmp oeq float %86, 0.000000e+00
  br i1 %87, label %88, label %89

88:                                               ; preds = %40
  store i32 4, ptr %6, align 4
  br label %167

89:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.b2RopeStretch, ptr %90, i32 0, i32 6
  %92 = load float, ptr %91, align 4, !tbaa !29
  %93 = load float, ptr %4, align 4, !tbaa !9
  %94 = fmul float %92, %93
  %95 = load float, ptr %4, align 4, !tbaa !9
  %96 = fmul float %94, %95
  %97 = fdiv float 1.000000e+00, %96
  store float %97, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %98 = load float, ptr %4, align 4, !tbaa !9
  %99 = load float, ptr %4, align 4, !tbaa !9
  %100 = fmul float %98, %99
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.b2RopeStretch, ptr %101, i32 0, i32 7
  %103 = load float, ptr %102, align 4, !tbaa !30
  %104 = fmul float %100, %103
  store float %104, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  %105 = load float, ptr %17, align 4, !tbaa !9
  %106 = load float, ptr %18, align 4, !tbaa !9
  %107 = fmul float %105, %106
  %108 = load float, ptr %4, align 4, !tbaa !9
  %109 = fdiv float %107, %108
  store float %109, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  %110 = load float, ptr %13, align 4, !tbaa !9
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.b2RopeStretch, ptr %111, i32 0, i32 4
  %113 = load float, ptr %112, align 4, !tbaa !31
  %114 = fsub float %110, %113
  store float %114, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  %115 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %116 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %117 = fadd float %115, %116
  store float %117, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #10
  %118 = load float, ptr %20, align 4, !tbaa !9
  %119 = load float, ptr %17, align 4, !tbaa !9
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.b2RopeStretch, ptr %120, i32 0, i32 5
  %122 = load float, ptr %121, align 4, !tbaa !32
  %123 = call float @llvm.fmuladd.f32(float %119, float %122, float %118)
  %124 = load float, ptr %19, align 4, !tbaa !9
  %125 = load float, ptr %21, align 4, !tbaa !9
  %126 = call float @llvm.fmuladd.f32(float %124, float %125, float %123)
  store float %126, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  %127 = load float, ptr %19, align 4, !tbaa !9
  %128 = fadd float 1.000000e+00, %127
  %129 = load float, ptr %16, align 4, !tbaa !9
  %130 = load float, ptr %17, align 4, !tbaa !9
  %131 = call float @llvm.fmuladd.f32(float %128, float %129, float %130)
  store float %131, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  %132 = load float, ptr %22, align 4, !tbaa !9
  %133 = fneg float %132
  %134 = load float, ptr %23, align 4, !tbaa !9
  %135 = fdiv float %133, %134
  store float %135, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.b2RopeStretch, ptr %136, i32 0, i32 2
  %138 = load float, ptr %137, align 4, !tbaa !27
  %139 = load float, ptr %24, align 4, !tbaa !9
  %140 = fmul float %138, %139
  %141 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %140, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %141, ptr %25, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #10
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.b2RopeStretch, ptr %142, i32 0, i32 3
  %144 = load float, ptr %143, align 4, !tbaa !28
  %145 = load float, ptr %24, align 4, !tbaa !9
  %146 = fmul float %144, %145
  %147 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %146, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %147, ptr %26, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %26)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #10
  %148 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 7
  %149 = load ptr, ptr %148, align 8, !tbaa !21
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b2RopeStretch, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 4, !tbaa !22
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds %struct.b2Vec2, ptr %149, i64 %153
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %154, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !24
  %155 = getelementptr inbounds %class.b2Rope, ptr %27, i32 0, i32 7
  %156 = load ptr, ptr %155, align 8, !tbaa !21
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.b2RopeStretch, ptr %157, i32 0, i32 1
  %159 = load i32, ptr %158, align 4, !tbaa !25
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds %struct.b2Vec2, ptr %156, i64 %160
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %161, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !24
  %162 = load float, ptr %24, align 4, !tbaa !9
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.b2RopeStretch, ptr %163, i32 0, i32 5
  %165 = load float, ptr %164, align 4, !tbaa !32
  %166 = fadd float %165, %162
  store float %166, ptr %164, align 4, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  store i32 0, ptr %6, align 4
  br label %167

167:                                              ; preds = %89, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  %168 = load i32, ptr %6, align 4
  switch i32 %168, label %174 [
    i32 0, label %169
    i32 4, label %170
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169, %167
  %171 = load i32, ptr %5, align 4, !tbaa !11
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %5, align 4, !tbaa !11
  br label %34, !llvm.loop !33

173:                                              ; preds = %39
  ret void

174:                                              ; preds = %167
  unreachable
}

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

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

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Rope17SolveStretch_XPBDEf = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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)) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Rope17SolveStretch_XPBDEf(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0, float noundef %1) local_unnamed_addr #3 align 2 {
  %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 = fcmp ogt float %1, 0.000000e+00
  br i1 %12, label %.preheader, label %20

.preheader:                                       ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  %19 = fmul float %1, %1
  br label %21

20:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 387, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Rope17SolveStretch_XPBDEf) #8
  unreachable

._crit_edge:                                      ; preds = %97, %.preheader
  ret void

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

54:                                               ; preds = %21
  %55 = getelementptr inbounds i8, ptr %23, i64 24
  %56 = load float, ptr %55, align 4, !tbaa !25
  %57 = fmul float %56, %1
  %58 = fmul float %57, %1
  %59 = fdiv float 1.000000e+00, %58
  %60 = getelementptr inbounds i8, ptr %23, i64 28
  %61 = load float, ptr %60, align 4, !tbaa !26
  %62 = fmul float %19, %61
  %63 = fmul float %62, %59
  %64 = fdiv float %63, %1
  %65 = getelementptr inbounds i8, ptr %23, i64 16
  %66 = load float, ptr %65, align 4, !tbaa !27
  %67 = fsub float %45, %66
  %68 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %69 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %70 = fadd float %68, %69
  %71 = getelementptr inbounds i8, ptr %23, i64 20
  %72 = load float, ptr %71, align 4, !tbaa !28
  %73 = call float @llvm.fmuladd.f32(float %59, float %72, float %67)
  %74 = call float @llvm.fmuladd.f32(float %64, float %70, float %73)
  %75 = fadd float %64, 1.000000e+00
  %76 = call float @llvm.fmuladd.f32(float %75, float %52, float %59)
  %77 = fneg float %74
  %78 = fdiv float %77, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %79 = load float, ptr %48, align 4, !tbaa !23
  %80 = fmul float %79, %78
  %81 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %80, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %81, ptr %10, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  %82 = load float, ptr %50, align 4, !tbaa !24
  %83 = fmul float %78, %82
  %84 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %83, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %84, ptr %11, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  %85 = load ptr, ptr %17, align 8, !tbaa !18
  %86 = load i32, ptr %23, align 4, !tbaa !19
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.b2Vec2, ptr %85, i64 %87
  %89 = load i64, ptr %3, align 8
  store i64 %89, ptr %88, align 4
  %90 = load ptr, ptr %17, align 8, !tbaa !18
  %91 = load i32, ptr %29, align 4, !tbaa !21
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %struct.b2Vec2, ptr %90, i64 %92
  %94 = load i64, ptr %4, align 8
  store i64 %94, ptr %93, align 4
  %95 = load float, ptr %71, align 4, !tbaa !28
  %96 = fadd float %78, %95
  store float %96, ptr %71, align 4, !tbaa !28
  br label %97

97:                                               ; preds = %21, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = icmp slt i64 %indvars.iv.next, %99
  br i1 %100, label %21, label %._crit_edge, !llvm.loop !29
}

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

attributes #0 = { noreturn nounwind "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"="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 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { 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 #8 = { noreturn nounwind }
attributes #9 = { 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 12}
!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, !12, i64 24}
!18 = !{!6, !12, i64 48}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTS13b2RopeStretch", !11, i64 0, !11, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!21 = !{!20, !11, i64 4}
!22 = !{!6, !12, i64 56}
!23 = !{!20, !8, i64 8}
!24 = !{!20, !8, i64 12}
!25 = !{!20, !8, i64 24}
!26 = !{!20, !8, i64 28}
!27 = !{!20, !8, i64 16}
!28 = !{!20, !8, i64 20}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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