; LLVM IR from ange-yaghi/simple-2d-constraint-solver :: src/spring.ll (ZN7atg_scs6Spring5applyEPNS_11SystemStateE)

; 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"

%"class.atg_scs::Spring" = type { %"class.atg_scs::ForceGenerator.base", double, double, double, double, double, double, double, ptr, ptr }
%"class.atg_scs::ForceGenerator.base" = type <{ ptr, i32 }>
%"struct.atg_scs::RigidBody" = type <{ double, double, double, double, double, double, double, double, i32, [4 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7atg_scs6Spring5applyEPNS_11SystemStateE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8
  %21 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 8
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = icmp eq ptr %22, null
  br i1 %23, label %28, label %24

24:                                               ; preds = %2
  %25 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 9
  %26 = load ptr, ptr %25, align 8, !tbaa !14
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %24, %2
  br label %197

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store double 0.000000e+00, ptr %9, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store double 0.000000e+00, ptr %10, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store double 0.000000e+00, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 0.000000e+00, ptr %12, align 8, !tbaa !15
  %30 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 8
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %31, i32 0, i32 8
  %33 = load i32, ptr %32, align 8, !tbaa !16
  %34 = icmp ne i32 %33, -1
  br i1 %34, label %35, label %54

35:                                               ; preds = %29
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 4
  %38 = load double, ptr %37, align 8, !tbaa !18
  %39 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 5
  %40 = load double, ptr %39, align 8, !tbaa !19
  %41 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 8
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %42, i32 0, i32 8
  %44 = load i32, ptr %43, align 8, !tbaa !16
  call void @_ZN7atg_scs11SystemState12localToWorldEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %36, double noundef %38, double noundef %40, ptr noundef %5, ptr noundef %6, i32 noundef %44)
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 4
  %47 = load double, ptr %46, align 8, !tbaa !18
  %48 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 5
  %49 = load double, ptr %48, align 8, !tbaa !19
  %50 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 8
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %51, i32 0, i32 8
  %53 = load i32, ptr %52, align 8, !tbaa !16
  call void @_ZN7atg_scs11SystemState15velocityAtPointEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %45, double noundef %47, double noundef %49, ptr noundef %9, ptr noundef %10, i32 noundef %53)
  br label %61

54:                                               ; preds = %29
  %55 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 8
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 4
  %58 = load double, ptr %57, align 8, !tbaa !18
  %59 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 5
  %60 = load double, ptr %59, align 8, !tbaa !19
  call void @_ZN7atg_scs9RigidBody12localToWorldEddPdS1_(ptr noundef nonnull align 8 dereferenceable(68) %56, double noundef %58, double noundef %60, ptr noundef %5, ptr noundef %6)
  br label %61

61:                                               ; preds = %54, %35
  %62 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 9
  %63 = load ptr, ptr %62, align 8, !tbaa !14
  %64 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %63, i32 0, i32 8
  %65 = load i32, ptr %64, align 8, !tbaa !16
  %66 = icmp ne i32 %65, -1
  br i1 %66, label %67, label %86

67:                                               ; preds = %61
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 6
  %70 = load double, ptr %69, align 8, !tbaa !20
  %71 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 7
  %72 = load double, ptr %71, align 8, !tbaa !21
  %73 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 9
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  %75 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %74, i32 0, i32 8
  %76 = load i32, ptr %75, align 8, !tbaa !16
  call void @_ZN7atg_scs11SystemState12localToWorldEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %68, double noundef %70, double noundef %72, ptr noundef %7, ptr noundef %8, i32 noundef %76)
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 6
  %79 = load double, ptr %78, align 8, !tbaa !20
  %80 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 7
  %81 = load double, ptr %80, align 8, !tbaa !21
  %82 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 9
  %83 = load ptr, ptr %82, align 8, !tbaa !14
  %84 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %83, i32 0, i32 8
  %85 = load i32, ptr %84, align 8, !tbaa !16
  call void @_ZN7atg_scs11SystemState15velocityAtPointEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %77, double noundef %79, double noundef %81, ptr noundef %11, ptr noundef %12, i32 noundef %85)
  br label %93

86:                                               ; preds = %61
  %87 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 9
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  %89 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 6
  %90 = load double, ptr %89, align 8, !tbaa !20
  %91 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 7
  %92 = load double, ptr %91, align 8, !tbaa !21
  call void @_ZN7atg_scs9RigidBody12localToWorldEddPdS1_(ptr noundef nonnull align 8 dereferenceable(68) %88, double noundef %90, double noundef %92, ptr noundef %7, ptr noundef %8)
  br label %93

93:                                               ; preds = %86, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %94 = load double, ptr %7, align 8, !tbaa !15
  %95 = load double, ptr %5, align 8, !tbaa !15
  %96 = fsub double %94, %95
  store double %96, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %97 = load double, ptr %8, align 8, !tbaa !15
  %98 = load double, ptr %6, align 8, !tbaa !15
  %99 = fsub double %97, %98
  store double %99, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %100 = load double, ptr %13, align 8, !tbaa !15
  %101 = load double, ptr %13, align 8, !tbaa !15
  %102 = load double, ptr %14, align 8, !tbaa !15
  %103 = load double, ptr %14, align 8, !tbaa !15
  %104 = fmul double %102, %103
  %105 = call double @llvm.fmuladd.f64(double %100, double %101, double %104)
  %106 = call double @sqrt(double noundef %105) #6
  store double %106, ptr %15, align 8, !tbaa !15
  %107 = load double, ptr %15, align 8, !tbaa !15
  %108 = call noundef double @_ZSt3absd(double noundef %107)
  %109 = fcmp oge double %108, 1.000000e-02
  br i1 %109, label %110, label %117

110:                                              ; preds = %93
  %111 = load double, ptr %15, align 8, !tbaa !15
  %112 = load double, ptr %13, align 8, !tbaa !15
  %113 = fdiv double %112, %111
  store double %113, ptr %13, align 8, !tbaa !15
  %114 = load double, ptr %15, align 8, !tbaa !15
  %115 = load double, ptr %14, align 8, !tbaa !15
  %116 = fdiv double %115, %114
  store double %116, ptr %14, align 8, !tbaa !15
  br label %118

117:                                              ; preds = %93
  store double 0.000000e+00, ptr %13, align 8, !tbaa !15
  store double 0.000000e+00, ptr %14, align 8, !tbaa !15
  br label %118

118:                                              ; preds = %117, %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %119 = load double, ptr %11, align 8, !tbaa !15
  %120 = load double, ptr %9, align 8, !tbaa !15
  %121 = fsub double %119, %120
  store double %121, ptr %16, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %122 = load double, ptr %12, align 8, !tbaa !15
  %123 = load double, ptr %10, align 8, !tbaa !15
  %124 = fsub double %122, %123
  store double %124, ptr %17, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %125 = load double, ptr %13, align 8, !tbaa !15
  %126 = load double, ptr %16, align 8, !tbaa !15
  %127 = load double, ptr %14, align 8, !tbaa !15
  %128 = load double, ptr %17, align 8, !tbaa !15
  %129 = fmul double %127, %128
  %130 = call double @llvm.fmuladd.f64(double %125, double %126, double %129)
  store double %130, ptr %18, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %131 = load double, ptr %15, align 8, !tbaa !15
  %132 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 1
  %133 = load double, ptr %132, align 8, !tbaa !22
  %134 = fsub double %131, %133
  store double %134, ptr %19, align 8, !tbaa !15
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 4
  %137 = load double, ptr %136, align 8, !tbaa !18
  %138 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 5
  %139 = load double, ptr %138, align 8, !tbaa !19
  %140 = load double, ptr %13, align 8, !tbaa !15
  %141 = load double, ptr %19, align 8, !tbaa !15
  %142 = fmul double %140, %141
  %143 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 2
  %144 = load double, ptr %143, align 8, !tbaa !23
  %145 = load double, ptr %16, align 8, !tbaa !15
  %146 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 3
  %147 = load double, ptr %146, align 8, !tbaa !24
  %148 = fmul double %145, %147
  %149 = call double @llvm.fmuladd.f64(double %142, double %144, double %148)
  %150 = load double, ptr %14, align 8, !tbaa !15
  %151 = load double, ptr %19, align 8, !tbaa !15
  %152 = fmul double %150, %151
  %153 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 2
  %154 = load double, ptr %153, align 8, !tbaa !23
  %155 = load double, ptr %17, align 8, !tbaa !15
  %156 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 3
  %157 = load double, ptr %156, align 8, !tbaa !24
  %158 = fmul double %155, %157
  %159 = call double @llvm.fmuladd.f64(double %152, double %154, double %158)
  %160 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 8
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %161, i32 0, i32 8
  %163 = load i32, ptr %162, align 8, !tbaa !16
  call void @_ZN7atg_scs11SystemState10applyForceEddddi(ptr noundef nonnull align 8 dereferenceable(152) %135, double noundef %137, double noundef %139, double noundef %149, double noundef %159, i32 noundef %163)
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 6
  %166 = load double, ptr %165, align 8, !tbaa !20
  %167 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 7
  %168 = load double, ptr %167, align 8, !tbaa !21
  %169 = load double, ptr %13, align 8, !tbaa !15
  %170 = fneg double %169
  %171 = load double, ptr %19, align 8, !tbaa !15
  %172 = fmul double %170, %171
  %173 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 2
  %174 = load double, ptr %173, align 8, !tbaa !23
  %175 = load double, ptr %16, align 8, !tbaa !15
  %176 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 3
  %177 = load double, ptr %176, align 8, !tbaa !24
  %178 = fmul double %175, %177
  %179 = fneg double %178
  %180 = call double @llvm.fmuladd.f64(double %172, double %174, double %179)
  %181 = load double, ptr %14, align 8, !tbaa !15
  %182 = fneg double %181
  %183 = load double, ptr %19, align 8, !tbaa !15
  %184 = fmul double %182, %183
  %185 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 2
  %186 = load double, ptr %185, align 8, !tbaa !23
  %187 = load double, ptr %17, align 8, !tbaa !15
  %188 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 3
  %189 = load double, ptr %188, align 8, !tbaa !24
  %190 = fmul double %187, %189
  %191 = fneg double %190
  %192 = call double @llvm.fmuladd.f64(double %184, double %186, double %191)
  %193 = getelementptr inbounds %"class.atg_scs::Spring", ptr %20, i32 0, i32 9
  %194 = load ptr, ptr %193, align 8, !tbaa !14
  %195 = getelementptr inbounds %"struct.atg_scs::RigidBody", ptr %194, i32 0, i32 8
  %196 = load i32, ptr %195, align 8, !tbaa !16
  call void @_ZN7atg_scs11SystemState10applyForceEddddi(ptr noundef nonnull align 8 dereferenceable(152) %164, double noundef %166, double noundef %168, double noundef %180, double noundef %192, i32 noundef %196)
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  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.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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %197

197:                                              ; preds = %118, %28
  ret void
}

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

declare void @_ZN7atg_scs11SystemState12localToWorldEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152), double noundef, double noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @_ZN7atg_scs11SystemState15velocityAtPointEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152), double noundef, double noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @_ZN7atg_scs9RigidBody12localToWorldEddPdS1_(ptr noundef nonnull align 8 dereferenceable(68), double noundef, double noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #5

declare void @_ZN7atg_scs11SystemState10applyForceEddddi(ptr noundef nonnull align 8 dereferenceable(152), double noundef, double noundef, double noundef, double noundef, i32 noundef) #2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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, !6, i64 72}
!10 = !{!"_ZTSN7atg_scs6SpringE", !11, i64 0, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !6, i64 72, !6, i64 80}
!11 = !{!"_ZTSN7atg_scs14ForceGeneratorE", !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!10, !6, i64 80}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !12, i64 64}
!17 = !{!"_ZTSN7atg_scs9RigidBodyE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !12, i64 64}
!18 = !{!10, !13, i64 40}
!19 = !{!10, !13, i64 48}
!20 = !{!10, !13, i64 56}
!21 = !{!10, !13, i64 64}
!22 = !{!10, !13, i64 16}
!23 = !{!10, !13, i64 24}
!24 = !{!10, !13, i64 32}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7atg_scs6Spring5applyEPNS_11SystemStateE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(88) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 72
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %105, label %14

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = icmp eq ptr %16, null
  br i1 %17, label %105, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store double 0.000000e+00, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store double 0.000000e+00, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  store double 0.000000e+00, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  store double 0.000000e+00, ptr %10, align 8, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %12, i64 64
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %.not = icmp eq i32 %20, -1
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = load double, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %0, i64 48
  %24 = load double, ptr %23, align 8, !tbaa !18
  br i1 %.not, label %31, label %25

25:                                               ; preds = %18
  call void @_ZN7atg_scs11SystemState12localToWorldEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %1, double noundef %22, double noundef %24, ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef %20)
  %26 = load double, ptr %21, align 8, !tbaa !17
  %27 = load double, ptr %23, align 8, !tbaa !18
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 64
  %30 = load i32, ptr %29, align 8, !tbaa !15
  call void @_ZN7atg_scs11SystemState15velocityAtPointEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %1, double noundef %26, double noundef %27, ptr noundef nonnull %7, ptr noundef nonnull %8, i32 noundef %30)
  br label %32

31:                                               ; preds = %18
  call void @_ZN7atg_scs9RigidBody12localToWorldEddPdS1_(ptr noundef nonnull align 8 dereferenceable(68) %12, double noundef %22, double noundef %24, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %32

32:                                               ; preds = %31, %25
  %33 = load ptr, ptr %15, align 8, !tbaa !13
  %34 = getelementptr inbounds i8, ptr %33, i64 64
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %.not36 = icmp eq i32 %35, -1
  %36 = getelementptr inbounds i8, ptr %0, i64 56
  %37 = load double, ptr %36, align 8, !tbaa !19
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  %39 = load double, ptr %38, align 8, !tbaa !20
  br i1 %.not36, label %46, label %40

40:                                               ; preds = %32
  call void @_ZN7atg_scs11SystemState12localToWorldEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %1, double noundef %37, double noundef %39, ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef %35)
  %41 = load double, ptr %36, align 8, !tbaa !19
  %42 = load double, ptr %38, align 8, !tbaa !20
  %43 = load ptr, ptr %15, align 8, !tbaa !13
  %44 = getelementptr inbounds i8, ptr %43, i64 64
  %45 = load i32, ptr %44, align 8, !tbaa !15
  call void @_ZN7atg_scs11SystemState15velocityAtPointEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152) %1, double noundef %41, double noundef %42, ptr noundef nonnull %9, ptr noundef nonnull %10, i32 noundef %45)
  br label %47

46:                                               ; preds = %32
  call void @_ZN7atg_scs9RigidBody12localToWorldEddPdS1_(ptr noundef nonnull align 8 dereferenceable(68) %33, double noundef %37, double noundef %39, ptr noundef nonnull %5, ptr noundef nonnull %6)
  br label %47

47:                                               ; preds = %46, %40
  %48 = load double, ptr %5, align 8, !tbaa !14
  %49 = load double, ptr %3, align 8, !tbaa !14
  %50 = fsub double %48, %49
  %51 = load double, ptr %6, align 8, !tbaa !14
  %52 = load double, ptr %4, align 8, !tbaa !14
  %53 = fsub double %51, %52
  %54 = fmul double %53, %53
  %55 = call double @llvm.fmuladd.f64(double %50, double %50, double %54)
  %sqrt = call double @llvm.sqrt.f64(double %55)
  %56 = call noundef double @_ZSt3absd(double noundef %sqrt)
  %57 = fcmp ult double %56, 1.000000e-02
  %58 = fdiv double %50, %sqrt
  %59 = fdiv double %53, %sqrt
  %.033 = select i1 %57, double 0.000000e+00, double %59
  %.0 = select i1 %57, double 0.000000e+00, double %58
  %60 = load double, ptr %9, align 8, !tbaa !14
  %61 = load double, ptr %7, align 8, !tbaa !14
  %62 = fsub double %60, %61
  %63 = load double, ptr %10, align 8, !tbaa !14
  %64 = load double, ptr %8, align 8, !tbaa !14
  %65 = fsub double %63, %64
  %66 = getelementptr inbounds i8, ptr %0, i64 16
  %67 = load double, ptr %66, align 8, !tbaa !21
  %68 = fsub double %sqrt, %67
  %69 = getelementptr inbounds i8, ptr %0, i64 40
  %70 = load double, ptr %69, align 8, !tbaa !17
  %71 = getelementptr inbounds i8, ptr %0, i64 48
  %72 = load double, ptr %71, align 8, !tbaa !18
  %73 = fmul double %.0, %68
  %74 = getelementptr inbounds i8, ptr %0, i64 24
  %75 = load double, ptr %74, align 8, !tbaa !22
  %76 = getelementptr inbounds i8, ptr %0, i64 32
  %77 = load double, ptr %76, align 8, !tbaa !23
  %78 = fmul double %62, %77
  %79 = call double @llvm.fmuladd.f64(double %73, double %75, double %78)
  %80 = fmul double %.033, %68
  %81 = fmul double %65, %77
  %82 = call double @llvm.fmuladd.f64(double %80, double %75, double %81)
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 64
  %85 = load i32, ptr %84, align 8, !tbaa !15
  call void @_ZN7atg_scs11SystemState10applyForceEddddi(ptr noundef nonnull align 8 dereferenceable(152) %1, double noundef %70, double noundef %72, double noundef %79, double noundef %82, i32 noundef %85)
  %86 = getelementptr inbounds i8, ptr %0, i64 56
  %87 = load double, ptr %86, align 8, !tbaa !19
  %88 = getelementptr inbounds i8, ptr %0, i64 64
  %89 = load double, ptr %88, align 8, !tbaa !20
  %90 = fneg double %.0
  %91 = fmul double %68, %90
  %92 = load double, ptr %74, align 8, !tbaa !22
  %93 = load double, ptr %76, align 8, !tbaa !23
  %94 = fneg double %62
  %95 = fmul double %93, %94
  %96 = call double @llvm.fmuladd.f64(double %91, double %92, double %95)
  %97 = fneg double %.033
  %98 = fmul double %68, %97
  %99 = fneg double %65
  %100 = fmul double %93, %99
  %101 = call double @llvm.fmuladd.f64(double %98, double %92, double %100)
  %102 = load ptr, ptr %15, align 8, !tbaa !13
  %103 = getelementptr inbounds i8, ptr %102, i64 64
  %104 = load i32, ptr %103, align 8, !tbaa !15
  call void @_ZN7atg_scs11SystemState10applyForceEddddi(ptr noundef nonnull align 8 dereferenceable(152) %1, double noundef %87, double noundef %89, double noundef %96, double noundef %101, i32 noundef %104)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %105

105:                                              ; preds = %2, %14, %47
  ret void
}

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

declare void @_ZN7atg_scs11SystemState12localToWorldEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152), double noundef, double noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @_ZN7atg_scs11SystemState15velocityAtPointEddPdS1_i(ptr noundef nonnull align 8 dereferenceable(152), double noundef, double noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @_ZN7atg_scs9RigidBody12localToWorldEddPdS1_(ptr noundef nonnull align 8 dereferenceable(68), double noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #4

declare void @_ZN7atg_scs11SystemState10applyForceEddddi(ptr noundef nonnull align 8 dereferenceable(152), double noundef, double noundef, double noundef, double noundef, i32 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) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !12, i64 72}
!6 = !{!"_ZTSN7atg_scs6SpringE", !7, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 80}
!7 = !{!"_ZTSN7atg_scs14ForceGeneratorE", !8, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!6, !12, i64 80}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !8, i64 64}
!16 = !{!"_ZTSN7atg_scs9RigidBodyE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !8, i64 64}
!17 = !{!6, !11, i64 40}
!18 = !{!6, !11, i64 48}
!19 = !{!6, !11, i64 56}
!20 = !{!6, !11, i64 64}
!21 = !{!6, !11, i64 16}
!22 = !{!6, !11, i64 24}
!23 = !{!6, !11, i64 32}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass